Enable cPanel Temporary Link / Mod_Userdir
The cPanel Temporary link can be used to view a website before the website is pointed to the servers nameservers or even before it starts to resolve. This can be handy to allow users to upload files to their website and then view what those files would look like once their domain name is resolving to the server.
The downside to this is that any bandwidth usage used to view the site would not be included in the user’s statistics and instead would be counted against the user “nobody”. Whilst it’s unlikely anyone would want to give out a temporary link its something all users should be aware of.
There are also some security concerns around this feature most noticeably the cPanel users username is used in the link. This can allow users to attempt to gain access to these accounts. Another security issue is the inability to use mod_ruid2 which enables Symlink Race Condition Protection. When using Mod_Userdir you cannot use mod_ruid2.
If Mod_Userdir is not enabled you will likely get a 404 error when using the cPanel temporary link to visit accounts on the server. To enable Mod_Userdir you first need to ensure mod_ruid2 is removed from the server.
Enable The cPanel Temporary Link
1) Remove Mod_ruid2 – In WHM select Easy Apache 4 and in the “Apache” section, enter mod_ruid2 in the search bar and uninstall the module if it’s enabled. Next, in the search bar enter mod_su. Enable mod_suexec and mod_suphp. Proceed to recompile Apache with these options.
2) In WHM select MultiPHP Manager and under PHP Handlers ensure SuPHP is being used as the handler for all PHP versions.
- If you change your PHP handler you may need to update some users files and folder permissions or you could see internal server errors.
3) Now, in WHM select the Apache mod_userdir Tweak link and on the next page check the “Enable mod_userdir Protection” box at the top and in the box below ensure the DefaultHost (nobody) checkbox is ticked. Click save at the bottom of the page.
4) Now, from the “List Accounts” page in WHM you can click the IP address next to an account and you will be taken to that website via the cPanel temporary link.
You may still find that you still get 404 error issues when using the cPanel temporary link. This is likely because the website in question is using mod_rewrite code in the .htacess file. Any site that has mod_rewrite code in this file will not work with mod_userdir.
How was this article – Enable Mod_Userdir – Enable cPanel Temporary Link
More from cPanel
About cPanel ModSecurity And How To Enable ModSecurity ModSecurity is a widely used tool to detect and prevent intrusion in your …
Updating WHMCS When Using WHMCS Secure Credentials New versions of WHMCS are released often and when you are updating WHMCS it's …