LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2003, 04:37 PM   #1
Michele
Member
 
Registered: Feb 2001
Location: Detroit
Posts: 31

Rep: Reputation: 15
Angry virtual host problem


I have two websites on one machine. I'm running apache 2 on mandrake 9.0

I'm having a problem with my virtual hosts file, when I change the document root to where the site lives, it changes both sites to the virtual host home page, when I change it back it changes both home pages back to the other home page.

Help!

Michele
 
Old 08-11-2003, 05:41 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I'm not sure if I follow.

You are changing the DocumentRoot of a <VirtualHost>.
Do your two VirtualHost directives look something like this:
Code:
<VirtualHost 10.0.0.1:80>
  DocumentRoot /path/to/docs
  Servername mysite.com
  ServerAlias www.mysite.com
  ErrorLog logs/mysite.com-error_log
  CustomLog logs/mysite.com-access_log common
</VirtualHost>
 
Old 08-11-2003, 06:07 PM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
hi,

are you using a name-based virtual host or an ip-based host?

basically, name-based means hosting multiple websites from one ip address
here is an example extract from the apache documentation page :

NameVirtualHost *

<VirtualHost *>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

try coping the above into your configuration file, and altering it to your needs

if all else fails, this: http://httpd.apache.org/docs-2.0/vhosts/ will be quite useful
 
Old 08-12-2003, 09:27 AM   #4
Michele
Member
 
Registered: Feb 2001
Location: Detroit
Posts: 31

Original Poster
Rep: Reputation: 15
didn't work

Hi Mathieu:

I copied the code you supplied and filled in the appropriate info for my server and it switched so that now both hosts on the machine answer the virtual host home page.

I'm clueless.

Michele
 
Old 08-12-2003, 09:56 AM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Can you post your virtual host file ?

Do you want these two web sites to be accessable from the internet?
 
Old 08-18-2003, 11:05 AM   #6
Michele
Member
 
Registered: Feb 2001
Location: Detroit
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for help with Vhost.conf

Thanks for the link to the man pages for apache, it was helpful and I got both my website up and running.

I had to put an entry in for every website on the ip, even the default.

Thanks,

Michele
 
  


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 Virtual Host Problem eckertc1 Linux - Newbie 11 03-23-2005 03:31 PM
Router Virtual Host Problem E-Oreo Linux - Networking 1 09-15-2004 07:17 AM
Apache virtual host problem Adrohak Linux - Software 3 07-18-2004 04:17 PM
Virtual Host Problem tictocdoc Linux - Networking 7 05-12-2004 09:08 PM
Name Based Virtual Host problem helios007 Linux - Networking 6 12-21-2003 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 PM.

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