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
- Find Authentication Unique Keys and Salts. "You can create unique values by visiting https://api.wordpress.org/secret-key/1.1/salt/Links to an external site. Links to an external site.to randomly generate a set of key values that you can copy and paste into your wp-config.php file"
-
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
toAllowOverride All
- Open the httpd.conf file and find the section that starts with <Directory "/var/www/html"> and change
- 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
- Fill out required info
- Click install wordpress
Deliverables
SUBMIT: Screenshot of Post-Install Wordpress Site.
SUBMIT URL to your Wordpress Site