Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
@johntron
DevOps!
@johntron
Buzzwords• DevOps• Back-end• SaaS• Scalability• Virtualization•Web services
@johntron
Tonight• LAMP stack (not really)• vi• BASH tips• Monit
Explain order
@johntron
Environment• Linux (Ubuntu)• Apache 2+• PHP 5.3+• MySQL 5.1+
@johntron
Supporting Software• Shell• Editor• SSH• Package manager• System services• Version control• System monitoring
@johntron
Where we’re at• Installed Ubuntu 12.04 LTS 64-bit• One user account: johntron• Nothing else
How many people use Ubuntu?Other Linux distros?My reasons http://distrowatch.com/dwres.php?resource=popularity
@johntron
APT
apt-cache searchsudo apt-get install openssh-server vim apache2 php5 mysql-server curl monit
@johntron
sudo apt-get install openssh-server vim apache2 php5 mysql-server curl monit
Lied about “nothing else”
@johntron
vi(m)
Who thinks they don’t need a powerful, standard editor?>>>But first! (next slide)<<<
@johntron
SSH shared keysDo it.
How many use them?Disable plaintext!12 min.
mkdir ~/.sshifconfigexit
ssh-keygenscp ~/.ssh/id_rsa.pub johntron@<ip>:~
@johntron
• command mode – ESC• insertion mode – i• line mode – :
vi(m)
Who thinks they don’t need a powerful, standard editor?
@johntron
• Changing modes• Cutting, paste, copy• Multi-line operations• Saving and quitting
vi(m)
sudo vi /etc/ssh/sshd_configx:esci:<line>:$:1,$d:w:q
@johntron
Job control
ctrl-zjobsbg 1fg 1%1# disable root login# disable password authentication# restart ssh
@johntron
There’s no place like ~
@johntron
Those who cannot remember the past are condemned to repeat it
– George Santayana
@johntron
History
!!history!<number><up arrow>!!:s/sudo //history -cblah !$
@johntron
Monit!
Who’s bored?sudo vi /etc/monit/monitrc# change delay# enable web consolesudo addgroup johntron monitman apache2# lookup pid locationsudo vi /etc/monit/conf.d/apache2http://mmonit.com/monit/documentation/monit.html#configuration_examples#change httpd to apache2sudo service apache2 stop
company
posix_getpid()