Disallow accessing sites via server IP?

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463

postcd

Well-Known Member
Oct 22, 2010
721
21
68
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: http://mywhmserverIP/~username/
Before the modification, directory listing was possible and file opening was 404. Now all are 404. Thank you
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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:


From a security perspective, it's imperative that you update cPanel & WHM to a supported version as soon as possible.

Let us know if there's anything we can do to help with the upgrade process.

Thank you.