Plesk

Nginx/Apache are not running after server reboot on a Plesk server: service start operation timed out. Terminating

Cause

Not sufficient timeout value for starting nginx or/and Apache.

Resolution

Note: This article may require additional administrative knowledge to apply. If any help is required, contact the server’s administrator or hosting support.

Add/increase TimeoutStartSec value in the [Service] section of Nginx or/and Apache init scripts:

For CentOS/RedHat 7

  1. Connect to the server using SSH.

  2. Backup a required init script using the command like:

    # cp -a /usr/lib/systemd/system/httpd.service{,.bak}

    # cp -a /usr/lib/systemd/system/nginx.service{,.bak}

  3. Open the init script with any text editor:

    • For Apache: /usr/lib/systemd/system/httpd.service

    • For nginx: /usr/lib/systemd/system/nginx.service

  4. Increase value for TimeoutStartSec parameter:

    [Service]
    ...
    TimeoutStartSec=600

For Debian 8/Ubuntu 16

  1. Connect to the server using SSH.

  2. Backup a required init script using the command like:

    # cp -a /usr/lib/systemd/system/apache2.service{,.bak}

    # cp -a /usr/lib/systemd/system/nginx.service{,.bak}

  3. Open the init script with any text editor:

    • For Apache: /usr/lib/systemd/system/apache2.service

    • For nginx: /usr/lib/systemd/system/nginx.service

  4. Increase value for TimeoutStartSec parameter:

    [Service]
    ...
    TimeoutStartSec=600

    Note: In case the apache2.service file does not exist, the TimeoutStartSec value should be set in the /lib/systemd/system/apache2.service.d/apache2-systemd.conf file

For Debian9/Ubuntu18

  1. Connect to the server via SSH.

  2. Backup the required init scripts with the commands:

    # cp -a /lib/systemd/system/apache2.service{,.bak}
    # cp -a /lib/systemd/system/nginx.service{,.bak}

    Note: The exact files can be found using:

    # systemctl status apache2.service | grep loaded
    # systemctl status nginx.service | grep loaded

  3. Open the init script with any text editor (for example vi):
    For Apache: /lib/systemd/system/apache2.service
    For nginx: /lib/systemd/system/nginx.service

  4. Increase value for TimeoutStartSec parameter or set one if not set:

    [Service]
    ...
    TimeoutStartSec=600

    Note: In case the apache2.service file does not exist, the TimeoutStartSec value should be set in the /lib/systemd/system/apache2.service.d/apache2-systemd.conf file

Exit mobile version