Linux basics (part 2)

download Linux basics (part 2)

If you can't read please download the document

Transcript of Linux basics (part 2)

PowerPoint Presentation

Linux Basics
Part 2

VIM Editor

vi improved

Installed on most Linux machines

Can be a bit confusing at first...

Cheat sheets FTW

Other popular editors:

emacs

nano

GREG

Networking

Commands:

ifconfig

netstat

route

ifup / ifdown

traceroute

mtr

Configuration setup different based on distro

DHCP vs. static

LANCE

SSH: Secure Shell

Secure Remote Shell

Encrypted

Replaced un-secure rsh, rlogin, and telnet

Useful tricks

Port forwarding

SOCKS proxy server

Remote command automation

Remote X applications

Copy files securely

GREG

SSH Keys

Public/Private key authentication

No password over the wire

ssh-agent passwordless logins

ssh-keygen

RSA vs DSA

Remote script automation

GREG

Package Management

Contains files for a package (binaries, documentation, etc.), install scripts, and metadata about the package

Picture Flickr user 'retail-packaging'

LANCE

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

LANCE

Package Dependencies

What does this package need in order to run?

some other package? A certain (version of a) library?

What does this package provide?

ie. binary, library, etc.

Simplifies package installation

LANCE

Some Examples

# Searching for a package
yum search php
apt-cache search php

#Installing a packageyum 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

LANCE

Services

Background processes serving something

Examples: http, email, mysql, etc

Automatically start when Linux boots

Picture Lance Albertson

GREG

Serving a Website

LAMP stack

Apache

PHP/Perl/etc

Database

GREG

Apache: Web Server

Easy to configure and use

Very dynamic in uses

Modular

Widely used

GREG

Apache: virtual hosts

Multiple websites on the same server

IP-based vs. Named-based

GREG

Mysql: Database server

Most commonly used database with webapps

/etc/my.cnf config

/var/lib/mysql data files

Other Databases:

postgresql

sqlite

LANCE

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

LANCE

Questions?

source:http://xkcd.com/456/