Install Wordpress on Ubuntu [ 22.04 LTS ] EC2 | Step By Step Tutorial |

Опубликовано: 29 Ноябрь 2024
на канале: Code Sagar
7,215
100

-In this video, I will guide you on how to install and Configure Latest Wordpress Version (6.0.1) on EC2 Linux Ubuntu 22.04 LTS operating system.

Topics Covered:
Update package index on Linux Ubuntu 22.04LTS
Install PHP
Check the installed PHP version
Download Wordpress
Give permissions to Wordpress folder
Create new database in MySQL
Add a new MySQL database user with full privileges
Give full privileges to newly added users in MySQL DB
Configure NGINX
Install Wordpress by installer
Install SSL certificates to secure website
Test Wordpress website

Wordpress install
Update packages:
sudo apt update && sudo apt upgrade -y

Install PHP:
sudo apt install -y nginx php-dom php-simplexml php-ssh2 php-xml php-xmlreader php-curl php-exif php-ftp php-gd php-iconv php-imagick php-json php-mbstring php-posix php-sockets php-tokenizer php-fpm php-mysql php-gmp php-intl php-cli

Check version
php --version

Configure PHP:
Path: sudo nano /etc/php/*/fpm/php.ini

upload_max_filesize = 200M
post_max_filesize = 500M
memory_limit = 512M
cgi.fix_pathinfo = 0
max_execution_time = 360

Save the file, start and enable PHP-FPM.
sudo systemctl restart php*-fpm.service

Verify if the service is running:
systemctl status php*-fpm.service
========================================
Download WordPress
wget https://wordpress.org/latest.tar.gz

Extract the file and move it to the /var/www directory
tar -xvzf latest.tar.gz
sudo mv wordpress /var/www/wordpress

Correct permissions for the directory:
sudo chown -R www-data:www-data /var/www/wordpress/
sudo chmod -R 755 /var/www/wordpress/

=========================================
Database

CREATE DATABASE dbname;
CREATE USER 'username’@‘localhost' IDENTIFIED WITH mysql_native_password BY ‘yourpassword;
GRANT ALL ON dbanme.* TO 'username’@‘localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT

=========================================
Configure Nginx Web server 
Path: sudo nano /etc/nginx/site-enabled/wordpress

server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
root /var/www/wordpress;
index index.php index.html index.htm;
access_log /var/log/nginx/wpress_access.log;
error_log /var/log/nginx/wpress_error.log;

client_max_body_size 100M;
autoindex off;
location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Note - Remember to replace example.com with your own domain name and /var/run/php/php7.4-fpm.sock with /var/run/php/php8.0-fpm.sock for PHP 8.0. Save the file and exit.

Check the syntax of the file:
sudo nginx -t

Restart:
sudo systemctl restart nginx

=========================================
Access the WordPress Web Installer
Install Wordpress
=========================================
Step 1 — Installing Certbot
sudo snap install core; sudo snap refresh core

Remove if ready installed
sudo apt remove certbot

sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Obtain certificate
sudo certbot --nginx -d example.com -d www.example.com

Step 3 — Allowing HTTPS Through the Firewall
sudo ufw status

Step 5 — Verifying Certbot Auto-Renewal
sudo systemctl status snap.certbot.renew.service
sudo certbot renew --dry-run
============================================

Once you complete watching this tutorial. I would suggest you follow the installation steps on your computer or remote server. If you encounter errors or didn't understand something, ask me questions in the comments section of this video, I would love to reply.

if you like this video, please do subscribe now and press the bell icon to get latest video update from #CodeSagar

How to Create EC2 Instance (Ubuntu 22.04) on AWS (Latest 2022) and Connect Via SSH using PEM.
   • How to Create EC2 Instance on AWS | C...  

Install and configure Mysql 8.0.30 on Linux Ubuntu 22.04 LTS
   • Install and configure Mysql 8.0.30 on...  

#ubuntu
#wordpress
#wordpressinstallation
#php
#Installphp
#nginx
#configure
#mysql
#configration
#installation
#database
#linux
#aws
#ec2
#awscli
#awstraining #WordPress #Ubuntu #webdevelopment #websitebuilding #CMS #opensource #linux #webdesign #blogging #wordpressinstallation #ubuntuinstallation #webhosting #php #server #websitecreation #coding #wordpresssetup