Article sections
The Apache UserDir directive should be disabled to prevent anonymous access to other user’s home directories via the web site with a tilde (~) preceding the username. For example:
- http://example.com/~demo/ might access a public_html sub-directory of a demo user’s home directory.
- The directive UserDir ./ might map /~root to the root directory (/).
Perform either one of the following to disable the user directories module:
1 – For source builds with static modules, run the Apache ./configure script with the –disable-userdir configure script options.
$ ./configure –disable-userdir
2 – For dynamically loaded modules, comment out the LoadModule directive for mod_userdir module from the httpd.conf file.
##LoadModule userdir_module modules/mod_userdir.so