Apache DocumentRoot Change

Status
Not open for further replies.

davkell

New Member
I need to change the document root on a domain that's held on a VPS. At the top of
/var/www/vhosts/<domain_name>/conf/httpd.include file, there's this notice:

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /var/www/vhosts/<domain_name>/conf/vhost.conf
# /var/www/vhosts/<domain_name>/subdomains/<subdomain-name>/conf/vhost.conf

<VirtualHost <ip_addr>:80>
ServerName <domain_name>:80
ServerAlias <domain_name>
UseCanonicalName Off
ServerAdmin "me@<domain_name>"
DocumentRoot /var/www/vhosts/<domain_name>/httpdocs


So, if I want to change the DocumentRoot to ..../httpdocs/public Do I just create a ...../conf/vhost.conf file and add in:

<VirtualHost<ip_addr>80>
DocumentRoot /var/www/vhosts/<domain_name>/httpdocs/public
</VirtualHost>

Will that override the rules in httpd.include....or am I just way off? :)

Cheers.
 

davkell

New Member
To answer my own question several hours later...

Creating the file:/var/www/vhosts/<domain_name>/conf/vhost.conf

with the line:

DocumentRoot /var/www/vhosts/<domain_name>/httpdocs/<new_doc_root_folder>

...seems to have done the trick.
 
Status
Not open for further replies.
Top