PHP

AWS

Steps:

AWS

putty
ubuntu

sudo su

apt update

apt install apache2

service apache2 start

service apache2 status

you will see a ubuntu on your ip

(/var/www/html/index.html)

cd /var/www/html/

ls

now you see index.html

now remove this index.html file

rm index.html

ls

install PHP

apt install php

install mysql sever

apt install mysql-server

now open filezilla

use ssh
and username ubuntu

password ppk key

upload file (in my case index2.zip) inside ubuntu folder

now move uploaded zip file into /var/www/html/

mv index2.zip /var/www/html/

cd /var/www/html/

ls
you can see your file here

now install unzip

apt install unzip

now unzip your file

unzip index2.zip

now
cd /etc/apache2/sites-available/

ls

now open
nano 000-default.conf

add your directory name if you have then save

now open mysql

mysql h localhost -u root

now change your db password using below query

ALTER USER ‘root’@localhost’ IDENTIFIED BY ‘BasantMallick’;

here BasantMallick is your password

now login with new password in mysql

now
create database frmscui;

use frmscui;

for importing sql file use below command

first exit from mysql

second move into parent or index file directory

and use below command

mysql -h localhost -u root -p yourdatabase > sqlfilename.sql

then again login into database

after login

use databasename

show tables

Note: for editing in file use nano before filename

Method 2:

Aws Cloud – host php mysql website on aws ec2 in hindi | http to https aws | free ssl

— * Used Commands *–

  1. update apt
    sudo apt-get update
  2. install mysql
    sudo apt-get install mysql-server
  3. mysql secure installation
    sudo mysql_secure_installation
  4. install apache
    sudo apt-get install apache2
  5. install php
    sudo apt-get install php libapache2-mod-php
  6. restart apache
    sudo systemctl restart apache2
  7. install phpmyadmin
    sudo apt-get install phpmyadmin php-mbstring php-gettext
  8. fix if php myadmin not work
    sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
    sudo a2enconf phpmyadmin.conf
    sudo systemctl restart apache2
  9. enable file permission
    sudo chown ubuntu /var/www/html
  10. change phpmyadmin password
    ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘new_password’;

Note: https://help.ubuntu.com/community/FilePermissions

ubuntu@ip-172-31-13-220:~$ sudo chown -R www-data:www-data Netrika/

ubuntu@ip-172-31-13-220:~$ ls -ilah

Basant

Recent Posts

How to make dependent dropdown of state and district using cakephp2 form?

Creating dependent dropdowns in CakePHP 2 involves using AJAX to dynamically load data into the…

11 months ago

How to make id as auto increment in postgrey SQL?

just add below code in column properties id Default input Method: 1nextval('form_submissions_id_seq'::regclass) Method: 2 Via…

11 months ago

How to Add Auto Increment to a Column in PostgreSQL ?

Learn how to efficiently set up auto-increment columns in PostgreSQL with this step-by-step guide. From…

12 months ago