IT Operations for Web Developers
Upcoming SlideShare
Loading in...5

IT Operations for Web Developers



Some linux background needed for web and rails developers.

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



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

IT Operations for Web Developers IT Operations for Web Developers Presentation Transcript

  • IT Operations for Web Developers Mahmoud Said aka @modsaid
  • Outline ● Why This Session? ● The Shell ● Basics ● ssh & authenticating ● Server Anatomy ● Nginx, passenger ● Webistrano ● File transfer ● Troubleshooting (metrics, logs) ● Behind Closed Doors
  • Why? Administration (IT Operations) Development Team Common knowledge
  • DevOps “DevOps is a software development method that stresses communication, collaboration and integration between software developers and information technology (IT) professionals.” Wikipedia
  • 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 (
  • 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 password or key pair .ssh/id_rsa (and .ssh/ .ssh/known_hosts ● Server .ssh/authorized_keys
  • ssh bookmarking .ssh/config Host myserver Hostname User myuser Port 3022 Host ldap Hostname User mahmoud
  • Connecting through ssh ssh -p3022 ssh myserver
  • 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)
  • nginx ● High-performance HTTP server and reverse proxy ● /etc/nginx/sites-enabled/ server { listen 80 default; server_name; root /usr/local/politwoops/current/public; }
  • Passenger ● Rails (and rack) nginx and apache module (like mod_php for php) server { listen 80; server_name; root /usr/local/politwoops/current/public; passenger_enabled on; }
  • More on nginx ● Response cache headers ● Memcache directly ● Rewrites ● Constraints ● Load balancing ● proxy-pass server { listen 80; server_name; location ~ ^/(assets)/ { gzip_static on; expires max; add_header Cache-Control public; } }
  • 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/production.log – Custom logs
  • 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 only what's needed
  • ssh tunneling ● A way to access closed ports through your ssh connection ssh myserver -L port:host:hostport ssh myserver -L 3056:localhost:3055
  • Open Discussion
  • Thank You Mahmoud said @modsaid