Report this

What is the reason for this report?

install Nginx, SSL Let's Encrypt, PHP, MySQL, Postfix on Ubuntu 19.10 x64 (Eoan Ermine)

Posted on November 13, 2019

Hello, Here is a tutorial to install Nginx, let’s encrypt SSL, PHP7.3, MySQL, PHPmyadmin Postfix on Ubuntu 19.10 x64 (Eoan Ermine).

I just finished an installation without any problem.

package version :

  • nginx-extras 1.16.1
  • php7.3 fpm 7.3.11
  • mysql 8.0.18
  • phpmyadmin 4.6.6-5
  • postfix 3.4.5-1
  • certbot
  • certbot-dns-digitalocean

update & upgrade

$ sudo apt update
$ sudo apt upgrade

install nginx-extras 1.16.1

$ wget --no-check-certificate http://archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx-extras_1.16.1-0ubuntu2_amd64.deb
$ sudo apt-get install ./nginx-extras_1.16.1-0ubuntu2_amd64.deb

install php7.3 fpm 7.3.11

$ wget --no-check-certificate  http://archive.ubuntu.com/ubuntu/pool/universe/p/php7.3/php7.3-fpm_7.3.11-0ubuntu0.19.10.1_amd64.deb
$ sudo apt-get install ./php7.3-fpm_7.3.11-0ubuntu0.19.10.1_amd64.deb

install mysql-server 8.0.18 & mysql-client 8.0.18

  1. download the MySQL repositories
$ wget –c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
  1. install the MySQL repositories
$ sudo apt-get install ./mysql-apt-config_0.8.14-1_all.deb
  1. Refresh the Repositories
$ sudo apt-get update
  1. Install MySQL
$ sudo apt-get install mysql-server
  1. Set up MySQL Security
$ sudo mysql_secure_installation
  1. Start, Stop, or Check Status of MySQL Service
$ sudo service mysql status
$ sudo service mysql stop
$ sudo service mysql start

install phpmyadmin 4.6.6-5

$ wget --no-check-certificate http://archive.ubuntu.com/ubuntu/pool/universe/p/phpmyadmin/phpmyadmin_4.6.6-5_all.deb
$ sudo apt-get install ./phpmyadmin_4.6.6-5_all.deb

enable Firewall for http, https, SMTP, IMAP, IMAPS, POP3, POP3S

$ sudo ufw allow 'OpenSSH'
$ sudo ufw allow 'Nginx Full'
$ sudo ufw allow 22
$ sudo ufw allow 80
$ sudo ufw allow 443
$ sudo ufw allow 143
$ sudo ufw allow 993
$ sudo ufw allow 110
$ sudo ufw allow 995
$ sudo ufw enable
$ sudo ufw status

install Postfix 3.4.5-1

$ wget --no-check-certificate http://archive.ubuntu.com/ubuntu/pool/main/p/postfix/postfix_3.4.5-1ubuntu1_amd64.deb
$ sudo apt-get install ./postfix_3.4.5-1ubuntu1_amd64.deb

install SSL certificate

Retrieve and automatically renew Let’s Encrypt SSL Wildcard Certificates with the plugin certbot-dns-digitalocean and API DigitalOcean. The dns_digitalocean plugin automates the process of completing a dns-01 challenge (DNS01) by creating, and subsequently removing, TXT records using the DigitalOcean API.

  1. create token here: https://cloud.digitalocean.com/settings/api/tokens

  2. install certbot and the certbot-dns-digitalocean plugin

$ sudo apt install certbot
$ sudo apt install python3-certbot-dns-digitalocean
$ sudo certbot certonly --dns-digitalocean --dns-digitalocean-credentials ~/.secrets/certbot/digitalocean.ini --dns-digitalocean-propagation-seconds 60 -d domain.tld -d *.domain.tld```

3. renewal of certificates. renew the certificate every Monday night, and restart nginx

$ sudo crontab -e 30 4 * * 1 certbot renew 40 4 * * 1 /etc/init.d/nginx reload


4. check config & restart Nginx

$ sudo nginx -t $ sudo /etc/init.d/nginx reload


* https://certbot-dns-digitalocean.readthedocs.io/en/stable/
* https://www.digitalocean.com/community/tutorials/how-to-retrieve-let-s-encrypt-ssl-wildcard-certificates-using-cloudflare-validation-on-centos-7

DONE


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hello, @Nicolas2020

Thanks for sharing this with the community! :)

Regards, Alex

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.