I have a working Redmine installation on my Debian server, but I don't know how to configure Apache2 properly so that neither the content of the Redmine folder nor the Redmine start page will be displayed as the homepage of my website. Suppose the URL of the website was www.myexample.com.
Current state
- www.myexample.com shows files of
/var/www/redmine
folder - with the symbolic link
/var/www/redmine -> /usr/local/lib/redmine-2.1/public/
Wanted state
- www.myexample.com should be my usual website homepage [e.g. showing index.html]
- www.redmine.myexample.com or www.myexample.com/redmine should show the redmine page
I guess it is just a configuration problem but I cannot figure out the problem. So here are my configuration files. Do you see what I am missing here?
/etc/apache2/httpd.conf
ServerName redmine.example.com DocumentRoot /var/www AllowOverride all Options -MultiViews
/etc/apache2/sites-available/redmine
DocumentRoot /var/www/redmine AllowOverride all Options -MultiViews RailsBaseURI /redmine
/etc/apache2/sites-available/default
ServerAdmin webmaster@localhost DocumentRoot /var/www Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined
After changing any of these files, do I have to restart Apache2 or use a2ensite to activate any of the hosts?
asked Nov 25, 2012 at 12:29
2
I've written a how-to including this. While it is about Redmine 1.3.x it should be still relevant for the Apache part.
Full how-to: Redmine stable on Debian stable. Basically, it comes down to this:
Install and configure
mod_passenger
in/etc/apache2/mods-available/passenger.conf
:PassengerDefaultUser www-data # Below are some lines to tweak mod-passenger. # This keeps some Ruby processes running, # but the average response time is a lot lower # on low-traffic sites. RailsSpawnMethod smart PassengerPoolIdleTime 3000 RailsAppSpawnerIdleTime 0 PassengerMaxRequests 1000
Extend your current main 'site', for example
/etc/apache2/sites-available/mymainsite
:RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on
Create another 'site' and include the same as above, changing the
RailsBaseURI
value to/
.
answered Nov 26, 2012 at 14:44
gertvdijkgertvdijk
3,3724 gold badges30 silver badges46 bronze badges
3
- Change the owner and the group of the Redmine directory to "apache".
# chown -R apache:apache /var/lib/redmine
- Execute Redmine in Apache's root directory. Update DocumentRoot in /etc/httpd/conf/httpd.conf as follows:
DocumentRoot "/var/lib/redmine/public"
Update ServerName. Specify the FQDN or IP address of the server that will run Redmine [in this example, we specify "example.com"].
ServerName example.com:80
If the FQDN was specified in /etc/httpd/conf/http, then in /etc/hosts register its IP address as follows: Specify the FQDN of the server running Redmine [in this example, we specify "example.com".]
127.0.0.1 example.com
- Restart Apache. Check the configuration file:
# /etc/init.d/httpd configtest
Check the status of SELinux.
# getenforce
If the command returns "Enforcing", then perform the steps described in "Configuring Redmine to run when SELinux is enabled". Otherwise, restart Apache.
# /etc/init.d/httpd graceful