Comprehensive System Administration


Lecture 4 notes:

administrivia:

Sorry For the Noise Between the band playing outside and the A/C unit running in here, it's kind of hard to hear.

class notes:

Apache Server

    SSI (Server Side Include) Example 

    <html>
     <head> <title>Today's Date </title> </head>
     <body>
        <!-- #exec cmd="date" -->
     </body> 
    </html>
    
    Date.pl

    !#/usr/bin/perl
    $stuff='cat index.html'
    print "$stuff"




How to Configure Apache

- For more info see: www.apache.org /usr/local/apache/root/ // Global settings ~$user/public_http/ // Local settings replace global httpd.conf // Use this to config Apache access.conf // Who has access to files srm.conf // [optional] Most of this in httpd.conf - Make sure port 8080 is open, or Apache will crash. Logs: - access log // Who's been here - error log // Log of everything that is FUBAR - Rotate logs using cron, archive older logs, really old logs disappear - Log location variable, set using httpd.conf - Possible location: /var/log/apache or /services/http/adm/

Vi (Village Idiot)

- Has two modes, command and insert, also know as beep and non-beep - Complete the vi tutor within two weeks - URL: http://www.ocf.berkeley.edu/~drew/tutor

RegExp

- Use to search and replace text in grep, vi, etc. - Syntax: a* // Matches everything before *, unlimited number of times (a, aa, aaa, ... are matched) .* // Matches any letter [abc]+ // Matches one of these letters, treats as one char [^abc] // Exclude a, b, c from search [a-z] // Match a-z \. // \s // () // Use for grouping - Examples: given: abcdeafghiajk .* // Entire line works, abcdeafghiajk a.*a // Matches everything between a and a, greedy, abcdeafghia a.*?a // Matches everything between a and a, non greedy, abcdea

Where We Are in the Class

Calman: You now know enough that you no longer have to show up to work. SSH in and run scripts to do everything.

Homework

Complete the vi tutor by 2001-10-26 (Friday) http://www.ocf.berkeley.edu/~drew/tutor