Skip to main content

Disallow accessing sites via server IP?

Comments

3 comments

  • cPanelMichael
    Hello :) The Apache mod_userdir module allows for visitors to access a user's website via a URL that contains that user's username. You can read about how this feature works (including how to disable it) at:
    0
  • postcd
    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
  • cPanelMichael
    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.