I am running a Plesk server. Everything works quite smoothly.
However, today i installed redmine. To finalize it, i integrated installed and configured passenger for apache2 and created the file:
/etc/apache2/sites-available/redmine
Which contains:
<VirtualHost *:80>
DocumentRoot /var/www/redmine
ServerName project.mydomain.com
RewriteEngine on
RewriteRule ^/$ /redmine [R]
<Directory /var/www/redmine>
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
(/var/www/redmine is a symlink that points to the actual redmine directory)
I then restarted apache without getting any errors.
However, calling project.mydomain.com leads me straight to the same result as if i would simply browse to the IP address of my server – thus apache does not seem to recognize the virtual host.
I did a dirty test and entered some invalid chars to the VirtualHost config and then tried to restart apache, which did not work due to the faulty input – thus i am certain the file is parsed.
What am i doing wrong here?
Sidenotes:
1) project.mydomain.com is, of course, only masked here in my example – in my configuration i got my actual subdomain+domain name.
2) Testing redmine through webrick works fine.
I would check the following:
Considering the path you created your site, it seems like you are using a debian/ubuntu dist. So, have you enabled your site?
root@notebook:~$ sudo a2ensite redmine
/var/www/redmine should be a symbolic link to the ‘public’ subdirectory of your redmine directory, not fot itself. Eg.:
brunojcm@brunojcm-htpc:~$ ll /var/www/redmine
lrwxrwxrwx 1 root root 27 Sep 4 2011 /var/www/redmine -> /opt/redmine/current/public/
Are you testing project.mydomain.com/redmine or just project.mydomain.com? I would test it first with project.mydomain.com/redmine, then configure the redirect. Or even remove ‘RailsBaseURI /redmine’ and let the redmine be on your vhost’s root.
I have very similar setups on different machines, and they all work. If you checked the points above and still don’t have it working, please post some logs on the comments and I can try to help you.