Hey Learners! Welcome back. As we all know over 30% of 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. In this challenge, we'll set up a WordPress website on AWS. Let's start...
Task 1-
First, we have to create one database server which is connected to one of the running instances as we did in the previous challenge. We already connected our instance to the Database server.
Day44 Link:- https://avp23.hashnode.dev/day-44-90daysofdevops
Now we have to create a database user for our WordPress application and permit him to access the WordPress database.
Now to run WordPress we have to install a web server on our system.
Let's install apache2 using sudo apt install apache2
command. Restart the service after installation and check via browser by hitting instance public IP.
Apach2 service is up and running.
Setup the server and post your new WordPress app
Download and unzip the software.
Download link:- https://wordpress.org/latest.tar.gz
Commands to run
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
Copy the wordpress directory into /var/www/html/ location using sudo cp wordpress /var/www/html/
command.
Now access the Web page PublicIP/wordpress
First, select the database you created go to the Connectivity and security section choose VPC security groups. Select the ec2-rds from the security group name and edit inbound rules as follows
Now click on Let's go and you will have a new window to enter your database details. Before moving forward Create a database and user using the following commands.
create database wordpress;
create user 'worduser' identified by 'wordpass';
grant all privileges on wordpress.* to worduser;
flush privileges;
exit
Now go to the web page*<publicIP/wordpress>* and click Let's go. Enter the details as shown and click Submit.
If you don't have any wp-config.php file then it will ask you to generate it manually. Copy the content showing from the next window and create a file in the specified location.
Paste the copied content in the wp-config.php file using the sudo vim /var/www/html/wordpress/wp-config.php
command. Save the file and restart the apache2 service. Start the installation.
Go through the process. Enter the details as shown below
Enter the credentials
Congratulations! Your WordPress is deployed successfully
Don't forget to delete created resources after practice.
Thank you so much for taking the time to read till the end! Hope you found this blog informative.
Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.
Find me on:- Hashnode LinkedIn Github
Happy Learning!