Background Back when I got my GL-AR150 mini router, I was blown away by the powerful capabilities of this $25 OpenWRT router,...
Best Apache VirtualHost configuration for PHP projectsStanislav Khromov
Here is an example of an Apache VirtualHost config that provides your site with security through open_basedir and writes both a regular access log, as well as a PHP error log.
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/html/example.com php_admin_value open_basedir /var/www/html/example.com CustomLog /var/log/httpd/example.com-access.log common ErrorLog /var/log/httpd/example.com-error.log </VirtualHost>
In order for open_basedir to work with file uploads, you need to add the following to your php.ini configuration file:
upload_tmp_dir = /tmp
I’m always looking to improve this configuration – send me a comment if you have a better version!