• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Virtualhost in vhost.con

D

dataneger

Guest
Dear Forum users,

I could not find any post regarding my question so i started a new thread.
I have the following problem:
I have a multiple domains and i want them to use the same codebase from 1 domain.
I made a Vhost.conf because i though i could add <VirtualHost> configs there.
But if i do that Plesk says "Can't containt Virtualhost inside of a Virtualhost". Logic because that file is included in httpd.conf inside a <Virtualhost> .

I want something like:
<VirtualHost IP:port>
ServerAlias Domain.com
ServerName Domain.com
Documentroot /var/www/vhosts/domain1.com/httpdocs/
</VirtualHost>
<VirtualHost IP:port>
ServerAlias Domain1.com
ServerName Domain1.com
Documentroot /var/www/vhosts/domain1.com/httpdocs/codebase
</VirtualHost>
<VirtualHost IP:port>
ServerAlias Domain2.com
ServerName Domain2.com
Documentroot /var/www/vhosts/domain1.com/httpdocs/codebase
</VirtualHost>

But that isnt allowed .... when i delete the Virtualhost brackets then Plesk/Apache gets confused with the DocumentRoot (Duh)

But how do i fix this ... i cant edit the httpd.conf because Plesk overwrites that file everytime. and i am stuck editing this in vhost.conf.

Somebody please help me out here

Thx
 
Hi,
To move ‘include’ line at the end of httpd.include.
For example, you created following /var/www/vhosts/domain2.com/conf/vhost.conf:

<VirtualHost IP:port>
ServerAlias Domain2.com
ServerName Domain2.com
Documentroot /var/www/vhosts/domain1.com/httpdocs/codebase
</VirtualHost>

Put the line below at the very end of /var/www/vhosts/domain2.com/conf/httpd.include:

Include /var/www/vhosts/domain2.com/conf/vhost.conf

Then reconfigure virtual host and restart Apache:
# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain2_name>
# /etc/init.d/httpd restart
Also, it will be useful to check the knowledge base http://kb.odin.com/en/5464
 
Back
Top