• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Need domain.com to docroot subdomain in vhost.conf

S

sector29

Guest
Hello,

How do I change vhost.conf so that domain.com/httpdocs, www.domain.com/httpdocs and IP/httpdocs point to subdomain.domain.com/httpdocs.

I've tried to insert DocumentRoot into vhost.conf but it doesnt work for me (yet?).

I intend to use the original domain.com/httpdocs as a storage area for symlinking.

currently vhost looks like most of the posts i've read
<Directory /home/httpd/vhosts/<domain>/httpdocs>
php_admin_value open_basedir /home/httpd/vhosts/<domain>/httpdocs
php_admin_value safe_mode 0
php_admin_value max_execution_time 6000
</Directory>

Also, does "safe_mode 0" turn off safe_mode? How is it turned off for a specific domain.
 
Also, does "safe_mode 0" turn off safe_mode? How is it turned off for a specific domain.
Yes it turns off safe mode. When you put those statements/directives into a vhost.conf file for a given domain, it will affect *that* domain.

After making changes to vhost.conf, you must remember to do the following commands at the SSH shell prompt:

/usr/local/psa/admin/bin/websrvmng -u --vhost-name=domain.com
service httpd restart

Note: Replace 'domain.com' with the name of the domain you are reconfiguring. There are many ways of restarting httpd/Apache, so depending on your OS that command may be a bit different.

For your other question 'How do I change vhost.conf so that domain.com/httpdocs, www.domain.com/httpdocs and IP/httpdocs point to subdomain.domain.com/httpdocs.' This would be done using RewriteCond and RewriteRule directives in the vhost.conf for the domains you wish to redirect. There are many recent posts where I have given examples.
 
Back
Top