SYS 255 ‐ Blog server - connor0329/repository-1 GitHub Wiki

What we did in this lab

1. Configured "blog01" so that it was on the LAN before powering it on first and after powering on, logged in using the "default root password"

EX:

Config for LAN

  • Right click on "blog01-SYS-255-02", edit settings
  • On the network adapter's drop down menu select, "SYS-255-02-LAN*

Default root password

  • When prompted with "localhost login:", type "root"
  • When prompted with "password:", type "Ch@mpl@1n!22"

2. Configuring blog01 network settings

I configured blog01's, IP Address and Netmask, Gateway, DNS, Search Domain, Hostname using "nmtui"

EX:

  • Type "nmtui"
  • Click "Enter", on "Edit a connection", click "Enter" on "ens192"
  • Use the arrow keys to get to "", click Enter on "", use the arrow keys to select "Manual", click Enter
  • Use the arrow keys to get to "" (right next to " in the IPv4 section), click Enter
  • Click Enter on "<Add...>", type "10.0.5.22/24"
  • Using arrow keys go down to gateway, type "10.0.5.2"
  • Go down to "DNS servers", click Enter on "<Add...>", type "10.0.5.6"
  • Go down to "Search domains", click Enter on "<Add...", type "connor.local"
  • It should look like this:
image
  • Go all the way down to "OK" and click Enter
  • Go all the way down to "Back", click Enter
  • Select "Set system hostname", click Enter, type "blog01-connor"
  • Go down to ", click Enter, click Enter on ""

3. Adding a Privileged User

EX:

  • Type "useradd connor", then type "passwd connor"
  • It will prompt you to type in a new password next to "New passowrd:", if done properly it will says "all authentication tokens updated successfully" (Password is "Lacrossekid3#"
  • Type "usermod -aG wheel connor"
  • Type "exit"
  • Sign in with your new user
  • For "blog01-connor login;" type "connor"
  • For "Password:" type "Lacrossekid3"
  • You are now logged in as the privileged user

4. Disabling remote ssh access

EX:

  • Type "sudo vi /etc/ssh/sshd_config"
  • Edit the config file like this:
image

5. Adding A and PTR records for dhcp01 to the DNS configuration on ad01

I added A and PTR records for "blog01" to Server manager on "ad01" so I can resolve "blog01" IP address via hostname

EX:

  • Open server manager, click the DNS tab
  • Right click on "AD01-CONNOR", select "DNS Manager"
  • Click the drop down for "Forward Lookup Zones"
  • Right click "connor.local", "New Host A or AAAA"
  • In the "name" field, type "blog01-connor", in the "IP address" field type, "10.0.5.22"
  • Check the, "Update associated pointer (PTR) record"

6. Joining web01 to the connor.local domain

EX:

  • Type "sudo dnf install realmd samba samba-common oddjob oddjob-mkhomedir sssd"
  • Type "sudo realm join --user=[email protected] CONNOR.LOCAL"

7. Installing Apache Web Server

EX:

  • Type "sudo dnf install httpd -y"
  • Type "sudo systemctl start httpd"
  • Type "sudo systemctl enable httpd"

8. Installing MySQL (MariaDB)

EX:

  • Type "sudo dnf install mariadb-server -y"
  • Type "sudo systemctl start mariadb"
  • Type "sudo sytemctl enable mariadb"
  • Type "sudo mysql_secure_installation"

9. Setting up a database for Wordpress

EX:

Log into MariaDB as root

  • Type "sudo mysql -u root -p"
  • When prompted with password enter, "Lacrossekid3"

Creating a new database for WordPress

  • Type "CREATE DATABASE wordpress_db;"
image

Creating a new user and granting it privileges

  • Type out these commands line by line:
image

10. Installing PHP

EX:

  • Type "sudo dnf install php php-mysqlnd php-fpm php-json php-xml php-gd -y"
  • Type "sudo sytemctl restart httpd"

11. Downloading and Configuring WordPress

EX:

Download the latest version

Moving WordPress to the Apache dictionary

  • Type "sudo mv wordpress /var/www/html/blog"

Setting Permissions

  • sudo chown -R apache:apache /var/www/html/blog
  • sudo chmod -R 755 /var/www/html/blog

Configure the WordPress by creating a configuration file

  • cd /var/www/html/blog
  • cp wp-config-sample.php wp-config.php

Edit the wp-config.php file

  • sudo vi wp-config.php
  • Edit the config file like this:
image

12. Open the Firewall

EX:

  • sudo firewall-cmd --permanent --add-service=http
  • sudo firewall-cmd --permanent --add-service=https
  • sudo firewall-cmd --reload

13. Accessing the Blog on Chrome

image

**12. **

⚠️ **GitHub.com Fallback** ⚠️