Day 45 Task: Deploy Wordpress website on AWS

Day 45 Task: Deploy Wordpress website on AWS

Over 30% of all websites on the internet use WordPress as their content management system (CMS). It is most often used to run blogs, but it can also be used to run e-commerce sites, message boards, and many other popular things. This guide will show you how to set up a WordPress blog site.

Task-01

  • As WordPress requires a MySQL database to store its data, create an RDS as you did on Day 44
    Login to the Aws console and go to RDS to create a database.

    Name your database.

    Created database.

    Now create an instance for WordPress.

    Now connect your instance and update the system then install MySQL
    sudo apt install mysql-client
    mysql -h <endpoint-name> -P <port-name> -u <username> -p

CREATE DATABASE wordpress;
CREATE USER 'wordpress' IDENTIFIED BY 'wordpress-pass';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress;
FLUSH PRIVILEGES;
Exit

Check whether your database was created or not

To configure this WordPress site, you will create the following resources in AWS:

  • An Amazon EC2 instance to install and host the WordPress application.
    Now install Apache on your EC2 instance for WordPress run.
    use sudo apt-get install apache2

    Check whether your instance ip apache web server is working or not.

  • An Amazon RDS for MySQL database to store your WordPress data.

  • Set up the server and post your new WordPress app.
    Now Download and uncompress the software by using the below commands.

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

    Now extract the tar file.

      tar -xvzf latest.tar.gz
    

    Now change the directory and copy the default configuration file

      cd wordpress
      cp wp-config-sample.php wp-config.php
    

    Now edit the wp-config.php file

      vim wp-config.php
    

    Now edit the Authentication Unique keys and salts.
    http://api.wordpress.org/secret-key/1.1/salt

      define('AUTH_KEY',         'N[D)?+J-}Wx<c*jX$AuW!pz>2{M[>_YT- 7tY`aT3y;*F! _LeM}Kj[t4o2v3qMm');
      define('SECURE_AUTH_KEY',  '9+>M!va% jq|B|f>kc9saFwE-cS|9-4B$xGu+2pI&3yis%-zzka =TAxq]+.Q7Fp');
      define('LOGGED_IN_KEY',    '>s4a)kHXSc(~i|$/P}SgvJPBiFp+tET.xdaW4Y%3mR~#P6;GK B)oADegQK#u)gV');
      define('NONCE_KEY',        'W-3_,k/oZcX.Mg6![$epnW@r/@z*9B@P=p#=mSIF-R9Z9X.Q+2-[+%L`]qBOQ++h');
      define('AUTH_SALT',        '<UFNBNl<x:%EuS#K+p-__>[EtE-tea]xP6-i_wz$8[%uU>>ia2_]z)-`MA}i,T8q');
      define('SECURE_AUTH_SALT', 'I`|%6X&* 0I-W%^^NlHN^{jg6`J;[^h))&?-R4&OfyF!U_^hh?P@+-:iqdgeI%AJ');
      define('LOGGED_IN_SALT',   'g96e[e61f|BG MUHkk~]Yoy%lyVHvS)5CAEjJ3]#^?ZB@~y2R<a/OM0d&ezwv.FN');
      define('NONCE_SALT',       ',FI>G~/$`NFqoAO?U~Lsw[Ko{ubrN&-]N$HT4s+U4<s0W(v9]f(bn1r_`OjV#LMH');
    

    Deploy the WordPress site and install dependencies.

      sudo apt install php libapache2-mod-php php-mysql -y
    

    Copy the WordPress file to the Apache root directory.

      cd ..
      sudo cp -r wordpress/* /var/www/html/
      sudo systemctl restart apache2
    

      #Check your wordpress wedsite is working or not
      http://<public-ip>/wp-admin
      http://54.227.222.215/wp-admin
    

Happy Learning :)

Stay in the loop with my latest insights and articles on cloud ☁️ and DevOps ♾️ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker #Jenkins #Kubernetes #AWS

Did you find this article valuable?

Support Chandresh Patle's Blog by becoming a sponsor. Any amount is appreciated!