Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: URL going to wrong site
PostPosted: Thu Feb 09, 2012 8:52 am 
Offline
Senior Member

Joined: Sat Feb 12, 2011 10:09 pm
Posts: 64
Hi guys, I just added a new domain to my server but its jumping to another crap blog that I made a while back instead of it's own location on the server.

I've made a new vhost file in sites-available:
Code:
<VirtualHost 178.79.183.119:81>
     # Postfix admin
     Alias /postfixadmin /srv/www/postfixadmin
     # blog
     ServerAdmin chris@pixelatedphotographer.com
     ServerName standingstart.net
     ServerAlias www.standingstart.net
     DocumentRoot /srv/www/standingstart.net/public_html/
     ErrorLog /srv/www/standingstart.net/logs/error.log
     CustomLog /srv/www/standingstart.net/logs/access.log combined
</VirtualHost>


The other domain is:
Code:
<VirtualHost 178.79.183.119:80>
     # Postfix admin
     Alias /postfixadmin /srv/www/postfixadmin
     # blog
     ServerAdmin chris@pixelatedphotographer.com
     ServerName chrisgilloch.com
     ServerAlias www.chrisgilloch.com
     DocumentRoot /srv/www/chrisgilloch.com/public_html/
     ErrorLog /srv/www/chrisgilloch.com/logs/error.log
     CustomLog /srv/www/chrisgilloch.com/logs/access.log combined
</VirtualHost>


When I had them both at <VirtualHost 178.79.183.119:80> I got the error:
Code:
[warn] VirtualHost 178.79.183.119:80 overlaps with VirtualHost 178.79.183.119:80, the first has precedence, perhaps you need a NameVirtualHost directive


and updated the hosts file:
127.0.0.1 localhost.localdomain localhost
178.79.183.119 swansea.chrisgilloch.com swansea
178.79.183.119 swansea.standingstart.net swansea

but www.standingstart.net jumps to www.chrisgilloch.com

My DNS settings are as follows:

Image

Image


I'm running Apache on ubuntu lucid

Can you guys spot where I'm going wrong? Any ideas would be great!

Cheers
Chris

[/code]


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2012 9:03 am 
Offline
Senior Newbie

Joined: Fri Apr 15, 2011 6:18 am
Posts: 8
Code:
<VirtualHost 178.79.183.119:81>

standingstart.net is on port 81, not port 80.
You'd have to set up apache to listen on port 81 and access the site as http://standingstart.net:81/
Just going to http://standingstart.net/ is equivalent to http://standingstart.net:80/ and since there is no standingstart.net on port 80, you end up hitting the default VirtualHost, which in this case happens to be www.chrisgilloch.com.
You should look at this piece of apache documentation for more info on the error message and how you can fix all of this.


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2012 10:14 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
You just need to add "NameVirtualHost *:80" somewhere in your Apache config. If you're on Ubuntu, this should be in your default configuration, but it seems that somehow it got lost.


Top
   
PostPosted: Thu Feb 09, 2012 10:17 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
crazyfruitbat wrote:
...

When I had them both at <VirtualHost 178.79.183.119:80> I got the error:
Code:
[warn] VirtualHost 178.79.183.119:80 overlaps with VirtualHost 178.79.183.119:80, the first has precedence, perhaps you need a NameVirtualHost directive

...
This should possibly be a hint at what you may be missing, though. Somewhere in your configuration (not in one of the sites-available files), you need a line like this:
Code:
NameVirtualHost 178.79.183.119:80


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2012 10:23 am 
Offline
Senior Member

Joined: Sat Feb 12, 2011 10:09 pm
Posts: 64
Hi Guys, many thanks for your answers you were all right.

I stuck:
NameVirtualHost 178.79.183.119:80

<VirtualHost 178.79.183.119:80>
ServerName www.chrisgilloch.com
ServerAlias chrisgilloch.com *.chrisgilloch.com
DocumentRoot /srv/www/chrisgilloch.com/public_html/
</VirtualHost>

<VirtualHost 178.79.183.119:80>
ServerName www.standingstart.net
DocumentRoot /srv/www/standingstart.net/public_html/
</VirtualHost>

Into the httpd.conf file and that resolved the issues.

Thank you for all the help!


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:  
RSS

Powered by phpBB® Forum Software © phpBB Group