• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Any subdomain to main folder, but www.domain to subdomain folder

Hello.
I have situation below.

I need that any subdomain goes to main folder /var/www/vhosts/domain/httpdocs and that is reached with A record
*.domain.com A server's IP

but www.domain.com must be opened from another folder. I have created subdomain www for that. Thus page must be loaded from /var/www/vhosts/domain/subdomain/www/httpdocs

Everything is working if I edit /var/www/vhosts/domain/conf/httpd.include file though I must move script for www.domain.com subdomain before main virtual host like this

<VirtualHost 64.150.164.189:80>
ServerName www.domain.com:80
DocumentRoot /var/www/vhosts/domain.com/subdomains/www/httpdocs
CustomLog /var/www/vhosts/domain.com/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/domain.com/statistics/logs/error_log
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /var/www/vhosts/domain.com/subdomains/www/httpdocs>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/www/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/www/httpdocs:/tmp"
</IfModule>
Options -Includes -ExecCGI
</Directory>
</VirtualHost>

<VirtualHost 64.150.164.189:80>
ServerName domain.com:80
DocumentRoot /var/www/vhosts/domain.com/httpdocs
CustomLog /var/www/vhosts/domain.com/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/domain.com/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /var/www/vhosts/domain.com/web_users
</IfModule>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /var/www/vhosts/domain.com/httpdocs>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp"
</IfModule>
Options -Includes -ExecCGI
</Directory>
<Directory /var/www/vhosts/domain.com/web_users>
<IfModule mod_php4.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Include /var/www/vhosts/domain.com/conf/vhost.conf
</VirtualHost>

But Plesk will restore httpd.include file. Therefore I've created vhost.conf file and now there:

ServerAlias www.domain.com "www.domain.com"
ServerAlias *.domain.com "domain.com"

And Now, if I go to domain.com, www.domain.com or something.domain.com the folder /var/www/vhosts/domain/httpdocs is used.

What I should to do at vhost.conf file?
 
Last edited by a moderator:
Back
Top