Error: 404 while trying to reach temporary URL on Cpanel.

One of our client was getting 404 error when he was trying to access temporary URL on Cpanel server. The url looks like this http://111.222.333.444/~domainusername/

While checking Error Logs:

root@server11 [~]#tail -f /usr/local/apache/logs/error_log

[error] [client 12.34.45.203] File does not exist: /usr/local/apache/htdocs/~username, referer: http://12.13.14.15:2086/scripts2/lis...rtorder=domain

[Thu july 23 14:21:23 2015] [error] [client 12.34.45.203] File does not exist: /usr/local/apache/htdocs/~username, referer: http://12.13.14.15/~domainusername/

This will happens while mod_userdir protection is enabled for the user nobody (DefaultHost) and it should be disabled using WHM or we can edit the below entry into httpd.conf file.

To enable enter domainusername seperated by space:

UserDir enabled user1 user2 user3

From WHM you can do it through Apache mod_userdir Tweak option.

mod_user