404 Page not found

While accessing the website I was getting the error as '404 Page not found' with below server error logs -

2017-03-26 21:44:24.608 [INFO] [local IP address] File not found [/home/cpanel_username/public_html/]
2017-03-26 21:44:24.608 [INFO] [local IP address] Cannot found appropriate handler for [/]
2017-03-26 21:44:24.608 [INFO] [local IP address] File not found [/home/cpanel_username/public_html/404.shtml]
2017-03-26 21:44:24.608 [INFO] [local IP address] Cannot found appropriate handler for [/404.shtml]

Solution -

1. Check the permission for the files and directoriesMake sure the files should have 644 permission and            directories should have 755 permission. You can fire below command to correct the permission -
 
    find . -type d -exec chmod 755 {} \;

    find . -type f -exec chmod 644 {} \;

Note - 

Please make sure to fire this command under cPanel >> File Manager >> /home/cPanel_user >> public_html/

Still I was getting the same error.

2. Check the permission and ownership of public_html -
    The public_html should have permission as 750 and ownership should be 'user.nobody'. 

You can follow below steps to update the permission of public_html -
  • Login to server using SSH.
  • Enter in the user's directory - cd ~username
  • Once you will enter in the user's directory - chmod 750 public_html
You can fire below steps to update the ownership of public_html -
  • Login to server using SSH.
  • Enter in the user's directory - cd ~username
  • Once you will enter in the user's directory - chown user.nobody public_html

It fixed my issue. Site started working!

Was this answer helpful?

 Print this Article

Also Read

A DNS entry for 'domain_name' already exists. You must remove this DNS entry from all servers in the DNS cluster to proceed.

While adding addon domain under cPanel, I was getting error as below - A DNS entry for...

How to allow remote MySql connection to only one IP?

There may be a case in which one of the cPanel user request you to provide access to Mysql...

How to force the site to use https using .htaccess file?

If you've working SSL certificate on your website and you'd like force your website to load using...

equired PHP version greater than equal to 5.4.0 AND found version is : 5.3.29 - Softaculous Prestashop not picking up correct php version

You may come across an issue while installing Prestashop via Softaculous regarding not picking up...

Fatal error: Call to undefined function utf8_substr()

While accessing Opencart site, I was getting error as 'Fatal error: Call to undefined function...

Powered by WHMCompleteSolution