Account / Subdomain / Virtual Hosts question
AnsweredThis is perhaps a bit niche, but we have two user accounts on the WHM/Cloudlinux/Litespeed server. This is a legacy setup but has worked well for us - the original account is the main domain, the second is a subdomain of the first, which contains an app, entirely separate from the website so reduces the possibility of errors.
We're migrating servers and I've run into a problem. We want the old version of the app (current server) and a newer version (new server) both accessible simultaneously but easy for clients to review.
Currently the new server/app is set up with the same primary subdomain (via cPanel transfer tool, then app upgraded on new server). Call it x.y.com. It would be easy to add a parked domain in this user account to serve the same content as the app's primary domain - x2.y.com. However that doesn't seem possible because the parent domain is in a separate account.
Another solution could be to just temporarily change the primary domain on the app's user account and then change it back before switching DNS but not sure if there are "side-effects." I'm always cautious. So the new primary domain would be x2.y.com.
So I tried accomplishing this with .conf files as on the cPanel support page, but the app isn't on a dedicated IP so I'm having trouble. Maybe it's inexperience but I can't serve the updated app content (x.y.com) with a new subdomain (x2.y.com) ... it's serving the old content from the live server at the same subomain instead which makes sense.
So in the proper locations (std and ssl), with the parent domain's user account and new subdomain:
/etc/apache2/conf.d/userdata/ssl/2_4/parentdomain/x2.y.com/include.conf
This is the included file:
<IfModule mod_proxy.c>
<Location "/">
ProxyPreserveHost Off
ProxyPass "http://x.y.com:8081"
ProxyPassReverse "http://x.y.com:8081"
</Location>
</IfModule>
If I had a dedicated IP (which is possible but strangely pricey) I think everything is fixed by replacing the domain name. Which one of these options will work the best/easiest?
Thank you!
-
Hey there! I wouldn't try the conf file option as that will just get messier when/if you go to change things back.
You mentioned it wasn't possible because the domains were on a different account. Do you have the "Allow cPanel users to create subdomains across accounts" option in WHM >> Tweak Settings enabled? If you do, that should allow your behavior to work.
0 -
Amazing cPRex - thank you! This is indeed exactly what I was looking for, I had the feeling I was overcomplicating it. The DNS zone is external but I was able to add the external IPs to 'Configure Remote Service IPs'...
This is the ideal solution and I sincerely appreciate the quick reply! 🎉
0 -
I'm glad that's all it took!
0 -
@... - glad to hear it!
0
Please sign in to leave a comment.
Comments
4 comments