Support / KnowledgeBase

 
Search the KnowledgeBase Search

Why is my vhost file not being used by Apache?

  • Applies to: (dv) 3.5, (dv) 4.0

  • Difficulty: Easy

  • Time needed: 10 minutes

  • Tools needed: SSH, root access, vi knowledge

 
  • Applies to: (dv) 4.0
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge
  • Applies to: (dv) 3.5
    • 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:

End of Life Warning

This service has a pending End of Life. Please move to a current service as soon as possible. For more information, please see: (dv) Dedicated-Virtual 4.0: Migration Information.

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
    /usr/local/psa/admin/sbin/websrvmng -a -v

Resources


User Comments

  1. 1. Anonymous/usr/local/psa/admin/sbin/websrvmng -a -v returns a 'command not found' error. So does httpdmng Both are visible in the directory.

  2. 2. Elite It sounds like you're running the command for a (dv) 3.5 on a (dv) 4.0. For the (dv) 4.0, use: /usr/local/psa/admin/sbin/httpdmng --reconfigure-all Be sure to click the tab at the top of the article for your service.

Fields marked with an asterisk(*) are required. Comment on this article
Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue