Lab 5 3 Setting up WordPress on LAMP - max-gallagher/SYS-360 GitHub Wiki

NOTE: For this Lab - you will use the LAMP server you configured in Lab 5-1 and 5-2

Install WordPress

  • Download the latest version of Wordpress with the wget command below
wget https://wordpress.org/latest.tar.gz
  • Unzip and unarchive the installation package
tar -xzf latest.tar.gz

Create a database user for WordPress installation

  • Ensure the mariadb is running

  • Login to your database using the root password we made in 5-2

mysql -u root -p
  • Using the command guidelines below create a new user and password for your MySQL Database (replace wordpress-user and strong_password with username and password of your choice)

(Name of the user for this lab is max-wp)

CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'your_strong_password';
  • Create your database
CREATE DATABASE `wordpress-db`;
  • Give your user that you made access to this new database
GRANT ALL PRIVILEGES ON `wordpress-db`.* TO "wordpress-user"@"localhost";
  • Flush database to update with all of the new changes
FLUSH PRIVILEGES;

Create and edit the wp-config.php file

  • Copy the wp-config-sample.php file to a file called wp-config.php
cp wordpress/wp-config-sample.php wordpress/wp-config.php
  • Edit the wp-config.php and enter values for your installation
nano wordpress/wp-config.php
  • Find the line that defines DB_NAME and change database_name_here to the database name that you created earlier

  • Find the line that defines DB_USER and change username_here to the database user that you created earlier

  • Find the line that defines DB_PASSWORD and change password_here to the strong password that you created earlier

image

image

  • Install your WordPress files under the Apache document root

    • WordPress will run at your document root, so copy the contents of the wordpress installation directory
cp -r wordpress/* /var/www/html/
  • Allow WordPress to use permalinks

    • Open the httpd.conf file and find the section that starts with <Directory "/var/www/html"> and change AllowOverride None to AllowOverride All

image

  • Install the PHP graphics drawing library on Amazon Linux 2
sudo yum install php-gd

Run the WordPress installation script with Amazon Linux 2

  • Access your wordpress url by searching your public DNS address for the instance

image

  • Fill out required info

image

  • Click install wordpress

image

Deliverables

SUBMIT: Screenshot of Post-Install Wordpress Site.

image

SUBMIT URL to your Wordpress Site

image