Apache HTTP Server /etc/httpd/conf.d/userdir.conf

Original 📋 Red Hat Enterprise Linux 9 (Plow) 36 lines

Works On

Viewing:
Red Hat Enterprise Linux 9 (Plow)
Same on:
CentOS Stream 9
Other versions:

Details

Size
36 lines
MD5
d4a2620683cc3ff2315c685f9f354265
SHA256
7e3e5b4f171425adcd259788d2cf1ae3fecad9b914a3e1cc92b70a2b75b1e8e0
/etc/httpd/conf.d/userdir.conf
#
# 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>

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/d4a2620683cc3ff2315c685f9f354265?hint=userdir.conf
wget:
wget -O userdir.conf https://exampleconfig.com/api/v1/config/original/d4a2620683cc3ff2315c685f9f354265?hint=userdir.conf

For AI Agents

<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.

Install Apache HTTP Server

Alpine Linux

sudo apk add apache2

Debian

sudo apt update && sudo apt install apache2

Red Hat Enterprise Linux

sudo yum install httpd

Ubuntu

sudo apt update && sudo apt install apache2

File Location

File Path
/etc/httpd/conf.d/userdir.conf
Directory
/etc/httpd/conf.d/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

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.