Beautiful accounting software
Building your own
LEMP stack on
AWS
Steven Cooper
@developersteve
717,000+
global subscribers
AWS servers
LEMP vs LAMP
Linux
NGINX vs APACHE
MySQL
PHP/Python/Pearl…
The Instance
Amazon Free Tier
Create an Ubuntu instance
Generate key pair
Chmod 600 {keypair name}
Open Ports
The public URL
The command line
Terminal
Putty
https://linuxacademy.com/blog/linux/connect-to-
amazon-ec2-using-putty-private-key-on-
Connect to the instance
Open port 22 on any local firewalls
ssh –I {keypair} ubuntu@{url of instance}
Server Build
Some basics
Sudo –I for root or use sudo [command]
/var/logs for most debugging
mkdir /var/www/
Change root password – passwd root
APT-GET
APT-GET Update, APT-GET upgrade, APT-
GET Install
APT-GET install git
APT-GET install VIM
APT-GET remove UFW
NGINX /etc/nginx/
APT-GET install Nginx
vi /etc/nginx/sites-enabled/default
i
Change root to /var/www/
Escape then :wq
Service nginx restart
PHP /etc/php/
APT-GET install php7.0
Add-apt-repository ppa:ondrej/php
Apt-get update
apt-get install php7.0 php7.0-cli php7.0-fpm
NGINX PHP template
MYSQL
APT-GET install mysql-server
mysql –u root –p
Create database dev1;
GRANT ALL PRIVILEGES ON dev1.* TO
"devuser"@"localhost" IDENTIFIED BY
"password";
Flush Privileges;
Exit
Swap Space
dd if=/dev/zero of=/var/swap bs=1M
count=2048
mkswap /var/swap
swapon /var/swap
Vi fstab and add
/var/swap swap swap defaults 0 0
SSL
Open port 443
https://certbot.eff.org
Performance
Blitz.io load testing
New Relic
UpDown
And if there's time
DNS
bind9
Email
Postfix and Dovecot
https://linode.com/docs/email/postfix/email-with-postfix-dovecot-and-
mysql
“The three most dangerous things in
the world are a programmer with a
soldering iron, a hardware type with a
program patch and a user with an
idea.”
Rick Cook - The Wizardry Consulted
Beautiful accounting software
www.xero.com

Compcon 2016 Workshop

Editor's Notes

  • #3 Need fun bio
  • #4 You think about that thought, that’s not just single users that businesses with not only multiple users but doing all the things to run businesses that employ people. 1 trillion transactions $31K per second
  • #14 Chmod 600 keypair
  • #19 https://linuxacademy.com/blog/linux/connect-to-amazon-ec2-using-putty-private-key-on-windows/
  • #24 Put a index.html into var/www
  • #26 Put a index.html into var/www
  • #38 Get the server whitelisted