Apache mod_userdir Tweak
Valid for versions 82 through the latest version
Last modified: January 18, 2021
This interface allows you to disable the Apache
mod_userdir module’s functionality for your users.
We strongly recommend that you disable this access for most of your users. Before you use this interface, make certain that you read the Security Implications and Warnings sections below.
If you enable Apache’s
ruby27-mod_passengermodule in WHM’s EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4), the system disables the Apache
mod_userdirmodule by default.
You must enable this feature to allow accounts to use shared SSL certificates. For more information about shared certificates, read our Guide to SSL documentation.
About this module
mod_userdir module allows for visitors to access a user’s website via a URL that contains that user’s username. For example, the following URLs point to the
Most servers use the Apache
mod_userdir module as a temporary URL system that allows users to view their websites. This temporary URL system functions even if the system does not possess a configured DNS or the domain does not yet point to the server.
mod_userdirmodule, any virtual host can access any website that uses the same IP address. It does not function only with the hostname.
mod_userdir access, perform the following steps:
Select the Enable
mod_userdirfunctionality for specific hosts, select the appropriate Exclude Protection checkboxes.Important:This action allows all users to access content on the host via the Apache
mod_userdirmodule. We recommend that you only enable
mod_userdirfunctionality on the DefaultHost.
To only allow
mod_userdirfunctionality for specific additional users to access these hosts, enter their usernames in the Additional Users text box.
Resellers can use this feature to allow their customers to access their own websites before DNS information propagates.
To enter multiple users, separate each account name with a space.
You own the following three cPanel accounts:
Arthur’s cPanel account (
Betty’s cPanel account (
Charles’ cPanel account (
Arthur’s domain resolves, but Betty’s and Charles’ domains do not yet resolve.
mod_userdir protection for the server to deny one user the ability to use another user’s bandwidth, select the Enable
mod_userdir Protection checkbox.
However, if you still want to allow Betty and Charles to use Arthur’s domain to see their sites, perform the following steps:
Do not select the checkbox next to
betty charlesin the Additional Users text box.
Betty and Charles can browse their sites with the following URLs:
We strongly recommend that you restrict
mod_userdir functionality for most of your users.
mod_userdir can expose potential security issues.
- The system accounts for bandwidth per-host rather than per-user. If a user access another user’s content via
mod_userdir, then the server will not record their bandwidth usage correctly. This can also potentially allow for one user to use the bandwidth of another.
When you disable
mod_userdir protection for a host, we recommend that you do not exclude the entire host, but rather exclude only specific users via the Additional Users text box.
Before you enable the Apache
mod_userdir module, make certain that you understand the following information:
Java servlets do not work with
mod_userdir-based URLs because Tomcat requires you to add additional directives to the virtual host.Important:EasyApache 3 does not support new installations of Tomcat. As of cPanel & WHM version 76, EasyApache 4 now supports Tomcat 8.5. For more information, read our Introduction to Tomcat documentation.
The following PHP handlers do not allow you to use the Apache
PHP via CGI.
open_basedirprotection restricts PHP’s access to the home directory of the user who owns the base domain, not the home directory of the user account that a visitor accesses. If you enable
open_basedirprotection in WHM’s MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor), visitors cannot access some sites via the
Websites that use
the mod_rewriteor other directives in their
.htaccessfiles will not function correctly when visitors view them through
If you enable Apache’s
mod_ruid2module, then the
mod_userdirmodule will not function correctly. For more information, read our Apache Module: ModRuid2 documentation.Warning:Under certain conditions, a user can attack another user’s account if they access a malicious script through a
To use Apache’s
mod_userdir module, perform the following actions:
Make certain that the
mod_suphp moduleis installed in the Apache Modules section of WHM’s EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4).
Select suphp for each version of PHP installed on your system in the PHP Handlers section of WHM’s MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager).
The Symlink Race Condition Protection option
The following table describes when the Symlink Race Condition Protection option blocks
|The requested URL includes a file and does not belong to the owner of the file.||Blocked.||
|The requested URL includes a file and an IP address that belongs to another account.||Blocked.||
|The requested URL contains a directory.||Not blocked.||
|You wish to access the server’s hostname.||Not blocked.||
Before you disable
mod_userdir protection, make certain that you understand the following information:
While this WHM feature allows you to restrict
mod_userdirfunctionality, it does not remove the module itself. Some PCI compliance scans may still detect it.
This feature does not list IP addresses because the
mod_userdirmodule uses virtual hosts.
You cannot use IP addresses to configure this feature.
If you do not protect the default host, you can access the server’s main IP address through the
mod_userdirmodule in most cases.
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.conffile with a text editor and add the following line: