• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Changing Subdomain webroot Problems

KingsleyM

New Pleskian
Hi all,

I've been trying to change the webroot folder of one of my subdomains and so far I've only achieved lots of stress and frustration.

I am running:
Parallels Plesk Panel version 9.2.2
Operating system Linux 2.6.27.29-0.1-default
CPU AuthenticAMD, Dual-Core AMD Opteron(tm) Processor 1212 HE
Average load 0.08; 0.04; 0.01

My subdomain structure at present looks like this:

<main_domain>/subdomains/<subdomain>/httpdocs/

What I would like is:

<main_domain>/subdomains/<subdomain>/httpdocs/public

so that public is my new webroot folder, so I can have a /system/ folder that holds my site config/settings files outside the root.

I've already done the following:
1. Created a vhost.conf file in the conf folder of my subdomain
2. Ran the following command '/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com'
3. Checked to see that the vhost was linked in http.include.
4. Restarted apache via the Plesk Panel

I've tried various syntax within my vhost.conf file, the latest being:

DocumentRoot /var/www/vhosts/<main_domain>/subdomains</subdomain>/httpdocs/public
<Directory /var/www/vhosts/<main_domain>/subdomains/</subdomain>/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/<main_domain>/subdomains/</subdomain>/httpdocs/public:/tmp"
php_admin_value safe_mode off
Allowoverride All
</Directory>

Which results in the following error log when I try and navigate to the subdomain:

[error] [client xxx.xxx.xxxxxx] client denied by server configuration: /var/www

I'm hoping someone can point me in the right direction with this, or perhaps even give me a better solution.

Thanks In Advance to anyone who can help!

- Kingsley
 
Last edited:
Back
Top