Apache 2.4.1-r2 will not start with the ebuild default configuration files.
The current package is affected the issues mentionned in the Apache 2.2 to 2.4 migration guide regarding the User, Order and Require directives (amongst others). Also, mod_authn_default, mod_authz_default and mod_mem_cache modules were removed in 2.4.
* Caching service dependencies ... [ ok ]
* apache2 has detected an error in your setup:
AH00526: Syntax error on line 128 of /etc/apache2/httpd.conf:
Invalid command 'User', perhaps misspelled or defined by a module not included in the server configuration
* ERROR: apache2 failed to start
Emerged with www-servers/apache-2.4.1-r2 USE="ssl threads -debug -doc -ldap (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker"
All configuration files are the ones included with the ebuild/package.
There is also authz_core module missing in httpd.conf so even upgrading all Order/Allow/Deny directives to new Require doesn't work and fails:
AH00526: Syntax error on line 110 of /etc/apache2/modules.d/00_default_settings.conf:
Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration
LoadModule authz_core_module modules/mod_authz_core.so
to httpd.conf resolves that.
to make apache start:
add to /etc/apache2/httpd.conf :
LoadModule unixd_module modules/mod_unixd.so # for User directive
LoadModule access_compat_module modules/mod_access_compat.so # for Order directive
to fix warnings:
remove from /etc/apache2/vhosts.d/00_default_vhost.conf :
# Use name-based virtual hosting.
remove from /etc/apache2/modules.d/00_mod_mime.conf :
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
after adding mod_unixd and mod_access_compat and removing the lines you mentioned i get internal server error on any web request.
for ssl you also need to add:
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
and the SSLMutex cannot be used because everything was migrated to one Mutex directive and I don't really know how to modify it properly.
adding "LoadModule authz_core_module modules/mod_authz_core.so"
fixed the internal server error. now need to find out how to fix SSL
just commenting out the SSLMutex directive was sifficiant enough for it to work! apache works again! thanks for the support!
*** Bug 410609 has been marked as a duplicate of this bug. ***
Created attachment 307655 [details, diff]
Migration to 2.4
Patch to get Apache running. Note that this is not an ideal solution. mod_access_compat is used instead of the correct migration to 2.4 style auth directives.
I think that the ideal solution would be to start from scratch from the httpd.conf.in from upstream.
(In reply to comment #7)
> Created attachment 307655 [details, diff] [details, diff]
> Migration to 2.4
> Patch to get Apache running. Note that this is not an ideal solution.
> mod_access_compat is used instead of the correct migration to 2.4 style auth
Why not migrate them too? It's pretty straight forward migration (I did it here too, so I can send patch for it if needed).
Created attachment 307657 [details, diff]
Apache 2.2 to 2.4 migration incl authz
Updated patch to include 2.4 style authorization directives
Created attachment 307661 [details, diff]
Apache 2.2 to 2.4 migration
Migrated 2.2 to 2.4 authorization directives. Removed modules that disappeared upstream. Also, removed unused comments. This patch likely break portage based conf.d settings inference from USE flags, but I have no idea how to do that.
I just finished upgrading my apache to 2.4. After migration it would not start but just hang. Finally, I found out that I had to build dev-libs/apr with USE="urandom".
JFYI, if anyone has the same problem.
Anyone any ideas how that could be?!
Created attachment 308503 [details]
my working apache2.4 config
Based on the proposed patch some; modules always loaded; You might need to rework your virtual host configs:
Allow from all
is equal to
Require all granted
hope this helps :(
(In reply to comment #13)
> Created attachment 308503 [details]
> my working apache2.4 config
> Based on the proposed patch some; modules always loaded; You might need to
> rework your virtual host configs:
> Order allow,deny
> Allow from all
> is equal to
> Require all granted
> hope this helps :(
OMG! you need to uncomment
in vhosts.d/00_default_vhost.conf :( 2.4 config is major FUBAR
Created attachment 318976 [details, diff]
Changes to gentoo-apache-2.4.1-patrick-20120401.tar.gz
For details see comments in the patch file.
Should cover everything from http://httpd.apache.org/docs/2.4/upgrading.html
Created attachment 318978 [details, diff]
metadata.xml: Added several flags for modules
Created attachment 318980 [details]
New ebuild: apache-2.4.2-r1.ebuild
Still testing, static flag does not work in some combinations.
The rest of the flags/modules seems to working (except proxy_scgi).
Tests with static still running, I'll summarize the changes later ...
Created attachment 318982 [details, diff]
Diff between apache-2.4.2.ebuild and my new apache-2.4.2-r1.ebuild
Created attachment 320752 [details, diff]
Removed duplicate cache_disk:cache from MODULE_DEPENDS
Is there an overlay for apache2.4? Just wondering. There is not much progress with apache2.4 and gentoo. By the way, 2.4.3 has been released.
...AND 2.4.3 is a major bugfix. I've tried to modify current ebuild to work for 2.4.3 but it's quite complicated and I'm not a ebuild guru :(
I am still willing to do whatever it takes, but get no response from the herd.
Was asked to send mail with my suggestions ... no reply.
For any default config to work out of the box, we'll have to change the default flags. Either by altering the profile or by enabling IUSE_DEFAULTS in the ebuild/eclass.
See bug https://bugs.gentoo.org/show_bug.cgi?id=427946
+ 12 Oct 2012; Patrick Lauer <email@example.com> +apache-2.4.3.ebuild,
+ -apache-2.4.2.ebuild, metadata.xml:
+ Bump with fixes from #410607 #411433 #433736