Why is my vhost file not being used by Apache?


Browse by products and services

  • Applies to: DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge
  • Applies to: DV 4.0
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge

Overview

The most common reason for the Apache webserver not being able to use your vhost file are usually related to permissions.

Requirements

Before you start, this article has the following dependencies:

Instructions

  1. Log into your server as root using SSH, and enter the following command to change the owner of all files in the conf directory to the apache user:
    chown -R apache /var/www/vhosts/system/example.com/conf
  2. Change the permissions to ensure the Apache user can read all of the files in the conf directory:
    chmod -R 644 /var/www/vhosts/system/example.com/conf
  3. Reconfigure your server to use the new vhost.conf file using Plesk's websrvmng command:
    /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Resources

Overview

The most common reason for the Apache webserver not being able to use your vhost file are usually related to permissions.

Requirements

Before you start, this article has the following dependencies:

Instructions

  1. Log into your server as root using SSH, and enter the following command to change the owner of all files in the conf directory to the apache user:
    chown -R apache /var/www/vhosts/example.com/conf
  2. Change the permissions to ensure the Apache user can read all of the files in the conf directory:
    chmod -R 644 /var/www/vhosts/example.com/conf
  3. Reconfigure your server to use the new vhost.conf file using Plesk's websrvmng command:
    /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Resources