2 domains 1 documentroot

From Cheatsheet
Revision as of 09:15, 13 December 2010 by Admin (talk | contribs) (Created page with 'This is incase you ever have a customer that has 2 domains that each need their own ip for a ssl, but need the same document root. It would be hard to park the domain and setup …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is incase you ever have a customer that has 2 domains that each need their own ip for a ssl, but need the same document root. It would be hard to park the domain and setup 2 SSL certificates, so here is my cheat.

Essentially this is pretty simple to accoplish. This was done on my vps to test it and it does work, all of the command below are exactly what I ran and did.

On my server I made:

proof.shooltz.net  >>  shooltz.net

So they each have a separate cpanel account and separate ip addresses, but resolve to the same document root. And I didnt edit the httpd.conf, or add any kind of special include, I made cpanel do the work.

First off.

vim /var/cpanel/userdata/proof/proof.shooltz.net

Your gonna edit the above file for the empty account that you are changing. This was done on my vps to test it and it does work (still is up if you wanna look). Below are the contents of that file.










vim /var/cpanel/users/thecheat
/scripts/rebuildcpusers
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak.today
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart