I have set up an apache2 server on Leap 42.3, then enabled selinux with “selinux-policy-minimum-20140730-98.1”
When apache2starting, there is a directory “/etc/apache2/sysconfig.d” created automatically. I have set the context manually with “semanage fcontext”. So the status now is:
# ls -lZ /etc/apache2/
....
drwxr-xr-x. 2 root root system_u:object_r:httpd_config_t:s0 4096 Aug 9 10:03 sysconfig.d
....
# ls -lZ /etc/apache2/sysconfig.d/
-rw-r--r--. 1 root root system_u:object_r:httpd_config_t:s0 238 Aug 9 10:10 global.conf
-rw-r--r--. 1 root root system_u:object_r:httpd_config_t:s0 92 Aug 9 10:10 include.conf
-rw-r--r--. 1 root root system_u:object_r:httpd_config_t:s0 1704 Aug 9 10:10 loadmodule.conf
Start apache2 with “systemctl start apache2” and failed.
# journalctl -xe
Aug 09 10:26:08 linux-9wtz systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Aug 09 10:26:08 linux-9wtz systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Aug 09 10:29:15 linux-9wtz systemd[1]: Starting The Apache Webserver...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//include.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 94: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 124: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 128: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 132: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 136: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 140: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:15 linux-9wtz start_apache2[1967]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1967]: AH00557: httpd-prefork: apr_sockaddr_info_get() failed for linux-9wtz
Aug 09 10:29:16 linux-9wtz start_apache2[1967]: AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Aug 09 10:29:16 linux-9wtz start_apache2[1967]: (13)Permission denied: AH00091: httpd-prefork: could not open error log file /var/log/apache2/error_log.
Aug 09 10:29:16 linux-9wtz start_apache2[1967]: AH00015: Unable to open logs
Aug 09 10:29:16 linux-9wtz systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//include.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 90: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 94: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 124: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 128: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 132: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 136: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 140: /etc/apache2/sysconfig.d//global.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: /usr/sbin/start_apache2: line 147: /etc/apache2/sysconfig.d//loadmodule.conf: Permission denied
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: AH00557: httpd-prefork: apr_sockaddr_info_get() failed for linux-9wtz
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Aug 09 10:29:16 linux-9wtz start_apache2[1976]: httpd (no pid file) not running
Aug 09 10:29:16 linux-9wtz systemd[1]: Failed to start The Apache Webserver.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Aug 09 10:29:16 linux-9wtz systemd[1]: apache2.service: Unit entered failed state.
Aug 09 10:29:16 linux-9wtz systemd[1]: apache2.service: Failed with result 'exit-code'.
SELinux log: /var/log/audit/audit.log****](https://paste.opensuse.org/7531318)
Could somebody give some tips? Thanks!