Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

  1. /etc/apache2/httpd.conf

    <VirtualHost *:80>
      ServerName redmine.example.com
      DocumentRoot /var/www
      <Directory /var/www>
        AllowOverride all
        Options -MultiViews
      </Directory>
    </VirtualHost>
    
  2. /etc/apache2/sites-available/redmine

    <VirtualHost *:80>
      DocumentRoot /var/www/redmine
      <Directory /var/www/redmine>
        AllowOverride all
        Options -MultiViews
        RailsBaseURI /redmine
      </Directory>
    </VirtualHost>
    
  3. /etc/apache2/sites-available/default

    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
    
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
    
        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
    </VirtualHost>
    

After changing any of these files, do I have to restart Apache2 or use a2ensite to activate any of the hosts?

share|improve this question
    
Yes, you have to reload Apache after changing its configuration. –  Michael Hampton Nov 25 '12 at 13:33
    
@MichaelHampton Well good to know. So any ideas about the general problem? –  Bastian Nov 25 '12 at 14:57
add comment

1 Answer

up vote 2 down vote accepted

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:

    <Directory /var/www/redmine>
            RailsBaseURI /redmine
            PassengerResolveSymlinksInDocumentRoot on
    </Directory>
    
  • Create another 'site' and include the same as above, changing the RailsBaseURI value to /.

share|improve this answer
    
Well I am kind of astonished, but your approach actually works! The redmine page is now available under 'mydomain/redmine'; while the standard homepage is available under 'mydomain';! One question though: Do you know how to make the redmine section available under a seperate subdomain 'redmine.mydomain';? –  Bastian Nov 26 '12 at 16:58
    
Use regular VirtualHosting directives like ServerName and include the <Directory> part as you like. This is out of scope of any Redmine/Ruby application, but basic Apache configuration. –  gertvdijk Nov 26 '12 at 17:07
    
Another question: I just switched my main directory to /var/www/main while keeping /var/www/redmine and the apache2 configuration as is. Unfortunately I seem to have broken the availability of redmine now, the website does not know http://mydomain/redmine anymore. Do you know what I have to change? –  Bastian Nov 27 '12 at 17:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.