When should I use this userdir.conf?
Use it to restore a missing default, confirm what shipped, or diff against your current Apache HTTP Server config.
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disabled
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
#UserDir public_html
</IfModule>
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Require method GET POST OPTIONS
</Directory>
curl https://exampleconfig.com/api/v1/config/original/d4a2620683cc3ff2315c685f9f354265?hint=userdir.conf
wget -O userdir.conf https://exampleconfig.com/api/v1/config/original/d4a2620683cc3ff2315c685f9f354265?hint=userdir.conf
<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/d4a2620683cc3ff2315c685f9f354265?hint=userdir.conf' /><config><app>Apache HTTP Server</app><os>Red Hat Enterprise Linux 9 (Plow)</os><location>/etc/httpd/conf.d/userdir.conf</location><lines>36</lines><md5>d4a2620683cc3ff2315c685f9f354265</md5><sha256>7e3e5b4f171425adcd259788d2cf1ae3fecad9b914a3e1cc92b70a2b75b1e8e0</sha256></config></prompt>
Paste into Claude, ChatGPT, or any AI assistant.
sudo apk add apache2
sudo apt update && sudo apt install apache2
sudo yum install httpd
sudo apt update && sudo apt install apache2
When should I use this userdir.conf?
Use it to restore a missing default, confirm what shipped, or diff against your current Apache HTTP Server config.
How do I restore Apache HTTP Server defaults?
Download the file, back up the current one in /etc/httpd/conf.d/userdir.conf, replace it, then reload or restart Apache HTTP Server.
Is userdir.conf safe for production?
It is the vendor default for Red Hat Enterprise Linux 9 (Plow). Treat it as a baseline and review security and performance settings before production use.
How does this differ from other OS versions?
Defaults vary by distro and version. This copy matches Red Hat Enterprise Linux 9 (Plow).
Can I use this for Apache HTTP Server troubleshooting?
Yes. Diff it against yours to find drift, then restore only the sections you need.