Helping friend to fixing his VPS that it has trouble with SSH and Apache2, both of them are not working

I have a friend that text me tonight, ask to help him fix his VPS that has an issue with Apache2. The VPS registered at Vultr, and he gives me two accounts: member area account and OS account.

The VPS using Ubuntu 18.04 LTS, I am happy about this because I think I am very familiar with Debian based distros.

Then I log in to the Vultr member area and try to find a web console menu. He told me before that He usually using web console without SSH. I think it’s bored because using the web console is not responsive and I don’t like it.

I try to access the VPS using SSH but it cannot be connected. So, I back to the web console and try to analyze what happened, and I got the notice that the SSH keys are not protected.

Then, I can fix it just using chmod to change the key’s permissions, by #chmod 600 /etc/ssh/ssh_host_key , we can change to 400 or to 600, its just about we can read-only or read and write only by us.

After I got access via SSH, it’s more easy to trace what happened with Apache2. When I try to check the Apache status, it’s shown that Could not reliably determine the server’s fully qualified domain name error.

I have been tried many different ways to fix this, but it cannot be fixed. I have tried checking the port, checking the configuration, but it has no effect.

After some time, I try to set the site-available configuration to default, for example in 000-default.conf. Next I changed some permissions and made sure port 80 listened.

And finally, after spending approximately an hour Apache2 can run normally.

I write this here, as a note to me personally, maybe one day I met a similar problem at another time.