Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

httpd.conf what am I doing wrong?

Status
Not open for further replies.

iwanalearn

Technical User
Sep 21, 2001
22
0
0
US
Yes I'm new to apache.
I have virtual websites on an NT server. I'm moving them over to Suse 9.0 Linux box.
I've followed the instruction found here and this is what happens.
If at a browser I type in the web address I get an index list of the folder on the webserver.
Same thing happens if I type in etc.
The same list of folder shows. I have a firewall and am using NAT.
Here is part of my configuration:

NameVirtualHost 192.168.0.100

<VirtualHost 192.168.0.100>
ServerAdmin webmaster@mysite.com
DocumentRoot /srv/ ServerName mysite.com
ServerAlias ErrorLog /srv/ CustomLog /srv/ combined

<Directory &quot;/srv/ Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ &quot;/srv/
<Directory &quot;/srv/ AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>
The other virtual hosts are cofigured the same but with their web addresses.
I have UseCanonicalName Off
Thanks for the help
 
Do you have an entry similar to the following in your httpd.conf file?

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>

The above tells the server what file name to serve up as the default.

Cheers,
Chuck
 
Chuck, Yes I do.
actually it is like this

<IfModule mod_dir.c>
DirectoryIndex index.html Home.php Chamber.php Splash.php
</IfModule>

Do I want to put this with each Virtual Host since each has a different home page?

Also, this information is found above the Virtual Host part. Do I need to comment this out for Virtual Host to work?

DocumentRoot &quot;/srv/ AllowOverride None
Order allow,deny
Allow from all

After the original posting, I put an index.html file in the /srv/ directory and each website found that same page.

Thanks again
 
why you have:
NameVirtualHost 192.168.0.100
<VirtualHost 192.168.0.100>
???

supossing you have as your default server, a virtual host must be so in virtual host should be:
NameVirtualHost <VirtualHost
using the IP as your address in the browser, you always will get the defaul server (
Regarding your last question, NO, you must *not* comment those lines, because those are your default server settings.

Cheers.
 
Hi mate,

Add UseCanonicalName Off to each virtualhost directive.

I realise that you say this is written above, but it normally has to be specified in each virtualhost for it to work.

As for the index pages:

DirectoryIndex index.html Home.php Chamber.php Splash.php

In this section just list the different filenames used, you don't have to put this into each virtualhost, but you could if you wanted.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top