Setup WordPress in Amazon Linux 2023

siddhant sugan dodrai
By -
0

WordPress is the most popular CMS (Content Management System) used to create and manage websites. WordPress is hosted on Amazon Linux, an operating system based on Linux that is offered by AWS (Amazon Web Services). Setup WordPress in Amazon Linux 2023

Setup WordPress in Amazon Linux 2023


If you’re looking for a reliable and scalable platform to host WordPress sites, then you’ve come to the right place. In today’s blog, we’re going to show you how to install WordPress on AWS in 2023. That way, you’ll have a strong base on which to build and maintain your website.

Let’s get started!

Set Up an Amazon Linux Instance:

🔹Log in to your Amazon Web Services (AWS) account.
🔹Go to the AWS EC2 Dashboard and select the AWS EC2 instance you want to run.
🔹Choose the AWS Machine Image (Amazon Machine Image) you want to run:
🔹Choose the AWS instance type you want to run
🔹Configure the storage and security group settings
🔹Review and run the instance.
🔹Download the private key file (.pem) to access your instance safely.


Step 2: Connect to Your Amazon Linux

To connect to your instance, open a terminal or a command prompt and go to the directory you saved your private key file in.

Use the command below to set the permissions for your key file:
ssh -i your-key-file.pem ec2-user@your-instance-public-ip

Step 3: Install Required Software:

Update the package manager
sudo dnf update -y
Install Nginx web server, MySQL, and PHP (LAMP stack):

sudo dnf install nginx php-fpm php-mysqlnd php-gd php-xml php-mbstring  -y
Re-start the Nginx web server and PHP FPM

sudo systemctl restart nginx
sudo systemctl restart php-fpm
Enable the Nginx and PHP-FPM

sudo systemctl enable nginx 
sudo systemctl enable php-fpm
Install MySQL server

sudo wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm sudo dnf install mysql80-community-release-el9-1.noarch.rpm -y sudo dnf install mysql-community-server -y 
sudo systemctl start mysqld
Enable the skip grant check by editing my.cnf file

sudo vi /etc/my.cnf
Add a line to mysqld block.*

skip-grant-tables

After that create a new MySQL Database by running the command
sudo mysql 
create schema wp;
Create an Nginx server block
sudo vi /etc/nginx/conf.d/your-domain.conf
You will see an empty file shell when you enter this command. You must paste the following code into the file:

Your-domain is the name of your domain

server {
    listen 80;
    server_name d1.topwptips.com;

    root /var/www/wordpress;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Restart the nginx server
sudo systemctl restart nginx
Now, connect your domain/sub-domain to your server and begin your WordPress installation.

Step 6: Complete the Installation:

To install WordPress on your VPS, execute the following commands one at a time:
sudo wget https://wordpress.org/latest.zip
unzip latest.zip 
chown -R apache /var/www/wordpress
Open a browser and go to the public IP address of your instance or domain name.
Go to the WordPress installation wizard and enter your site name, user name, and password.

Once the installation is done, you can log into the WordPress admin dashboard to start setting up your site.

Conclusion

WordPress on Amazon Linux 2023 is easy to install. All you need to do is set up your Amazon Linux instance, configure your LAMP stack, download/configure WordPress, and you’re ready to go!

In this guide, we’ll show you how to set up a WordPress-based website on Amazon Linux. You’ll be able to take advantage of AWS’s scalability and reliability to build and manage your online presence.









Post a Comment

0Comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!