Tuesday, July 23, 2019

Install LEMP, Nginx, php-fpm, mysql, and mysql drivers on Digital Ocean Ubuntu 18.04


 2  sudo apt update
    3  # update apt
    4  sudo apt install nginx
    5  # Install nginx
    6  sudo ufw app list
    7  # Show apps available in Uncomplicated firewall
    8  sudo ufw allow 'Nginx HTTP'
    9  # Allow NGINX
   10  sudo ufw status
   11  # Show if UFW is working
   12  systemctl status nginx
   13  # Show if UFW is turned on status/systemctl
   14  curl yourip
   15  #verify nginx is running, and you are getting html
   16  sudo apt install mysql-server
   17  # Install Mysql Server
   18  sudo mysql_secure_installation
   19  # Set up a secure mysql install
   20  sudo mysql
   21  # Setup root user appropriately in mysql, see /root/.mysql_history
   22  sudo add-apt-repository universe
   23  # set up repo for php-fpm
   24  sudo apt install php-fpm php-mysql
   25  #Install Both PHP-FPM and the PHP-FPM drivers
   26  vim /etc/nginx/sites-available/example.com
   27  # Setup your server block
   28  sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
   29  # enable your server block
   30  sudo unlink /etc/nginx/sites-enabled/default
   31  #disable the default
   32  sudo nginx -t
   33  # test new nginx config
   34  sudo systemctl reload nginx
   35  #restart and reload nginx
   36  vim /var/www/html/info.php
   37  #create phpinfo page
   38  curl http://yourip/info.php
   39  #verify page is working, make sure the mysql and mysql are on the page

No comments: