Several / multiple virtualhosts for one cPanel user
Hi,
I have used cPanel/WHM very successfully for high-volume single-domain sites because I lack the expertise needed to secure a production linux box for a decent-sized business.
Shared hosting obviously works well.
But now I have a situation where I need one cPanel user to host 100-200 domains not as add-on domains in separate directories, but as Apache VirtualHosts from one cPanel user - the LAMP application handling all these domains is a single one and in the PHP code we check the domain and serve content accordingly.
We are currently doing this with plain httpd.conf modifications using VirtualHosts with domains pointing to the same document root.
Can this be done in cPanel without excessive/complicated hacking at Apache conf files?
Currently this works:
...
DocumentRoot /var/www/html/one_big_folder
...
ServerName domain1.com
Serveralias www.domain1.com
...
DocumentRoot /var/www/html/one_big_folder
...
ServerName domain2.com
Serveralias www.domain2.com
...
...
DocumentRoot /var/www/html/one_big_folder
...
ServerName domain100.com
Serveralias www.domain100.com
Emails for all these domains are being handled separately are not a concern at all.
If we can do this it means that we migrate to cPanel/WHM which is less headache and peace of mind for server administration .
Thanks in advance.
Regards,
actived
-
Hi, Why is there a need for individual virtual hosts? Why does addon domains not work? Unfortunately, in this situation, hard coding this would probably be the only solution, other than splitting the domains up between individual users. 0 -
Firstly, thanks for the quick reply. Why is there a need for individual virtual hosts? Why does addon domains not work?
Well:the LAMP application handling all these domains is a single one and in the PHP code we check the domain and serve content accordingly.
Now, if there is a solution in cPanel by which we can point all the add-on domain directories to a single directory, then I'm all ears.Unfortunately, in this situation, hard coding this would probably be the only solution, other than splitting the domains up between individual users.
In which case, this would go to one of the pre/post template conf files, right? Regards, actived0 -
Good morning, Thanks for the quick update. That makes sense, and it's not the first time I've heard of an application handling the domain routing. A wildcard domain might work well for you. That'll send *.domain.com to a specific directory, and the script / rewrite rules can do the rest. You an also point all addon domains to the same folder, this shouldn't be an issue. When you create the addon domain, point it to your specific folder instead of the default public_html/$domain folder. I hope this helps! 0 -
You an also point all addon domains to the same folder, this shouldn't be an issue. When you create the addon domain, point it to your specific folder instead of the default public_html/$domain folder.
Hmm. This is a good tip. I will try this soon and post an update if it works. Thanks again for the fast reply. Regards, actived0
Please sign in to leave a comment.
Comments
4 comments