Webserver reconfiguration fails with permission denied when SELinux is in enforced mode

Created:

2016-11-16 13:11:16 UTC

Modified:

2017-08-16 18:26:57 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Webserver reconfiguration fails with permission denied when SELinux is in enforced mode

Applicable to:

  • Plesk 10.x for Linux
  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

The problem described in this Knowledgebase article has been completely fixed since Parallels Plesk 11.5 (see the release notes ).

Webserver reconfiguration fails with an error like:

New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 8 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 16 of /usr/local/psa/admin/conf/vhosts_bootstrap.conf: Could not open configuration file /var/www/vhosts/domain13gcl.a10-52-59-230.qa.plesk.ru/conf/13382830970.33967600_httpd.include: Permission denied

Cause

Incorrectly set context on the webserver configuration files.

Resolution

  1. Connect to the server using SSH .
  2. Reinstall psa-selinux package to reset SELinux policies on webserver configuration files

    # yum reinstall psa-selinux

  3. Reconfigure webserver configuration files

    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

If by some reason it was not helped, then follow steps below:

  1. Install the package which provides the semanage utility:

    # yum install policycoreutils-python

  2. Change the context type for webserver configuration files:

    # semanage fcontext -a -t httpd_sys_content_t "/var/www/vhosts/[^/]*/conf(/.*)?"

  3. Apply your context type changes:

    # restorecon -Rv /var/www/vhosts/

  4. Reconfigure webserver configurations:

    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Have more questions? Submit a request
Please sign in to leave a comment.