How can I get HTTPD to serve the html/php files and not list/index them when they are in folder for virtual host. Using Centos 6.0

Posted by LaserBeak on Server Fault See other posts from Server Fault or by LaserBeak
Published on 2011-11-29T01:14:38Z Indexed on 2011/11/29 1:52 UTC
Read the original article Hit count: 761

Filed under:
|
|
|

My virtual hosts are configured as below, initally I could not even get to the /public_html/ directory when typing example.com and apache would just serve me up the default welcome page, I would also get the error: Directory index forbidden by Options directive: /var/www/html/example.com/public_html/ in the log . After editing the welcome.conf page (- Index) so it does not show again when I now type example.com the/public_html/ contents (Index.php) are indexed in the browser. Where as I want it to actually execute and diplay the index.php page.

vhost.conf , located in etc/httpd/vhost.d/

NameVirtualHost *:80

    <VirtualHost *:80>
         ServerAdmin [email protected]
         ServerName localhost
         ServerAlias localhost.example.com
         DocumentRoot /var/www/html/example.com/public_html/
         ErrorLog /var/www/html/example.com/logs/error.log
         CustomLog /var/www/html/example.com/logs/access.log combined
    </VirtualHost>

    <VirtualHost *:80>
         ServerAdmin [email protected]
         ServerName example.org
         ServerAlias www.example.org
         DocumentRoot /var/www/html/example.org/public_html/
         ErrorLog /var/www/html/example.org/logs/error.log
         CustomLog /var/www/html/example.org/logs/access.log combined
    </VirtualHost>

httpd.conf, settings on default, added onto end:

Include /etc/httpd/vhosts.d/*.conf

Root directories:

DocumentRoot "/var/www/html"

© Server Fault or respective owner

Related posts about linux

Related posts about apache2