Webserver (Apache/nginx) configs regeneration fails because created symlink file name of latest Apache config already exists

Created:

2016-12-30 18:47:09 UTC

Modified:

2017-08-16 17:25:26 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Webserver (Apache/nginx) configs regeneration fails because created symlink file name of latest Apache config already exists

Applicable to:

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

Symptoms

Web server reconfiguration fails:

`2016-09-06T14:27:06+01:00 ERR (3): Apache config (14731684050.68106800) generation failed:  
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] => example1.com, example2.com, .......
)
Details: Empty error message from utility.`

OR

Apache configuration files regeneration fails with the following error in /usr/local/psa/admin/logs/panel.log or in an email to the Plesk administrator:

`2012-08-13T15:13:33+07:00 ERR (3): Apache config (13448456120.70254100) generation failed: Refusing to create symlink '/srv/www/vhosts/example.com/conf/last_httpd.include': file with the same name already exists`

Cause

Plesk can't create the symlinks "last\_httpd.include"  or "last\_nginx.conf" in configuration directories of virtual hosts because files with these names (not symlinks) already exist.

Plesk can create symlinks with these names, but not files.

Resolution

  1. Find a list of domains without generated configuration files:

    mysql> select name from domains where id in (select distinct(objectId) from Configurations where status='error' and objectType='domain');
  2. Reconfigure domains one-by-one (according to the article #213384069 ) and find domains with error:

    # cat domains | while read i; do /usr/local/psa/admin/bin/httpdmng --reconfigure-domain $i; echo "$i - success"; done
  3. Remove or rename the extra files for domains found in the previous step:

    # mv /srv/www/vhosts/example.com/conf/last_httpd.include /srv/www/vhosts/example.com/conf/custom_last_httpd.include
  4. Find the files that are not links:

    # HTTPD_VHOSTS_D=`cat /etc/psa/psa.conf | grep HTTPD_VHOSTS_D| awk '{print $2}'`
    # for i in `ls -1 $HTTPD_VHOSTS_D/*/conf/{last_httpd.include,last_nginx.conf}`;
    do if [ ! -L $i ]; then echo "File $i is not a link! "; fi ;
    done File /var/www/vhosts/example.com/conf/last_httpd.include is not a link!
  5. Regenerate configuration files for domains with error by executing /usr/local/psa/admin/bin/httpdmng --reconfigure-domain <domain name> .

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