Disallow accessing sites via server IP?
How to disallow accessing cpanel hosted files via server IP, like for example:
http://mywhmserverIP/~lwogjdkug/ABC/cgi-bin/something/123/
and require access via domain names assigned to particular cpanel?
I would like to set this for all future accounts and preferably also for all existing.
Thank you in advance for help.
-
Thank you for help, it was helpful. Though note that yours mentioned article mentioned non existing path in my case (WHM76): "If you attempt to provide protection on a dedicated IP address, the site's contents will still display when protection is enabled. To disable this behavior, open the /etc/apache2/conf.d/includes/post_virtualhost_global.conf file..." The path that exist in my case is: /usr/local/apache/conf/includes/post_virtualhost_global.conf After i added "UserDir disabled" into it and restarting apache, even directory listing become impossible showing 404 error: 0 -
Hello @postcd, The documented paths are intended for servers using EasyApache 4. Since you're using cPanel & WHM version 76 (and I presume EasyApache 3), I recommend reverting the changes you made to /usr/local/apache/conf/includes/post_virtualhost_global.conf and then rebuilding the Apache configuration file using the command below: /scripts/rebuildhttpdconf
Note that cPanel & WHM version 76 is at EOL status:0
Please sign in to leave a comment.
Comments
3 comments