• 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!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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