compcon 2016 workshop

Post on 15-Apr-2017

319 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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-windows/

Connect to the instanceOpen port 22 on any local firewalls

ssh –I {keypair} ubuntu@{url of instance}

Server Build

Some basicsSudo –I for root or use sudo [command]

/var/logs for most debugging

mkdir /var/www/

Change root password – passwd root

APT-GETAPT-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

MYSQLAPT-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 Spacedd 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

SSLOpen 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

top related