I have a server which is serving up a web page for a project.
The project is stored in a user directory on the server. (/home/user/theproject/webstuff
).
Originally, I was using the userdir
module to make this accessible via http://theserver/user
and a symbolic link from /home/user/public_html
to /home/user/theproject/webstuff
to indicate the location of the files.
But, ultimately, it would be better to serve the files from http://theserver
without having to indicate the user (since there really is only one user).
And then I had a truly brilliant idea.
Instead, I would rewrite my /etc/apache2/sites-enabled/000-default.conf
file to read:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/user/theproject/webstuff
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Now everything is lovely and good... except that PHP doesn't run any more.
Instead, the following error is raised:
AH01630: client denied by server configuration: /home/user/theproject/webstuff/script.php
To the client, this appears as a 403 Forbidden error.
So this is something of a dual question:
- Is there a better way to achieve my goal?
- How can I enable PHP in this situation?