๐๐ง๐ญ๐๐ ๐ซ๐๐ญ๐ข๐จ๐ง ๐จ๐ ๐๐ฆ๐๐ณ๐จ๐ง ๐๐๐ ๐ฐ๐ข๐ญ๐ก ๐๐ฎ๐ฅ๐ญ๐ข-๐๐ข๐๐ซ ๐๐ฉ๐ฉ๐ฅ๐ข๐๐๐ญ๐ข๐จ๐ง ๐๐จ๐ซ๐๐๐ซ๐๐ฌ๐ฌ
๐ฐTask Description
๐
Create an AWS EC2 instance
๐
Configure the instance with Apache webserver.
๐ Download PHP application name WordPress.
๐ As WordPress stores data at the backend in MySQL database server. Therefore we need to Setup a MySQL server using AWS RDS service using Free tier.
๐ Provide the endpoint/ connection string to PHP application to make it work
So Letโs beginโฆ..
Before moving ahead, letโs know some basic introduction
Amazon Relational Database Service (RDS)
Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need.
WordPress
WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes.
MySQL
MySQL is an open source, relational database management system (RDBMS) based on structured query language (SQL). MySQL is available on all major operating systems, including Windows, Linux and Solaris. It is free to use for individuals and non-production environments under the GNU General Public License; however, if used commercially, a commercial licence is required.
MySQL, like other relational databases, stores data in tables, columns and rows. Each entry is defined by a unique identifier. MySQL was designed and optimized for the web development arena; it is arguably the most common database used in web server deployments. MySQL works very well with Apache and PHP and is often the go to database for LAMP stack deployments. MySQL powers 9 out of 10 websites on the internet today, and is the database chosen by Facebook, Twitter and Wikipedia.
Letโs Beginโฆ
๐ Create an AWS EC2 instance
To create an EC2 instance Iโm using Amazon Linux 2 image
๐ Configure the instance mysql database and apache webserver.
- Install mysql
yum install mysql -y
2. Install PHP
amazon-linux-extras install php7.2 -y
3. Install httpd
yum install httpd -y
4. Install WordPress
5. Extract WordPress
tar -xzf latest.tar.gz
6. Moving WordPress folder to root directory /var/www/html
mv wordpress /var/www/html
7. Edit httpd configuration file
vim /etc/httpd/conf/httpd.conf
AllowOverride All
8. Start httpd service
systemctl start httpd
For Storing the data WordPress used the MySQL Database Server. So we need to Configure the Database Using the Amazon RDS Service.
For Creating the Database in free tier follow the Below Steps carefully
Database Created Successfully โฆโฆ.!
Then we need to create MySQL Databse
CREATE DATABASE <database_name>;
here I have created a database named mydb.
Now On Browser give the public IP of Ec2-Instance
Browser Now
http://<public ip of ec2-instance>/wordpress
Here, we can see, it is not able to create wp-config.php fileโ๏ธ
So, we have to create it manallyโฆ
cat > /var/www/html/wordpress/wp-config.php
# and save the fileโฆ.
Here we can see that our Wordpress has been install successfully โฆ
Now we are going to login into worpdress to make our website โฆ
Now we can create blogs and publish it.
After that we need to check our database