Mod userdir

From Acenet Knowledgebase
Jump to: navigation, search

Mod_userdir is an Apache module that allows access to an account's content on your server via your server's main IP or hostname followed by a tilde (~) and the domain's username. Examples:

http://hostname/~user
http://127.0.0.2/~user

mod_userdir is useful because it allows you to view an account's content on your server if the account's domain is not yet resolving to your server.

mod_userdir is also how you can use a shared SSL on a cPanel server. You can order an SSL for your server's hostname and then configure it as your shared SSL on your server. Your accounts will then be able to utilize your shared SSL by using the following URL:

https://hostname/~user


One issue with using mod_userdir is that any bandwidth used will count against the domain being used to access the user's account. For example, let's say you accessed an account on your server with the following URL:

http://ace-host.net/~example

and the domain ace-host.net is not associated with the username 'example'. Bandwidth usage when accessing this URL would be put on the domain ace-host.net and not the 'example' account. To prevent this from happening, and to prevent accounts from being accessed from other accounts' domains, you can enable mod_userdir Protection through your WHM. Instructions on how to do so are provided below.

1) Log into WHM as root.

2) Click on 'Apache mod_userdir Tweak' under the 'Security Center' section.

3) Check 'Enable mod_userdir Protection' box.

4) Check mark the 'Exclude Protection' box to the right of 'DefaultHost (nobody)'.

This allows for a shared SSL to be used.

5) Click the WHM save.jpg button at the bottom.