LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-04-2004, 08:19 AM   #1
snu
Member
 
Registered: May 2003
Location: NRW
Distribution: FreeBSD
Posts: 64

Rep: Reputation: 15
virtual hosts


I searched for the answer, but perhaps i am too blind to find it.
Hope you can help me.
I have got one Domain and one IP

I want to have my normal domain and a virtual domain
something like this

domain.com

foo.domain.com

So I configured Apache

<VirtualHost *:80>
Servername domain.com
ServerAdmin webmaster@domain.com
ScriptAlias /cgi-bin/ /var/www/webmaster/cgi-bin/
DocumentRoot /var/www/webmaster/html/
</VirtualHost>


<VirtualHost *:80>
Servername foo.domain.com
ServerAlias pictures
ServerAdmin webmaster@domain.com
ScriptAlias /cgi-bin/ /var/www/webmaster/cgi-bin/
DocumentRoot /var/www/webmaster/html/foo/
</VirtualHost>

When i start apache i get this

Starting httpd: [Tue May 04 15:17:53 2004] [warn] _default_ VirtualHost overlap on port 80, the first has precedence

Yes I use the same port for both. But how to change it? The other configuration is o.k i get the right website by comment the other other out.
Please help.
 
Old 05-04-2004, 08:43 AM   #2
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
maybe it's about directory overlap?
"DocumentRoot /var/www/webmaster/html/foo/"
is inside the
"DocumentRoot /var/www/webmaster/html/"
wich means if you go to foo.domain.com you end up on domain.com/foo. I don't have much experience with virtual servers but maybe you should create real seperate directories for both?

greetz,
.-=~ iluvatar ~=-.
 
Old 05-04-2004, 09:18 AM   #3
snu
Member
 
Registered: May 2003
Location: NRW
Distribution: FreeBSD
Posts: 64

Original Poster
Rep: Reputation: 15
No it wasn t but thanx
 
Old 05-04-2004, 10:57 AM   #4
bentman78
Member
 
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
post the last part of your conf file.
 
Old 05-04-2004, 11:03 AM   #5
snu
Member
 
Registered: May 2003
Location: NRW
Distribution: FreeBSD
Posts: 64

Original Poster
Rep: Reputation: 15
That is the last part that is not comment out
I wrote

<VirtualHost *:80>
Servername domain.com
ServerAdmin webmaster@domain.com
ScriptAlias /cgi-bin/ /var/www/webmaster/cgi-bin/
DocumentRoot /var/www/webmaster/html/
</VirtualHost>


<VirtualHost *:80>
Servername foo.domain.com
ServerAlias pictures
ServerAdmin webmaster@domain.com
ScriptAlias /cgi-bin/ /var/www/webmaster/cgi-bin/
DocumentRoot /var/www/webmaster/html/foo/
</VirtualHost>



That is the example that is at the end
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
 
Old 05-04-2004, 12:49 PM   #6
bentman78
Member
 
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
is this in there anywhere?

NameVirtualHost *:80

should be right above your virtual hosts containers
 
Old 05-04-2004, 12:53 PM   #7
bentman78
Member
 
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
also look at your server name. The first one lists your domain name. It needs to have a FQDN. you just have domain.com. You need to give it a name. like www.domain.com.
The next one can be foo.domain.com or whatever you want to call it. Be sure to update your hosts file with the new server names as well, and give them the ip address of the ethernet connection.
 
Old 05-04-2004, 02:13 PM   #8
snu
Member
 
Registered: May 2003
Location: NRW
Distribution: FreeBSD
Posts: 64

Original Poster
Rep: Reputation: 15
Thanx a lot.
NameVirtualHost *:80 was the error. It was commented out. I put
NameVirtualHost Mydomain.de:80
and it fits.
Thanx to everyone for help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
virtual hosts, virtual ip's? kuplo Linux - Newbie 3 11-29-2005 08:44 PM
Help with Virtual Hosts? econnections Linux - Newbie 3 07-02-2005 12:39 PM
Virtual hosts Help carminejg3 Linux - Newbie 2 12-22-2004 02:47 PM
virtual hosts... Digital_Err0r Linux - Newbie 25 03-25-2004 03:58 PM


All times are GMT -5. The time now is 01:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration