• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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