开源时代200810(第二期)

117

Upload: yongwei-bao

Post on 14-Nov-2014

78 views

Category:

Documents


0 download

DESCRIPTION

开源时代杂志第二期

TRANSCRIPT

ChinaUnix.net ----- Linux/Unix

2008 10 - 2 -

[email protected]

ChinaUnix.net ----- Linux/Unix

2008 10 - 3 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

5 Office OpenOffice 3.0 Office OpenOffice 3.0 WPS Ubuntu 8.10 Windows CU CU 9 CU

2008 10 - 4 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

Linux

Linux Linux AIG UFJ

Linux Linux --BtrFS Oracle Chris Mason BtrFS Oracle

2008 10 - 5 -

[email protected]

ChinaUnix.net ----- Linux/Unix

IBMIntelNovell Linux BtrFS Linux Ted Ts'o ext4 Linux Linux Linux Linux Linux Linux ZFS Linux Linux

Linux Linux Linux Linux Linux Linux IBM Gerrit Huizenga IBM Linux Linux

Linux Linux Windows Windows Internet Unix/Linux Linux root

Linux Windows 2008 10 - 6 -

[email protected]

ChinaUnix.net ----- Linux/Unix

( Linux root ) Linux Windows Linux Linux Linux Linux md5

() Linux Linux Linux Linux Linux Linux Linux Linux Linux

Linux Linux Linux Linux Linux Ubuntu 8.11OpenSUSE 11.11 Fedora 10 Linux Linux Linux Linux ubuntu 8.10 Linux Linux Linux 2008 10 - 7 -

OpenSUSE 11.1 12 OpenSUSE 11.1 SELinux mandatory access control system Novell

[email protected]

ChinaUnix.net ----- Linux/Unix

SELinux Linux Linux SELinux Red Hat Novell Linux --AppArmor 2005 Novell Immuix Novell SELinux SELinux OpenSUSE SELinux AppArmor Novell SELinux SELinux

Novell SUSE Linux Fedora Linux 10 11 Red Hat Sectool Sectool bashpython Fedora 10 5

MySQL Sun MySQL MySQL (David Axmark) Sun IT MySQL Sun 1 Sun 10 MySQL MySQL 11 10 Sun Sun MySQL Sun MySQL MySQL (Michael Widenius) Sun MySQL CEO (Marten Mickos)

2008 10 - 8 -

[email protected]

ChinaUnix.net ----- Linux/Unix

SaaS SaaS SaaS SOA SOA Apache Tuscany SOA Java C++ SCA/SDO/DAS Eclipse STPSOA Tools Platform SOA .net Eclipse NetBeans "" SaaSSOA

Linux Jim Zemlin "Linux " SaaSSOA SaaS

Sun Solaris Linux Unix Linux Sun Solaris Unix Linux Solaris Sun 16 Solaris Linux Solaris Sun Jim Zemlin Linux

Linux Solaris 2008 10 - 9 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Microsoft Windows Unix SolarisSolaris Solaris Zemlin Linux x86 Sun ERP ( 720 ) Linux Linux ( ) Linux Zemlin Linux Sun Linux Zemlin IBM AIX HP-UX Unix Unix Zemlin Unix Unix Linux IDC Al Gillen Linux Solaris IDC Linux 2006 240 2007 270 Solaris 2006 376,0002007 Zemlin Solaris Zemlin Sun Solaris Linux Dtrace(Solaris ) ZFS (Zettabyte File System) Sun Microsystems ZFS Dtrace SunSolaris Sun Sparc x86 Linux Zemlin ZFS Dtrace Linux Sun Common Development 2008 10 - 10 -

Distribution License(CDDL) Linux GNU General Public License Sun CDDL GPL Solaris Linux Sesame WorkshopSesame Workshop Noah Broadwater Linux Solaris Solaris Broadwater Sesame Linux 20,000 Broadwater Linux IBM Cognos BI x86 Linux Sparc Solaris Solaris Sun Solaris Charlie Boyle Linux SolarisBoyle Solaris ZFS Solaris Solaris Solaris Boyle Solaris

Sun Neil Wilson Solaris Solaris Linux Gracenote( MP3 )

[email protected]

ChinaUnix.net ----- Linux/Unix

Gracenote Matthew Leeds Linux Solaris Solaris Solaris Sun Solaris OpenSolaris Solaris Linux Zemlin Sun Solaris Sun OpenSolaris Sun

OpenSolaris Sun-driven OpenDS Zemlin Open Solaris Solaris Sun Boyle Sun OpenSolaris () OpenSolaris 160,000 Sun OpenSolaris Sun

OpenOffice 3.0 Office Windows Office OpenOffice.org OpenOffice.org 3.0 OpenOffice 3.0 Office Office OpenOffice.org Office SUSE Linux Enterprise Desktop Grant Ho Novell OpenOffice SUSE Linux OpenOffice OpenOffice.org Office Office OpenOffice.org Grant Ho Novell OpenOffice 3.0 Office Calc VBA OpenOffice 3.0 Microsoft Office Web Michael Croan

Office Open XML (OOXML) OpenOffice 3.0 OpenOffice 3.0

2008 10 - 11 -

[email protected]

ChinaUnix.net ----- Linux/Unix

OpenOffice Office Sun Microsystems OpenOffice.org Louis Suarez-Potts OpenOffice Office OpenOffice Suarez-Potts OpenOffice 3.0 Firefox xtensions.services.openoffice.org OpenOffice OpenOffice.org StarOffice OpenOffice.org Suarez-Potts OpenOffice OpenOffice Suarez-Potts Suarez-Potts OpenOffice PDF PDF Suarez-Potts OpenDocument FormatODF

JIT Suarez-Potts Suarez-Potts

Sun OpenOffice Suarez-Potts Sun 20 OpenOffice 1999 Sun StarOfficeOpenOffice OpenOffice 50 uarez-Potts Suarez-Potts ---

Linux Windows 2008 10 - 12 -

10 Red Hat Network

[email protected]

ChinaUnix.net ----- Linux/Unix

249

HPC 475

: 1 Windows Linux 2005 Office IE OpenOffice Firefox() 24% 21% 17% 15% 39% (34%)(28%) 175000 U Talend Bertrand Diard SAP Diard IT ? Altic Marc Sallieres

7 * OW2

2008 10 - 13 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Pezzini SOA logiciel libre free software (free as in speech, not free as in beer)Logiciel libre IT IT Pezzini

Bonita Miguel Valdes Valdes Gartner Massimo Pezzini

Red Hat Red Hat Qumranet Red Hat Linux KVM() 6 Red Hat Red Hat Linux oVirt KVM Red Hat Linux Linux Windows Red Hat Scott Crenshaw Red Hat Qumranet KVM VDI() Crenshaw KVM Red Hat OEM Linux

2008 10 - 14 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Crenshaw KVM Red Hat Linux(RHEL) RHEL Crenshaw Red Hat Red Hat Linux SolidICE VDI Red Hat Qumranet VDI Red Hat SolidICE SPICE( ) Windows Linux Citrix XenDesktop The 451 Group Jay Lyman Red Hat Red Hat KVM Red Hat XenXen Red Hat Red Hat Linux KVM Lyman Red Hat Qumranet Red Hat KVM Red Hat

RHEL

Kusnetzky Group Dan Kusnetzky Red Hat Red Hat Red Hat Xen KVM ( Linux )Red Hat Red Hat 1. Red Hat 2. 3. 4. Kuznetzky Qumranet Red Hat Qumranet SolidICE Red Hat Red Hat Qumranet KVM Red Hat Red Hat

2008 10 - 15 -

[email protected]

ChinaUnix.net ----- Linux/Unix

, Richard Stallman Gmail , . Google Stallman , ,Stallman () , Stallman GNU CEO - Web2.0 Stallman

Oracle IT Red Hat 15 Oracle Unbreakable Linux Linux Unbreakable Linux IT Oracle RedHat Oracle Red Hat Oracle Yahoo Red Hat YahooRedHat Yahoo Red Hat Oralce Red Hat

2008 10 - 16 -

[email protected]

ChinaUnix.net ----- Linux/Unix

RedHat Linux RedHat Red Hat Oracle RedHat Oracle

Red Hat 28 Oralce Larry Ellison Oracle Red Hat

IDC Digital Universe 50 IDC Backup Exec Zmanda LinuxUnixWindowsMac Chander Kant Kant Kant

tarrsync cpioLinux Unix dump Windows ntbackup 2008 10 - 17 -

Zmanda BackupPC PC Kant Kant PERL Zmanda

[email protected]

ChinaUnix.net ----- Linux/Unix

Amanda Network Backup Zmanda Amanda Network Backup

Mono 2.0 .NET Mono 2.0 .NET 2.0 .NET Mono2.0 Mono Miguel de Icaza Mono Miguel de Icaza Mono .NET Mono1.2.3 NoMA Mono Linux

Novell Mono 2.0 Linux .NET Mono Novell Linux .NET 2.0

Untangle Linux Andrew Fife Untangle Fife

2008 10 - 18 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Fife Sourcefire ClamAV Tomasz Kojm Morris 95% 98% Morris Morris 2008 10 - 19 -

Apache, Linux Firefox Untangle Dirk Morris Kojm ClamAV, Fife SNORT (IDS) 10000 ( ) Gartner Joseph Feiman Feiman Untangle

[email protected]

ChinaUnix.net ----- Linux/Unix

Feiman Morris ClamAV,Snort SSL VPN()Morris Untangle Fife Fife Fife

Fife Untangle Tomasz Fife

Unix Sun Unix Sun Solaris CTO Sun 4 Solaris 70000 Dell Linux 30% 1700 Sun Solaris Linux CTO Linux/Intel 90% 3

2008 10 - 20 -

[email protected]

ChinaUnix.net ----- Linux/Unix

infoWorld Sun Sun Solaris Linux Jim Zemlin Unix Unix Unix Linux Sun Linux Microsoft Windows Unix Solaris Solaris Sun 7% Sun Sun 6 Sun 70 3 Sun 40% NASDAQ

13% Fujitsu Sun IBMHPDell Sun Sun 7.2% IDC IBM 14%

Solaris OpenSolaris Sun Sun Sun Solaris

2008 10 - 21 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

PHP PHP () Zend CEO 2008 Zend/PHP java Zend 400% PHP 5 PHP Goldberg 5 10 PHP PHP PHP David Swim PHP ColdFusion PHP David Swim PHP Kargo Zend CEO Harold Goldberg PHP PHP Goldberg PHP PHP Goldberg PHP Kargo Swim PHP ColdFusion Goldberg LAMP Linux, Apache, MySQL, Perl/PHP/Python Windows, IBM DB2, JavaScript, Microsoft SQL Server, VMware, and Dojo AJAX LAMP Goldberg Goldberg SugarCRM Zend

25 9 27 Richard Stallman GNU 25 25 2008 10 - 22 -

Stallman 1983 GNU 45 1989 Stallman GNU GPL

[email protected]

ChinaUnix.net ----- Linux/Unix

1.0(Copyleft) 1992 GNU GPL 2.0 GPL 1;2 GNU (Linux)

10 ) SLOCCount COCOMO Linux 2.6 6.12 Linux 2.6.27 640 10 U Linux GNOME OpenOffice Stallman () ( EULA) Stallman EULA GNU 25

2004 10 4 Jeff V. Merkey Linux 5 Merkey Linux Merkey Linux 2006 10 9 David A. Wheeler Linux Kernel 2.6It`s Worth More!(

Gentoo Linux 2008.1 Linux Gentoo Linux Gentoo Linux Gentoo Linux 2007.1 2008.1 Gentoo Linux Gentoo Linux Gentoo 2008 10 - 23 [email protected]

ChinaUnix.net ----- Linux/Unix

Gentoo Linux NovellDebian Linux Gentoo Gentoo weekly minimal images Gentoo Donnie Berkholz Gentoo Gentoo Gentoo Gentoo Gentoo Linux Gentoo 2008.0 Gentoo 2008.1 2007.1 Gentoo 2007.1 Gentoo Gentoo Gentoo Portage Berkholz Gentoo buzz CD Gentoo 2008.1 Gentoo Daniel Robbins InternetNews.com Gentoo2008.1 2007.1 Gentoo

Gentoo Gentoo Robbins Gentoo2008.1 Gentoo Gentoo

Robbins Gentoo Linus Torvalds git Gentoo Robbins Gentoo Gentoo catalyst Gentoo Robbins "Funtoo" Gentoo Gentoo Gentoo Gentoo Gentoo

2008 10 - 24 -

[email protected]

ChinaUnix.net ----- Linux/Unix

15 Debian McIntyre Debian 23000 10 i386 AMD64 PowerPC SPARC Debian Linux Debian Windows McIntyre Debian Debian Debian Linux Debian Ian Murdock McIntyre Murdock Linux Murdock Debian Debian Debian Murdock Debian Debian Unix Linux (dependency

Ian Murdock Linux Debian Debian Debian Linux GNU/Linux Debian 8 16 15 Linux Linux 15 Debian McIntyre Debian 15 1993 Ian Murdock 1000 2008 10 - 25 -

[email protected]

ChinaUnix.net ----- Linux/Unix

resolution) Debian .RPM Debian Martin Michlmayr Debian Michlmayr Debian Debian Debian Michlmayr FTPmaster 15 Debian 15 Debian Debian ?Michlmayr Debian Linux Debian Debian Debian Debian 2008 10 - 26 -

Debian Debian Debian Debian

Debian Murdock Debian Murdock Debian Debian Debian

[email protected]

ChinaUnix.net ----- Linux/Unix

Debian Debian Mark Shuttleworth Ubuntu Debian Ubuntu Canonical Ubuntu Ubuntu Debian Debian Michlmayr Debian Ubuntu Debian Ubuntu Debian Linux

GNewSense Debian Blag Linux Linux DebianUbuntu Linux Debian Debian Debian Debian Debian 15

10 Slashdot Rob Malda Perl CPANPerl 1997 CPAN HTML PHP PHP Perl Python InfoWorld 10

Web 5 PerlPHPPython Ruby

2008 10 - 27 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Python3.0 : 2000 Python Guido van Rossum Python 3.0 Python 3.0 RC Rossum 3.0 Rossum python Python 90 python Rossum Python print print() exec exec() != Python 2.6 2.6 3.0 python 2.0 python 3.0 python 3.0 vista windows xp Aahz Maruch Page DNA 20 Maruch 3.0 Python CPython C Python Python JPython(Python in Java),IronPython ( .net Python), PyPy( Python Python ) Python Python 3.0 Rossum 2.6 3.0 Python 3.0 Python 3.0

Python 3.0 Python Rossum Python Python web Van Rossum 1990 Python Python 08 3 Anton Ertl Python C Java pythonpython

2008 10 - 28 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

? (+OFFICE)58 2000 RedOffice 4.0 49 20 WPSWPS WPS WPS WPS Windows UOF() UOF 07 11 () UOF UOF 40 80 2008 10 - 29 [email protected]

ChinaUnix.net ----- Linux/Unix

Linux 2000 1998 And as long as they`re going to steal it, we want them to steal ours. 2007 3 (Jeff Raike)

2008 10 - 30 -

[email protected]

ChinaUnix.net ----- Linux/Unix

(21 ) 20 CCTV 30 CCTV windows

2008 10 - 31 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

ChinaUnix 2008 9 20 ChinaUnix CU Linux 160 200 ChinaUnix haproxynginxLVSSquidDNS haproxynginxLVSSquid 20% F5/netscaler/radware Sina LVS Nginx haporxy ChinaUnix IT Metoo2008HonestQiao 2008 LVS linux/unix Nginx F5 CU HonestQiao haproxy php php linux/unix 2008 10 - 32 [email protected]

ChinaUnix.net ----- Linux/Unix

ChinaUnix

Lvs+keepalived PPT Lvs LVS

Nginx PPT Nginx Nginx

haproxy haproxy haproxy

PPT :

2008 10 - 33 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

Linux Greg Kroah-Hartman Ubuntu Ubuntu Ubuntu Greg Kroah-Hartman Linux Ubuntu newsmth LinuxApp cppgx Ubunbu

cppgx Ubuntu Linux Ubuntu Ubuntu Ubuntu Ubuntu Ubuntu Ubuntu Windows Ubuntu GNU/Linux Ubuntu Windows Vista Ubuntu Debian Ubuntu Debian openssl Ubuntu black list 2008 10 - 34 -

Ubuntu Ubuntu 7.04 7.10 X Window. Ubuntu dash bash Ubuntu dash #!/bin/sh #!/bin/dash Ubuntu Ubuntu Windows Ubuntu Windows *nix Windows Program Files tkConfig Ubuntu Ubuntu Ubuntu

[email protected]

ChinaUnix.net ----- Linux/Unix

Linux Ubuntu Greg Kroah-Hartman Linux Plumbers Conference 2008 Ubuntu Canonical Linux Ubuntu CEO Matt Zimmerman Greg Kroah-Hartman Ubuntu Red hat Novell Ubuntu Linux Zimmerman Kroah-Hartman Linux Kroah-Hartman Linux GCCbinutilsX.org Glibc Linux GNOME KDE Linux Zimmerman Kroah-Hartman Novell Novell Ubuntu Linux Ubuntu CEO Ubuntu Greg Kroah-Hartman Linux Linux USB, PCI, I2C NovellLinux Device Drivers

ppt Ubuntu 5 100 Linux 10 Ubuntu 0.1% Linux Red Hat Novell Linux Ubuntu Canonical

Ubuntu Ubuntu 9 19 Novell Linux Greg Kroah-Hartman Linux Ubuntu Canonical Canonical Linux 3 Canonical 100 2008 10 - 35 -

Linux 0.1 Greg Ubuntu Linux Linux Ubuntu Canonical

[email protected]

ChinaUnix.net ----- Linux/Unix

130 Novell4,100 IBM38 Canonical Linux Ubuntu Linux Linux Greg Novell Novell Ubuntu Greg Ubuntu Ubuntu Ubuntu Ubuntu Ubuntu Debian Ubuntu Ubuntu

Ubuntu

Ubuntu Ubuntu Canonical Ubuntu Canonical Canonical Ubuntu

2008 10 - 36 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

------Linux 20 Windows XP Office Windows XP () Office WGA 20 (Microsoft update) WGA OGA WGA WGA 1 6 ChinaUnix zhengwei_zw 82% Linux

10 14 10 15 2008 Office 2008 10 20 Windows WGA Office OGA WGA WindowsXP OGA Office XPOffice 2003 Office 2007 WGA 2008 10 - 37 -

[email protected]

ChinaUnix.net ----- Linux/Unix

10 15 20 WGA OGA () () XP XP ( ) () () (WGA OGA)() ( ) WGA OGA WGA OGA (EULA) XP

Linux ()() Windows Linux () OOo 3.0 OOo 3.0 Office ( Michael Meeks Measuring the true success of OpenOffice.org) OOo 3.0 Linux Linux Linux

20 XP , , , IT

10 15 2008 10

2008 10 - 38 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Office Linux Office Office Office

Office

Windows (WGA) Office (OGA) WGA OGA WGA OGA WGA OGA Windows Office WGA OGA WGA OGA Windows Office Windows Office 2008 10 - 39 -

WGA OGA WGA OGA WGA OGA Windows Office Windows Office

[email protected]

ChinaUnix.net ----- Linux/Unix

WGA OGA WGA OGA WGA OGA 3E Education()Engineering() Enforcement()

WGA OGA WGA OGA WGA OGA

CEO 10 20 WGA Office Office 20 WPS Office 200 WPS WPS WPSOffice WPSOffice Office Office WPS Office WPSOffice 2006 WPSOffice 56.2% 57 28 200 WPS1.0 Office Office WPS

2008 10 - 40 -

[email protected]

ChinaUnix.net ----- Linux/Unix

*******************************************************************************************************

Linux shell -- shell CU

LINUX UNIX SHELL 14 shell bash shell 3 Chapter 3. Customizing Your Environment 2008-10-21 LINUX UNIX SHELL

shell shell shell shell 4 shell shell

Variable-name =value Variable-name Variable-name +value Variable-name Variable-name:?value Variable-name Variable-name ?value Variable-name Variable-name:= value Variable-name e Variable-name :- value Variable-name shell

2008 10 - 41 -

[email protected]

ChinaUnix.net ----- Linux/Unix

, ]# HELLO='Hello World!' ]# echo $HELLO Hello World! ]# echo ${HELLO}; Hello World!

set shell unset : ]# HELLO='Hello World!' ]# readonly HELLO ]# HELLO="YES" -bash: HELLO: readonly variable

(), shell profile /etc/profile profile export env PATH=$PATH:$HOME/bin:/usr/local/ActiveTcl/bin:/home/meil/program/expect export PATH unset Brourne shell /etc/profile shell CDPATH: cd EXINIT:EXINIT vi HOME: passwd 2 IFS: shell LOGNAME: MAIL MAILCHECK 2008 10 - 42 [email protected]

ChinaUnix.net ----- Linux/Unix

MAILPATH PATH PS1: shell #$ PS2:PS2 > PS2 SHELL TERMINFO:/usr/lib/terminfo /usr/share/terminfo/ TERM: TERM vt100,vt200vt200-8 TZ : EDITOR PWD PAGER MAMPATH LPDEST PRINTER

$ H O M E. profile s e t - a set -a /etc/profile $ H O M E. profile . : 4 9 shift 14-2 shell $# $* 9 $$ I D $! I D $@ $# $- shell set $? 0

4 2008 10 - 43 [email protected]

ChinaUnix.net ----- Linux/Unix

9 shift $0-$9, $ 0 $# $* 9 $$ id $! id $@ $# $- shell set $? 0

3

3.1 .bash_profile, .bash_logout, and .bashrc .bash_profile source .bash_profile . source .bash_profile .bash_login.profile c shell Bourne shell .bashrc shell .bash_profile shell .bash_logout shell

3.2 alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' c shellbash = alias cdvoy='cd sipp/demo/animation/voyager' shell

3.3 -+ Option emacs Description Enters emacs editing mode (on by default)

ignoreeo Doesn't allow use of a single CTRL-D to log off; use the exit command to log off

2008 10 - 44 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Option f

Description immediately (this has the same effect as setting the shell variable IGNOREEOF=10)

noclobb Doesn't allow output redirection (>) to overwrite an existing file er noglob Doesn't expand filename wildcards like * and ? (wildcard expansion is sometimes called globbing)

nounset Indicates an error when trying to use a variable that is undefined vi Enters vi editing mode

B set o

shopt Option Meaning -p -s -u -q -o Displays a list of the settable options and their current values Sets each option name Unsets each option name Suppresses normal output; the return status indicates if a variable is set or unset Allows the values of the option names to be those defined for the -o option of the set command

Option

Meaning

If set, an argument to the cd built-in command that is not a directory is cdable_v assumed to be the name of a variable whose value is the directory to change ars to. If set, bash checks that a command found in the hash table exists before trying checkhas to execute it. If a hashed command no longer exists, a normal path search is h performed. cmdhist dotglob If set, bash attempts to save all lines of a multiple-line command in the same history entry. If set, bash includes filenames beginning with a . (dot) in the results of

2008 10 - 45 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Option

Meaning pathname expansion. If set, a non-interactive shell will not exit if it cannot execute the file specified as an argument to the exec command. An interactive shell does not exit if exec fails.

execfail

histappen If set, the history list is appended to the file named by the value of the HISTFILE d variable when the shell exits, rather than overwriting the file. If set, and the cmdhist option is enabled, multiline commands are saved to the history with embedded newlines, rather than using semicolon separators where possible.

lithist

If set, and a file that bash is checking for mail has been accessed since the last mailwarn time it was checked, the message "The mail in mailfile has been read" is displayed.

3.4 shell fred='Four spaces between these # echo "$fred" Four spaces between these # echo $fred Four spaces between these words. shell shell words. words.'

Table 3-4. Editing mode variables Variable HISTCMD HISTCONTROL Meaning The history number of the current command. A list of patterns, separated by colons (:), which can have the following values. ignorespace: lines beginning with a space are not

2008 10 - 46 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Table 3-4. Editing mode variables Variable Meaning entered into the history list. ignoredups: lines matching the last history line are not entered. erasedups: all previous lines matching the current line are removed from the history list before the line is saved. ignoreboth: enables both ignorespace and ignoredups.[8] A list of patterns, separated by colons (:), used to decide which command lines to save in the history list. Patterns are considered to start at the beginning of the command line and must fully specify the line, i.e., no wildcard (*) is implicitly appended. The patterns are checked against the line after HISTCONTROL is applied. An ampersand (&) matches the previous line. An explicit & may be generated by escaping it with a backslash.[9] HISTFILE Name of history file in which the command history is saved. The default is ~/.bash_history. The maximum number of lines to store in the history file. The default is 500. When this variable is assigned a value, the history file is truncated, if necessary, to the given number of lines. The maximum number of commands to remember in the command history. The default is 500. If it is set and not null, its value is used as a format string for strftime(3) to print the time stamp associated with each history entry displayed by the history command. Time stamps are written to the history file so they may be preserved across shell sessions.[10] FCEDIT Pathname of the editor to use with the fc command.

HISTIGNORE

HISTFILESIZE

HISTSIZE

HISTTIMEFORMAT

HISTSIZE HISTCONTROL ignoredups HISTIGNORE &l*:& HISTTIMEFORMAT HISTTIMEFORMAT="%y/%m/%d %T "

2008 10 - 47 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Table 3-5. Time stamp formats Format Replaced by %a %A %b %B %c %C %d %D %e %h %H %I %j %m %M %n %p %r %R %S %t %T The locale's abbreviated weekday name The locale's full weekday name The locale's abbreviated month name The locale's full month name The locale's appropriate date and time representation The century number (the year divided by 100 and truncated to an integer) as a decimal number [00-99] The day of the month as a decimal number [01-31] The date in American format; the same value as %m/%d/%y. The day of the month as a decimal number [1-31]; a single digit is preceded by a space The same as %b The hour (24-hour clock) as a decimal number [00-23] The hour (12-hour clock) as a decimal number [01-12] The day of the year as a decimal number [001-366] The month as a decimal number [01-12] The minute as a decimal number [00-59] A newline character The locale's equivalent of either a.m. or p.m The time in a.m. and p.m. notation; in the POSIX locale this is equivalent to %I:%M: %S %p The time in 24-hour notation (%H:%M) The second as a decimal number [00-61] A tab character The time (%H:%M:%S)

2008 10 - 48 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Table 3-5. Time stamp formats Format Replaced by %u %U The weekday as a decimal number [1-7], with 1 representing Monday The week number of the year (Sunday as the first day of the week) as a decimal number [00-53] The week number of the year (Monday as the first day of the week) as a decimal number [01-53]; if the week containing 1 January has four or more days in the new year, then it is considered week 1otherwise, it is the last week of the previous year, and the next week is week 1 The weekday as a decimal number [0-6], with 0 representing Sunday The week number of the year (Monday as the first day of the week) as a decimal number [00-53]; all days in a new year preceding the first Monday are considered to be in week 0 The locale's appropriate date representation The locale's appropriate time representation The year without century as a decimal number [00-99] The year with century as a decimal number The timezone name or abbreviation, or by nothing if no timezone information exists %

%V

%w

%W

%x %X %y %Y %Z %%

Shell bash "you have new mail"BSD biff

Table 3-6. Mail variables Variable MAIL MAILCHECK MAILPATH Meaning Name of file to check for incoming mail How often, in seconds, to check for new mail (default 60 seconds) List of filenames, separated by colons (:), to check for incoming mail

mailers mail MAILPATH bash 2008 10 - 49 [email protected]

ChinaUnix.net ----- Linux/Unix

MAILPATH MAILPATH=/usr/mail/you/martin:/usr/mail/you/geoffm:\ /usr/mail/you/paulr

Shell 4 PS1, PS2, PS3, and PS4PS1 "\s-\v\$ ". PS1="\u--> "PS1="\u \!--> "alice 1>, alice 2> PS1="\w--> " Table 3-7. Prompt string customizations Comman Meaning d \a \A \d \D {format} \e \H \h \j \l \n \r \s \T \t \@ \u The ASCII bell character (007) The current time in 24-hour HH:MM format The date in "Weekday Month Day" format The format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation; the braces are required The ASCII escape character (033) The hostname The hostname up to the first "." The number of jobs currently managed by the shell The basename of the shell's terminal device name A carriage return and line feed A carriage return The name of the shell The current time in 12-hour HH:MM:SS format The current time in HH:MM:SS format The current time in 12-hour a.m./p.m. format The username of the current user

2008 10 - 50 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Table 3-7. Prompt string customizations Comman Meaning d \v \V \w \W \# \! \$ \nnn \\ \[ \] The version of bash (e.g., 2.00) The release of bash; the version and patchlevel (e.g., 2.00.0) The current working directory The basename of the current working directory The command number of the current command The history number of the current command If the effective UID is 0, print a #, otherwise print a $ Character code in octal Print a backslash Begin a sequence of non-printing characters, such as terminal control sequences End a sequence of non-printing characters

PS2 2 PS3 and PS4 shell 59

PATH hash PATH #hash hits 1 1 1 5 1 command /bin/grep /bin/chmod /usr/bin/vim /usr/bin/ssh /bin/ls

2008 10 - 51 -

[email protected]

ChinaUnix.net ----- Linux/Unix

CDPATH # pwd /root/temp [root@localhost temp]# CDPATH=/usr/local/rss [root@localhost temp]# cd bin /usr/local/rss/bin [root@localhost bin]# pwd /usr/local/rss/bin shopt cdable_vars Table 3-8. Status variables Variable HOME SECONDS BASH BASH_VERSION BASH_VERSINFO PWD OLDPWD Meaning Name of your home (login) directory Number of seconds since the shell was invoked Pathname of this instance of the shell you are running The version number of the shell you are running An array of version information for the shell you are running Current directory Previous directory before the last cd command

3.5 shell vi emacs TERM Unix EDITOR VISUAL export set -a or set -o allexport export varnames export wonderland=alice 2008 10 - 52 -

[email protected]

ChinaUnix.net ----- Linux/Unix

varname=value command TERM=trythisone emacs filename Export export p Variable COLUMNS EDITOR LINES SHELL TERM /usr/share/terminfoTERM .bashrc Meaning The number of columns your display has[22] Pathname of your text editor The number of lines your display has Pathname of the shell you are running The type of terminal that you are using

LVS CU jerrywjl

LVS aLinux Virtual Server IP Red Hat Cluster Suite LVSLinux Virtual Server LVS / IP LVS Director LVS RouterReal-server LVS real-server LVS Router real-server

2008 10 - 53 -

[email protected]

ChinaUnix.net ----- Linux/Unix

real server IP IP LVS Real-server ftp, http, dns, telnet, nntp, smtp Real-Server LVS Director Real-Server Load Balancer IP IPVIP bLinux Virtual Server LVS IP IP Network Address Translation VS/NAT Virtual Server via Network Address Translation IP Cisco LocalDirectorF5 Big/IP Alteon ACEDirector VS/NAT IP VS/TUNVirtual Server via IP Tunneling VS/DRVirtual Server via Direct Routing IPVS IP Virtual Server via Network Address TranslationVS/NAT Red Hat LVS HA NAT

NAT LVS

2008 10 - 54 -

[email protected]

ChinaUnix.net ----- Linux/Unix

http://www.redhat.com/docs/enUS/Red_Hat_Enterprise_Linux/5.2/html/Virtual_Server_Administration/s2-lvs-nat-VSA.html Virtual Server via Direct RoutingVS/DR VS/DR MAC VS/TUN VS/DR IP IP

DR LVS http://www.redhat.com/docs/enUS/Red_Hat_Enterprise_Linux/5.2/html/Virtual_Server_Administration/s2-lvs-directroutingVSA.html Virtual Server via IP TunnelingVS/TUN NAT IP VS/TUN 10 Tunnel LVS Debug LVS NAT DR LVS

2008 10 - 55 -

[email protected]

ChinaUnix.net ----- Linux/Unix

cLinux Virtual Server LVS IP LVS 1 load balancer IP IP server pool WEBMAILFTP DNS shared storage Single Entry Point IP IP Linux 100Mbps Myrinet Gigabit Linux LVS LVS LVS LVS pulselvsipvsadm nany/etc/sysconfig/ha/ lvs.cf piranha configuration tooly IP arp send_arp pulse LVS LVS /etc/sysconfig/ha/lvs.cf router pulse LVS router pulse router router router pulse router LVS send_arp IP router MAC lvs router /etc/sysconfig/ha/lvs.cf lvsadm

2008 10 - 56 -

[email protected]

ChinaUnix.net ----- Linux/Unix

ipvs LVS nanny nanny lvs ipvsadm IPVS ipvsadm kernel IPVS IPVS nanny LVS Router LVS Router piranha configuration tool /etc/sysconfig/ha/lvs.cf send_arp IP LVS router arp

Redhat DHCP Server CU DHCP 80/20 80% 20% 20% DHCP Red Hat Enterprise Linux AS release 4 (Nahant Update 5) DHCP 2 4 CPU8G 8 DHCP 5 -- dhcp-3.0.1-59.EL4.i386.rpm

DHCP DHCP-Failover failover /etc/dhcpd.conf /etc/dhcpd.master /etc/dhcpd.conf /etc/dhcpd.conf authoritative; ddns-update-style interim; ignore client-updates;

2008 10 - 57 -

[email protected]

ChinaUnix.net ----- Linux/Unix

one-lease-per-client true; failover peer "dhcp" { primary; address 10.14.0.9; port 520; peer address 10.14.0.13; peer port 519; max-response-delay 60; max-unacked-updates 10; mclt 600; split 128; load balance max seconds 3; } include "/etc/dhcpd.master"; /etc/dhcpd.conf authoritative; ddns-update-style interim; ignore client-updates; one-lease-per-client true; failover peer "dhcp" { secondary; address 10.14.0.13; port 519; peer address 10.14.0.9; peer port 520; max-response-delay 60; max-unacked-updates 10; } include "/etc/dhcpd.master";

2008 10 - 58 -

[email protected]

ChinaUnix.net ----- Linux/Unix

1 dhcp server ntp 2Dhcp Failover dhcp Failover subnet x.x.x.x netmask 255.255.255.248 { }Bonding Failover Failover

Dhcp01

Dhcp02

/etc/dhcpd.conf authoritative; ddns-update-style interim; ignore client-updates; one-lease-per-client true; failover peer "dhcp" { primary; address 10.14.0.9; port 520; peer address 10.14.0.13; peer port 519; max-response-delay 60; DNS 3 1 DNS 2 failover dhcp 60

2008 10 - 59 -

[email protected]

ChinaUnix.net ----- Linux/Unix

3 max-unacked-updates 20; mclt 3600; split 128; load balance max seconds 3; } include "/etc/dhcpd.master"; 1 style interim()ad-hoc none 2 trueenabled DHCPREQUEST DHCPREQUEST DHCPREQUEST 3 1 180 /etc/dhcpd.master option domain-name-servers 10.14.0.9,10.14.0.13; default-lease-time 21600; max-lease-time 43200; 6 20 3600 0256128

subnet 10.14.0.8 netmask 255.255.255.248 { option routers 10.14.0.14; pool { failover peer "dhcp"; range 10.14.0.11 10.14.0.12; deny dynamic bootp clients; } }

/ dhcp failover range bootp

#shuniu 2008 10 - 60 [email protected]

ChinaUnix.net ----- Linux/Unix

subnet 10.0.0.0 netmask 255.255.224.0 { option routers 10.0.31.254; pool { failover peer "dhcp"; range 10.0.0.1 10.0.31.250; deny dynamic bootp clients; } } ......

1 dhcp # service dhcpd start 2 # chkconfig dhcpd on 3 # netstat -anutp | grep dhcpd udp 0 0 0.0.0.0:67 0.0.0.0:* 6581/dhcpd

4 # cat /var/lib/dhcp/dhcpd.leases 3.1 dhcpd /var/lib/dhcpd.leases dhcpd.leases~ 3.2 DHCP # service dhcpd congrestart 3.3 DHCP # tail -f /var/log/messages 2008 10 - 61 [email protected]

ChinaUnix.net ----- Linux/Unix

DHCP-RELAY 3.4 1 dhcp 2 2 dhcp ntp

RedHat 5.0 YUM CU anmyyang Yum Yellow dog Updater, Modified Fedora Shell RPM RPM YUM 1 YUM Client: yum-3.0.1-5.el5 yum-metadata-parser-1.0-8.fc6 2 YUM Server yum-3.0.1-5.el5 yum-metadata-parser-1.0-8.fc6 yum-rhn-plugin-0.4.3-1.el5 yum-updatesd-3.0.1-5.el5 createrepo-0.4.4-2.fc6.noarch.rpm yum-arch-2.2.2-2.fc7.noarch.rpm yum 1 YUM redhatES5 /mnt /rhel5 [root@ns100 vmware]# mkdir /rhel5 Server /rhel5, Server rhel5 5G /rhel5 [root@ns100 vmware]# cp -R /mnt/Server /rhel5 key [root@ns100 vmware]# cp /mnt/RPM-GPG-KEY-redhat-release /rhel5/Server iso () /mnt 2008 10 - 62 [email protected]

ChinaUnix.net ----- Linux/Unix

mount -o loop redhat.iso /mnt /mnt 2 YUM [root@ns100 vmware]# yum-arch /rhel5/Server [root@ns100 vmware]# createrepo /rhel5/Server 3 www /etc/httpd/conf/httpd.conf httpd setenforce 0 SELinux DocumentRoot "/var/www/html" DocumentRoot "/rhel5" http [root@localhost ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] 4 1 /etc/yum.repos.d/ Server.repo /etc/yum.conf yum.conf Client: .repo [root@network yum.repos.d]# mkdir -p /etc/yum.repos.d/backup [root@network yum.repos.d]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup [root@network yum.repos.d]# touch /etc/yum.repos.d/Server.repo [root@network yum.repos.d]# cat /etc/yum.repos.d/Server.repo yum.conf [Server] name=Red Hat baseurl=http://10.0.0.1/Server/ gpgcheck=1 gpgkey=http://10.0.0.1/Server/RPM-GPG-KEY-redhat-release 2 /etc/rhel-debuginfo.repo baseurl=http://10.0.0.1/Server/ enabled=1 5 2008 10 - 63 [email protected]

ChinaUnix.net ----- Linux/Unix

yum install dasher yum -y install firefox yes yum remove httpd yum clean all yum list YUM yum upgrade yum update yum list installed yum list available yum list updates

FTP YUM 1 redhatES5 /mnt [root@ns100 vmware]# cp -R /mnt/Server /var/ftp/Server [root@ns100 vmware]# cp /mnt/RPM-GPG-KEY-redhat-release /var/ftp/Server 2 [root@ns100 vmware]# yum-arch /var/ftp/Server [root@ns100 vmware]# createrepo /var/ftp/Server 3 yum.conf [root@ns100 vmware]# cat /etc/yum.conf [main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 4 vsftp service vsftpd restart 5 2008 10 - 64 [email protected]

ChinaUnix.net ----- Linux/Unix

1 /etc/yum.repos.d/ Server.repo /etc/yum.conf yum.conf Client: [root@network yum.repos.d]# mkdir -p /etc/yum.repos.d/backup [root@network yum.repos.d]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup [root@network yum.repos.d]# touch /etc/yum.repos.d/Server.repo [root@network yum.repos.d]# cat /etc/yum.repos.d/Server.repo yum.conf [Server] name=Red Hat baseurl=ftp://10.0.0.1/Server/ gpgcheck=1 gpgkey=ftp://10.0.0.1/Server/RPM-GPG-KEY-redhat-release 2 /etc/rhel-debuginfo.repo baseurl=ftp://10.0.0.1/Server/ enabled=1

VPN(pptp+radius+mysql) CU vrlinux.cn pptp+radius+mysql linux,, 2.6 RHEL5 beta1, 2.6.18-1.2747.el5xen MPPE

mppe modprobe ppp-compress-18 && echo ok ok mppe

mppe http://sourceforge.net/project/showfiles.php?group_id=44827 2 rpm dkms-2.0.10-1.noarch.rpm 2008 10 - 65 [email protected]

ChinaUnix.net ----- Linux/Unix

kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm dkms kernel_ppp_mppe mppe OK

pppd RPM ppp-2.4.3-5.rhel4.i386.rpm, FC http://samba.org/ppp/download.html ppp-2.4.4b1.tar.gz mppe http://mppe-mppc.alphacron.de/#AEN56 ppp pppd mppe [root@localhost]# strings `which pppd`|grep -i mppe|wc --lines 42 36, tar -zxvf ... configure,make,make install make install-etcppp

pptpd http://sourceforge.net/project/showfiles.php?group_id=44827 , pptpd-1.3.4.tar.gz RPM pptpd-1.3.3-1.rhel4.i386.rpm,FC6 tar -zxvf ... configure,make,make install

pppd /etc/ppp pptpd /etc/pptpd.conf pptpd.conf localip 10.10.10.1 remoteip 10.10.110.2-100 2008 10 - 66 [email protected]

ChinaUnix.net ----- Linux/Unix

localip pptpd ip ip remoteip ip - ip

/etc/ppp/chap-secrets # Secrets for authentication using CHAP # client server secret IP addresses

test pptpd test * /etc/ppp/options.pp mppe, debug dump ,/var/log/messages pptpd XP VPN radius http://www.freeradius.org freeradius-server-2.0.4.tar.bz2 1.X 2.X , 1.X 2.X

tar -zxvf ...,configure,make,make install

pppd /etc/radiusclient/ cp -R ppp-2.4.4b1/pppd/plugins/radius/etc /etc/radiusclient/

options.pptpd plugin /usr/local/lib/pppd/2.4.4b1/radius.so

/etc/radiusclient servers radiusclient.conf servers radiusd

2008 10 - 67 -

[email protected]

ChinaUnix.net ----- Linux/Unix

localhost

vpn

localhost radiusd vpn

radiusclient.conf authserver acctserver localhost:1812 localhost:1813

radiusclient /etc/radiusclient

freeradius freeradius/etc/raddb clients.conf nas radiusd clientnas pptpd pptpd client 127.0.0.1 {

secret = vpn shortname = mm nastype } = other

127.0.0.1 secret /etc/radiusclient servers

users ww Auth-Type:= MS-CHAP, User-Password=="ww", Simultaneous-Use:=1 Service-Type = Framed-User, Framed-Protocol = PPP, Framed-IP-Address = 255.255.255.254, Framed-IP-Netmask = 255.255.255.0

ww auth-type 2008 10 - 68 [email protected]

ChinaUnix.net ----- Linux/Unix

ww Simultaneous-Use

check tab radius pptpd reply ip 255.255 debug radiusd sbin/radiusd -x

XP VPN , ww

mysql mysql . radius , freeradius16/share/doc/freeradius/examples/mysql.sql sql.conf etc/raddb sql.conf # Connect info server = "192.168.8.53" login = "radius" password = "radius"

# Database table configuration radius_db = "radius"

simul# sql # Uncomment simul_count_query to enable simultaneous use checking simul_count_query = "SELECT COUNT(*) FROM ${acct_table1} WHERE UserName='% {SQL-User-Name}' AND AcctStopTime = 0"

2008 10 - 69 -

[email protected]

ChinaUnix.net ----- Linux/Unix

radiusd.conf

authorize { files sql

preacct { files

accounting { radutmp sql #

session{ radutmp sql #

post-auth { sql # files sql

usergroup test vpn radgroupcheck vpn attribute Simultaneous-Use op := value 1

radcheck username test

2008 10 - 70 -

[email protected]

ChinaUnix.net ----- Linux/Unix

attribute User-Password op == value test test vpn test 1

debug radiusd

http://www.chinaunix.net/jh/50/698648.html, i_amok

Squid MySQL IP CU geekjim Squid Proxy MySQL IP GPL v2 I. Red Hat Enterprise Linux AS 4 Unix/Linux Squid 2.5 MySQL 3.0 or 4.x MySQL_auth ip_user (ip_user Linux Squid ) MySQL_Auth ip_user IP

II. squid # rpm -q squid squid-2.5.STABLExxxx-xxxx

III. MySQL_Auth MySQL_auth Homepage: http://people.arxnet.hu/airween/mysql.auth/ mysql_auth-0.8.tar.gz

IV. ip_user ( squid ) 2008 10 - 71 [email protected]

ChinaUnix.net ----- Linux/Unix

ip_user Hompage: geekbunker.org/rodrigo/ip_user.html ip_user 1.0

V. MySQL_Auth, MySQL a. MySQL_Auth $ tar -xzvf mysql_auth-0.8.tar.gz $ cd mysql_auth-0.8 $ make /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make: *** [mysql_auth] Error 1 Makefile libmysqlclient /usr/lib/mysql, /usr/local/lib, Makefile, CFLAGS /usr/lib/mysql : CFLAGS CFLAGS = -I/usr/local/include -L/usr/local/lib -L /usr/lib/mysql Makefile, vi (or emacs or nano or joe or whatever) make $ make . $ su 0,BOOLEAN->0 B. 5.0 6. A. B. 7. A. B. 0 1 0 1

Nginx 0.7.x + PHP 5.2.6FastCGI Web Nginx + PHPFastCGIWeb 4 Nginx + PHP Nginx Nginx 0.7.x 3 Nginx 0.7.x Nginx ("engine x") HTTP IMAP/POP3/SMTP Nginx Igor Sysoev Rambler.ru Igor BSD Nginx Apache Nginx Web 2008 10 - 86 [email protected]

ChinaUnix.net ----- Linux/Unix

56.com Discuz!YUPOO SNS Web 2.0 Nginx http://wiki.codemongers.com/NginxChs Nginx Apache Nginx 7 Nginx 0.7.17 + PHP 5.2.6 (FastCGI) 3 Apache 10 4GB +Apacheprefork 3000 3GB 1GB Apache MaxClients 4000 Apache 3800 Swap Nginx 0.7.17 + PHP 5.2.6 (FastCGI) 3 10 Nginx 150M 15M*10=150M 64 php-cgi 1280M 20M*64=1280M 2GB 25 php-cgi php-cgi 500M 3 Nginx 0.7.17 + PHP 5.2.6 (FastCGI) PHP Nginx 28457 Nginx Nginx

Nginx + PHP5FastCGI PHP Nginx + PHP5FastCGI PHP 700 / 6000 700*60*60*24=60480000

2008 10 - 87 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Linux 2.6+ Linux CentOS 5.1 RedHat AS4

1 CentOS Linux yum RedHat Linux RPM sudo -s LANG=C yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel

2RedHat Linux RPM rpm -qa | grep libjpeg RPM xxx-devel RedHat CentOS RPM RPM RedHat AS4 & CentOS 4 http://mirror.be10.com/centos/4/os/i386/CentOS/RPMS/ http://mirror.be10.com/centos/4/os/x86_64/CentOS/RPMS/ RedHat AS5 & CentOS 5 http://mirror.be10.com/centos/5/os/i386/CentOS/ http://mirror.be10.com/centos/5/os/x86_64/CentOS/ RPM

2008 10 - 88 -

[email protected]

ChinaUnix.net ----- Linux/Unix

http://rpm.pbone.net/ http://www.rpmfind.net/ 3 2008 8 28 mkdir -p /data0/software cd /data0/software wget http://sysoev.ru/nginx/nginx-0.7.17.tar.gz wget http://www.php.net/get/php-5.2.6.tar.gz/from/this/mirror wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.9.diff.gz #wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.26rc.tar.gz/from/http://mirror.x10.com/mirror/mysql/ wget http://blog.s135.com/soft/linux/mysql/mysql-5.1.26-rc.tar.gz wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz #wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz? modtime=1171868460&big_mirror=0" wget http://mirror.optus.net/sourceforge/m/mc/mcrypt/libmcrypt-2.5.8.tar.gz #wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.7.tar.gz? modtime=1194463373&big_mirror=0" wget http://mirror.optus.net/sourceforge/m/mc/mcrypt/mcrypt-2.6.7.tar.gz wget http://pecl.php.net/get/memcache-2.2.3.tgz #wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.tar.gz? modtime=1175740843&big_mirror=0" wget http://mirror.optus.net/sourceforge/m/mh/mhash/mhash-0.9.9.tar.gz wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.7.tar.gz wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2

PHP 5.2.6FastCGI 1 PHP 5.2.6 tar zxvf libiconv-1.12.tar.gz cd libiconv-1.12/ ./configure --prefix=/usr/local make

2008 10 - 89 -

[email protected]

ChinaUnix.net ----- Linux/Unix

make install cd ../

tar zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8/ ./configure make make install /sbin/ldconfig cd libltdl/ ./configure --enable-ltdl-install make make install cd ../../

tar zxvf mhash-0.9.9.tar.gz cd mhash-0.9.9/ ./configure make make install cd ../

cp /usr/local/lib/libmcrypt.* /usr/lib ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

tar zxvf mcrypt-2.6.7.tar.gz cd mcrypt-2.6.7/ ./configure make make install cd ../

2008 10 - 90 -

[email protected]

ChinaUnix.net ----- Linux/Unix

2 MySQL 5.1.26-rc /usr/sbin/groupadd mysql /usr/sbin/useradd -g mysql mysql tar zxvf mysql-5.1.26-rc.tar.gz cd mysql-5.1.26-rc/ ./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extracharsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile make && make install chmod +w /usr/local/webserver/mysql chown -R mysql:mysql /usr/local/webserver/mysql cp support-files/my-medium.cnf /usr/local/webserver/mysql/my.cnf cd ../ MySQL PHP MySQL MySQL mysql /usr/local/webserver/mysql/bin/mysql_install_db --defaultsfile=/usr/local/webserver/mysql/my.cnf --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data --user=mysql --pidfile=/usr/local/webserver/mysql/mysql.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock MySQL& /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaultsfile=/usr/local/webserver/mysql/my.cnf &

3 PHPFastCGI tar zxvf php-5.2.6.tar.gz gzip -cd php-5.2.6-fpm-0.5.9.diff.gz | patch -d php-5.2.6 -p1 cd php-5.2.6/ ./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/ php/etc --with-mysql=/usr/local/webserver/mysql --withmysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-

2008 10 - 91 -

[email protected]

ChinaUnix.net ----- Linux/Unix

freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enableshmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enablembstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl sed -i 's#-lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt#& -liconv#' Makefile make make install cp php.ini-dist /usr/local/webserver/php/etc/php.ini cd ../

4 PHP5 tar zxvf memcache-2.2.3.tgz cd memcache-2.2.3/ /usr/local/webserver/php/bin/phpize ./configure --with-php-config=/usr/local/webserver/php/bin/php-config make make install cd ../

tar jxvf eaccelerator-0.9.5.3.tar.bz2 cd eaccelerator-0.9.5.3/ /usr/local/webserver/php/bin/phpize ./configure --enable-eaccelerator=shared --with-phpconfig=/usr/local/webserver/php/bin/php-config make make install cd ../

5 php.ini /usr/local/webserver/php/etc/php.ini extension_dir = "./" extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-nonzts-20060613/" 2008 10 - 92 [email protected]

ChinaUnix.net ----- Linux/Unix

extension = "memcache.so" output_buffering = Off output_buffering = On shell php.ini sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/webserver/php/lib/php/extensions/ no-debug-non-zts-20060613/"\nextension = "memcache.so"\n#' /usr/local/webserver/php/etc/php.ini sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/webserver/php/etc/php.ini

6 eAccelerator PHP mkdir -p /usr/local/webserver/eaccelerator_cache vi /usr/local/webserver/php/etc/php.ini shift+g [eaccelerator] zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-nonzts-20060613/eaccelerator.so" eaccelerator.shm_size="128" eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="300" eaccelerator.shm_prune_period="120" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"

2008 10 - 93 -

[email protected]

ChinaUnix.net ----- Linux/Unix

vi /etc/sysctl.conf kernel.shmmax = 134217728 /sbin/sysctl -p

7 www blog.s135.com www.s135.com /usr/sbin/groupadd www -g 48 /usr/sbin/useradd -u 48 -g www www mkdir -p /data0/htdocs/blog chmod +w /data0/htdocs/blog chown -R www:www /data0/htdocs/blog mkdir -p /data0/htdocs/www chmod +w /data0/htdocs/www chown -R www:www /data0/htdocs/www

8 php-fpm php-fpm PHP FastCGI php.ini php-cgi /usr/local/webserver/php/etc/ php-fpm.conf rm -f /usr/local/webserver/php/etc/php-fpm.conf vi /usr/local/webserver/php/etc/php-fpm.conf Nginx + PHP 01 PHP Nginx 500 1. 2. 3. 4. All relative paths in this config are relative to php's install prefix 5. 6. 7. 2008 10 - 94 [email protected]

ChinaUnix.net ----- Linux/Unix

8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29.

Pid file /usr/local/webserver/php/logs/php-fpm.pid

Error log file /usr/local/webserver/php/logs/php-fpm.log

Log level notice

When this amount of php processes exited with SIGSEGV or SIGBUS ... 10

... in a less than this interval of time, a graceful restart will be initiated. Useful to work around accidental curruptions in accelerator's shared memory. 1m

Time limit on waiting child's reaction on signals from master 5s

Set to 'no' to debug fpm yes

30. 31. 32. 33. 34. 35. 36. 37. 38. Name of pool. Used in logs and stats. default

2008 10 - 95 -

[email protected]

ChinaUnix.net ----- Linux/Unix

39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. server. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68.

Address to accept fastcgi requests on. Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' 127.0.0.1:9000

Set listen(2) backlog -1

Set permissions for unix socket, if one used. In Linux read/write permissions must be set in order to allow connections from web Many BSD-derrived systems allow connections regardless of permissions. 0666

Additional php.ini defines, specific to this pool of workers. /usr/sbin/sendmail -t -i 1

Unix user of processes www

Unix group of processes www

Process manager settings

2008 10 - 96 -

[email protected]

ChinaUnix.net ----- Linux/Unix

69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99.

Sets style of controling worker process count. Valid values are 'static' and 'apache-like' static

Sets the limit on the number of simultaneous requests that will be served. Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. 128

Settings group for 'apache-like' pm style

Sets the number of server processes created on startup. Used only when 'apache-like' pm_style is selected 20

Sets the desired minimum number of idle server processes. Used only when 'apache-like' pm_style is selected 5

Sets the desired maximum number of idle server processes. Used only when 'apache-like' pm_style is selected 35

2008 10 - 97 -

[email protected]

ChinaUnix.net ----- Linux/Unix

100. The timeout (in seconds) for serving a single request after which the worker process will be terminated 101. Should be used when 'max_execution_time' ini option does not stop script execution for some reason 102. 103. 104. 105. The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. How much requests each process should execute before [email protected]

'0s' means 'off' 0s

'0s' means 'off' 0s

The log file for slow requests logs/slow.log

Set open file desc rlimit 51200

Set max core size rlimit 0

Chroot to this directory at the start, absolute path

Chdir to this directory at the start, absolute path

Redirect workers' stdout and stderr into main error log. If not set, they will be redirected to /dev/null, according to FastCGI specs yes

2008 10 - 98 -

ChinaUnix.net ----- Linux/Unix

129. 130. 131. 132. 133.

Useful to work around memory leaks in 3rd party libraries. For endless request processing please specify 0 Equivalent to PHP_FCGI_MAX_REQUESTS 10240

134. Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. Pass environment variables like LD_LIBRARY_PATH All $VARIABLEs are taken from current environment $HOSTNAME /usr/local/bin:/usr/bin:/bin /tmp /tmp /tmp $OSTYPE $MACHTYPE 2 Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) Makes sense only with AF_INET listening socket. 127.0.0.1

9 php-cgi 127.0.0.1 9000 200 3GB 64 www 2008 10 - 99 [email protected]

ChinaUnix.net ----- Linux/Unix

ulimit -SHn 51200 /usr/local/webserver/php/sbin/php-fpm start /usr/local/webserver/php/sbin/php-fpm start|stop|quit|restart| reload|logrotate php.ini php-cgi reload

Nginx 0.7.17 1 Nginx pcre tar zxvf pcre-7.7.tar.gz cd pcre-7.7/ ./configure make && make install cd ../

2 Nginx tar zxvf nginx-0.7.17.tar.gz cd nginx-0.7.17/ ./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --withhttp_stub_status_module --with-http_ssl_module make && make install cd ../

3 Nginx mkdir -p /data1/logs chmod +w /data1/logs chown -R www:www /data1/logs

4 Nginx /usr/local/webserver/nginx/conf/ nginx.conf rm -f /usr/local/webserver/nginx/conf/nginx.conf vi /usr/local/webserver/nginx/conf/nginx.conf

2008 10 - 100 [email protected]

ChinaUnix.net ----- Linux/Unix

user www www; worker_processes 8; error_log /data1/logs/nginx_error.log crit; pid /usr/local/webserver/nginx/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; } http { include mime.types;

default_type application/octet-stream; #charset gb2312; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; sendfile on; tcp_nopush on;

keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k;

2008 10 - 101 -

[email protected]

ChinaUnix.net ----- Linux/Unix

gzip on; gzip_min_length 1k; gzip_buffers 4 16k;

gzip_http_version 1.0; gzip_comp_level 2; gzip_types gzip_vary on; text/plain application/x-javascript text/css application/xml;

#limit_zone crawler $binary_remote_addr 10m; server { listen 80;

server_name blog.s135.com; index index.html index.htm index.php; root /data0/htdocs/blog; #limit_conn crawler 20; location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires } location ~ .*\.(js|css)?$ { expires } 1h; 30d;

2008 10 - 102 -

[email protected]

ChinaUnix.net ----- Linux/Unix

log_format access '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; access_log /data1/logs/access.log access; }

server { listen 80;

server_name www.s135.com; index index.html index.htm index.php; root /data0/htdocs/www;

location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } log_format wwwlogs '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; access_log /data1/logs/wwwlogs.log wwwlogs; } server { listen 80; server_name status.blog.s135.com;

2008 10 - 103 -

[email protected]

ChinaUnix.net ----- Linux/Unix

location / { stub_status on; access_log off; } } }

/usr/local/webserver/nginx/conf/ fcgi.conf vi /usr/local/webserver/nginx/conf/fcgi.conf fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx;

fastcgi_param QUERY_STRING fastcgi_param REQUEST_METHOD fastcgi_param CONTENT_TYPE fastcgi_param CONTENT_LENGTH

$query_string; $request_method; $content_type; $content_length;

fastcgi_param SCRIPT_FILENAME fastcgi_param SCRIPT_NAME fastcgi_param REQUEST_URI fastcgi_param DOCUMENT_URI fastcgi_param DOCUMENT_ROOT

$document_root$fastcgi_script_name; $fastcgi_script_name;

$request_uri; $document_uri; $document_root; $server_protocol;

fastcgi_param SERVER_PROTOCOL

fastcgi_param REMOTE_ADDR fastcgi_param REMOTE_PORT fastcgi_param SERVER_ADDR fastcgi_param SERVER_PORT fastcgi_param SERVER_NAME

$remote_addr; $remote_port; $server_addr; $server_port; $server_name;

2008 10 - 104 -

[email protected]

ChinaUnix.net ----- Linux/Unix

# PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200;

5 Nginx ulimit -SHn 51200 /usr/local/webserver/nginx/sbin/nginx

Nginx + PHP vi /etc/rc.local ulimit -SHn 51200 /usr/local/webserver/php/sbin/php-fpm start /usr/local/webserver/nginx/sbin/nginx

Linux vi /etc/sysctl.conf net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 300 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.ip_local_port_range = 5000 65000 /sbin/sysctl -p

Nginx Nginx 1/usr/local/webserver/nginx/conf/nginx.conf /usr/local/webserver/nginx/sbin/nginx -t

2008 10 - 105 -

[email protected]

ChinaUnix.net ----- Linux/Unix

the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully

2 Nginx ps -ef | grep "nginx: master process" | grep -v "grep" | awk -F ' ' '{print $2}' Nginx 6302 Nginx kill -HUP 6302 Nginx Pid kill -HUP `cat /usr/local/webserver/nginx/nginx.pid`

Nginx 1/usr/local/nginx/sbin/cut_nginx_log.sh vi /usr/local/nginx/sbin/cut_nginx_log.sh #!/bin/bash # This script run at 00:00 # The Nginx logs path logs_path="/usr/local/webserver/nginx/logs/" mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/ mv ${logs_path}access.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/access_$(date -d "yesterday" +"%Y%m%d").log kill -USR1 `cat /usr/local/webserver/nginx/nginx.pid`

2 crontab 00:00 nginx crontab -e 00 00 * * * /bin/bash /usr/local/nginx/sbin/cut_nginx_log.sh

2008 10 - 106 -

[email protected]

ChinaUnix.net ----- Linux/Unix

Ubuntu TracCU leo_ss_pku

Ubuntu Server 8.04 subversiontask/issue/bug trac eclipsesubclipseeclipse subversion pydevpython eclipse mylyn eclipse

Ubuntu trac Trac task/issue/bug SVN/CVS/BZR/HG Trac ubuntu trac Trac Ubuntu 8.04 Server $ sudo aptitude install trac * apache svn /etc/apache2/mod-available/dav_svn.conf $ sudo aptitude install libapache2-svn ubuntu tracapachesubversion trac BZR sudo aptitude install trac-bzr trac Trac 1 svn $ sudo mkdir -p /home/svn/repo $ sudo svnadmin create /home/svn/repo $ sudo chown -R www-data.www-data /home/svn/repo 2 Trac $ sudo mkdir -p /home/trac/myproject $ sudo trac-admin /home/trac/myproject initevn trac-admin svn /home/svn/repo $ sudo chown -R www-data.www-data /home/trac/myproject 3 apache $ ln -s /usr/share/trac/cgi-bin/trac.cgi /usr/lib64/cgi-bin/trac.cgi trac $ cd /etc/apache2/conf.d 2008 10 - 107 [email protected]

ChinaUnix.net ----- Linux/Unix

$ sudo vi trac AllowOverride None Order allow,deny Allow from all SetEnv TRAC_ENV "/home/trac/myproject" SetEnv PYTHON_EGG_CACHE "/tmp" AuthType Basic AuthName "Leo's Projects" AuthUserFile /home/trac.htpasswd Require valid-user 4 trac.htpasswd $ htpasswd -c /home/trac.htpasswd leo New password: mypassword Re-type new password: mypassword Adding password for user leo 5 apache $ sudo /etc/init.d/apache2 restart http://localhost/cgi-bin/trac.cgi trac 6 tracrpcXML RPC webadminWEB tracpygments

CU BlueDavy LiveJournal ebay :) 2008 10 - 108 [email protected]

ChinaUnix.net ----- Linux/Unix

webserver

squid webserver OK squid

squid squid 2008 10 - 109 [email protected]

ChinaUnix.net ----- Linux/Unix

squid webserver squid ESI OK ESI

ESI ESI ESI

Map 2008 10 - 110 [email protected]

ChinaUnix.net ----- Linux/Unix

webserver webserver webserver webserver down webserver webserver 1 Apache LVS 2 session cookie session 3 4 webserver

linux ARP linuxheart-beat Cookie UDP NFS

2008 10 - 111 [email protected]

ChinaUnix.net ----- Linux/Unix

DAL ebay DAL

2008 10 - 112 -

[email protected]

ChinaUnix.net ----- Linux/Unix

hash consistenthash DAL webserver webserver apache webserver webserver 1Apache LVS web F5NetsclarAthelon 2 webserver 2008 10 - 113 [email protected]

ChinaUnix.net ----- Linux/Unix

webserver BigTable

2008 10 - 114 -

[email protected]

ChinaUnix.net ----- Linux/Unix

standby OS webserver webserver web N bug 1 2 3 2008 10 - 115 [email protected]

ChinaUnix.net ----- Linux/Unix

blog CDN

2008 10 - 116 -

[email protected]

ChinaUnix.net ----- Linux/Unix

******************************************************************************************************* 2.6 Bug network JAVA C++ GCC WEB C freebsd linux C i++++i DLL Linux UNIX Hash Linker Script in Linux FC8 mplayer CentOS YUM vim RHCE redhat linux netfilter Linux Vista RPM linux linux Linux 49 ubuntu linux windows Solaris Linux CTO VB100 : IT TD GPS Windows Office mysql 10 Linux Vista 40 i386 i686 LINUX Linux

2008 10 - 117 -

[email protected]