The issue is the Virtual host settings in our httpd.conf file gets recognised inside the server. If I type the IP (name server defined in httpd.conf)inside my server, the IP gets redirected to the path mentioned in the conf file. But when I access the same Ip from an external machine, I go to the Redhat default page.
The paths var, var/www,var/www/html all have 777 access permission.
We are using
RHEL Version 5
Settings in httpd conf********
NameVirtualHost n.n.n.n:80
ServerAdmin n.n.n.n
Servername n.n.n.n
DocumentRoot "/var/www/html/mysite"
**********END of httpd.conf
N.n.n.n from outside the server takes me to the redhat default page, where as n.n.n.n/mysite works.
The error that i get in my log is "Directory index forbidden by option directive:var/www/html"
Comments
Does Apache Have the AutoIndex Module enabled?
Sorry after reading my last post I think I missed your point--so I deleted and rewrote it. Here is what I think you were looking for.
Does your httpd.conf have a directive like this?
The Indexes option will allow apache to show the files and subdirectories.
That is, if your apache has the mod_autoindex module installed.
John Berns
Travel Guide
Travel Photographer
Thanks for the response
Thanks for your support.We solved the issue by setting
this
We are unable to access url://n.n.n.n from inside the
host machine. This problem surfaced yesterday, even
before we made the above mentioned settings. What are
the reasons for inability to access IP from inside
host. Thanks once again for your prompt support.
Shyamala
Team Leader (http://www.netlinkindia.com)
Shyamala
http://www.unimitysolutions.com
Localhost
"We are unable to access url://n.n.n.n from inside the
host machine"
What happens when you enter localhost or 127.0.0.1 in the address bar of the host machine?
Why Using IPs?
For starters, you seem to be confusing Named Virtual Hosts with IP-based virtual hosts. n.n.n.n is not a server name, it's an IP address; www.domain.com or dev.domain.com is a server name.
I can see you are already running into a mess with this server configuration strategy. I think you are better off moving to using domain names rather than IPs to develop and test your sites.
I never just use IPs for development. I use names like "dev.somedomain.com" "sandbox.anotherdomain.com" and I either have those names resolved by a local DNS server--or if I am just working on a couple of sites by myself I keep things simple and edit the /etc/hosts files on the local machines.
Here is how the httpd.conf and hosts files would look:
Named Virtual Hosts section from httpd.conf
Then I create a /etc/hosts file like this on the server (this is hosted on a linux box; windows has a similar hosts file, see below):
The windows hosts file located at C:\WINDOWS\system32\drivers\etc\hosts, but the file layout is a little different, if you look at the file you should be able to figure out what to do--it's that basic.
John Berns
Travel Guide
Travel Photographer