How to add Public Key Authentication for Ubuntu 16.04 server

For better security we should use public key authentication on the server. Here is steps how to do it. 1. Generate SSH key pair on your local computer. Skip if you already have ssh key pair in your local computer

Output:

Hit ENTER and enter passphrase for your Read more…

Letsencrypt automatic certificate renew

To make automatic renew you Letsencrypt certificates you need create crontab job. Here is simple instructions 1. Create /root/certrenew.sh file with content:

2. Make it executable chmod +x /root/certrenew.sh 3. sudo crontab -e 4. Add crontab job. Job for running every day at 3:15AM will be next:

/var/log/le-renew.log Read more…

How to automatically restart MySQL service

Here is instruction how to launch MySQL server after close unexpectedly. 1. Create /root/mysqlfix.sh file with next content:

2. Make it executable chmod +x /root/mysqlfix.sh 3. sudo crontab -e 4. Add crontab job. For 3 min period job will be next:

/var/log/mysqlfix.log – log file Let me know Read more…

How to automatically restart Nginx

Here is instruction how to launch Nginx server after close unexpectedly. 1. Create /root/nginxfix.sh file with next content:

2. Make it executable chmod +x /root/nginxfix.sh 3. sudo crontab -e 4. Add crontab job. For 3 min period job will be next:

/var/log/nginxfix.log – log file Let me know Read more…

How to fix Attempting to renew cert from /etc/letsencrypt/renewal/example.com.conf produced an unexpected error: Problem binding to port 443: Could not bind to IPv4 or IPv6.. Skipping.

Issue: Attempting to renew cert from /etc/letsencrypt/renewal/example.com.conf produced an unexpected error: Problem binding to port 443: Could not bind to IPv4 or IPv6.. Skipping. How to fix: Just stop webserver before renew letsencrypt.

How to fix “Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration” for apache2 in Ubuntu

If you got:

message in error log of your apache2 web server under Ubuntu you need to do next: Run this command in terminal with sudo

Restart Apache2: Also run with sudo