403 Forbidden error after restarting the server ubuntu 14.04 x64

Posted September 16, 2015 5.3k views
PHPWordPressControl Panels


I needed to edit some permissions so i went to log in into Ajenti to do so, But i couldn’t load the script so i went to restart the server via “shutdown -r now” using SSH and after that only one website works fine but the others i got 403 forbidden error.

Note 1 : I have virtual hosts to host multiple websites.
Note 2 : Every time in the SSH after each command i got “sudo : error to resolve host”.

Any ideas ?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Two things to check (assuming your machine is called my-machine, you can change this as appropriate):

  • That the /etc/hostname file contains just the name of the machine.
  • That /etc/hosts has an entry for localhost. It should have something like: localhost.localdomain localhost           my-machine  server1

If either of these files aren’t correct (since you can’t sudo), you may have to reboot the machine into recovery mode and make the modifications, then reboot to your usual environment.

  • Hello,

    The hostname file contains only :


    and the hosts file contains for the ipv4 : MainDroplet MainDroplet localhost.localdomain localhost localhost4.localdomain4 localhost4

    I see they are correct, What should i do ?

    • What permissions did you change with your script? This probably caused alot of trouble, so you can find the fix in there

      • I didn’t change, I wanted to change some permissions but i couldn’t open the Ajenti so i restarted the server and the problem came out !

        • Allright, well I never experienced an error like this. Maybe somebody else knows a solution, or you could contact me so I can check your droplet and find out the problem. Skype: cryptic-designs