I have a VPS that has a web app on it and a website. The web app and the website have separate cPanels.
Default root directory for web app is:
Default root directory for website is:
I would like my main domain
example.com to take the user to the website, and a subdomain called
subdomain.example.com to take the user to the webapp.
I first went into my DNS settings and created an A Record for my domain,
example.com, that points to my VPS' IP address.
I then logged in with my root account and created two VirtualHosts in
<VirtualHost *:80> ServerAdmin email@example.com DocumentRoot /home/website/public_html ServerName www.example.com ServerAlias example.com </VirtualHost> <VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /home/webapp/public_html ServerName subdomain.example.com ServerAlias subdomain.example.com </VirtualHost>
Lastly, I restarted Apache and tried accessing my domain and subdomain, but to my surprise, I am taken to the default
cgi-sys/defaultwebpage.cgi page. This is the same page that I'm taken to when I go to my IP address directly.
What am I doing wrong?
My OS is CentOS 6.