28th September 2012, 10:50
Join Date: Aug 2012
Thanked 0 Times in 0 Posts
CentOS Apache DNS - Virtual Host
Okay, so I have managed to fix my other issues through searching around Google, but now, I have stumbled yet again with another problem that I could neither fix nor search through Google.
Anyway, hello and good day pipz.
I am trying to create a local server through LAN connection. Other computers can already access the server by either typing the hostname or the I.P. address.
The default server root is /var/www/html, and the server displays an Apache Welcome page, since I removed the index.html in the said location.
I would want for the server to instantly throw me to a page I made, which is located inside a folder within the server root.
I can access the said page if I type the IP address, followed by slashes and names of the folder locations and then the file name, like so...
And the server displays it no problem.
Now though, I want to simply type "example.com" and the server automatically throws me to the index.php within loc1 and loc2 folders.
After researching, I found out that I needed to write a Virtual Host within httpd.conf.
I did just that...
But after trying to type example.com, the server displays a white blank page. Accessing the error log files, it gave me this message.
# DocumentRoot /var/www/html
Allow from all
Redirect 404 /favicon.ico
ErrorDocument 404 "No favicon"
I don't understand why that is happening. If I comment the file's location and uncomment the root location, the server displays the Apache Welcome page again, and if I type the location on the address bar, the index.php is displayed properly.
Directory index forbidden by Options directive: /var/www/html/
Any help would be appreciated.