What's new

VPN Your VPS is now setup with LEMP (Linux, Nginx, MySQL, and PHP).

ah nou nhy mou

Staff member
  • SikatPInoy Staff
  • medal 1
How to setup VPS with LEMP (Linux, Nginx, MySQL, and PHP).

1. Get a VPS from http://www.getfree10dollarbonus.us
2. Setup a droplet 512MB 20GB with Ubuntu 14.04
3. You will receive an email with root password and public IP address of your VPS
4. Putty or Terminal (MAC) download it
5. In Putty save your IP and load, click OK to CACHE
6. Sign in with root and change your root password
7. Create new user
adduser bob

8. Give new user SUDO priviliges, this user can execute “root” commands
usermod -aG sudo bob

Prepare server
Remove unnecessary programs. Run the following commands logged in as user. We will be using SUDO commands.

sudo apt-get purge apache2* bind9* samba*

Update your server

sudo apt-get update

Install PHP (FPM)

sudo apt-get install php5-mysql php5-xmlrpc php5-cgi php5-curl php5-gd php5-cli php5-fpm php-pear php5-dev php5-imap php5-mcrypt
Install MySQL

sudo apt-get install mysql-server

(You’ll also be asked to setup a MySQL root password – do it and write it down. You will need it.)
sudo mysql_install_db

Secure your MySQL installation
sudo mysql_secure_installation
type your root mysql password

You will get a few questions. Type N to change root password and then type Y for everything else. Done.
Install Nginx

sudo apt-get install nginx

sudo nano /etc/nginx/nginx.conf

and look for # server_names_hash_bucket_size 64;
delete the # to uncomment it. It will allow longer URLs.

Ctrl+X, then Y then enter to save it.

Restart Nginx
sudo service nginx restart

Setup Firewall

Allow the following apps by executing commands:
sudo ufw allow OpenSSH and sudo ufw allow 'Nginx HTTP'

Enable firewall
sudo ufw enable
click Y

Just to check if everything went ok run
sudo ufw status