I'm trying to add subdomain to my domain. I just installed httpd on my clean centos 7. At first I created file /etc/httpd/conf.d/htmltest.mydomain.com.conf with the following contents:
<VirtualHost *:80> # Admin email, Server Name (domain name), and any aliases ServerAdmin firstname.lastname@example.org ServerName htmltest.mydomain.com DirectoryIndex index.html index.php DocumentRoot /www/sites/htmltest.mydomain.com/htdocs # Log file locations LogLevel warn ErrorLog /www/sites/htmltest.mydomain.com/log/error.log CustomLog /www/sites/htmltest.mydomain.com/log/access.log combined </VirtualHost> <Directory "/www/sites/htmltest.mydomain.com/htdocs"> Options Indexes FollowSymlinks AllowOverride None Require all granted </Directory>
Also /www/sites/htmltest.mydomain.com/htdocs folder was created with index.html file inside. With this configuration my attempt to access htmltest.mydomain.com gives 'server DNS address could not be found' error in the browser. But mydomain.com opens htmltest subdomains index.html. In my hosting CP dns settings there is mydomain.com with the htmltest 'A' record pointing to server IP, along with the www record. How can I fix this?
UPD: I've changed domain to use vultr nameservers, and it works properly now.
www.mydomain.comwhere you want a single