Adding Virtual Hosts to Apache on CentOS

When adding a new *.conf file in /etc/httpd/conf.d/ folder and trying to restart the httpd service you may find that the service does not due to permission errors. Whatever you may try with file ownership, file permissions and different users starting Apache process nothing seems to work. This is due to a SELINUX security issue.

In order to instruct SELINUX to allow Apache use the .conf to give the following command:

 sudo chcon -t httpd_config_t [filename.conf]

 

 

 

Adding Virtual Hosts to Apache on CentOS