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
- Install nginx using
sudo dnf install nginx -y
. - Enable the service immediately with
sudo systemctl enable --now nginx
Second Step: Ensure http traffic is passed through the firewall
- Allow http through firewall using
sudo firewall-cmd --permanent --add-service=http
- 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
- NodeJS can be installed with
sudo dnf install nodejs
Fourth Step: Install MariaDB
- 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
- 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.
- 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
- Create Database
CREATE DATABASE ghost;
This creates the databaseCREATE 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 databaseFLUSH PRIVILEGES;
Save the privileges so my changes take place.- 'EXIT;'
References Used
- Installing nginx on rocky