Linux Basics Part 2
VIM Editor vi improved Installed on most Linux machines Can be a bit confusing at first... o Cheat sheets FTW Other popular editors: o emacs o nano
Networking Commands: o ifconfig o netstat o route o ifup / ifdown o traceroute o mtr Configuration setup different based on distro DHCP vs. static
SSH: Secure Shell Secure Remote Shell o Encrypted Replaced un-secure rsh, rlogin, and telnet Useful tricks o Port forwarding o SOCKS proxy server o Remote command automation o Remote X applications o Copy files securely
SSH Keys Public/Private key authentication No password “over the wire” ssh-agent – “passwordless” logins ssh-keygen RSA vs DSA Remote script automation
Package Management Contains files for a package (binaries, documentation, etc.), install scripts, and metadata about the package Picture © Flickr user 'retail-packaging'
Benefits of Packages Easy to manage (install, upgrade, remove) Central database tracks all installed packages on a system yum/apt (or similar tools) handles dependency resolution Package repositories make it easy to find/install common software Included/official repos vs. external repos
Package Dependencies What does this package need in order to run? o some other package? A certain (version of a) library? What does this package provide? o ie. binary, library, etc. Simplifies package installation
Some Examples # Searching for a package yum search php apt-cache search php # Installing a package yum install php apt-get install php # List all files from a package rpm -ql php dpkg-query -L php # Updating all packages yum update apt-get upgrade
Services Background processes serving something Examples: http, , mysql, etc Automatically start when Linux boots Picture © Lance Albertson
Serving a Website LAMP “stack” Apache PHP/Perl/etc Database
Apache: Web Server Easy to configure and use Very dynamic in uses Modular Widely used
Apache: virtual hosts Multiple websites on the same server IP-based vs. Named-based
Mysql: Database server Most commonly used database with webapps /etc/my.cnf – config /var/lib/mysql – data files Other Databases: o postgresql o sqlite
Caching High Traffic sites Database caching Memcached Op-code caching Static content caching
Configuration Management Infrastructure programming language Defining your infrastructure Puppet CFEngine Chef
Wordpress Install Setup MySQL & Apache Create Virtual Host Create Database & user Unpack tarball Go to website
Questions? source: /