Problem with Hosting multiple rails applications on Ubuntu
I am trying to host 2 different rails applications on Linode. Here are the details.
1) First app is
2) Second app is
I have followed the same procedure that listed in the tutorial,
So here is my apache config,
File excerpt: /etc/apache2/sites-available/eyesandfeet.com
ServerName eyesandfeet.com
ServerAlias
DocumentRoot /srv/www/eyesandfeet.com/eyesandfeet/public
ErrorLog /srv/www/eyesandfeet.com/logs/error.log
CustomLog /srv/www/eyesandfeet.com/logs/access.log combined
File excerpt: /etc/apache2/sites-available/use.eyesandfeet.com
ServerName use.eyesandfeet.com
ServerAlias
DocumentRoot /srv/www/use.eyesandfeet.com/eyesandfeet/public
ErrorLog /srv/www/use.eyesandfeet.com/logs/error.log
CustomLog /srv/www/use.eyesandfeet.com/logs/access.log combined
Then I have enabled both the sites and reloaded the apache.
I have placed the 2 rails applications in the respective folders as follows.
/srv/www/eyesandfeet.com/eyesandfeet
/srv/www/use.eyesandfeet.com/eyesandfeet
I have created 2 DNS entires for eyesandfeet.com and use.eyesandfeet.com..
When I point to
But it supposed to go to the other application.
I have the same problem since 3days. Any help will be much appreciated.
Thanks,
Muni.
5 Replies
@Ævar Arnfjörð Bjarmason:
You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.
@Ævar Arnfjörð Bjarmason:
You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.
This is incorrect - you have it backwards. See the apache docs.:wink:
muni, I don't know that this will correct your problem, but I did notice you are missing the "Directory" directive. For example:
<virtualhost 69.164.207.220:80="">ServerAdmin admin@eyesandfeet.com
ServerName eyesandfeet.com
ServerAlias www.eyesandfeet.com
DocumentRoot /srv/www/eyesandfeet.com/eyesandfeet/public
ErrorLog /srv/www/eyesandfeet.com/logs/error.log
CustomLog /srv/www/eyesandfeet.com/logs/access.log combined
<directory "="" srv="" www="" eyesandfeet.com="" eyesandfeet="" public"="">Options Indexes +ExecCGI FollowSymLinks
Order allow,deny
Allow from all</directory>
<virtualhost 69.164.207.220:80="">ServerAdmin admin@eyesandfeet.com
ServerName use.eyesandfeet.com
ServerAlias www.use.eyesandfeet.com
DocumentRoot /srv/www/use.eyesandfeet.com/eyesandfeet/public
ErrorLog /srv/www/use.eyesandfeet.com/logs/error.log
CustomLog /srv/www/use.eyesandfeet.com/logs/access.log combined
<directory "="" srv="" www="" use.eyesandfeet.com="" eyesandfeet="" public"="">Options Indexes +ExecCGI FollowSymLinks
Order allow,deny
Allow from all</directory></virtualhost></virtualhost>
@BrianJM:
@Ævar Arnfjörð Bjarmason:You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.
This is incorrect - you have it backwards. See the apache docs. :wink:
http://httpd.apache.org/docs/2.0/mod/co … irtualhost">http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost
Yeah, I stand corrected. I shouldn't post so early in the morning. Anyway, i can't see anything wrong with the configuration file then.
But it's possible to find this out via Apache, e.g. by checking in the logs what vhosts it things it's serving for specific requests.
Thanks for all your help. The problem was with the config file.. I was supposed to do the NameVirtualHost but was doing the IP Based Virtual Hosting..
So after modifying the config files it looks like this..
ServerName use.eyesandfeet.com
ServerAlias
DocumentRoot /srv/www/use.eyesandfeet.com/eyesandfeet/public
ErrorLog /srv/www/use.eyesandfeet.com/logs/error.log
CustomLog /srv/www/use.eyesandfeet.com/logs/access.log combined
same thing for eyesandfeet.com also..
And then I have added the line "NameVirtualHost *" in the apache2.conf file..
I have disabled the sites and loaded the apache and then restarted the apache….
Thats all.. Both the things works now as it is supposed to work..
Once again thanks for all your help..
Thanks,
Muni.
@Ævar Arnfjörð Bjarmason:
@BrianJM:
@Ævar Arnfjörð Bjarmason:You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.
This is incorrect - you have it backwards. See the apache docs.:wink:
http://httpd.apache.org/docs/2.0/mod/co … irtualhost">http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost Yeah, I stand corrected. I shouldn't post so early in the morning. Anyway, i can't see anything wrong with the configuration file then.
But it's possible to find this out via Apache, e.g. by checking in the logs what vhosts it things it's serving for specific requests.