I have a VPS that has a web application and a website. The web application and the website have separate cPanels.
The default root directory for the web application is: / home / webapp / public_html
The default root directory for the website is: / home / website / public_html
I would like my main domain example.com to take the user to the website, and a subdomain called subdomain.example.com take the user to the web application.
First I went into my DNS configuration and created an A Registry for my domain, example.com, which points to the IP address of my VPS.
Then I logged in with my root account and created two VirtualHosts in /etc/httpd/conf/httpd.config:
ServerAdmin email@example.com DocumentRoot / home / website / public_html ServerName www.example.com ServerAlias example.com ServerAdmin firstname.lastname@example.org DocumentRoot / home / website / public_html Server name www.subdominio.example.com ServerAlias subdomain.example.com
Finally, I restarted Apache and tried to access my domain and subdomain, but to my surprise, they took me to the default page cgi-sys / defaultwebpage.cgi. This is the same page that I take when I go directly to my IP address.
What am I doing wrong?
My operating system is CentOS 6.
Thanks in advance for any assistance!