Domains not working after using transvhosts.pl to move vhost location

Refers to:

  • Plesk 12.0 for Linux

Created:

2016-11-16 12:53:05 UTC

Modified:

2016-12-21 19:27:09 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Domains not working after using transvhosts.pl to move vhost location

Symptoms

After moving vhosts with the tool transvhosts.pl non of the subscriptions are working

Following error could be found in the domain access logs, for example:

[authz_core:error] [pid 25044] [client 1.2.3.4:55431] AH01630: client denied by server configuration: /plesk/vhosts/domain.com/httpdocs

Cause

Apache configuration file contains default path for HTTPD_VHOSTS_D :

# less /etc/apache2/apache2.conf  | grep '/var/www'
<Directory /plesk/vhosts/>

Issue is actual for Debian-based systems with Apache 2.4 version, since the structure of /etc/apache2/apache2.conf has been changed and now Virtual host configuration files in the sites-available directory must use the .conf extension.

In version 2.4 , HTTPD_VHOSTS_D directive Directory defined in /etc/apache2/apache2.conf , for example:

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

Resolution

Set the correct path to new location of virtual hosts and restart Apache. Directory should be pointed to the new virtual host directory location, for example /plesk/vhosts .

Note: In the case of you are using custom php configurations with 'open_basedir' parameter, please make sure that it is pointed to the new location. For example:

# grep -iR "open_basedir" /plesk/vhosts/system/domain.com/etc/ | grep "/plesk/vhosts"
/plesk/vhosts/system/domain.com/etc/php.ini:open_basedir = "/plesk/vhosts/domain.com/:/tmp/"
Have more questions? Submit a request
Please sign in to leave a comment.