• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

vhost.conf not being used?

M

Martin Anderson

Guest
I'm trying to get a subdomain and the main domain to share a common code. The application they will be sharing has been configured to differentiate based on the incoming URL.

I've tried a couple of methods to get this working, but ultimately it seems to require getting the vhost.conf to be recognized, and I don't believe this is happening, based on the contents of the httpd.include files that are being generated. None of the settings in my vhost.conf for the subdomain are reflected.

My first attempt was to use the DocumentRoot directive to have the subdomain use the same httpdocs folder as the main domain. I followed that with a Directory block repeating the same options I had specified in the main domain's vhost.conf, including open_basedir.

I then ran "/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=mytrojanuv.com -v" which completed without error. A quick restart of Apache and... nothing. The subdomain still shows the default page.

My next approach was to make the httpdocs folder a symbolic link to the httpdocs folder of the main domain. This time, I set the vhost.conf to allow turn on FollowSymLinks, and added an open_basedir directive to allow directory access to both the main domain's httpdocs path and that for the subdomain.

Once again, I forced an update of the httpd.include (though the contents look the same as before), and restarted Apache. This time, I got a 403 Forbidden page, with the following messages:

"You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."

It's my belief in both cases that the failure is based on the vhost.conf not being read, or at least not being adopted. Any ideas why this might be happening?

Just so you know, I did place the the vhost.conf in:
/var/www/vhosts/mydomain.com/subdomains/mysubdomain/conf

Thanks in advance for any help, this has been extremely frustrating.
 
OK, here's an update.

I did the unthinkable and manually edited the httpd.include, at least the part pertaining to the subdomain. Sure enough, once I set the DocumentRoot, open_basedir and similar paths to be the same as the main domain, everything works as planned.

The only surprise was that I had to had "UseCanonicalName Off" to the subdomain, it had previously kept redirecting any page request to the home page.

I did try running "/usr/local/psa/admin/sbin/websrvmng -a" afterwards and it didn't seem to overwrite anything, so hopefully that's a good sign.

Is it possible that this version of Plesk has more limited support for vhost.conf for subdomains?
 
Back
Top