Lab 11: Linux Lab - savannahc502/SavC-TechJournal-SYS255 GitHub Wiki

Resources:


Step 1: Setup the Server

Follow Along With: Apache Web Server

  • Ethernet cord and launch
    • nmtui
    • 10.0.5.10/24 (anything below 11 that isnโ€™t in use) โ€”> 10.0.5.20/24
      • Switch IPv4 Configuration to Manual
    • 10.0.5.2 Gateway
    • 10.0.5.6 DNS
    • Hostname blog01-savannah
    • systemctl restart network
  • Add named privileged user
    • Run useradd savannah
    • Run passwd savannah and will out the password prompts
    • Run usermod -aG wheel savannah to add the new savannah to the admin ("wheel") group.
    • This is the local admin account now -- test sign in and pinging for connectivity.
  • After all of this is completed, follow the steps in the procedure section of Lab-02 under "DNS and DNS Record Setup" and create the new host for the Foward Lookup Zone (remember to check off PTR as well). This is being done on the ad01-savannah device.
Note: With DNS Record change, if you get a warning that there might be DNS spoofing, type ssh-keygen -R hostname or IP address โ†’ in this case that was ssh-keygen -R blog01-savannah

Linux Domain Join

  • sudo yum install -y realmd samba samba-common oddjob oddjob-mkhomedir sssd
  • realm join --user=[email protected] savannah.local
  • realm list (checking for correcting domain)
  • You can also check the active directory to see that it has been added
  • Should be able to ping hostnames on the LAN via blog01-savannah now

Installing WordPress

Step 0

  • sudo yum update

Step 1 โ€” Install the Apache Web Server (Did this Here)

  • ssh loginto web01-savannah as the named privileged user

  • sudo yum install httpd

    • sudo systemctl start httpd
    • systemctl enable httpd
  • firewall-cmd --add-port=80/tcp --permanent

  • firewall-cmd --add-port=443/tcp --permanent

  • firewall-cmd --reload

  • Test that by showing wks browsing to web01 by hostname

Step 2 โ€“ Installing MySQL (MariaDB)

  • sudo yum install mariadb-server
  • sudo systemctl start mariadb
  • sudo systemctl enable mariadb

Step 3 โ€“ Install PHP

  • sudo yum install php php-mysql
  • systemctl restart httpd

Step 4 โ€“ MySQL and WordPress

  • mysql -u root -p
  • CREATE DATABASE wordpress;cd
  • CREATE USER savannah@localhost IDENTIFIED BY 'TimeToFight2023!';
  • GRANT ALL PRIVILEGES ON wordpress.* TO savannah@localhost IDENTIFIED BY 'TimeToFight2023!';
  • FLUSH PRIVILEGES;
  • Exit

Step 5 โ€“ Install WordPress

  • sudo yum install php-gd
  • sudo service httpd restart
  • cd ~
  • tar xzvf latest.tar.gz
  • sudo rsync -avP ~/wordpress/ /var/www/html/
  • mkdir /var/www/html/wp-content/uploads
  • sudo chown -R apache:apache /var/www/html/*

Step 6 โ€“ Begin WordPress Configuration

  • Mostly done through web interface, but this needs to be done first:
  • cd /var/www/html
  • cp wp-config-sample.php wp-config.php
  • nano wp-config.php
    • The only modifications we need to make to this file are to the parameters that hold our database information. We will need to find the section titled MySQL settings and change the DB_NAME, DB_USER, and DB_PASSWORD variables in order for WordPress to correctly connect and authenticate to the database that we created.
  • systemctl restart httpd
  • navigate to your serverโ€™s domain name or public IP address on workstation

image