How to Enable Apache mod_userdir Access

April 18, 2024 / Servers, Hosting & Email

Apache mod_userdir allows users to access a website using a temporary URL that includes the username, which is helpful for previewing websites before DNS propagation. In cPanel/WHM, this feature is commonly used by administrators and resellers to provide early access to websites. However, since it can affect multiple virtual hosts on the same IP, it should be enabled with proper restrictions.

Let us follow the steps:

  1. Log in to WHM as the root user or reseller.
  2. Go to: WHM > Security Center > Apache mod_userdir Tweak.
    apache mod-userdir tweak
  3. Check the box “Enable mod_userdir Protection”.
  4. Under Exclude Protection, select the appropriate hosts.
  5.  Recommendation:
    Enable mod_userdir only for DefaultHost to avoid security risks.
    enable
  6. Restrict Access to Specific Users
    1. In the Additional Users field, enter the usernames that should be allowed to use mod_userdir.
    2. Separate multiple usernames with a space.
    3. Example: user1 user2 user3
  7. Click Save to apply the configuration.
    save
  8. Open a browser and access the site using:http://server-ip/~username
    The website should load successfully if mod_userdir is enabled correctly.

By following these steps, you can activate Apache mod_userdir access. If you encounter any challenges, do not hesitate to reach out to our support team for assistance.

Spread the love