Click to See Complete Forum and Search --> : apache virtual host displays default test page only


rioguia
11-03-2003, 11:39 AM
My apache server running two virtual domains works correctly for the default (first) virtual domain (www.substantis.com) but displays a test page for the second virtual domain (www.lubuto.org).

Red Hat 9.0 with a stock rpm install modified only to accomodate at gallery.php install that is currently functioning as a link from the first virtual domain (www.substantis.com/gallery)

The steps I have taken to date:

1. I have been looking for a solution using two texts, Red Hat Linux Administration: A Beginner's Guide (Beginner's Guide) by Michael Turner, Steve Shah and using google searches on the linux board at google (httpd.conf, virtual "test page") and Linux Apache Web Server Administration, First Edition by Charles Aulds. Aulds says cryptically:When setting up named-based hosts that all apply to the same IP address,you should enter the hostnames as Canonical Name or CNAME records in theDNS server for the domian. This will place them in the DNS as aliases for the one true hostname that should exist (as an Address or A) record in theDNS.

2. Created a master forward file in my DNS server for LUBUTO.ORG following Auld's instructions. It may be that this record is the issue.

$TTL 3H
lubuto.org. 1D IN SOA ns1.substantis.com. mworden.substantis.com. (
2003103103
2H
1H
1W
1D )
lubuto.org. 1W IN NS ns1.substantis.com.
lubuto.org. 1W IN NS ns1.speakeasy.net.
lubuto.org. 1W IN NS ns2.speakeasy.net.
lubuto.org. 3H IN MX 10 mail.substantis.com.
lubuto.org. 3H IN A 66.92.149.196
www.lubuto.org 1W IN CNAME www.substantis.com

3. I tested the DNS record through www.dnsreport.com. the only complaint of relevance here is as follows:
WARNING. Your web site (www.lubuto.org) has a CNAME record pointing to www.substantis.com.. That by itself is confusing, but acceptable. However, the CNAME record in this case causes an extra DNS lookup, which will slightly delay visitors to your website, and use extra bandwidth.

4. I modifed the apache httpd.conf file.
here is the (hopefully) relevant portion of my conf file. as you can see, i had a little problem making this document root structure work so i commented out the vh1 (virtual host for substantis.com) and placed the contents of my primary virtual host the same as my original document root configuration (per Ault's directions).

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@substantis.com
DocumentRoot /var/www/html
ServerName www.substanis.com
ErrorLog logs/noname.substantis.com-error_log
CustomLog logs/noname.substanis.com-access_log common
</VirtualHost>
#
# <VirtualHost *>
# ServerAdmin webmaster@.substantis.com
# DocumentRoot /var/www/html/vh1
# ServerName www.substantis.com
# ErrorLog logs/vh1.substantis.com-error_log
# CustomLog logs/vh1.substantis.com-access_log common
#</VirtualHost>
#
<VirtualHost *:80>
ServerAdmin webmaster@lubuto.org
DocumentRoot /var/www/html/vh2
ServerName www.lubuto.org
ErrorLog logs/vh2.lubuto.org-error_log
CustomLog logs/vh2.lubuto.org-access_log common
</VirtualHost>

5. i placed an index.html document in my virtual domain document root pursuant to my directive at /var/www/html/vh2 (see my virtual configuration above). I changed the privileges on this directory and its contents using chmod 644. The index.html page does not display but instead the default test page.

blizz
11-03-2003, 04:46 PM
Hi,

I can ping www.lubuto.org and it resolves to 66.92.149.196

2. Created a master forward file in my DNS server for LUBUTO.ORG following Auld's instructions. It may be that this record is the issue.

I'm kinda confused are you running your own dns server for this domain? If so did you add LUBUTO.ORG to the named.conf file?

rioguia
11-04-2003, 03:48 AM
yes, i am running my own dns server and yes i have it as part of the named.conf file. i just found the problem. iam embarassed to say that I had the wrong permissions. i found a thread discussing the same problem and did a chmod 766 /var/www/html/vh2/index.html. i refereshed my browser and the correct page appeared. i had previously set the permissions at chmod 644 var/www/html/vh2/index.html using the example from Red Hat Linux Administration: A Beginner's Guide (Beginner's Guide) by Michael Turner, Steve Shah, page 366. can anyone tell me why this works.? I did not change the permissions of the index itself because i didn't use the -r recursive argument. The permissions on the index remain:
-rw-r--r-- 1 root root 159 Nov 3 14:28 index.html