During the installation of nfsen - a netflow monitoring system on my machine, I stumbled across this error after doing nfsen configuration:
Could not open configuration file /etc/httpd/conf.d/nfsen.conf
I checked all the permissions and they were correct. After some time, I realized that it is an SE-Linux issue!
[root@localhost html]# vim /etc/httpd/conf.d/nfsen.conf
[root@localhost html]# service httpd start
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/nfsen.conf: Permission denied
[FAILED]
[root@localhost html]# ls -l /etc/httpd/conf/httpd.conf
-rw-r--r--. 1 apache apache 34418 Feb 28 21:52 /etc/httpd/conf/httpd.conf
[root@localhost html]# httpd -k start
[root@localhost html]# httpd -k stop
[root@localhost html]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
[root@localhost html]# chcon -t httpd_config_t /etc/httpd/conf.d/nfsen.conf
[root@localhost html]# service httpd start
Starting httpd: [ OK ]
Could not open configuration file /etc/httpd/conf.d/nfsen.conf
I checked all the permissions and they were correct. After some time, I realized that it is an SE-Linux issue!
[root@localhost html]# vim /etc/httpd/conf.d/nfsen.conf
[root@localhost html]# service httpd start
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/nfsen.conf: Permission denied
[FAILED]
[root@localhost html]# ls -l /etc/httpd/conf/httpd.conf
-rw-r--r--. 1 apache apache 34418 Feb 28 21:52 /etc/httpd/conf/httpd.conf
[root@localhost html]# httpd -k start
[root@localhost html]# httpd -k stop
[root@localhost html]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
[root@localhost html]# chcon -t httpd_config_t /etc/httpd/conf.d/nfsen.conf
[root@localhost html]# service httpd start
Starting httpd: [ OK ]
No comments:
Post a Comment