Thursday, 23 February 2017

How to Install LAMP stack on Ubunt 16.04 VPS

1)Install Apache

-sudo apt-get update
-sudo apt-get install apache2

add a single line to the /etc/apache2/apache2.conf file to suppress a warning message.


-sudo apache2ctl configtest

Open up the main configuration file


-sudo nano /etc/apache2/apache2.conf

at the bottom of the file, add:-

ServerName Domain Name or IP


 check for syntax errors

-sudo apache2ctl configtest

Output
Syntax OK

Restart Apache to implement the changes:

-sudo systemctl restart apache2

see the Apache Full profile:

-sudo ufw app info Apache Full
Output
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.

Ports:
  80/tcp

Allow incoming traffic for this profile:

-sudo ufw allow in "Apache Full"


2)Install MySQL

-sudo apt-get install mysql-server

for security, run following command and press other than Y

-sudo mysql_secure_installation
check mysql
-mysql --version



3)Install PHP

-sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

check php installation

-php --version

CREAT BASIC PHP SCRIPT OF PHP INFO
-sudo nano /var/www/html/info.php
PUT THE TEXT IN BLANK FILE
<?php
phpinfo();
?>
ctrl+x, then press Y and hit Enter

Go to your browser then type:

domainname/IP address/info.php












How to setup Initial Ubuntu -16.04 server

create new droplet in Digital Ocean.
Log In to your newly created droplet
-ssh root@your_server_ip

Create New User

-adduser zealgeeks


Add new user to sudo group

-usermod -aG sudo zealgeek

switch to new user
-su - zealgeeks

-mkdir ~/.ssh          (create new directory)
-chmod 700 ~/.ssh       (restrict the permission)


-nano ~/.ssh/authorized_keys
Now insert your public key (which should be in your clipboard) by pasting it into the editor.

Hit CTRL-x to exit the file, then y to save the changes that you made, then ENTER to confirm the file name.

-chmod 600 ~/.ssh/authorized_keys

Test user Log in

-ssh zealgeeks@server_IP

Set Up a Basic UFW(uncomplicate)Firewall

-sudo ufw app list

We need to make sure that the firewall allows SSH connections so that we can log back in next time. We can allow these connections by typing:

-sudo ufw allow OpenSSH
Afterwards, we can enable the firewall by typing:

-sudo ufw enable
Type "y" and press ENTER to proceed. You can see that SSH connections are still allowed by typing:

-sudo ufw status
Output
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)














Tuesday, 21 February 2017

How to create SSH Key pair

On your local computer, enter this command into the terminal

ssh-keygen

 cat ~/.ssh/id_rsa.pub              (for manually copy and paste ssh key to server)


How change or remove the passphrase,

ssh-keygen -p

How to connect to Droplet

1)create  a new Droplet through the DigitalOcean Control Panel, without adding SSH key to droplet.

2)Get Serve Login credentials at your email from digital ocean.

User name: root

Password

Server IP address


-ssh root@serverIP_address





Monday, 20 February 2017

How to watch an avi file format clip on ubuntu 14.04

You can download and install the Ubuntu Restricted Extras directly from the Ubuntu Software Center which provides support for most video and audio formats (mp3,avi,mpeg,Java Flash, TrueType,Codecs).

HOW TO INSTALL SAFEEYES ON UBUNTU

sudo add-apt-repository ppa:slgobinath/safeeyes
sudo apt update
sudo apt install safeeyes