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 server called DEV01.intranet where I have installed Redmine.

I managed to configure a subdomain redmine.dev01.intranet, which is working now, but when I go to dev01.intranet alone it shows Redmine again (??!!!)

I would like to access Redmine from http://redmine.dev01.intranet and http://dev01.intranet/redmine.

I have these in sites-enabled:

GNU nano 2.2.6 File: /etc/apache2/sites-enabled/default1

<VirtualHost *:80>
        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>

GNU nano 2.2.6 File: /etc/apache2/sites-enabled/redmine

<VirtualHost redmine.dev01.intranet.fusiondev.com.ar:80>
 ServerName redmine.dev01.intranet.fusiondev.com.ar
 DocumentRoot /usr/local/share/redmine/public
 ServerAlias redmine.dev01.intranet.fusiondev.com.ar
 ServerAdmin jsivil@fusiondev.com.ar
 LogLevel warn
 ErrorLog /var/log/apache2/redmine_error
 CustomLog /var/log/apache2/redmine_access combined
 RailsEnv production
 RailsBaseURI /redmine
 PassengerDefaultUser www-data
 PassengerResolveSymlinksInDocumentRoot on
 <Directory /var/www/redmine>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride None
   Order allow,deny
   allow from all
 </Directory>
</VirtualHost>

What I am doing wrong and why is Redmine shown at root / when no one says so?

Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I finally came around the solution.

The bigges problem solved adding 000-xxx, 001-xxx (number prefix) to VirtualHosts symbolic links from sites-available to sites-enabled. That way the dev01 alone will load first, then redmine.dev01.

Last, I had no CSS in the second Redmine to load. If I go to redmine.dev01 first after Apache restart, it loads OK. But de01/redmine wont have CSS, and viceversa if I load it first.

The solution was to make a copy of the source folder and point the subdomain DocumentRoot's to the second folder. It's like a new instance. Didn't search too much for other solutions, but since the DB is the same, it's only 60mb of wasted disk space and a second instance in memory (If that's the way Ruby on Rails manages it).

My VirtualHosts, in case anyone needs a hand.

GNU nano 2.2.6 File: /etc/apache2/sites-enabled/000-dev01

<VirtualHost *:80>
        ServerAdmin jsivil@fusiondev.com.ar
        ServerName dev01.intranet.fusiondev.com.ar
        ServerAlias www.dev01.intranet.fusiondev.com.ar
        DocumentRoot /var/www/dev01
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/dev01>
                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>

        <Directory /var/www/dev01/redmine>
                RailsBaseURI /redmine
                PassengerResolveSymlinksInDocumentRoot on
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

GNU nano 2.2.6 File: /etc/apache2/sites-enabled/001-redmine.dev01

<VirtualHost *:80>
 ServerName redmine.dev01.intranet.fusiondev.com.ar
 DocumentRoot /var/www/redmine.dev01/redmine
 ServerAlias www.redmine.dev01.intranet.fusiondev.com.ar
 ServerAdmin jsivil@fusiondev.com.ar
 LogLevel warn
 ErrorLog /var/log/apache2/redmine_error
 CustomLog /var/log/apache2/redmine_access combined
 RailsEnv production
 RailsBaseURI /redmine
 PassengerDefaultUser www-data
 PassengerResolveSymlinksInDocumentRoot on
 <Directory /var/www/redmine.dev01/redmine>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride None
   Order allow,deny
   allow from all
 </Directory>
</VirtualHost>
share|improve this answer

try to exhange:

<VirtualHost redmine.dev01.intranet.fusiondev.com.ar:80>

with

<VirtualHost *:80>

VirtualHosts and IP addresses are somewhat tricky - look here for details.

share|improve this answer
    
Thanks! I've found the answer. Can you vote up my question so I can put it? Requires 10 reputation and I have 9. Thanks! –  Jorge Feb 6 '13 at 5:30
    
No problem - voted you up :) –  mt_ Feb 6 '13 at 17:44

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.