IT Operations for Web Developers
Mahmoud Said aka @modsaid
Outline
● Why This Session?
● The Shell
● Basics
● ssh & authenticating
● Server Anatomy
● Nginx, passenger
● Webistrano
●...
Why?
Administration
(IT Operations)
Development
Team
Common
knowledge
DevOps
“DevOps is a software development method that stresses communication, collaboration
and integration between softwar...
The Shell
● Hides hardware and OS details
● Text based Command Line interface
● Sequence of commands are “scripts”
The Shell
● There is no recycle bin, and no undo.. “Read
before you hit Enter”
Realizing a wrong chown -R (http://devopsre...
The basics
● Everything is a file
● Files names are case sensitive and do not
contain '/'
● Extensions are just conventions
ssh and Authentication
● Command line based sessions on the server
● apt-get install openssh-client
● Authentication via p...
ssh bookmarking
.ssh/config Host myserver
Hostname myserver.com
User myuser
Port 3022
Host ldap
Hostname 66.85.165.135
Use...
Connecting through ssh
ssh myuser@myserver.com -p3022
ssh myserver
Server Anatomy
Web Server (nginx, apache)
Application Server
(Passenger, thin, mod_php, tomcat,..)Other Services
Memcache
...
nginx
● High-performance HTTP server and reverse
proxy
● /etc/nginx/sites-enabled/kelmetak.com
server {
listen 80 default;...
Passenger
● Rails (and rack) nginx and apache module (like
mod_php for php)
server {
listen 80;
server_name 2ad.kelmetak.c...
More on nginx
● Response cache headers
● Memcache directly
● Rewrites
● Constraints
● Load balancing
● proxy-pass
server {...
webistrano
● Easy automated deployments
● Based on capistrano
● Let's dive together
File transfer
● Scp
● Rsync
● wget
WTF !!
Troubleshooting
● Troubleshooting
● Metrics
– CPU, Memory, I/O
● Tools
– top, htop, free -m, ps, iotop, iftop
Troubleshooting (2)
● Logs
– /var/log/nginx/access.log
– /var/log/nginx/error.log
– /usr/local/myproject/current/log/produ...
Troubleshooting (3)
● Newrelic is your friend
● Debugging via rails console
● Debugging via separate “rails server”
Behind Closed doors
Firewall
● Allow/deny connections based on
– Source/destination ip
– Port
– Protocol
● Everything should be closed, open o...
ssh tunneling
● A way to access closed ports through your ssh
connection
ssh myserver -L port:host:hostport
ssh myserver -...
Open Discussion
Thank You
Mahmoud said
mahmoud.said@espace.com.eg
@modsaid
Upcoming SlideShare
Loading in …5
×

IT Operations for Web Developers

568 views

Published on

Some linux background needed for web and rails developers.
Internal session for interns and new comers at eSpace

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
568
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

IT Operations for Web Developers

  1. 1. IT Operations for Web Developers Mahmoud Said aka @modsaid
  2. 2. Outline ● Why This Session? ● The Shell ● Basics ● ssh & authenticating ● Server Anatomy ● Nginx, passenger ● Webistrano ● File transfer ● Troubleshooting (metrics, logs) ● Behind Closed Doors
  3. 3. Why? Administration (IT Operations) Development Team Common knowledge
  4. 4. DevOps “DevOps is a software development method that stresses communication, collaboration and integration between software developers and information technology (IT) professionals.” Wikipedia
  5. 5. The Shell ● Hides hardware and OS details ● Text based Command Line interface ● Sequence of commands are “scripts”
  6. 6. The Shell ● There is no recycle bin, and no undo.. “Read before you hit Enter” Realizing a wrong chown -R (http://devopsreactions.tumblr.com/)
  7. 7. The basics ● Everything is a file ● Files names are case sensitive and do not contain '/' ● Extensions are just conventions
  8. 8. ssh and Authentication ● Command line based sessions on the server ● apt-get install openssh-client ● Authentication via password or key pair .ssh/id_rsa (and .ssh/id_rsa.pub) .ssh/known_hosts ● Server .ssh/authorized_keys
  9. 9. ssh bookmarking .ssh/config Host myserver Hostname myserver.com User myuser Port 3022 Host ldap Hostname 66.85.165.135 User mahmoud
  10. 10. Connecting through ssh ssh myuser@myserver.com -p3022 ssh myserver
  11. 11. Server Anatomy Web Server (nginx, apache) Application Server (Passenger, thin, mod_php, tomcat,..)Other Services Memcache Solr DB Server Processes (background jobs) File system (Static Resources)
  12. 12. nginx ● High-performance HTTP server and reverse proxy ● /etc/nginx/sites-enabled/kelmetak.com server { listen 80 default; server_name kelmetak.com 2ad.kelemtak.com; root /usr/local/politwoops/current/public; }
  13. 13. Passenger ● Rails (and rack) nginx and apache module (like mod_php for php) server { listen 80; server_name 2ad.kelmetak.com; root /usr/local/politwoops/current/public; passenger_enabled on; }
  14. 14. More on nginx ● Response cache headers ● Memcache directly ● Rewrites ● Constraints ● Load balancing ● proxy-pass server { listen 80; server_name app.com; location ~ ^/(assets)/ { gzip_static on; expires max; add_header Cache-Control public; } }
  15. 15. webistrano ● Easy automated deployments ● Based on capistrano ● Let's dive together
  16. 16. File transfer ● Scp ● Rsync ● wget
  17. 17. WTF !!
  18. 18. Troubleshooting ● Troubleshooting ● Metrics – CPU, Memory, I/O ● Tools – top, htop, free -m, ps, iotop, iftop
  19. 19. Troubleshooting (2) ● Logs – /var/log/nginx/access.log – /var/log/nginx/error.log – /usr/local/myproject/current/log/production.log – Custom logs
  20. 20. Troubleshooting (3) ● Newrelic is your friend ● Debugging via rails console ● Debugging via separate “rails server”
  21. 21. Behind Closed doors
  22. 22. Firewall ● Allow/deny connections based on – Source/destination ip – Port – Protocol ● Everything should be closed, open only what's needed
  23. 23. ssh tunneling ● A way to access closed ports through your ssh connection ssh myserver -L port:host:hostport ssh myserver -L 3056:localhost:3055
  24. 24. Open Discussion
  25. 25. Thank You Mahmoud said mahmoud.said@espace.com.eg @modsaid

×