logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Error compiling mod_auth_cas Page 1, 2  Next
Author
everbright



Joined: 14 Feb 2008
Posts: 2

PostPosted: Thu 14 Feb '08 15:08    Post subject: Error compiling mod_auth_cas Reply with quote

Hi all,

I'm trying to compile mod_auth_cas for Apache 2.2.6 on Windows using APXS.

I've already download and install apxs_win32 using the package from Apache Lounge. Also installed Microsoft Visual Studio 2008 Express after receiving compliant from apxs that cl.exe is absent.

Encountered the following errors when compiling. Any ideas what I'm missing here?

Thanks in advance for any suggestions!

Admin note: Move output to http://apaste.info/NfM

Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 16 Feb '08 15:21    Post subject: Reply with quote

Looks that you miss at least the openssl sources/includes. Maybe better to follow instructions at:

https://www.ja-sig.org/svn/cas-clients/mod_auth_cas/tags/mod_auth_cas-1.0.7-rc2/README.win32

Steffen
Back to top
everbright



Joined: 14 Feb 2008
Posts: 2

PostPosted: Sat 16 Feb '08 15:32    Post subject: Reply with quote

Thanks for the suggestion!

Tried it and it works great. Have one follow-up problem from that however.

I succeeded in compiling the mod_auth_cas.dll following the instructions in the Readme file for the mod_auth_cas, using the following combination:

Apache 2.2.8
Windows XP SP2
OpenSSL 0.9.8g
mod_auth_cas 1.0.6
Visual C++ 2008 Express

I then tried to copy the DLL onto a machine with the following set-up (my production environment):

Windows 2000 SP4
Apache 2.2.6

The same configurations were used. However when I tried to start Apache, it could not start up due to errors with the mod_auth_cas. The error message was that "the module could not be found".

I definitely sure that it's not a path mis-configuration, as I'm able to locate other Apache modules.

Any ideas if this is due to the differences in operating environment? Or something else I've missed?

Thanks!
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Sat 16 Feb '08 16:10    Post subject: Reply with quote

Any errors in the logs and/or Windows Event Viewer ?

Btw, Win2000 is not supported by Visual C++ 2008, that's a reason we at the Apachelounge stick with Visual C++ 2005.


Steffen
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Sat 16 Feb '08 21:01    Post subject: Reply with quote

You can still download the Visual C++ 2005 Express Edition here.

Be sure to completely uninstall Visual C++ 2008 before you install Visual C++ 2005.

After installing Visual C++2005, you will want to install the Service pack to upgrade it to SP1.
Scroll down to the Download Additional Components section and choose Download Visual C++ 2005 Express SP1.

You will also want to install the Windows Server 2003 R2 Platform SDK.
Don't let the name ("Server 2003") confuse you - this is the correct SDK to use for Windows 2000, Windows XP, and Windows Server 2003.

-tom-
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Tue 15 Sep '15 22:19    Post subject: apache.2.2.6 Reply with quote

I am having problems finding the src for apache 2.2.6 and mod_auth_cas where did you get them?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 16 Sep '15 9:56    Post subject: Reply with quote

The source code of apache is on http://httpd.apache.org/download.cgi
However 2.2.6 is super old and should be used any longer. if you have to use 2.2.x use the last version of it. But better use 2.4.x

The module can be found at https://github.com/Jasig/mod_auth_cas
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Thu 17 Sep '15 19:40    Post subject: compilation Reply with quote

Ok Cool actially now I am having trouble finding the cURL
lib and h files. I was able to get openssl however
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Fri 18 Sep '15 20:05    Post subject: more issues Reply with quote

got the openssl and cURL libs and headers however sys\file.h is missing from the headers for visual studio 2008. what headers shoupld I include instead if that? as well I tried using windows.h this however lead to duplicate declarations with error.h .... how does anyone get this compiled in windows
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 18 Sep '15 21:55    Post subject: Reply with quote

evidently they don't which is why it states in the readme

Code:
NOTE:   As of mod_auth_cas 1.0.9, Win32 support has been dropped due
   to lack of development resources and low community interest.
   As a result, these instructions may be inaccurate.  As an
   explicit example, the additional curl dependency is not
   addressed in these instructions at all.


All hope is not lost.

You should not need sys/file.h, I don't get asked
for sys/file.h which I do not have in my VS2008.

I looked up the SAS webserver v. 9.4. The last "hotfix" I found for 9.4 was an update to OpenSSL 1.0.1h (vulnerable now too). So my question is, what version of OpenSSL are you running? It does matter because you're going to have to share the same library with mod_auth_cas.

To be honest, it would be easier for me to just build the module for you than explain how to build it, but you've come this far so I may as well push you over the hill.

BTW: I did NOT use apsx for this one.
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Fri 18 Sep '15 22:11    Post subject: Reply with quote

HAHA yup that would be great if you can help me figure this out. yes their OpenSSL v is 1.0.1h-fips

its part of a vFabric apache server licensed from VMware I belive. I am compiling it right on my local DEV server so I have compatability with the real DEV TEST PROD servers.
here is what I see in mod_auth_cas.c

/*
*
* Copyright 2011 the mod_auth_cas team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* mod_auth_cas.c
* Apache CAS Authentication Module
* Version 1.0.10
*
* Contact: mod-auth-cas-dev@lists.jasig.org
*
*/

#include <error.h>
#include <string.h>
#include <sys/file.h>
#include <sys/types.h>

#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

#include <curl/curl.h>


I tried commenting out sys/file.h and substituting in stdio.h or windows.h trying to cover off its functionality, but if I leave it in it cannot be found
if I take it out I am missing the flock() and an IPv6 structure

WITH:
C:\Program Files\Apache22\bin>apxs -i -lssl -lcurl -c mod_auth_cas.c
Use of assignment to $[ is deprecated at apxs.bat line 120.
C:\PROGRA~2\MICROS~2.0\vc\bin\cl.exe /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"C:\PROGRA~1\Apache22\include" /c /Fomod_auth_cas.lo mod_auth_cas.c
mod_auth_cas.c
mod_auth_cas.c(27) : fatal error C1083: Cannot open include file: 'sys/file.h': No such file or directory
apxs:Error: Command failed with rc=131072
.


WITHOUT:
C:\Program Files\Apache22\bin>apxs -i -lssl -lcurl -c mod_auth_cas.c
Use of assignment to $[ is deprecated at apxs.bat line 120.
C:\PROGRA~2\MICROS~2.0\vc\bin\cl.exe /nologo /MD /W0 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"C:\PROGRA~1\Apache22\include" /c /Fomod_auth_cas.lo mod_auth_cas.c
mod_auth_cas.c
c:\program files\apache22\include\apr_network_io.h(115) : error C2011: 'in6_addr' : 'struct' type redefinition
C:\PROGRA~1\Apache22\include\in6addr.h(22) : see declaration of 'in6_addr'
c:\program files\apache22\include\apr_network_io.h(119) : error C2011: 'sockaddr_in6' : 'struct' type redefinition
C:\PROGRA~1\Apache22\include\ws2ipdef.h(159) : see declaration of 'sockaddr_in6'
mod_auth_cas.c(928) : error C2065: 'LOCK_SH' : undeclared identifier
mod_auth_cas.c(954) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(992) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1002) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1039) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1075) : error C2065: 'LOCK_EX' : undeclared identifier
mod_auth_cas.c(1088) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1101) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1120) : error C2065: 'LOCK_UN' : undeclared identifier
mod_auth_cas.c(1201) : error C2065: 'LOCK_EX' : undeclared identifier
mod_auth_cas.c(1242) : error C2065: 'LOCK_UN' : undeclared identifier
apxs:Error: Command failed with rc=131072
.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 19 Sep '15 8:02    Post subject: Reply with quote

Ok, provided the info you have dribbled throughout a few different threads is correct, I've come to believe this;

Apache 2.2.26 x64
OpenSSL 1.0.1h (hopefully the fips doesn't matter, that's another can of worms)

I suggest using mod_auth_cas 1.0.9.1 source, not the master. I'm not going to put a lot of time into a module that I will likely never use. Even 1.0.9.1 needs a little fudging, I've supplied a patch for that among other things.

I dug into my archive of Apache Haus builds and used 2.2.26 x64 to build this and record my steps.

I cannot fully test it because I do not have a CAS authentication server or whatever may be needed. I got the module to load in my Apache/2.2.31 (Win64) OpenSSL/1.0.1p build and show up in the server-info by feeding it the required 3 config items (using fake URLs for CASLoginURL & CASValidateURL)

You will not be using apxs with this build. I never use it except for mod_perl where it is absolutely positively 100% required.

Follow these instructions and you should be good to go:
http://truly.buggycode.info:88/build-mod_auth_cas.html
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Mon 21 Sep '15 17:24    Post subject: apache Reply with quote

yeah sorry

its been kind off a mess trying to figure this out I will follow these instructions and see where I get. I am seriously considering starting from scratch with Linux if support for that mod on windows has been abondoned
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Mon 21 Sep '15 20:20    Post subject: error Reply with quote

ok worked up until curl
nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64

gives

Creating library ..\builds\libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib\libcurl.lib and object ..\builds\libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib\libcurl.exp
idn_win32.obj : error LNK2019: unresolved external symbol __imp_IdnToAscii referenced in function curl_win32_idn_to_ascii
idn_win32.obj : error LNK2019: unresolved external symbol __imp_IdnToUnicode referenced in function curl_win32_ascii_to_idn
..\builds\libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib\libcurl.dll : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\x86_amd64\link.exe"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.


nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64 USE_IDN="yes"

nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64 USE_IDN="true"

nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64 USE_IDN="no"

as well no luck

so I am looking at

winbuild\makefilebuild.vc line 177 and down any idea how to get this working

!IFNDEF USE_IDN
USE_IDN = true
!ELSEIF "$(USE_IDN)"=="yes"
USE_IDN = true
!ENDIF

!IF "$(USE_IDN)"=="true"
IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES
WIN_LIBS = $(WIN_LIBS) Normaliz.lib
!ENDIF
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 21 Sep '15 21:55    Post subject: Reply with quote

BUG, long running bug even since it's been like this a long time.

!IFNDEF USE_IDN
USE_IDN = true
!ELSEIF "$(USE_IDN)"=="yes"
USE_IDN = true
!ENDIF

no matter what you do USE_IDN is going to be true so this really should be

!IFNDEF USE_IDN
USE_IDN = false
!ELSEIF "$(USE_IDN)"=="yes"
USE_IDN = true
!ENDIF

otherwise the USE_IDN on the command line is useless.
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Mon 21 Sep '15 21:59    Post subject: Reply with quote

yes sorry I had modified it when I was hacking for a solutions the make file is defined properly


!IFNDEF USE_IDN
USE_IDN = false
!ELSEIF "$(USE_IDN)"=="yes"
USE_IDN = true
!ENDIF

that still has it giving that error ,additionally I tried
nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64 ENABLE_IDN=no
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 21 Sep '15 23:47    Post subject: Reply with quote

Reading the BUILD.WINDOWS.txt file again, the command line to turn IDN off is ENABLE_IDN=no. It's default is yes as can be seen in winbuild/makefile.vc line 65 & 66. so technically, that line 177 in makefileBuild.vc was not wrong.

You're in a country that speaks/writes in French and English, is international domain names support needed? If so, the note in the BUILD.WINDOWS.txt tells you how to get it in pre-Vista versions of Windows (the link is still valid)

I build VC9 on Vista, VC11 & 14 on Win 7 which explains why I've never run into this.
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Tue 22 Sep '15 0:00    Post subject: Reply with quote

thanks GL

I am in a country that speaks and writes French but my localization is American English Id rather not have IDN on and using that switch still gives me the issue

C:\build\curl-7.44.0\winbuild>nmake /f makefile.vc mode=dll VC=9 WITH_SSL=dll WITH_DEVEL=C:\build\deps MACHINE=x64 ENABLE_IDN=no

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

configuration name: libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi
Using SSL: true
Using c-ares:
Using SSH2:
Using ZLIB:
Using IDN: false
Using IPv6: true
Using SSPI: true
Using WinSSL: false
CFLAGS: /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /I"C:\build\deps/include" /DUSE_OPENSSL /I"C:\build\deps/include/openssl" /DUSE_IPV6 /DUSE_WINDOWS_SSPI
LFLAGS: /nologo /machine:x64 "/LIBPATH:C:\build\deps/lib" libeay32.lib ssleay32.lib
GenPDB:
Debug:
Machine: x64

-- snip --

idn_win32.obj : error LNK2019: unresolved external symbol __imp_IdnToAscii referenced in function curl_win32_idn_to_ascii
idn_win32.obj : error LNK2019: unresolved external symbol __imp_IdnToUnicode referenced in function curl_win32_ascii_to_idn
..\builds\libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib\libcurl.dll : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\x86_amd64\link.exe"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Back to top
merrittr



Joined: 18 Aug 2015
Posts: 16
Location: canada

PostPosted: Tue 22 Sep '15 0:18    Post subject: Reply with quote

how do I stop this being included in the link?


..\builds\libcurl-vc9-x64-release-dll-ssl-dll-ipv6-sspi-obj-lib/idn_win32.obj
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 22 Sep '15 0:21    Post subject: Reply with quote

delete curl's "builds" folder. c:\build\curl-7.44.0\builds

it's probably not rebuilding the .obj files and using the already compiled ones in builds\libcurl-vc9-x86-release-dll-ssl-dll-ipv6-sspi-obj-curl

then start the build again.
Back to top


Reply to topic   Topic: Error compiling mod_auth_cas View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads Page 1, 2  Next