LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-04-2004, 05:24 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
apache 2 virual hosts


Hi i want my apache serves 2 web sites... When i run the server this error message appears

[warn] VirtualHost palaios.gr:0 overlaps with VirtualHost evridikifans.gr:0, the first has precedence, perhaps you need a NameVirtualHost directive

and here is my configuration file
<VirtualHost palaios.gr>
ServerName palaios.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/palaios.gr"
</VirtualHost>

<VirtualHost evridikifans.gr>
ServerName evridikifans.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/evridikifans.gr"
</VirtualHost>


the palaios and evridikifans.gr has the same ip as denoted in the /etc/hosts file....
What i must do to solve it... and why this message appears?
Have a nice day
 
Old 06-03-2004, 12:43 AM   #2
kbcnetau
Member
 
Registered: Dec 2003
Location: South Australia (ex-Devon, UK)
Distribution: SuSE, Slackware, Fedora, Debian, Knoppix
Posts: 141

Rep: Reputation: 15
Try this:

<VirtualHost *>
ServerName palaios.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/palaios.gr"
</VirtualHost>

<VirtualHost *>
ServerName evridikifans.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/evridikifans.gr"
</VirtualHost>

...and do you not want them to have www in front? You could:

<VirtualHost *>
ServerName palaios.gr
ServerAlias www.palaios.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/palaios.gr"
</VirtualHost>

<VirtualHost *>
ServerName evridikifans.gr
ServerAlias www.evridikifans.gr
ServerAdmin alex@palaios.gr
DocumentRoot "/www/docs/evridikifans.gr"
</VirtualHost>
 
Old 06-03-2004, 09:33 AM   #3
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
I do my virtual hosts like this... you need the first line to avoid duplicates I think...

Code:
NameVirtualHost ipofserver
then goes the vhosts...
Code:
<VirtualHost ipofserverhere>
ServerAlias domain.com
ServerAdmin root@domain.com
DocumentRoot /home/user/public_html
ServerName www.domain.com
</VirtualHost>

<VirtualHost ipofserverhere>
ServerAlias sub.domain.com
ServerAdmin root@domain.com
DocumentRoot /home/wherever/public_html
ServerName www.domain.com
</VirtualHost>
 
Old 06-03-2004, 06:06 PM   #4
kbcnetau
Member
 
Registered: Dec 2003
Location: South Australia (ex-Devon, UK)
Distribution: SuSE, Slackware, Fedora, Debian, Knoppix
Posts: 141

Rep: Reputation: 15
I think that this is true if you have more than one IP address on your machine.

My Web servers all just have the wildcard * where Astro has ipofserver, but they all have one NIC/IP address each.
 
Old 06-03-2004, 06:48 PM   #5
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
Quote:
Originally posted by kbcnetau
I think that this is true if you have more than one IP address on your machine.

My Web servers all just have the wildcard * where Astro has ipofserver, but they all have one NIC/IP address each.
Good point, not sure if that matters, but my server does have 2 interfaces with 2 different IP's.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache hosts Henster Linux - Software 1 07-24-2005 05:24 AM
apache virtual hosts Red Squirrel Linux - Software 4 06-20-2004 09:05 AM
apache 2 virual hosts alaios Linux - Software 6 05-18-2004 01:05 PM
Apache virtual hosts Mil0 Linux - Software 5 06-01-2003 11:58 PM
apache virtual hosts jonfa Linux - General 1 06-04-2002 01:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration