• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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