• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Unable to generate the web server configuration file

ErikLo

New Pleskian
After installing Wordpress or Joomla I get the error:

Unable to generate the web server configuration file on the host <click2it.nl> because of the following errors:

Template_Exception: httpd: Syntax error on line 223 of /etc/httpd/conf/httpd.conf: Syntax error on line 8 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/click2it.nl.conf: Permission denied

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 68
code: 0

Please resolve the errors in web server configuration templates and generate the file again.​

Anyone any idea how to resolve this?

Thanks in advance!
 
Hello,

Try to rebuild httpd conf file on your server

Code:
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
 
What is line 8 in /etc/httpd/conf.d/zz010_psa_httpd.conf ?

What is permissions on file /etc/httpd/conf/plesk.conf.d/vhosts/click2it.nl.conf ?
 
With the After the Rebuild All with the Webserver Configurations Troubleshooter I get:

Error: Can not reconfigure webserver configurations: Unable to execute httpdmng: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-domains [1] => dvoot.com,dvoot.nl,mijnwebtekst.nl,click2it.nl,strandtent.nl,strandtent.com,click2it.nl,strandtent.nl,strandtent.com ) Details: 2013-12-14T15:05:43+01:00 ERR (3) [util_exec]: proc_close() failed 2013-12-14T15:05:45+01:00 ERR (3) [util_exec]: proc_close() failed 2013-12-14T15:05:45+01:00 ERR (3) [panel]: Apache config (13870299410.90669900) generation failed: Template_Exception: 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: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf: Permission denied file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php line: 68 code: 0 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: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf: Permission denied
 
What do following command show?
getenforce
ls -la /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf
 
I get

lrwxrwxrwx. 1 root root 75 Dec 14 15:07 /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf -> /var/www/vhosts/system/mijnwebtekst.nl.conf/13870300460.85268900_httpd.conf
 
What about getenforce? Try to disable selinux then reconfigure configs and return selinux state.
Code:
[root@a10-52-59-230 ~]# SELINUX=`getenforce`
[root@a10-52-59-230 ~]# echo $SELINUX
Enforcing
[root@a10-52-59-230 ~]# setenforce 0
[root@a10-52-59-230 ~]# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
[root@a10-52-59-230 ~]# setenforce $SELINUX
[root@a10-52-59-230 ~]# getenforce 
Enforcing
 
I did that but no positive result
I get an email:

Unable to generate the web server configuration file on the host <click2it.nl> because of the following errors:

Template_Exception: 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: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf: Permission denied

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 68
code: 0

Please resolve the errors in web server configuration templates and generate the file again.


And in Plesk I get:

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: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf: Permission denied . The error message containing the detailed error descriptions was sent to you by e-mail. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.
 
Could you send me the output of command above or print here if it's not too big?
And output of following command too:
ls -laZ /var/www/vhosts/system/mijnwebtekst.nl.conf
 
Hereby the output of the command above:

Code:
[root@click2it elodeweges]# SELINUX=`getenforce`
[root@click2it elodeweges]# echo $SELINUX
Enforcing
[root@click2it elodeweges]# setenforce 0
[root@click2it elodeweges]# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
[root@click2it elodeweges]# setenforce $SELINUX
[root@click2it elodeweges]# getenforce
Enforcing
[root@click2it elodeweges]#

Ans the LS command gives:

Code:
[root@click2it elodeweges]# ls -laZ /var/www/vhosts/system/mijnwebtekst.nl.conf
ls: cannot access /var/www/vhosts/system/mijnwebtekst.nl.conf: No such file or directory
 
With the command above I get:

Code:
[root@click2it elodeweges]# SELINUX=`getenforce`
[root@click2it elodeweges]# echo $SELINUX
Enforcing
[root@click2it elodeweges]# setenforce 0
[root@click2it elodeweges]# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
[root@click2it elodeweges]# setenforce $SELINUX
[root@click2it elodeweges]# getenforce
Enforcing
[root@click2it elodeweges]#


And the ls command gives:

Code:
[root@click2it system]# ls -laZ /var/www/vhosts/system/mijnwebtekst.nl.conf
ls: cannot access /var/www/vhosts/system/mijnwebtekst.nl.conf: No such file or directory
[root@click2it system]#
 
With the command above I get:

Code:
[root@click2it elodeweges]# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
[root@click2it elodeweges]# setenforce $SELINUX
Empty output of httpdmng utility means that all configurations were successfully reconfigured.

Does Plesk still show the reconfiguration error?
 
Last edited:
Yes, it does:

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: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/mijnwebtekst.nl.conf: Permission denied . The error message containing the detailed error descriptions was sent to you by e-mail. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

Schermafbeelding 2013-12-16 om 11.36.46.png
 
The error in panel means that you had had the issue before reconfiguration in console. Sometimes when the erroneous object is deleted the error is not removed from the database.
You can workaround it with Webserver Configuration Checker:
1. In the extension on Configurations tab select only erroneous configuration by clicking "Show Errors" button.
2. Select all erroneous configuration and delete it with "Remove" button.
3. (Optional)Then you can rebuild all configurations with "Rebuild All" button to make you sure that issue disappeared and it was not the selinux issue.
 
BTW, were there no warnings on the Checker tab of Webserver Configurations Troubleshooter?
 
Try with disabled selinux:
1. [root@click2it elodeweges]# setenforce 0
2. Then remove erroneous configuration in Webserver Configuration Troubleshooter.
3. "Rebuild All" in Webserver Configuration Troubleshooter.
 
There is only one more problem.
Some sites with website hosting do forward to another website hosted on the same Plesk Panel.
For example: I setup a Wordpress site at mijnwebtekst.nl but now it is forwarded to dvoot.com.
 
Back
Top