I have a domain
example.com with two subdomains:
cloud.example.com. I set an A-Record for both of them to my server's IP address.
my server is a VPS with centos7 and has two directories below
/var/www/html/ for each of the domains:
/var/www/html/website.example.com/contains all wordpress files
/var/www/html/cloud/contains all files for ownCloud.
I enhanced my httpd.conf to contain:
Listen 80 Listen 81 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/html/website.example.com ServerName www.website.example.com </VirtualHost> NameVirtualHost *:81 <VirtualHost *:81> DocumentRoot /var/www/html/cloud ServerName www.cloud.example.com </VirtualHost>
Now, when I restart httpd and run wget i get the following responses:
my.vps.ip.address-> response from wordpress site
my.vps.ip.address:80-> response from wordpress site
my.vps.ip.address:81-> response from cloud site
website.example.com-> response from wordpress site
cloud.example.com-> response from wordpress site.
This results to the browser experience -> When i enter
website.example.com in my browser I get on my wordpress site. But when I enter
cloud.example.com I also get on my wordpress site instead of the owncloud site.
What am I missing?