Click to See Complete Forum and Search --> : virtualservers not working, i only get apache page
diggler
04-18-2002, 11:20 AM
My apache web server is running fine on mandrake 8.1. But when i set-up a name based virtualserver, the type the url into a browser i only get the default apache server page. It seems like it wont use the document path even though it put an access_log in the correct folder. I hope someone can help... :confused:
chikn
04-18-2002, 12:05 PM
Post your Vhosts.conf file for us so we can see where you went wrong.
diggler
04-18-2002, 12:15 PM
################# Named VirtualHosts
#NameVirtualHost 111.222.33.44
#<VirtualHost 111.222.33.44>
#ServerName www.domain.tld (http://www.domain.tld)
#ServerPath /domain
#DocumentRoot /web/domain
#</VirtualHost>
NameVirtualHost 65.188.174.149
<VirtualHost 65.188.174.149>
ServerName www.clanog.com (http://www.clanog.com)
ServerAlias clanog.com *.clanog.com
ServerPath /var/www/html/clanog
DocumentRoot /var/www/html/clanog
CustomLog /var/www/html/clanog/access_log "combined"
</VirtualHost>
chikn
04-18-2002, 03:02 PM
That looks good.
You do have seperate DNS entries for each domain?
diggler
04-18-2002, 04:23 PM
yes and clanog.com is resolving the correct ip
chikn
04-18-2002, 07:35 PM
Originally posted by diggler:
<STRONG>yes and clanog.com is resolving the correct ip</STRONG>
Ive had trouble with the vhosts on 1 and 1 machine only not working without a reboot (starting and stopping apache didnt work). Never figured out why.
Also had trouble on another machine that if I didnt
#postmap Vhosts.conf
it wouldnt work either
Since you Vhosts.conf file looks right, you have correctly set DNS entries for the virtuals and I assume you since atleast the log is working that you httpd.conf or commonhttpd.conf file is pointing to the correct vhost configuration file then it would seem to me its something specific to your system thats causing the problem.
diggler
04-24-2002, 01:27 PM
Someone finally gave me the code:
For example, suppose that both www.domain.tld (http://www.domain.tld) and www.otherdomain.tld (http://www.otherdomain.tld) point at an IP address that the server is listening to. Then you simply add the following to httpd.conf:
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.tld (http://www.domain.tld)
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *>
ServerName www.otherdomain.tld (http://www.otherdomain.tld)
DocumentRoot /www/otherdomain
</VirtualHost>
Thanks for all your help.