Hmm, I am pretty suspicious of the config file
/etc/apache2/vhosts.d/30_subversion_ssl_vhost.conf
When you remove the '-D SSL' you will cause all parts of the configuration files that are enclosed in ... to be skipped. The default SSL vhost file on my Gentoo box is wrapped in that tag so I wonder if, by removing the '-D SSL', you are preventing the config in 30_subversion_ssl_vhost.conf from being run at all and if that is what is allowing Apache to start.
If you temporarily remove the file 30_subversion_ssl_vhost.conf from /etc/apache2/vhosts.d does Apache run? Are there any other SSL related vhost.conf files in vhosts.d? My reasonably fresh/unused Apache install's vhosts.d directory looks like this:
# pwd && ls
/etc/apache2/vhosts.d
00_default_ssl_vhost.conf 00_default_vhost.conf default_vhost.include
edit 1:
So much for that theory :) I am now wondering if the problem is with the Apache SSL setup itself. I apologize if I am covering ground you have already checked but I am wondering if you could do the following to help verify your Apache install.
On my Apache install with working SSL the use flags are as follows:
# emerge -av apache
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild U ] www-servers/apache-2.2.11-r2 [2.2.11] USE="ssl -debug -doc -ldap (-selinux) -sni -static -suexec -threads" 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 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 -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 64 kB
In particular do you have the 'ssl' USE flag set?
Also, could you use equery to verify the integrity of your apache2 install? If you do not have the equery command you can install it by running 'emerge -av gentoolkit'. The following command should verify the integrity of your apache install:
equery check apache
On my server the above command gives the following output:
[ Checking www-servers/apache-2.2.11 ]
!!! /etc/apache2/vhosts.d/00_default_ssl_vhost.conf has wrong mtime (is 1256620928, should be 1246793824)
!!! /etc/apache2/modules.d/00_default_settings.conf has wrong mtime (is 1246796304, should be 1246793824)
!!! /etc/conf.d/apache2 has incorrect md5sum
* 429 out of 432 files good
edit 2:
Well the install looks good to me, so much for theory 2. I am wondering if we can coax Apache into giving some more information on startup. In /etc/conf.d/apache2 if you change your APACHE2_OPTS line from:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
to
APACHE2_OPTS="-X -e debug -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
and then start Apache (/etc/init.d/apache2 start) the daemon should stay in the foreground (the -X flag) and output debuging messages as it starts (the -e debug option). Maybe this will give a clue as to why it is dying on startup.
Try edit Apache mpm configuration.
$apache2 -V | grep MPM
Server MPM: Prefork
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 5
MaxClients 30
ServerLimit 30
MaxRequestsPerChild 5000
</IfModule>
$apache2 -V | grep MPM
Server MPM: Worker
<IfModule mpm_worker_module>
StartServers 2
MaxClients 30
MinSpareThreads 15
MaxSpareThreads 20
ThreadsPerChild 10
MaxRequestsPerChild 5000
</IfModule>
Best Answer
The short answer: you cannot predict which apache process will handle a request.
The simplest way to solve this problem is to dedicate an xterm to every apache process and run
strace -p <pid>
in it for each apache pid.When I'm in this situation, I usually do this in my
httpd.conf
(on a development box):This reduces the number of processes I need to monitor... obviously it's not a good solution for a production environment.
FYI, if you need to
strace
a process that will fork after you startstracing
(for instance, awsgi
process) you can usestrace -fp <pid_of_future_forker>
and it willstrace
the forked children automagically.