How To Launch an Instance (Ubuntu 18.04 & Nginx) On Amazon EC2 2019

Subscribe our YouTube Channel    

How To Launch an Instance (Ubuntu 18.04 & Nginx) On Amazon EC2 | Hello dosto aapka bahut bahut swagat hai aaj ke yah fresh article and video mai, aaj me aapko puri details or step by step sikhaunga ki kis tarah se aap aapni wordpress, php ki website launch kar sakte ho AWS me with Nginx web server.

Note: Article mai sirf video mai use kiye gaye commands hi hai,agar aapko step by step sikhna hai to aapko uparka video dekhna padega, Thanks.

Setup Ubuntu 18.04 & Install Nginx on Amazon EC2

01. Install Nginx


sudo apt-get update

sudo apt-get install nginx

02. Install MySQL


sudo apt-get update

sudo apt-get install mysql-server

03. MySQL Security


sudo mysql_secure_installation

04. Install PHP


sudo apt-get install php-fpm php-mysql

05. Create MySQL User


sudo mysql

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

FLUSH PRIVILEGES;

exit

06. Start PHP


sudo nano /etc/php/7.2/fpm/php.ini

cgi.fix_pathinfo=0

sudo service php7.2-fpm start

sudo systemctl restart php7.2-fpm

07. Edit Default Conf File


sudo nano /etc/nginx/sites-available/default

server{

 listen 80 default_server;
 listen [::]:80 default_server;

 root /var/www/html;
 index index.php index.html index.htm index.nginx-debin.html;

 server_name server_domain_or_IP;
 
 location / {
  try_files $uri $uri/ /index.php?$args;
 }

 location ~ \.php$ {
  include $nippets/fastcgi.php.conf;
  fastcgi_pass unix:/run/php/php7.2-fpm.sock;
 }

 location ~ /\.ht {
  deny all;
 }

}

08. Check Nginx Status


sudo nginx -t

09. Reload Nginx


sudo systemctl reload nginx

10. Installing phpMyAdmin


sudo apt-get update

sudo apt-get install phpmyadmin

sudo ln -s /usr/share/phpmyadmin /var/www/html

sudo phpenmod mcrypt

sudo service php7.2-fpm restart

11. Secure PhpMyAdmin


cd /var/www/html

sudo mv phpmyadmin qu_db 

sudo service nginx restart

12. install SSL Certificate


sudo apt-get update

sudo add-apt-repository ppa:certbot/certbot

sudo apt-get install python-certbot-nginx

sudo nano /etc/nginx/sites-available/default

server_name example.com www.example.com;

sudo nginx -t

sudo systemctl reload nginx

13. Allowing HTTPS Through the Firewall


sudo ufw status

sudo ufw enable

sudo ufw allow 'Nginx Full'

sudo ufw delete allow 'Nginx HTTP'

sudo ufw status

14. Installing Certificate


sudo certbot --nginx -d example.com

sudo service nginx restart

15. Download WordPress

Download WordPress Latest Version – Click here

16. Change Directory Permission


sudo chown -R ec2-user /var/www/html

sudo chmod -R 755 /var/www/html

17. Move Directory


sudo mv  -v /var/www/html/html/* /var/www/html/

sudo service nginx restart

18. Install ZIP/Unzip


sudo apt-get update

sudo apt-get install zip unzip

sudo service nginx restart

# Final Word

To dosto mai finaly aasha rakhta hu ki aapko yah article pasand aaya hoga, agar aaya to der kis bat ki share kardijiye taki aapke friend bhi kuch naya sikhe.

Agar aapko yah article pasand aaya to share jarur kijiyega sabhi social media me, or ha ek request hai hamare youtube channel ko jarur Subscribe karna ,aap hume sabhi social media pe bhi follow karlijiye jaise ki, Facebook, Twitter, Instagram, YouTube.

Also read this

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

Hey, I’m Bharat Makwana, A Full Time Blogger & Youtuber, Founder of InfinityGyan, WPMesh, Veewom and BM Tech Tips YouTube Channel.

You may also like this!