Nishu

nishumsn03@gmail.com

Deployment On DigitalOcean for php/html project

Posted on June 29, 2021



Step1: SSH Login for server access

$> ssh root@168.0.x.x.0

>cd home

>cd /

>adduser vishavjeet

>usermod -aG sudo vishavjeet

>ufw app list

>ufw status

>ufw allow OpenSSH

>ufw enable

>ufw status

>exit()

#login as vishavjeet

> sudo apt update

>sudo apt install apache2

>sudo ufw app list

>sudo ufw app info "Apache Full"

>sudo ufw allow in "Apache Full"

>sudo apt install mysql-server

>sudo mysql

>select user, authentication_strings, plugin, host from myqsl.user;

>exit

>sudo mysql -p

>exit

>sudo apt install php libapache2-mod-php php-mysql

#how can open default index.php

>nano /ect/apache2/mods-enables/dir.conf

<ifModule mod.dir>

Dir index.php index.cgi, ..index.html

...

>sudo service apache2 restart

>sudo apt install phpmyadmin php-mbstring php-gettext

>sudo phpenmod mbstring

>sudo service apache2 restart

>sudo mysql -p

>mysq>grant all privilleges en *.* 'vishavjeet'@'localhost' with grant option;

www>mkdir project_first

>ls -lart

>sudo chown -R $USER:$USER project_first

>ls -lart

project_first>nano index.html

>cd /etc/apache2/sites-available/

>cp 000-default.conf project_first.conf

>ls

000-default.conf project_first.conf

>sudo nano project_first.conf

<VirtualHost *:80>

ServevAdmin vishavjeet@tech-overflow.com

ServerName tech-overflow.com

ServerAlias www.tech-overflow.com

DocumentRoot /var/www/project_first

>

>sudo a2ensite project_first.conf

>sudo a2dissite 000-default.conf

>sudo service apache2 restart

>sudo apache2ctl config test

Step2:  Domain configuration in Goddady

A @ 192.241.142.132 600sec

Cname www @ h hours



Sign In for comment and like the post.
admin

Nice Explanantion....