Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 410607 - www-servers/apache 2.4.1-r2 will not start with default conf
Summary: www-servers/apache 2.4.1-r2 will not start with default conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: Normal major with 2 votes (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
: 410609 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-02 22:02 UTC by Martin Cyr
Modified: 2012-10-12 06:07 UTC (History)
24 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Migration to 2.4 (apache2.4.1-r2.diff,4.28 KB, patch)
2012-04-03 18:33 UTC, Martin Cyr
Details | Diff
Apache 2.2 to 2.4 migration incl authz (apache2.4.1-r2.diff,8.76 KB, patch)
2012-04-03 18:58 UTC, Martin Cyr
Details | Diff
Apache 2.2 to 2.4 migration (apache2.4.1-r2.diff,9.08 KB, patch)
2012-04-03 19:09 UTC, Martin Cyr
Details | Diff
my working apache2.4 config (example_apache2.4_conf.tar.bz2,7.60 KB, application/octet-stream)
2012-04-11 07:47 UTC, Stoian Ivanov
Details
gentoo-apache-2.4.1-patrick-20120401-2.4.2-r1.patch (gentoo-apache-2.4.1-patrick-20120401-2.4.2-r1.patch,13.61 KB, patch)
2012-07-23 12:45 UTC, Stefan Kuhn
Details | Diff
metadata.xml.diff (metadata.xml.diff,2.04 KB, patch)
2012-07-23 12:50 UTC, Stefan Kuhn
Details | Diff
apache-2.4.2-r1.ebuild (apache-2.4.2-r1.ebuild,6.95 KB, text/plain)
2012-07-23 12:55 UTC, Stefan Kuhn
Details
apache-2.4.2-r1.ebuild.diff (apache-2.4.2-r1.ebuild.diff,6.25 KB, patch)
2012-07-23 12:56 UTC, Stefan Kuhn
Details | Diff
Removed duplicate cache_disk:cache from MODULE_DEPENDS (apache-2.4.2-r1.ebuild.diff,307 bytes, patch)
2012-08-08 20:54 UTC, Martin Cyr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Cyr 2012-04-02 22:02:25 UTC
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.

See http://httpd.apache.org/docs/2.4/upgrading.html#commonproblems

 * 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.
Comment 1 Martin Jansa 2012-04-03 11:49:21 UTC
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

Adding this
LoadModule authz_core_module modules/mod_authz_core.so
to httpd.conf resolves that.
Comment 2 Mathieu Rochette 2012-04-03 11:54:49 UTC
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. 
NameVirtualHost *:80 

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 
# text. 
DefaultType text/plain
Comment 3 Kfir Ozer 2012-04-03 12:40:16 UTC
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.
Comment 4 Kfir Ozer 2012-04-03 12:46:08 UTC
adding "LoadModule authz_core_module modules/mod_authz_core.so"
fixed the internal server error. now need to find out how to fix SSL
Comment 5 Kfir Ozer 2012-04-03 12:51:14 UTC
just commenting out the SSLMutex directive was sifficiant enough for it to work! apache works again! thanks for the support!
Comment 6 Jeroen Roovers gentoo-dev 2012-04-03 15:52:30 UTC
*** Bug 410609 has been marked as a duplicate of this bug. ***
Comment 7 Martin Cyr 2012-04-03 18:33:53 UTC
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.
Comment 8 Martin Cyr 2012-04-03 18:35:44 UTC
I think that the ideal solution would be to start from scratch from the httpd.conf.in from upstream.
Comment 9 Martin Jansa 2012-04-03 18:37:52 UTC
(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
> directives.

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).
Comment 10 Martin Cyr 2012-04-03 18:58:50 UTC
Created attachment 307657 [details, diff]
Apache 2.2 to 2.4 migration incl authz

Updated patch to include 2.4 style authorization directives
Comment 11 Martin Cyr 2012-04-03 19:09:22 UTC
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.
Comment 12 Hanno Meyer-Thurow (geki) 2012-04-06 13:57:32 UTC
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?!
Comment 13 Stoian Ivanov 2012-04-11 07:47:23 UTC
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 :(
Comment 14 Stoian Ivanov 2012-04-11 07:54:51 UTC
(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 

Listen 80

in vhosts.d/00_default_vhost.conf :( 2.4 config is major FUBAR
Comment 15 Stefan Kuhn 2012-07-23 12:45:31 UTC
Created attachment 318976 [details, diff]
gentoo-apache-2.4.1-patrick-20120401-2.4.2-r1.patch

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
Comment 16 Stefan Kuhn 2012-07-23 12:50:01 UTC
Created attachment 318978 [details, diff]
metadata.xml.diff

metadata.xml: Added several flags for modules
Comment 17 Stefan Kuhn 2012-07-23 12:55:41 UTC
Created attachment 318980 [details]
apache-2.4.2-r1.ebuild

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 ...
Comment 18 Stefan Kuhn 2012-07-23 12:56:43 UTC
Created attachment 318982 [details, diff]
apache-2.4.2-r1.ebuild.diff

Diff between apache-2.4.2.ebuild and my new apache-2.4.2-r1.ebuild
Comment 19 Martin Cyr 2012-08-08 20:54:07 UTC
Created attachment 320752 [details, diff]
Removed duplicate cache_disk:cache from MODULE_DEPENDS
Comment 20 Thomas Stein 2012-08-22 12:00:35 UTC
Hello.

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.
Comment 21 Stoian Ivanov 2012-08-28 11:36:42 UTC
...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 :(
Comment 22 Stefan Kuhn 2012-09-03 22:59:31 UTC
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
Comment 23 Patrick Lauer gentoo-dev 2012-10-12 06:07:48 UTC
+  12 Oct 2012; Patrick Lauer <patrick@gentoo.org> +apache-2.4.3.ebuild,
+  -apache-2.4.2.ebuild, metadata.xml:
+  Bump with fixes from #410607 #411433 #433736