Wednesday, August 17, 2016

Use external folder as DocumentRoot in Apache

When adding a new Virtual Host in Apache with DocumentRoot outsite of the default htdocs folder (xamp), you need the red line in your server virtual host configuration:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/photography"

    ErrorLog "logs/"
    CustomLog "logs/" common

<Directory "C:/xampp/photography/">
Options Indexes MultiViews
Order allow,deny
Allow from all
Require all granted

If not, you gonna get the Do not have permission error when trying to access your website.