Setup LAMP Website on VPS Server

My photo website’s excellent software Gallery had gone end of life with no support. I used the opportunity to explore new photo gallery software, Koken, and move from shared hosting to my first VPS – Virtual Private Server. VPS is like going from renter to home owner, the good and bad news is…. you own it all! Install, setup, patching, security… everything but the hosting hardware and network. I chose Digital Ocean for it’s popularity, reviews, pay as you consume pricing (you can turn a test site on and off)  and excellent tutorials which facilitated this project. Big Bonus moving to VPS  – with shared hosting my sites would go offline 2-10 minutes quite often for who knows what.  After moving to VPS I’ve had no downtime , no one else contending for resources and services – nice!

I’m a Windows/Mac guy so this project was both fun and hard. The end result is a clean, lean and fast site: http://photo.gfisk.com/
Zero downtime alerts from Uptime Robot, no unplanned downtime while I’m working, no email spammers or porno sites causing slow performance or application/system crashes…
Status = It’s always on and always up – unless I’m upgrading/breaking things!

Steps to get this rolling!

  1. Setup and connect to your droplet at Digital Ocean
  2. Install and configure Ubuntu
  3. Install and configure Apache, MySQL, PHP and phpMyAdmin
  4. Install Koken (if you fancy…)

Tools you will need (Windows OS)

  1. Putty – SSH client for windows
  2. PuttyGen – create authentication keys for SSH
    1. Using PuttyGen – how to from Digital Ocean
  3. Paegent – an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink
  4. FileZilla – SFTP (requires Paegent for

Setup your Digital Ocean Droplet

  1. Setup Droplet – Chose Ubuntu for the droplet image – 14.04 x86

Connect and setup your server – 3 doc set from Digital Ocean

  1. Connect via SSH
  2. Initial Server Setup with Ubuntu 14.04
  3. Additional Recommended Steps for New Ubuntu 14.04 Servers

Install LAMP – Linux, Apache web server, MySQL Database, PHP server side scripting language

  1. How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04

Install phpMyAdmin to create and manage Databases (optional – GUI Database Manager)

  1. How To Install and Secure phpMyAdmin on Ubuntu 14.04
  2. Security – in addition to htaccess steps I change the default access point:
    1. Edit line three and change the alias in phpmyadmin.conf
    2. sudo nano /etc/apache2/conf-enabled/phpmyadmin.conf
      # Alias /phpmyadmin /usr/share/phpMyAdmin
      Alias /whateveryouwant /usr/share/phpMyAdmin
    3. Restart Apache – sudo service apache2 restart
    4. Access phpMyAdmin -http://yoursite.com/whateveryouwant

Create SSL Certificate for secure https transactions

  1. How To Create a SSL Certificate on Apache for Ubuntu 12.04
    1. This is a self signed certificate which is only good for development or protecting and admin area.
  2. How To Install an SSL Certificate from a Commercial Certificate Authority

Install Software of your choosing

  1. Install WordPress
  2. Install phpMyAdmin
  3. Install Koken (dead…)

 

2 thoughts on “Setup LAMP Website on VPS Server

Leave a Reply

Your email address will not be published. Required fields are marked *