I have a small domain, which I use only for personal purposes. I'm the main user, and have at most 3-4 users at the same time.
I use apache2 with passenger to serve redmine.
So I start with an empty apache2:
root@xxxxx:/home/# service apache2 start
[ ok ] Starting web server: apache2.
root@xxxxx:/home/# a2dissite
Your choices are:
Which site(s) do you want to disable (wildcards ok)?
Then enable my site, and restart (not reload) apache2:
root@xxxxx:/home/# a2ensite 200-redmine
Enabling site 200-redmine.
To activate the new configuration, you need to run:
service apache2 reload
root@xxxxx:/home/# service apache2 restart
[FAIL] Restarting web server: apache2 failed!
[warn] The apache2 instance did not start within 20 seconds. Please read the log files to discover problems ... (warning).
root@xxxxx:/home/# service apache2 restart
[FAIL] Restarting web server: apache2 failed!
[warn] There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand. ... (warning).
root@xxxxx:/home/# pidof apache2
20948
Here's my 200-redmine.conf:
PerlLoadModule Apache::Redmine
<VirtualHost *:80>
ServerName redmine.xxxxx.xxx
DocumentRoot /var/www/redmine/public/
ErrorLog ${APACHE_LOG_DIR}/redmine.error.log
CustomLog ${APACHE_LOG_DIR}/redmine.access.log common
MaxRequestLen 20971520
<Directory "/var/www/redmine/public/">
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
SetEnv GIT_PROJECT_ROOT /opt/git/
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location /git>
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
PerlAccessHandler Apache::Authn::Redmine::access_handler
AuthType Basic
Require valid-user
AuthName "Redmine Git Repository"
RedmineDSN "DBI:mysql:database=redmine;host=localhost:3306"
RedmineDbUser "redmine"
RedmineDbPass "password"
RedmineCacheCredsMax 50
</Location>
</VirtualHost>
Now if I comment out the ScriptAlias / stuff, it works !
In addition, starting the server with 200-redmine disabled, then enabling it works. But apache2 will die randomly. Plus the location doesn't work.
The logs show nothing:
root@xxxxx:/home/# ll /var/log/apache2/
total 8
drwxr-xr-x 2 root root 4096 Oct 30 07:52 coredump
-rw-r--r-- 1 root root 0 Nov 4 02:39 default.access.log
-rw-r--r-- 1 root root 2356 Nov 4 02:39 default.error.log
-rw-r--r-- 1 root root 0 Nov 4 02:39 other_vhosts_access.log
-rw-r--r-- 1 root root 0 Nov 4 02:39 redmine.access.log
-rw-r--r-- 1 root root 0 Nov 4 02:39 redmine.error.log
root@xxxxx:/home/# ll /var/log/apache2/coredump/
total 0
root@xxxxx:/home/# cat /var/log/apache2/default.error.log
[ 2013-11-04 02:39:36.0130 21471/7fcf090f4740 agents/Watchdog/Main.cpp:452 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '21470', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-11-04 02:39:36.0255 21474/7f9a99fda740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.21470/generation-0/request
[ 2013-11-04 02:39:36.0507 21479/7f8316b0f740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.21470/generation-0/logging
[ 2013-11-04 02:39:36.0511 21471/7fcf090f4740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
[ 2013-11-04 02:39:36.3158 21495/7fba6f686740 agents/Watchdog/Main.cpp:452 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '21491', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-11-04 02:39:36.3304 21498/7f0106d9b740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.21491/generation-0/request
[ 2013-11-04 02:39:36.3522 21503/7f92ad392740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.21491/generation-0/logging
[ 2013-11-04 02:39:36.3525 21495/7fba6f686740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
And at last:
root@xxxxx:/home/# apache2ctl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:80 is a NameVirtualHost
default server redmine.xxxx.xxx (/etc/apache2/sites-enabled/200-redmine.conf:5)
port 80 namevhost redmine.xxxx.xxx (/etc/apache2/sites-enabled/200-redmine.conf:5)
port 80 namevhost redmine.xxxxx.xxx (/etc/apache2/sites-enabled/200-redmine.conf:5)
root@xxxxx:/home/# uname -a
Linux xxxx.xxx 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux
root@xxxxx:/home/# dpkg --list | grep apache2
ii apache2 2.4.6-3 amd64 Apache HTTP Server
ii apache2-bin 2.4.6-3 amd64 Apache HTTP Server (binary files and modules)
ii apache2-data 2.4.6-3 all Apache HTTP Server (common files)
ii apache2-utils 2.4.6-3 amd64 Apache HTTP Server (utility programs for web servers)
ii libapache2-mod-fcgid 1:2.3.9-1 amd64 FastCGI interface module for Apache 2
ii libapache2-mod-passenger 4.0.10-1 amd64 Rails and Rack support for Apache2
ii libapache2-mod-perl2 2.0.8+httpd24-r1449661-6+b1 amd64 Integration of perl with the Apache2 web server
ii libapache2-mod-perl2-dev 2.0.8+httpd24-r1449661-6 all Integration of perl with the Apache2 web server - development files
ii libapache2-mod-perl2-doc 2.0.8+httpd24-r1449661-6 all Integration of perl with the Apache2 web server - documentation
ii libapache2-mod-proxy-html 1:2.4.6-3 amd64 Transitional package for apache2-bin
ii libapache2-mod-svn 1.7.13-2 amd64 Apache Subversion server modules for Apache httpd
ii libapache2-reload-perl 0.12-2 all module for reloading Perl modules when changed on disk
ii libapache2-svn 1.7.13-2 all Apache Subversion server modules for Apache httpd (dummy package)
root@xxxxx:/home/# a2dismod
Your choices are: access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_svn authz_user autoindex dav dav_svn deflate dir env fcgid filter mime mpm_event negotiation passenger perl proxy proxy_http rewrite setenvif status
Which module(s) do you want to disable (wildcards ok)?