Skip to content

BloggingAssessment

echadbourne edited this page Nov 7, 2023 · 15 revisions

First Steps

Order of Operations:

  1. New local user
  2. Update the ip address and hostname - nmtui
  3. Disable root SSH
  4. Install software of choice - wordpress (there are many steps to this so they aren't listed)
  5. Domain Join

New Local User

First reset the root user password with passwd (as root)

Then make a new user:

  • useradd elizabeth.chadbourne
  • passwd elizabeth.chadbourne
  • usermod -aG wheel elizabeth.chadbourne

Log out and log back in as elizabeth.chadbourne

IP address and hostname

nmtui

  • IP to 10.0.5.10/24
  • Default Gateway 10.0.5.2/24
  • DNS to 10.0.5.6/24
  • hostname to web02-elizabeth

systemctl restart network

Disable root SSH

nano /etc/ssh/sshd_config

If nano doesn't work install with: yum install -y nano

Change "Permit root login" from yes to no

systemctl reload sshd

Wordpress Installation Prep

I'm doing this in a slightly different way than the tutorial, but it should have the same result

Apache

yum install -y httpd - Install httpd services

Configure the firewall

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

Enable everything

  • systemctl enable --now httpd

PHP 7

Wordpress requires PHP 7 which is not in Centos 7 by default, so we need to make sure we download the correct version

  • yum install -y yum-utils epel-release
  • yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  • yum-config-manager --enable remi-php73
  • yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql –y

MySQL

This will make it easier to configure wordpress later

  • yum install -y mariadb-server
  • systemctl enable --now mariadb

I just want to restart httpd one more time before we install Wordpress:

systemctl restart httpd

Wordpress (Finally)

  • yum install -y wget unzip - needed to get everything we need
  • wget https://wordpress.org/latest.zip
  • unzip latest.zip

Remove the current /var/www/html to make it easier to put wordpress there

  • rm -r /var/www/html
  • mv wordpress /var/www/html

MySQL database and root user

mysql -u root

In MySQL prompt:

  • CREATE DATABASE ;
  • GRANT ALL ON .* to 'username'@localhost identified by 'apassword'; # This will identify the username and password you will use to log in to Wordpress later
  • FLUSH PRIVILEGES;
  • exit;

Make sure to put the semicolon (;) at the end of each line, otherwise it won't work right

Continue with Wordpress setup

  • setenforce 0
  • chown -R apache:apache /var/www/html
  • cp /var/www/wp-config-sample.php /var/www/wp-config.php - Copy the sample file into a new config file
  • nano /var/www/html/wp-config.php - edit said config file with the database name, username, and password

Restart httpd now with wordpress installed

systemctl restart httpd

Browse to http://10.0.5.10 and set up wordpress!

AD Join

yum install -y realmd samba samba-common oddjob oddjob-mkhomedir sssd

realm join --user=your-domain-admin-username@yourdomain.local yourdomain.local

Proof:

  • realm list

Also check the DNS records in AD to make sure it was properly joined

Overall Sources

Sources not from class materials:

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-centos-7 https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7

Clone this wiki locally