I am setting up a small web hosting service for my clients. I have my dedicated server which will be the shared server to host clients websites using WHM/cPanel.
I have a separate VPS server that I want to use for hosting my own sites, so that in the event the shared server goes down my clients can still reach me to open tickets, etc.
I have set up my business domain name on my shared server. I created glue records within Namecheap to set up ns1/ns2 so that my shared server can be reached using mydomain.com and can forward domains using ns1.mydomain.com and ns2.mydomain.com.
What I want to do now is forward www.mydomain.com and mydomain.com to my VPS so that I can use it to host my main website.
I have edited the DNS zone within WHM/cPanel to point the @ and www 'A Record' to my VPS IP address.
Now when I try to visit www./mydomain.com it shows the Apache 2 test page as if vhosts weren't working. I have set up VPS before and never had this issue so I'm thinking either a problem with the DNS A/www records or I have missed something when configuring the VPS.
Here is my vhosts within
httpd.conf: (CentOS 6.5)
# # Use name-based virtual hosting. # NameVirtualHost *:80 ... <VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html ServerName vps.mydomain.com ServerAlias 126.96.36.199 </VirtualHost> <VirtualHost *:80> ServerAdmin email@example.com DocumentRoot /var/www/username/public_html ServerName www.mydomain.com ServerAlias mydomain.com </VirtualHost>
If this was working then vps.mydomain.com and server IP should show the default apache page and mydomain.com should show the site located at
I appreciate this could be a hard question to answer but I am pulling my hair out. Is there anything blatant obvious I could have missed?
Is the way I'm setting up the domain the best route to take? The idea is that if my clients visit me at mydomain.com they'll be taken to my website on the VPA, but they can also use ns1.mydomain.com and ns2.mydomain.com to point domain to the shared server and hostname.mydomain.com for things like SSL when using IMAP, would there be a better way to achieve this? Maybe pushing domain back to Namecheap and managing DNS from there?