linux:vqdev-aws-setup

VQDEV WordPress AWS EC2 Instance Setup

Instructions assume you have started a Amazon Linux instance and have a terminal open.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
1.) connect to your instance
- connect through ssh with private key
2.)

sudo yum update -y

- update the system
3.)

sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd

- install Apache web server, MySQL, and PHP
4.)

sudo service httpd start

- Start the Apache web server
5.)

sudo chkconfig httpd on

- Use the chkconfig command to configure the Apache web server
6.)

chkconfig --list httpd

- The chkconfig command does not provide any confirmation message when you successfully enable a service. You can verify that httpd is on by running the following command
7.) XXX.XXX.XXX.XXX
- check your instance is running by going to the IP address
8.)

sudo groupadd www

- Add the www group to your instance
9.)

sudo usermod -a -G www ec2-user

- Add your user to the www group
10.)

exit

- You need to log out and log back in to pick up the new group
11.)

groups

- Reconnect to your instance, and then run the following command to verify your membership in the www group
12.)

sudo chown -R root:www /var/www

- Change the group ownership of /var/www and its contents to the www group
13.)

sudo chmod 2775 /var/www

- Change the directory permissions of /var/www
14.)

find /var/www -type d -exec sudo chmod 2775 {} +

- and change its subdirectories to add group write permissions and to set the group ID on future subdirectories
15.)

find /var/www -type f -exec sudo chmod 0664 {} +

- Recursively change the file permissions of /var/www and its subdirectories to add group write permissions.
16.)

sudo service mysqld start

- Start the MySQL server so that you can run mysql_secure_installation
17.)

sudo mysql_secure_installation

- Press Enter, then y, then type a very secure password, then confirm it, then y, then enter, then y, then enter, then y, then enter, then y, then enter
18.)

sudo service mysqld stop

- stop the mysql server if you dont plan on using it again for a little bit
19.)

sudo chkconfig mysqld on

- If you want the MySQL server to start at every boot, enter the following command
20.)
-

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html
1.)

wget https://wordpress.org/latest.tar.gz

- install wordpress
2.)

tar -xzf latest.tar.gz

- unzip the package
3.)

sudo service mysqld start

- start MySQL Server
4.)

mysql -u root -p

-
5.)

CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'Georgia2015!';

-
6.)

CREATE DATABASE `wp-db-1`;

7.)

GRANT ALL PRIVILEGES ON `wp-db-1`.* TO "wpuser"@"localhost";

8.)

FLUSH PRIVILEGES;

9.)

exit

10.)

cd wordpress/

11.)

cp wp-config-sample.php wp-config.php

12.)

vim wp-config.php

- Replace database name, dabase user, and password with what you just set up
- then use https://api.wordpress.org/secret-key/1.1/salt/ to create salts and replace that
- then save with :wq!
13.)

sudo mv * /var/www/html/

14.)

sudo vim /etc/httpd/conf/httpd.conf

- in <Directory “/var/www/html”> replace AllowOverride None with AllowOverride All to allow permalinks
15.)

sudo usermod -a -G www apache

16.)

sudo chown -R apache /var/www

17.)

sudo chgrp -R www /var/www

18.)

sudo chmod 2775 /var/www

19.)

find /var/www -type d -exec sudo chmod 2775 {} +

20.)

find /var/www -type f -exec sudo chmod 0664 {} +

21.)

sudo service httpd restart

22.)

sudo chkconfig httpd on

23.)

sudo chkconfig mysqld on

24.)

sudo service mysqld status

- Chech MySQL server is running, if not run sudo service mysqld start
25.)

sudo service httpd status

- check apache web server is running, if not run sudo service httpd start
26.)

  • linux/vqdev-aws-setup.txt
  • Last modified: 2018/04/02 20:03
  • by 108.225.197.92