Domain or subdomain point to server (external DNS) but not configured show a page of one domain on server
This is something I have never dealt with in WHM.
How is it possible that a domain or subdomain that, due to external DNS, points to the IP of a WHM/Cpanel server and this, or rather Apache serves a server page instead of a 404?
ok to try to solve it, using Apache and Cpanel logic
Create a file in /usr/local/apache/conf/includes/pre_virtualhost_global.conf
<VirtualHost *:80>
ServerName default
DocumentRoot /var/www/html/default
<Directory /var/www/html/default>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorDocument 404 /error.html
</VirtualHost>
Create a file in /var/www/html/default/error.html
I rebuilt Apache with /scripts/rebuildhttpdconf and restarted Apache.
Nothing... it doesn't work.
If in the browser a domain resolves to the server, and this domain is not configured in the server get a web of server.
A good point for someone knowing this is to point a porn page or a domain with an ugly name to a client's page.
Something that can be fixed in a "normal" Apache.
-
Hey there! You can set the default SSL vhost and default vhost for an IP to resolve this issue:
https://support.cpanel.net/hc/en-us/articles/1500005458561-How-to-set-the-default-HTTPS-VirtualHost
0 -
A lot of thanks.
0 -
You're very welcome!
0
Please sign in to leave a comment.
Comments
3 comments