Author |
|
Pixelbrei123
Joined: 30 Sep 2014 Posts: 6 Location: Germany
|
Posted: Thu 02 Oct '14 16:05 Post subject: mod_auth_tkt compiling issue |
|
|
Hello,
I recently started working with Apache and need the windows binary for the latest version of mod_auth_tkt. http://www.openfusion.com.au/labs/mod_auth_tkt/
Since the author does not provide any windows binaries I tried to compile it myself.
I did the following things:
- Installed Apache2.2 source
- Installed ActivePerl
- Installed and configured apxs from this site
- Installed mingw toolchains
- I also have an old VC6 compiler installed
When I try to make it fails with "apxs:Error: Command failed with rc=65536".
My guess is that i am missing the dependancy "libtool" from unix.
I also tried compiling directly in Visual Studio 6 by linking the apache include/libs. But it failed to find certain headers.
#include <netinet/in.h>
#include <arpa/inet.h>
Replacing them with winsock.h didnt do the trick.
Any suggestions? I face the same problem of missing windows binaries with similar modules.
Greetings,
Pixelbrei |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 3:43 Post subject: |
|
|
Are you a thrill seeker? Do you like disturbing hornets nests? If so, this module is surely for you.
The biggest thing you will have to overcome is the call to inet_aton() on line 807. That does not exist in VC++ or the Windows API. Tackle that and the call to ntohl() after it and you should be close enough.
inet_pton will work but it's only in Vista and above. If you need this to work in say Server 2003 you will have to get one from somewhere. If you want to build on VC6 you will have to get one from somewhere.
ntohl I think is in winsock2, so that should be in VC6.
What else gives you problems? |
|
Back to top |
|
Pixelbrei123
Joined: 30 Sep 2014 Posts: 6 Location: Germany
|
Posted: Sat 04 Oct '14 17:47 Post subject: |
|
|
Thanks for the quick reply.
I feared this would be a hornets nest. It seems I have to create my own version of the module.
I work on a legacy system and we are migrating from server 2003 to 2008/2012. So the module does not need to work on 2003. Ofc, it would be nice if possible.
I'm also thinking to compile it with apache 2.4.10. I don't think that should be too difficult. http_request changed so I only need to fix ap_hook_check_user_id.
I'll give it a shot this weekend and will post any problems here. I'm sure there will be plenty. |
|
Back to top |
|
Pixelbrei123
Joined: 30 Sep 2014 Posts: 6 Location: Germany
|
Posted: Sun 05 Oct '14 23:26 Post subject: |
|
|
So instead of using VC6 I went on using Visual Studio 2012.
I fixed all compile errors but it still fails to build. This is the first apache module im working on so I will give you a short overview what I did.
In Visual Studio:
1. Created a win32 dll project.
2. Added the module sources.
3. Set the apache include/lib folders as "Additional Include Directories"
4. Linker: Set the apache lib folder as "Additional Libary Directories"
5. Linker Input: Set Additional Dependencies to "PathToApacheLibFolder\*.lib"
When I try to build it fails with:
Code: | ...
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__ap_log_error
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_pstrdup@8
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_psprintf
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__ap_add_version_component@8
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_array_make@12
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_array_push@4
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_palloc@8
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__apr_table_get@8
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__ap_set_string_slot
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__ap_set_flag_slot
1>mod_auth_tkt.obj : error LNK2001: unresolved external symbol __imp__ap_hook_post_config@16
1>C:\...\mod_auth_tkt.so : fatal error LNK1120: 11 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
This looks like a linker problem to the apache libs but I checked the linker settings and cant find a mistake.
Any ideas how to fix this?
Greetings,
Pixelbrei |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 06 Oct '14 4:12 Post subject: |
|
|
I do not have VC6 handy but in the project's properties itself, add to addition libraries (or something like that) libhttpd.lib libapr-1.lib & libaprutil-1.lib.
Or, do it the command line
Set the path to Apache's root folder
set APACHE=C:\Apache24
cl /nologo /O2 /MD /W3 -DWIN32 -D_WIN32 -DAPACHE22 -I%APACHE%\include /c *.c
link kernel32.lib ws2_32.lib libhttpd.lib libapr-1.lib libaprutil-1.lib /libpath:"%APACHE%\lib" /nologo /subsystem:windows /dll /out:mod_auth_tkt.so *.obj |
|
Back to top |
|
Pixelbrei123
Joined: 30 Sep 2014 Posts: 6 Location: Germany
|
Posted: Fri 10 Oct '14 16:08 Post subject: |
|
|
Thanks for the help so far.
But I'm still not able to compile it correctly so I decided to use a different authentication method before I put too much effort into reviving this module.
Maybe I'll try again someday when I have more time to spare. |
|
Back to top |
|