Articles in this section

Error in Plesk inteface: New configuration files were not created: Could not open configuration file: No such file or directory

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • The following error is shown within the Plesk GUI:

    New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 7 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Could not open configuration file /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf: No such file or directory.

  • The file mentioned in the error message exists, but its link is missing (or vice versa):

    # ls -l /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf
    lrwxrwxrwx 1 root root 55 Aug 7 13:36 /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf -> /var/www/vhosts/system/example.com/conf/httpd.conf
    # ls -l /var/www/vhosts/system/example.com/conf/httpd.conf
    ls: cannot access /var/www/vhosts/system/example.com/conf/httpd.conf: No such file or directory

  • The domain example.com (from the error message) is not visible anywhere within the Plesk GUI

Cause

The domain was not completely removed from the Linux server and only some web server configuration files that are related to it remain, which causes the error.

Resolution

Click on a section to expand

Via SSH
  1. Connect to the Plesk server via SSH
  2. Rebuild web server configuration files:

    # plesk sbin httpdmng --reconfigure-server

 

Via Plesk GUI
  1. Log into Plesk
  2. Open Tools & Settings > Webserver Configurations Troubleshooter > Rebuild > Broken:

 

If the above does not help, use these manual removal steps
  1. Connect to the Plesk server via SSH
  2. Move vhosts configuration files to the different directories:

    For CentOS / RedHat/ CloudLinux:

    # mkdir -p /root/plesk-backup-nginx/webmails
    # mkdir -p /root/plesk-backup-nginx/vhosts
    # mkdir -p /root/plesk-backup-apache/webmails
    # mkdir -p /root/plesk-backup-apache/vhosts
    # mv /etc/nginx/plesk.conf.d/vhosts/* /root/plesk-backup-nginx/vhosts/
    # mv /etc/nginx/plesk.conf.d/webmails/* /root/plesk-backup-nginx/webmails
    # mv /etc/httpd/conf/plesk.conf.d/vhosts/* /root/plesk-backup-apache/vhosts
    # mv /etc/httpd/conf/plesk.conf.d/webmails/* /root/plesk-backup-apache/webmails/

    For Debian / Ubuntu:

    # mkdir -p /root/pleskbackup/
    # mv /etc/apache2/plesk.conf.d/vhosts/* /root/pleskbackup

  3. Rebuild all web server configuration files from scratch by executing this command:

    # plesk sbin httpdmng --reconfigure-all

If all of the above solutions do not resolve the error, follow the steps here
  1. In Plesk create the domain example.com.

  2. Connect to the Plesk server via SSH

  3. Rebuild domain's configuration files:

    # plesk repair web example.com

  4. Remove the domain example.com from Plesk.

    Note: In case there are other domains with the same issue, perform the same actions mentioned above.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.