Troubleshoot - Setting of Apache Httpd VirtualHost

Published in the topic of Webserver, Config

Setting of Apache Httpd VirtualHost

Provided is simplest working setting for VirtualHost with symbolic link.

<VirtualHost *:80>
    DocumentRoot "/path/to/directory/"
    ServerName servername.localhost
    ServerAlias servername.localhost

    # Ensure directory exists
    ErrorLog /var/log/httpd/error.log
    CustomLog /var/log/httpd/requests.log combined

    <Directory "/path/to/directory/">
        # Indexes : Allow directory listing on missing index file.
        # FollowSymlinks : Allow symlynk as DocumentRoot or part of the path.
        # SymLinksIfOwnerMatch : Allow different user owner other than httpd's
        Options +Indexes +FollowSymlinks -SymLinksIfOwnerMatch

        # To avoid specific case of 403 Forbidden
        Require all granted
        Allow from all
        # Enable .htaccess
        AllowOverride All
    </Directory>
</VirtualHost>

abdillah