I can't run a php from my custom location:
$ cat /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/alex/Documents/var_www_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
$ ls -l ~/Documents/var_www_html
total 52
drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 dir1
drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 dir2
-rwxr-xr-x 1 alex alex 493 Oct 25 16:37 file1.inc.php
drwxr-xr-x 3 alex alex 4096 Oct 25 16:37 css
-rwxr-xr-x 1 alex alex 3638 Oct 25 16:37 favicon.ico
drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 images
-rwxr-xr-x 1 alex alex 2091 Oct 25 16:37 index.php
drwxr-xr-x 3 alex alex 4096 Oct 25 16:37 js
drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 lib
-rwxr-xr-x 1 alex alex 1081 Oct 25 16:37 LICENSE
-rwxr-xr-x 1 alex alex 719 Oct 25 16:37 README.md
drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 tpl
drwxr-xr-x 3 alex alex 4096 Oct 25 16:37 website_itself
$ ls -ld ~/Documents/var_www_html
drwxr-xr-x 10 alex alex 4096 Oct 25 16:37 /home/alex/Documents/var_www_html
The error is:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
How come?
That error is caused from not having a statement such as the one below within you VirtualHost or in a block etc, or any other block like this:
To allow the listing of directory contents, because no default file was found. You can specify a default file with a statement such as the one below in a similar area (so in the VirtualHost, Location etc:
Did you have mod_php loaded? Have you thought about using perl under FCGI instead, generally its a bit more secure.