LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   virtual host problem (https://www.linuxquestions.org/questions/linux-newbie-8/virtual-host-problem-81068/)

Michele 08-11-2003 04:37 PM

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

Mathieu 08-11-2003 05:41 PM

I'm not sure if I follow. :scratch:

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>


antken 08-11-2003 06:07 PM

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

Michele 08-12-2003 09:27 AM

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

Mathieu 08-12-2003 09:56 AM

Can you post your virtual host file ?

Do you want these two web sites to be accessable from the internet?

Michele 08-18-2003 11:05 AM

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


All times are GMT -5. The time now is 10:35 AM.