Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jul 23, 2010 6:37 am 
Offline
Newbie

Joined: Fri Jul 23, 2010 6:09 am
Posts: 4
Hello,

I am trying to host 2 different rails applications on Linode. Here are the details.

1) First app is www.eyesandfeet.com
2) Second app is www.use.eyesandfeet.com

I have followed the same procedure that listed in the tutorial,

http://library.linode.com/web-servers/a ... al_hosting

So here is my apache config,

File excerpt: /etc/apache2/sites-available/eyesandfeet.com

<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
</VirtualHost>

File excerpt: /etc/apache2/sites-available/use.eyesandfeet.com

<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
</VirtualHost>

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 www.use.eyesandfeet.com, it points to www.eyesandfeet.com.

But it supposed to go to the other application.

I have the same problem since 3days. Any help will be much appreciated.

Thanks,
Muni.


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2010 6:39 am 
Offline
Junior Member

Joined: Mon Dec 28, 2009 2:52 pm
Posts: 29
You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2010 9:32 am 
Offline
Newbie

Joined: Fri Jul 23, 2010 6:09 am
Posts: 4
Can you please give an example? Please never mind..

Ævar Arnfjörð Bjarmason wrote:
You're supposed to use a host, not an IP in the VirtualHost directive. See the apache docs.


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2010 10:21 am 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
Ævar Arnfjörð Bjarmason wrote:
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


muni, I don't know that this will correct your problem, but I did notice you are missing the "Directory" directive. For example:
Code:
<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>


Last edited by BrianJM on Fri Jul 23, 2010 10:32 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Fri Jul 23, 2010 10:30 am 
Offline
Junior Member

Joined: Mon Dec 28, 2009 2:52 pm
Posts: 29
BrianJM wrote:
Ævar Arnfjörð Bjarmason wrote:
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


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.


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2010 12:50 pm 
Offline
Newbie

Joined: Fri Jul 23, 2010 6:09 am
Posts: 4
Hello Guys,

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..
<VirtualHost *: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
</VirtualHost>


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 wrote:
BrianJM wrote:
Ævar Arnfjörð Bjarmason wrote:
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


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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group