Apache startup error Permission denied: httpd: could not open error log file solution
- 2020-05-09 19:45:54
- OfStack
1. System environment
CentOS 6.3 X64
yum installed apache
Version: httpd 2.2.15-30. el6. centos. x86_64
2. Problem description
New virtual host site, can not start, view the log, show:
Start the httpd : (13)Permission denied: httpd: could not open error log file /home/wwwroot/ofstack.com/logs/error_log.
Unable to open logs
[ failure ]
3. Reasons for the problem
Because of the newly installed system, SELinux is turned on by default and off
4. Solutions
1. Temporary shutdown (no need to restart the machine) :
setenforce 0 ## Set up the SELinux Become a permissive model
##setenforce 1 Set up the SELinux Become a enforcing model
2. To modify the configuration file, restart the machine:
Modify the /etc/selinux/config file
Change SELINUX=enforcing to SELINUX=disabled
Just restart the machine.