is it possibile to statically compile modules in apache.exe?
On both linux and mac side I was able to build an apache exec (httpd) stand alone that contains both all deps (apr, apr-util, pcre) and the modules that I needed, but in Windows I was only able to build an apache.exe stand alone (that cointains only apr.dll, apr-util.dll and other deps) without modules. So for example, I cannot be able to use the Order directive in httpd.conf file because the needed module is not included in apache.exe.
I modify a lot of mak files included the httpd.mak file in order to build the apache.exe using link.exe in this way:
link.exe Release\main.obj \ Release\httpd.res \ srclib\apr\Release\libapr.lib \ srclib\pcre\Release\pcre.lib \ srclib\apr-iconv\Release\libapriconv.lib \ Release\my_modules.lib \ Release\libhttpd.lib
every .lib file has all the obj files built statically with lib.exe
Building in this way the "my_modules.lib" seems to be ignored and all the obj module files were not included in the apache.exe (for example mod_authn_file.obj, mod_expires, mod_actions and so on…).
If I add obj files explicitally during build in this way:
link.exe Release\main.obj \ Release\httpd.res \ srclib\apr\Release\libapr.lib \ srclib\pcre\Release\pcre.lib \ srclib\apr-iconv\Release\libapriconv.lib \ Release\libhttpd.lib \ modules\Release\mod_authn_file.obj \ modules\Release\mod_expires.obj \ modules\Release\mod_actions.obj \ ...... (other object modules)
the size of apache.exe grow but if I use the command apache.exe -M to see Loaded Modules, I find only:
core_module (static) win32_module (static) mpm_winnt_module (static) http:module (static) so_module (static)
[that are all modules that aren't included in my_modules.lib]
Using Dependency Walker I can see all the modules in the apache.exe:
actions_module alias_module _ap_get_server_built@0 auth_basic_module authn_default_module authn_file_module authz_default_module authz_groupfile_module authz_host_module authz_user_module cgi_module dir_module expires_module filter_module http_module log_config_module mime_module mpm_winnt_module setenvif_module so_module status_module version_module win32_module
It seems that the modules were linked but they were not enabled…
I hope that someone can help me.
Best Answer
I've solved it...
I modified modules.c file in os/win32/ folder in this way:
then I recompile the modules.obj file with this command:
then I rebuild apache.exe and execute apache.exe -M:
so in this way I have compiled an apache 2.2.17 statically for win32!