Category Archives: CentOS

Best Apache VirtualHost configuration for PHP projects

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>

DocumentRoot    /var/www/html/

php_admin_value open_basedir /var/www/html/

CustomLog       /var/log/httpd/ common
ErrorLog        /var/log/httpd/

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!

Installing EPEL and Remi repo on CentOS 6

Install the repos with the following commands:

sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Now, enable the Remi repo to be always enabled by editing:

sudo vim /etc/yum.repos.d/remi.repo



…on the topmost repo (right under the [remi] tag).

That’s it!


Installing Vagrant on CentOS 6

Installing Vagrant is easy thanks to the provided RPMs.

Download RPM

wget -O vagrant_1.4.2_x86_64.rpm

Install it

sudo rpm -i vagrant_1.4.2_x86_64.rpm

That’s it! Let’s check to make sure Vagrant works:

vagrant -v
Vagrant 1.4.2

If you want the latest version, go to the Downloads page at and find the latest version download link.
Download it in the first step instead – installing works the same.

Original source