Final Project: Ghost Blog - Galen-Dively/SYS250-02-Journal GitHub Wiki

Goal

My goal is to use nginx to host a ghost blog on rocky linux machine.

Testing

Before using it on my live blog01 I am setting it up on a Rocky Linux machine set up using vmware on my macbook. This is for troubleshooting and to see where I can automate it on my blog01

First Step: Install & Configure Nginx

  1. Install nginx using sudo dnf install nginx -y.
  2. Enable the service immediately with sudo systemctl enable --now nginx

Second Step: Ensure http traffic is passed through the firewall

  1. Allow http through firewall using sudo firewall-cmd --permanent --add-service=http
  2. Saves changes to the firewall with sudo firewall-cmd --reload

After these steps I check that everything is working by going too http://myip which should show the rocky linux web server welcome message.

Third Step: Install Nodejs

  1. NodeJS can be installed with sudo dnf install nodejs

Fourth Step: Install MariaDB

  1. MariaDB is installed with sudo dnf install mariadb-server

Steps 1, 2, 3, and 4 can be made into a small script just to make it easier. I have done this in install_nginx.sh.

Continuation of Step 4: Setup & Configure MariaDB

  1. Using sudo mysql_secure_installation
    • First Prompt: Root Password, because there is no root password yet I press enter
    • Second Prompt: unix_socket authentication, I select no.
    • Third Prompt: Change Root Password, I select yes.
    • Fourth Prompt: Remove anonymous user, yes.
    • Fifth Prompt: Disallow root login remotely, yes.
    • Sixth prompt: Delete test database, yes.
    • Seventh Prompt: Reload Privelages, yes.
  2. With our installation now secure it is time to configure the database, I start by logging into the MySQL server using sudo mysql -u root -p
  3. Create Database
    • CREATE DATABASE ghost; This creates the database
    • CREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'password'; This create the ghostuser with 'password'
    • GRANT ALL PRIVILEGES ON ghost.* TO 'ghostuser'@'localhost' Allow the ghostuser to read/write/modify on the ghost database
    • FLUSH PRIVILEGES; Save the privileges so my changes take place.
    • 'EXIT;'

References Used