国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項超值服

開通VIP
Linux簡明系統(tǒng)維護(hù)手冊[zt]
前言
有同事已經(jīng)通過艱苦的工作完成了長達(dá)好幾百頁的關(guān)于Linux的文檔。事實(shí)上,在網(wǎng)上還有超過好幾萬頁的各種關(guān)于Linux的技術(shù)精華,還不包括英文的。有數(shù)萬程序員和網(wǎng)絡(luò)專家在為這個軟件努力工作。這就是自由的魅力。
我使用Linux有不少時間了,期間也經(jīng)歷過無數(shù)的挫折,同時也得到過很多高手的幫助。我一向喜歡言簡意賅的文字。通過下面的簡單句子和代碼,我希望能夠表達(dá)出我使用Linux的體會。也許本文的結(jié)構(gòu)比較凌亂,但我希望它的每一句話都是對你有用的。當(dāng)然,你要知道一些更詳細(xì)的東西,請參閱我同事寫的文檔。
當(dāng)然,能夠通過查閱這個文檔,使你的工作順利是我最大的心愿。
一、關(guān)于Linux的誤區(qū)
1、Linux干什么用?
首先,很少有人用Linux做桌面系統(tǒng),因為Windows桌面系統(tǒng)已經(jīng)足夠好了。我們主要把Linux用作網(wǎng)絡(luò)服務(wù)器的操作系統(tǒng)。如果你和你的應(yīng)用符合下面的幾條,那么你合適使用Linux:
*不愿意花錢在操作系統(tǒng)和網(wǎng)絡(luò)應(yīng)用上。
*用D版系統(tǒng)受良心譴責(zé)或害怕承擔(dān)責(zé)任。
*想得到和花錢的系統(tǒng)差不多的性能。
*在用戶面前顯得水平較高。
*認(rèn)識幾個弄Linux的高手,或者知道在哪里能夠找到問題答案。
2、每種Linux發(fā)行包差別很多嗎?
如果你在上世紀(jì)80年代末到95年之前這段時間大量使用PC機(jī)的話,那對于Linux你應(yīng)該很好理解:它就象一個有著32位搶先多任務(wù)核心的DOS,其區(qū)別在于外表看起來像是一種UNIX。Linux是好多人用智慧堆砌起來的,初學(xué)者經(jīng)常問:“RedHat好還是Slackware好?”。這個人同時還面臨上百種選擇,這的確讓人頭痛。大部分Linux發(fā)行包實(shí)際上很簡單,幾乎所有的發(fā)行包都有相同的內(nèi)核(也許是不同版本),外部命令和數(shù)據(jù)文件的差別也僅僅局限于在文件系統(tǒng)中的存放位置不同(這導(dǎo)致了某些兼容性問題,因為在某些地方找不到特定的文件嘛)。另外就是有些發(fā)行包為了顯示自己的卓而不群,在發(fā)行包中增加了一些自己的實(shí)用程序。實(shí)際上動手修改內(nèi)核的廠商不算太多,因為這樣會內(nèi)核官方版本的不斷更新而手忙腳亂。當(dāng)然有一些嵌入式系統(tǒng)開發(fā)商在 Linux基礎(chǔ)上做了自己的系統(tǒng)另說。
擁有眾多的發(fā)行包是Linux的一個很討厭的問題,在這一點(diǎn)上,我更喜歡FreeBSD,因為它只有一個官方發(fā)行版本,也運(yùn)行得比較穩(wěn)定。可給Linux做軟件的程序員太多了,Linux上面的資料也更多。記?。寒?dāng)一個家伙跟你說用哪個發(fā)行版本無所謂的時候,那他就是專家。
3、Linux業(yè)余愛好者的東西嗎?
這樣的宣傳給了很多人這樣的印象。其實(shí),Linux是一個嚴(yán)肅的操作系統(tǒng),擁有一切操作系統(tǒng)共有的特性。它可以用在很多嚴(yán)肅的場合。
4、Linux性能比Windows更好嗎?
這里的答案會讓你失望,據(jù)我以往的實(shí)際測試,2.2版本的Linux核心的性能比windows2000要低。值得欣慰的是2.4版本的核心性能有大幅度提高基本上接近了Windows2000。但Windows2000復(fù)雜的圖形界面占用了相當(dāng)?shù)南到y(tǒng)資源。
5、Linux比Windows更復(fù)雜更專業(yè)嗎?
從復(fù)雜度上說,Windows2000要比Linux復(fù)雜很多。在核心技術(shù)上,Windows也更先進(jìn)。
6、Linux更可靠嗎?
應(yīng)該從兩個角度評價系統(tǒng)的可靠性。(1)系統(tǒng)自身的可靠性,兩者象差不多。人們普遍認(rèn)為的Windwos不如Linux可靠的印象來源于Windows 眾多的良莠不齊的軟件。當(dāng)然,Linux比Windows結(jié)構(gòu)簡單,在一定程度上也可以提高可靠性。(2)從安全性角度來說,Linux遠(yuǎn)遠(yuǎn)高于 Windows系統(tǒng),道理很簡單:樹大招風(fēng)嘛。另外,Linux的源代碼開放機(jī)制使得漏洞發(fā)現(xiàn)和消滅得很快。而Windows相對就顯得比較官僚了。這里補(bǔ)充一點(diǎn),我用過的最可靠的系統(tǒng)是BSD類的OS,可靠性和安全性都可圈可點(diǎn)。
7、Linux真的不用花一分錢嗎?
大部分的發(fā)行包需要花少量的錢購買。當(dāng)然你也可以從網(wǎng)絡(luò)上DOWN。其實(shí)這些發(fā)行包未必符合你的應(yīng)用,一般都需要經(jīng)過一些改動和定制才能運(yùn)行好。當(dāng)然,花的錢跟Windows沒法比。
二、Linux安裝注意事項
現(xiàn)在的大部分發(fā)行包都很容易安裝,基本上都是圖形向?qū)降?,每個發(fā)行包都不太相同,也無法一一描述,如果你連安裝都不明白,那就別用Linux了。這里僅僅說明幾個注意的問題。
1、如果要和Windows混裝,一定要先裝Windows,后裝Linux。
2、分區(qū)的時候,根據(jù)計劃安裝的軟件靈活決定分區(qū)。一般分區(qū)有:/,/root,/usr,/var和swap分區(qū),其中swap分區(qū)類型和其他不同需要專門選擇一下,它的空間一般是物理內(nèi)存的兩倍即可。/root分區(qū)是緊急情況root用的,有64兆就行了。
3、當(dāng)然,為了方便,你可以安裝發(fā)行包給你做好的軟件。但我安裝Linux的習(xí)慣做法是開始就安裝一個最小系統(tǒng),然后安裝所有的編譯工具。安裝編譯工具的方法一般都通過你用的發(fā)行包的包管理工具實(shí)現(xiàn),這樣最方便。比如在TurboLinux中,運(yùn)行/usr/sbin/Turbopkg就可以了。在管理工具中選擇所有關(guān)于Developoment相關(guān)的選項或gcc相關(guān)選項,一般就可以了。
4、lilo一定要裝。否則一旦出現(xiàn)分區(qū)問題都不好辦。
5、如果和Windows混裝的時候,裝完了系統(tǒng)起不來了。可以用98啟動盤啟動,然后用FDISK /MBR回復(fù)主引導(dǎo)分區(qū)來保住Windows分區(qū)。
在安裝了最小系統(tǒng)和全套的編譯器后,我們應(yīng)該得到一個比較干凈的系統(tǒng)。在這個系統(tǒng)上,可以下載和安裝各種應(yīng)用軟件了。
三、基本使用
1、文件系統(tǒng)
無論有多少個分區(qū),整個文件系統(tǒng)都是一棵完整的樹結(jié)構(gòu)。經(jīng)常用到的目錄有:
(1)/usr:存放各種應(yīng)用程序文件用。其中的/usr/local用來存放后安裝的軟件
(2)/var:用來存放所有的數(shù)據(jù)文件
(3)/proc:里面的文件用來表示系統(tǒng)內(nèi)核的各種配置和狀態(tài)。這一塊不是真正的文件系統(tǒng),而是內(nèi)存里面的各種數(shù)據(jù)。可以從這里得到一些常用的系統(tǒng)信息。比如CPU內(nèi)存什么的。
(4)/etc:這里是放置所有的系統(tǒng)配置文件。一般情況下,后安裝的軟件的配置文件不會放到這里。除非你是用RPM安裝的隨發(fā)行包配的軟件或者故意這樣做。我不喜歡把不同軟件的文件混在一起,因此通常讓不同的軟件的配置文件放在各自的目錄中。
2、常用的命令
這里我列出一些經(jīng)常用的命令,具體的用法可以參見相關(guān)手冊頁(希望你的英文不象我這么差)。
vi(一定要會用這個你非常討厭的東西,如果你屈服了,可以選擇另一個叫做pico的編輯器,它有點(diǎn)象DOS的edit)
head(用來看很長的文件用)
tail(同上)
netstat(看網(wǎng)絡(luò)狀態(tài))
tar(解開.tar.gz的壓縮包)
ps(察看進(jìn)程)
kill(干掉進(jìn)程)
top(看系統(tǒng)狀況)
shutdown(關(guān)閉系統(tǒng))
cat(看文件內(nèi)容)
ping (看網(wǎng)絡(luò)連通狀況)
ftp(傳輸文件)
man(手冊)
上面這些命令都是最最常用的,一定要把基本用法記牢。事實(shí)上,每人能記住全部命令或一個命令的全部參數(shù),記住幾個常用的就行了。其他的查書。
3、內(nèi)核升級
如果你不愿意冒險,可以跳過這個部分。不過根據(jù)我實(shí)際使用的經(jīng)驗,2.4.x版本的內(nèi)核性能比2.2.x的性能至少提高40%,還是很值得一試的?,F(xiàn)在最新的發(fā)行包幾乎都帶有新的2.4內(nèi)核,但是版本號想對保守。這里,我的建議是在決定升級任何部分的時候,一定要首先看一下所謂的 “currect version release note”信息,里面告訴你本次版本升級都有些什么改動。如果改動的內(nèi)容不涉及你當(dāng)前的環(huán)境或需求,只是增加了一些邪門設(shè)備的驅(qū)動,你大可不必急著升級。補(bǔ)充一句話:Linux的內(nèi)核版本號的中間一位是奇數(shù)的是非穩(wěn)定版本,比如2.3,是偶數(shù)的才是穩(wěn)定版本。
升級內(nèi)核的步驟如下:
(1)首先在網(wǎng)上找到你打算升級的內(nèi)核文件,一般名字是:linux- 2.x.xx.tar.gz,把這個文件復(fù)制到/usr/src。(不知道在哪里找?看看:http://www.kernel.org ,最好找到. tar.gz格式的,比如這里:http://www.kernel.org/pub/linux/kernel/v2.x/)。下面的升級舉例是從 2.2.18升級到2.5.7(這是最新的內(nèi)核了,你使用其它的版本別忘了改變版本號)
(2)解壓縮:tar zxvf linux-2.5.7.tar.gz后生成一個目錄:linux-2.5.7。
(3)進(jìn)入/usr/src,用ls –l 命令可以看到src里面有一個連接,類似于:linux -> linux-2.2.18/ (連接指向你當(dāng)前用的內(nèi)核版本)。首先刪除這個連接(rm linux),用ln -s linux-2.5.7 linux 命令重建連接。我想你一定不會連這里的版本號都照抄吧?
(4)進(jìn)入linux-2.5.7 目錄,如果不是第一次編譯這個內(nèi)核,最好用命令:make mrproper 刪掉上次編譯產(chǎn)生的.o文件等,當(dāng)然以前保存的配置也丟了。
(5)用命令:make menuconfig命令調(diào)整內(nèi)核配置以適應(yīng)你目前的環(huán)境,記住,不懂的配置不要亂動。首要任務(wù)是調(diào)整各種硬件的環(huán)境,比如 SCSI卡:SCSI support/SCSI low-level drivers,不知道現(xiàn)在的SCSI卡型號?在/proc/scsi中可以找到。還有網(wǎng)卡,在Network Device Support 里面。不知道現(xiàn)在的網(wǎng)卡型號?在這個文件里面寫著呢: /proc/net/PRO_LAN_Adapters/eth0.info或/proc/pci文件中也可以找到 。在menuconfig中用空格鍵改變選項狀態(tài),前面的<*>表示該功能編譯在內(nèi)核中,主要是運(yùn)行速度快。< >表示不需要該功能。表示把該功能編譯成模塊,通常為了減小尺寸,和更換方便而把某些驅(qū)動編譯成模塊。
(6)下面的事情比較程序化,照著做:make dep (檢查文件的完整性,過程很復(fù)雜)
(7)make bzImage 注意大小寫(真正開始編譯了耶!我覺著這個最過癮了,屏幕“嘩啦嘩啦”的,這時候你會感覺到,多少不知名的程序員在這個復(fù)雜的系統(tǒng)中貢獻(xiàn)了自己的一份力量)
(8)make modules (編譯那些被標(biāo)記為的功能模塊或驅(qū)動程序)
(9)make modules_install(把編譯好的模塊復(fù)制到指定地點(diǎn),一般是:/lib/modules/ 。注意:不同版本號的模塊是完全分開在不同目錄中的,因為modules跟內(nèi)核是緊密相關(guān)的,混用容易導(dǎo)致系統(tǒng)崩潰)
(10)cd /usr/src/linux-2.5.7/arch/i386/boot ,用命令: cp /usr/src/linux2.5.7/arch/i386/boot/bzImage /boot/vmlinuz-2.5.7 把文件 bzImage文件改名成vmlinuz-2.5.7復(fù)制到/boot/
(11)cp /usr/src/linux-2.5.7/System.map /boot/System.map-2.5.7
(12)進(jìn)入/boot目錄,rm System.map
(13)在/boot目錄中運(yùn)行l(wèi)n System.map-2.5.7 System.map 10-13兩個步驟每次重新編譯都要做。
(14)我開始提醒過的,但愿你安裝了lilo (否則你就高唱:“神啊,救救我吧!”),編輯文件:/etc/lilo.conf ,做下面的編輯:
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
lba32
default=linux-2.5.7
image=/boot/vmlinuz
label=linux
initrd=/boot/initrd
read-only
root=/dev/sda5
image=/boot/vmlinuz-2.5.7
label=linux-2.5.7
initrd=/boot/initrd
read-only
root=/dev/sda5
黑體字部分是后加的和修改的。萬一你沒有安裝lilo,你只能修改/boot下面的連接指向你新的System.map和vmlinuz , 而不用修改lilo了。這樣也能啟動,但是一旦出現(xiàn)問題,你的機(jī)器就啟動不了了。
(15)執(zhí)行命令:lilo (用來更新lilo數(shù)據(jù)),注意輸出的結(jié)果:帶星號的是缺省的。
(16)祈禱,然后reboot 系統(tǒng)重新啟動后,用uname –a 可看到新的內(nèi)核起作用了。如果出現(xiàn)任何問題不能引導(dǎo)了,你需要在lilo的引導(dǎo)界面選擇原來的內(nèi)核啟動,進(jìn)入系統(tǒng)后重新改變內(nèi)核參數(shù),調(diào)整硬件或其他配置。然后重復(fù)前面所有過程。
四、主要的軟件安裝
前面說過,我的習(xí)慣是,裝系統(tǒng)的時候就安裝一個內(nèi)核和編譯系統(tǒng),得到了一個干凈的系統(tǒng)后,再安裝其他的軟件就比較清晰。另一點(diǎn),除非搞不到源代碼版本,一般情況下我都會下載官方版本的源代碼文件,來重新編譯之。同樣的,選擇軟件版本要根據(jù)該軟件的Release Note來決定,并非越新越好。這就是為什么很多軟件都是幾個版本齊頭并進(jìn)的發(fā)展之原因。這些軟件不同版本之間的安裝方法會有少許不同,安裝前一定要仔細(xì)閱讀目錄中的README文件和 INSTALL文件,否則這些少許不同會造成不少得麻煩。下面描述的安裝過程都核版本號緊密相關(guān)。另外,所有的軟件都把程序文件的包拷貝到 /usr/local/src目錄中再解壓縮,這是習(xí)慣。因為在Linux中習(xí)慣于把后來的軟件裝在/usr/local中。
(1)安裝DNS服務(wù)器
1、從www.isc.org下載bind 域名服務(wù)器軟件。我們這里用的是bind8.3.0,bind8分支和bind9分支是并行發(fā)展的。根據(jù)自己的實(shí)際情況選擇合適的bind版本。
2、mkdir /usr/src/bind83
3、下載的文件叫bind-src.tar.gz,復(fù)制到/usr/local/src/bind83目錄下。
4、cd /usr/local/src/bind83
5、tar zxvf bind-src.tar.gz
6、cd src
7、make stdlinks
8、make clean
9、make depend
10、make all
11、make install
12、編輯配置文件:/etc/named.conf內(nèi)容如下,需要更改的部分用黑體標(biāo)出:
/*
* This is a worthless, nonrunnable example of a named.conf file that has
* every conceivable syntax element in use. We use it to test the parser.
* It could also be used as a conceptual template for users of new features.
*/
/*
* C-style comments are OK
*/
// So are C++-style comments
# So are shell-style comments
// watch out for ";" -- it‘s important!
options {
directory "/var/named";
// use current directory
named-xfer "/usr/libexec/named-xfer";
// _PATH_XFER
dump-file "named_dump.db";
// _PATH_DUMPFILE
pid-file "/var/run/named.pid";
// _PATH_PIDFILE
statistics-file "named.stats";
// _PATH_STATS
memstatistics-file "named.memstats";
// _PATH_MEMSTATS
check-names master fail;
check-names slave warn;
check-names response ignore;
host-statistics no;
deallocate-on-exit no;
// Painstakingly deallocate all
// objects when exiting instead of
// letting the OS clean up for us.
// Useful a memory leak is suspected.
// Final statistics are written to the
// memstatistics-file.
datasize default;
stacksize default;
coresize default;
files unlimited;
recursion yes;
fetch-glue yes;
fake-iquery no;
notify yes;
// send NOTIFY messages. You can set
// notify on a zone-by-zone
// basis in the "zone" statement
// see (below)
serial-queries 4;
// number of parallel SOA queries
// we can have outstanding for master
// zone change testing purposes
auth-nxdomain yes;
// always set AA on NXDOMAIN.
// don‘t set this to ‘no‘ unless
// you know what you‘re doing -- older
// servers won‘t like it.
multiple-cnames no;
// if yes, then a name my have more
// than one CNAME RR. This use
// is non-standard and is not
// recommended, but it is available
// because previous releases supported
// it and it was used by large sites
// for load balancing.
allow-query { any; };
allow-transfer { any; };
transfers-in 10;
// DEFAULT_XFERS_RUNNING, cannot be
// set > than MAX_XFERS_RUNNING (20)
transfers-per-ns 2;
// DEFAULT_XFERS_PER_NS
transfers-out 0;
// not implemented
max-transfer-time-in 120;
// MAX_XFER_TIME; the default number
// of minutes an inbound zone transfer
// may run. May be set on a per-zone
// basis.
transfer-format one-answer;
query-source address * port *;
/*
* The "forward" option is only meaningful if you‘ve defined
* forwarders. "first" gives the normal BIND
* forwarding behavior, i.e. ask the forwarders first, and if that
* doesn‘t work then do the full lookup. You can also say
* "forward only;" which is what used to be specified with
* "slave" or "options forward-only". "only" will never attempt
* a full lookup; only the forwarders will be used.
*/
forward first;
forwarders { };
// default is no forwarders
topology { localhost; localnets; };
// prefer local nameservers
listen-on port 53 { any; };
// listen for queries on port 53 on
// any interface on the system
// (i.e. all interfaces). The
// "port 53" is optional; if you
// don‘t specify a port, port 53
// is assumed.
/*
* Interval Timers
*/
cleaning-interval 60;
// clean the cache of expired RRs
// every ‘cleaning-interval‘ minutes
interface-interval 60;
// scan for new or deleted interfaces
// every ‘interface-interval‘ minutes
statistics-interval 60;
// log statistics every
// ‘statistics-interval‘ minutes
maintain-ixfr-base no;
// If yes, keep transaction log file for IXFR
max-ixfr-log-size 20;
// Not implemented, maximum size the
// IXFR transaction log file to grow
};
/*
* Control listeners, for "ndc". Every nameserver needs at least one.
*/
controls {
inet * port 52 allow { any; };
// a bad idea
unix "/var/run/ndc" perm 0600 owner 0 group 0;
// the default
};
zone "rd.21vianet.com" in {
type master;
// what used to be called "primary"
file "rd.21vianet.com.db";
check-names fail;
allow-update { none; };
allow-transfer { any; };
allow-query { any; };
// notify yes;
// send NOTIFY messages for this
// zone? The global option is used
// if "notify" is not specified
// here.
also-notify { };
// don‘t notify any nameservers other
// than those on the NS list for this
// zone
};
zone "223.99.211.in-addr.arpa" in {
type master;
// what used to be called "secondary"
file "211.99.223.db";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.db";
};
zone "." in {
type hint;
// used to be specified w/ "cache"
file "named.root";
};
logging {
/*
* All log output goes to one or more "channels"; you can make as
* many of them as you want.
*/
channel syslog_errors {
// this channel will send errors or
syslog user;
// or worse to syslog (user facility)
severity error;
};
category parser {
syslog_errors;
// you can log to as many channels
default_syslog;
// as you want
};
category lame-servers { null; };
// don‘t log these at all
channel moderate_debug {
severity debug 3;
// level 3 debugging to file
file "foo";
// foo
print-time yes;
// timestamp log entries
print-category yes;
// print category name
print-severity yes;
// print severity level
/*
* Note that debugging must have been turned on either
* on the command line or with a signal to get debugging
* output (non-debugging output will still be written to
* this channel).
*/
};
/*
* If you don‘t want to see "zone XXXX loaded" messages but do
* want to see any problems, you could do the following.
*/
channel no_info_messages {
syslog;
severity notice;
};
category load { no_info_messages; };
/*
* You can also define category "default"; it gets used when no
* "category" statement has been given for a category.
*/
category default {
default_syslog;
moderate_debug;
};
};
13、在/var/named/中生成/etc/named.conf中標(biāo)記的文件:rd.21vianet.com.db,內(nèi)容如下,需要修改和調(diào)整相應(yīng)部分:
;Authoriative data for rd.21vianet.com
;
$TTL 3600
@ IN SOA compaq.rd.21vianet.com. tandongyu.rd.21vianet.com. (
20020101 ;Serial
3600 ;Refresh 1 hour
900 ;Retry 15 mins
604800 ;Expire 7 days
86400) ;Mini 24 hours
;Name server NS records
@ IN NS compaq.rd.21vianet.com.
;Mail Exchange (MX) records
rd.21vianet.com. IN MX 0 compaq
;Address (A) records.
localhost IN A 127.0.0.1
compaq IN A 211.99.223.9
tls65 IN A 211.99.223.8
fbsd IN A 211.99.223.7
14、在/var/named/中生成/etc/named.conf中標(biāo)記的文件:211.99.223.db,內(nèi)容如下,你需要修改相應(yīng)部分:
;
;
$TTL 3600
@ IN SOA compaq.rd.21vianet.com. tandongyu.rd.21vianet.com. (
20020101 ;Serial
3600 ;Refresh
900 ;Retry 15 mins
604800 ;Expire 7 days
86400) ;Mini 24 hours
;NameServer (NS) records
@ IN NS compaq.rd.21vianet.com.
;Address Point to Name (PTR) records
9 IN PTR compaq.rd.21vianet.com.
8 IN PTR tls65.rd.21vianet.com.
7 IN PTR fbsd.rd.21vianet.com.
15、在/var/named/中生成/etc/named.conf中標(biāo)記的文件:127.0.0.db,內(nèi)容如下,你需要修改相應(yīng)部分:
; 0.0.127.in-addr.arpa
$TTL 3600
@ IN SOA compaq.rd.21vianet.com. tandongyu.rd.21vianet.com. (
20020101;serial
3600 ;refresh
1800 ;retry
604800 ;expiration
3600 ) ;minimum
IN NS compaq.rd.21vianet.com.
1 IN PTR localhost.
16、在/var/named/中生成/etc/named.conf中標(biāo)記的文件:named.root,內(nèi)容大致如下。該文件標(biāo)記了14個域名服務(wù)器。可以從ftp.rs.internic.net獲得該文件的最新樣本:named.hosts,然后改名成你需要的名字,比如: named.root
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . "
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC registration services
; under anonymous FTP as
; file /domain/named.root
; on server FTP.RS.INTERNIC.NET
; -OR- under Gopher at RS.INTERNIC.NET
; under menu InterNIC Registration Services (NSI)
; submenu InterNIC Registration Archives
; file named.root
;
; last update: Aug 22, 1997
; related version of root zone: 1997082200
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; temporarily housed at NSI (InterNIC)
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 198.41.0.10
;
; housed in LINX, operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; temporarily housed at ISI (IANA)
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; housed in Japan, operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File
17、我們還需要配置/etc/resolv.conf、/etc/hosts、/etc/hosts.conf文件以適應(yīng)新的狀況。
18、一切都結(jié)束后,用/usr/sbin/ndc start命令啟動bind,同樣的可用stop、restart、reload等命令參數(shù)操作。
19、啟動后用nslookup命令(有的系統(tǒng)推薦使用dig命令)檢驗是否正確。如果出現(xiàn)錯誤,該命令將不能啟動。一般的錯誤都是數(shù)據(jù)庫文件或配置文件筆誤所至。比如少個“.”或者文件明不正確等等。
(2) 安裝sendmail服務(wù)器
1、從www.sendmail.org下載最新的版本(這個snedmail倒是有必要升級為最新的版本,因為它的升級主要是安全漏洞問題)。這里說明的是用的sendmail-8.12.2.tar.gz
2、cd /usr/local/src/
3、把文件下載到:/usr/local/src中
4、tar zxvf sendmail-8.12.2.tar.gz
5、cd /usr/local/src/sendmail-8.12.2
6、chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
7、chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
8、cd /usr/local/src/sendmail-8.12.2/sendmail
9、sh Build
10、cd /usr/local/src/sendmail-8.12.2/cf/cf
11、建立文件sendmail.mc內(nèi)容如下,你可根據(jù)需要修改相應(yīng)部分。
divert(-1)
dnl This is the macro config file used to generate the /etc/sendmail.cf
dnl file. If you modify thei file you will have to regenerate the
dnl /etc/sendmail.cf by running this macro config through the m4
dnl preprocessor:
dnl m4 /etc/sendmail.mc > /etc/sendmail.cf
dnl You will need to have the Sendmail-cf pacage installed for this to work.
include(`/usr/local/src/sendmail-8.12.2/cf‘)
define(`confDEF_USER_ID‘,`8:12‘)
OSTYPE(`linux‘)
undefine(`UUCP_RELAY‘)
undefine(`BITNET_RELAY‘)
define(`confTO_CONNECT‘, `1m‘)
define(`confTRY_NULL_MX_LIST‘,true)
define(`confDONT_PROBE_INTERFACES‘,true)
define(`PROCMAIL_MAILER_PATH‘,`/usr/bin/procmail‘)
define(`SMART_HOST‘,compaq.rd.21vianet.com)
<---這條用于(非HUB)缺省使用HUB發(fā)送郵件
MASQUERADE_AS(`rd.21vianet.com‘)
<-------------------------
FEATURE(`masquerade_entire_domain‘)
<---這三條用于郵件地址偽裝
FEATURE(`masquerade_envelope‘)
<-------------------------
FEATURE(`smrsh‘,`/usr/sbin/smrsh‘)
FEATURE(`mailertable‘,`hash -o /etc/mail/mailertable‘)
FEATURE(`virtusertable‘,`hash -o /etc/mail/virtusertable‘)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
FEATURE(`access_db‘)
FEATURE(`blacklist_recipients‘)
FEATURE(`accept_unresolvable_domains‘)
MAILER(smtp)
MAILER(procmail)
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not hav 24x7 DNS do need this.
dnl FEATURE(`relay_based_on_MX‘)
12、sh Build install-cf
13、groupadd smmsp
14、useradd smmsp
15、cd cd /usr/local/src/sendmail-8.12.2/sendmail
16、sh Build install
17、cd /usr/local/src/sendmail-8.12.2/makemap
18、sh Build clean
19、sh Build all
20、sh Build install
21、cd /usr/local/src/sendmail-8.12.2/
22、在本域DNS主數(shù)據(jù)庫文件中增加MX紀(jì)錄:
rd.21vianet.com. IN MX 0 compaq
注意修改相應(yīng)部分。那個0是有幾個郵件集中器的時候用于標(biāo)記先后順序的。當(dāng)有好幾個MX的時候,建議順序?qū)憺?0、20、30…
23、在/etc/mail目錄下創(chuàng)建access文件,內(nèi)容類似如下:
127.0.0.1 RELAY
211.99.223 RELAY
211.99.221.238 RELAY
然后:makemap hash access.db < access
24、創(chuàng)建文件/etc/mail/local-host-names,其內(nèi)容為本機(jī)的擁有的域名信息。
rd.21vianet.com
compaq.rd.21vianet.com
25、創(chuàng)建文件/etc/mail/aliases,內(nèi)容類似:
MAILER-DAEMON: postmaster
postmaster: root
bin: root
daemon: root
nobody: root
運(yùn)行newaliases創(chuàng)建數(shù)據(jù)庫。
創(chuàng)建別名文件的意義之一在于當(dāng)郵件發(fā)往域中其他郵件服務(wù)器的用戶而不是mail HUB用戶的時候用。
比如增加一條:
atan: atan@fbsd
則導(dǎo)致郵件發(fā)往mail HUB的時候自動轉(zhuǎn)發(fā)到atan@fbsd.rd.21vianet.com
26、啟動sendmail: /usr/sbin/sendmail -bd -q30m
排錯:如果有問題導(dǎo)致啟動不了,大部分問題和DNS配置有關(guān),可以使用nslookup檢查DNS是否正常。挨個檢查/etc/mail中的文件內(nèi)容也是排錯的好辦法。另外,修改配置,不建議直接編輯sendmail.cf文件,建議使用m4宏編譯工具,因為有些帶有安全漏洞或過時的宏在編譯的時候會有提示,這樣以免造成相關(guān)安全問題。
(3)安裝DHCP服務(wù)器
1、源程序下載地址是:ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.tar.gz ,我們的版本是:dhcpd-3.0
2、復(fù)制到:/usr/local/scr后解壓:tar zxvf dhcp-3.0.tar.gz
3、cd /usr/local/src/dhcp-3.0.tar.gz
4、./configure
5、make(如果不是第一次編譯,先make clean)
6、make install
7、cp ./server/dhcpd.conf /etc
8、編輯這個文件,看起來類似下面這樣:(要更改的地方用粗體標(biāo)出)
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "rd.21vianet.com";
option domain-name-servers compaq.rd.21vianet.com;
default-lease-time 86400;
max-lease-time 172800;
ddns-update-style ad-hoc;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
# This is a very basic subnet declaration.
subnet 211.99.223.0 netmask 255.255.255.224 {
range 211.99.223.2 211.99.223.6;
option routers 211.99.223.1;
}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don‘t really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224   {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
上面這個文件中后面都是注釋,是原來系統(tǒng)給你的配置做的例子,可以不要。當(dāng)然除非你用到它們,并且清楚它們的含義。
9、建立空文件:touch /var/state/dhcp/dhcpd.leases空文件
10、檢查內(nèi)核編譯選項:Networking options-----Packet socket: mmapped IO和 Socket Filtering選項是否被選中(不知道怎么看?看看前面的文章,用make menuconfig呀),如果沒有就需要重新編譯內(nèi)核了。
11、route add -host 255.255.255.255 dev eth0
12、roote add -host localhost dev eth0
13、在/etc/rc.d/rc.local最后增加一行route add -host 255.255.255.255 dev eth0
14、reboot系統(tǒng)
15、用dhcpd命令啟動DHCP,用其他的機(jī)器試試看能不能自動配置網(wǎng)絡(luò)了。
(4) 安裝apache+mysql+php+gd+png+zlib+jpeg+freetype+sslmod
這么一大堆東西為什么要一塊說呢?因為他們中間是有緊密聯(lián)系的,尤其是那個PHP,用到其他所有的模塊。要想PHP功能全,只能一步步來了。
1、首先安裝MYSQL:從http://www.mysql.com/downloads/index.html下載自己覺得合適的版本。這里用3.23.42版本。
2、進(jìn)入目錄/usr/local/src(這個以后就不用說了吧?)解壓縮:tar zxvf mysql-3.23.42.tar.gz
3、cd mysql-3.23.42/
4、configure --prefix=/usr/local/mysql
5、make
6、make install
7、useradd mysql ; groupadd mysql ; su mysql ;(建立命名為mysql的用戶和組,并切換為mysql身份)
8、scripts/mysql_install_db (建立數(shù)據(jù)庫結(jié)構(gòu))
9、cd /usr/local/mysql/bin
10、./safe_mysqld & (啟動了)
11、./mysqladmin -u root password "new-password"(你的新密碼,記住MYSQL的密碼核系統(tǒng)密碼是獨(dú)立的,缺省是沒有密碼)
12、用mysql程序試試看。
下面的步驟都很程式化,我盡量簡潔地寫出。
13、下載相關(guān)的軟件包:地址表格如下
軟件     版本     地址
jpegsrc.v6b.tar.gz  6b ftp://ftp.uu.net/graphics/jpeg
zlib.tar.gz 1.1.3 ftp://ftp.uu.net/graphics/png/src
freetype-2.0.8.tar.gz 2.0.8 http://www.freetype.org
libpng-1.0.10.tar.gz 1.0.10 ftp://ftp.uu.net/graphics/png/src
gd-1.8.4.tar.gz 1.8.4 http://www.boutell.com/gd
apache_1.3.23.tar.gz 1.3.23 http://www.apache.org
php-4.1.1.tar.gz 4.1.1 http://www.php.net
number4.tar.gz 4 http://www.php.net/extra
rsaref20.tar.Z 2.0 ftp://ftp.ai.mit.edu/pub/deberg
openssl-engine-0.9.6c.tar.gz 0.9.6c http://www.openssl.org/source
mod_ssl-2.8.6-1.3.23.tar.gz 2.8.6 http://www.modssl.org
下齊了就放在/usr/local/src目錄下,除了number4.tar.gz和rsaref20.tar.Z以外,其他一律用tar zxvf XXXX.tar.gz解壓縮。(過癮吧?)
特殊的,rsaref20.tar.Z 需要先建立一個rsaref-2.0目錄,然后把rsaref20.tar.Z復(fù)制到改目錄下用 tar zxvf rsaref30.tar.Z釋放壓縮。Number4.tar.gz需要復(fù)制到php-4.1.1目錄內(nèi),然后用 tar zxvf number4.tar.gz解壓縮。
下面的描述我想簡單一點(diǎn),只寫出進(jìn)入目錄后執(zhí)行的命令。那些目錄都是釋放的時候自己建立的,如果你這些操作都在/usr/local/src下面執(zhí)行,所有的目錄就都在這里面。最好按照順序執(zhí)行。再羅嗦一句:如果不是第一次編譯,一般情況請執(zhí)行一次make clean后再編譯。
14、[jpeg-6b]:生成JPEG圖像的函數(shù)庫。
./configure
make
make test
make install
15、[zlib-1.1.3]:壓縮算法庫,是PNG和JPEG需要的
make test
make install
16、[freetype-2.0.8]:字體庫,在圖像上使用字體的時候需要用到,
./configure --prefix=/usr/local
make
make install
17、[libpng-1.0.10]:生成PNG圖像的函數(shù)庫
cp scripts/makefile.linux makefile
make test
pngtest pngnow.png
(如果都通過測試了,請繼續(xù)。否則,看看錯誤提示,改正錯誤)
make install
18、[gd-1.8.4]:GD庫,用來動態(tài)生成圖像用,這里主要是配合PHP生成圖像。
編輯Makefile 文件:
把下列行取消注釋符號(#):
CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG
-DHAVE_LIBFREETYPE -DHAVE_LIBTTF
LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf
注釋下列行(增加#):
CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
LIBS=-lgd -lpng -lz -lm
修改下列行:
INCLUDEDIRS=-I. -I/usr/local/include/freetype2 -I/usr/include/X11
-I/usr/X11R6/include/X11 -I/usr/local/include
-I/usr/include/freetype
保存后執(zhí)行:
make
make install
19、[apache_1.3.23]:步驟一 ./configure --prefix=/usr/local/apache
20、[php-4.1.1]:
如果不是第一次安裝,請刪除:config.cache文件,然后執(zhí)行先執(zhí)行make clean
接下來配置環(huán)境,輸入一個比較長的命令:
./configure
--with-apache=/usr/local/src/apache_1.3.23
--with-config-file-path=/local/apache/conf
--with-enable-versioning
--with-mysql=/usr/local/mysql
--with-ftp
--with-gd=/usr/local/src/gd-1.8.4
--with-enabled-bcmath=yes
--with-disable-debug
--enable-memory-limit=yes
--enable-track-vars
--with-zlib
--with-jpeg-dir=/usr/local/src/jpeg-6b
--with-png-dir=/usr/local/src/libpng-1.0.10
--with-freetype-dir=/usr//local/src/freetype-2.0.8
當(dāng)然你也可以實(shí)現(xiàn)準(zhǔn)備一個含有上述命令的sh文件,這樣改起來方便些。我就是這樣做的。
make
make install
21、[rsaref-2.0]:RSA加密模塊
前面說過,這個目錄的釋放是特殊的,先見目錄后釋放,希望你是這樣做的。
cp -rp install/unix local
cd local
make
mv rsaref.a librsaref.a
22、[openssl-engine-0.9.6c]:openssl引擎
./config -prefix=/usr/local/ssl -L`pwd`/../rsaref-2.0/local/ rsaref –fPIC
make
make test
make install
23、[mod_ssl-2.8.6-1.3.23]
./configure --with-apache=../apache_1.3.23
24、[apache_1.3.23]步驟二
./configure --prefix=/usr/local/apache --enable-shared=ssl
--enable-module=ssl --activate-module=src/modules/php4/libphp4.a
make
make certificate TYPE=custom(回答一些問題)
make install
25、收尾工作:
編輯/usr/local/apache/conf/httpd.conf文件,增加一行:
AddType application/x-httpd-php .php
26、用命令/usr/local/apache/bin/apachectl configtest檢查一下配置文件的正確性。
27、用/usr/lcoal/apache/bin/apachectl start啟動apache服務(wù)器
28、在/usr/local/apache/htdocs建立一個test.php文件包含下列內(nèi)容:
phpinfo();
?>
29、在別的機(jī)器上用瀏覽器看一下這個機(jī)器:http://xxx.xxx.xxx.xxx/test.php會出現(xiàn)php的配置總匯,看看前面編譯的模塊都在不在。
30、檢驗ssl很麻煩,需要用apachectl startssl啟動apache然后還要生成一大堆證書。這里就不討論了。
31、把/usr/local/apache/bin/apachectl文件復(fù)制到/etc/rc.d/init.d中,然后在/etc/rc.d/rd3.d中建立個符號連接指向/etc/rc.d/init.d中的上述文件:
ln -s ../init.d/apachectl S70apachectl
這樣系統(tǒng)啟動的時候就可以自動啟動apache和她的哪一大堆模塊了。
呼~~~~(喘口氣)到這里,就基本上完成了一個功能很全的WEB服務(wù)器系統(tǒng)了。
(5)安裝 ftp 服務(wù)器
(6)安裝 pop3服務(wù)器
有的郵件服務(wù)器自己帶pop3功能(比如Qmail、Xmail),如果你用這幾種郵件服務(wù)器軟件,當(dāng)然就不用安裝pop3了。目前,常用的郵件服務(wù)器里面不帶pop3的好象只有sendmail和postfix等少數(shù)幾種。這幾種郵件服務(wù)器軟件使用的都是系統(tǒng)用戶,而我們安裝的pop3也只是對系統(tǒng)用戶的郵件進(jìn)行彈出操作的。這里我們使用的版本和下載地址是:
qpopper4.0.3.tar.gz
http://www.eudora.com/qpopper_general/
同樣的,把文件下載到/usr/local/src中,按照下列步驟安裝:
tar zxvf qpopper4.0.3.tar.gz
cd qpopper4.0.3
./configure
make
make install
完成后,qpopper安裝在/usr/local/sbin中(如果你愿意把它放在其他地方,可以在前面用./configure –prefix= /your_path指定),文件名叫作popper。通常情況下,popper是作為一個inetd(超級網(wǎng)絡(luò)服務(wù)進(jìn)程)的子進(jìn)程加載的。這樣需要編輯文件/etc/inetd.conf并做下面改動: ...
# POP3 mail server
#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
pop-3 stream tcp nowait root /usr/local/sbin/popper qpopper –s
...
增加黑體的這一行,注釋掉原來的(上面這一行),注意,如果你的安裝路經(jīng)不同,記著改過來呀。然后,用下面的命令得到inetd的進(jìn)程號:
ps –ax | grep inetd
得到結(jié)果類似:
248 ? S 0:00 inetd
什么?哪個是進(jìn)程號?就是最前面那個數(shù)字。然后用下面的命令重新啟動inetd:
kill –HUP 248
用下面的命令看看pop3是不是啟動了。
netstat -ln|grep 110
如果結(jié)果是這樣,就恭喜了。
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN
這里還要補(bǔ)充一點(diǎn),少數(shù)情況下,pop3進(jìn)程需要獨(dú)立的監(jiān)聽端口,也就是不作為inetd的子進(jìn)程裝載,上面過程需要做如下改動:
./configure的時候加上--enable-standalone參數(shù)。
編輯/etc/inetd.conf不增加黑體一行,但需要注釋掉原來的pop-3一行(如果有的話)。
啟動的時候,直接運(yùn)行/usr/local/sbin/popper xxx.xxx.xxx.xxx:110即可。后面的參數(shù)是本地需要幾監(jiān)聽的IP 地址和端口。注意,沒有特殊需要,端口必須是110。最后要說的是:其實(shí)最簡單的辦法就是用你使用的Linux發(fā)行包帶的pop3軟件,安裝的時候直接選上即可。
(7)安裝imap服務(wù)器
幾乎所有的發(fā)行包都帶有imap服務(wù)器軟件(一般是華盛頓大學(xué)版本),最好的辦法是用你的發(fā)行包安裝IMAP服務(wù)器。事實(shí)上,我個人覺得IMAP服務(wù)器很少被使用。下載最常規(guī)的IMAP服務(wù)器源碼地址是:ftp: //ftp.cac.washington.edu/imap/imap.tar.Z
tar zxvf imap.tar.Z
cd imap-2001a
make slx
(如果不行依次試驗一下其他你覺得可能的系統(tǒng)類型,用vi看一下Makefile中列的名稱)
然后配置/etc/inetd.conf,讓inetd允許imap服務(wù)。[本節(jié)內(nèi)容沒有試驗成功,編譯總是過不去]
(安裝squid服務(wù)器
SQUID是一個優(yōu)秀的代理服務(wù)器軟件,它可以很靈活的被配置為各種應(yīng)用形式,其中包括正向代理,反向加速模式和透明代理等。但是SQUID目前只能代理HTTP協(xié)議,代理FTP協(xié)議需要配置瀏覽器仿真主動FTP協(xié)議。下面的步驟是安裝SQUID的過程。
1、下載反向代理服務(wù)器軟件采用squid,下載地址:http://www.squid-cache.org/
下載后存放在/usr/local/src目錄里,文件名是squid-2.4.STABLE2-src.tar.gz
2、tar zxvf squid-2.4.STABLE2-src.tar.gz 解壓縮
3、cd /usr/local/src/squid-2.4.STABLE2 進(jìn)入目錄
4、./configure --prefix=/usr/local/squid --enable-heap-replacement -- disable-internal-dns建立環(huán)境,把squid安裝/usr/local/squid中。第二個參數(shù)是指定使用更先進(jìn)的緩沖算法。第三個參數(shù)是取消內(nèi)部DNS解析(如果使用在遠(yuǎn)程高速緩存模式,比如GSLB,需要增加選項:--disable-internal-dns,目的是關(guān)閉內(nèi)部 DNS.否則內(nèi)部DNS不理睬你在etc/hosts中的設(shè)定,直接尋找域名服務(wù)器,這樣就會造成轉(zhuǎn)發(fā)循環(huán)。就是cache發(fā)送給物理服務(wù)器的更新請求(因為用域名)也會被用戶的GSLN設(shè)備解析回來而形成循環(huán)。)
5、make 開始編譯
6、make install 安裝到剛才--prefix=指定的路徑當(dāng)中
7、安裝完成后,會在您指定的安裝路徑里產(chǎn)生一個squid目錄,squid目錄下有四個目錄:bin/ etc/  libexec/ logs/。其中etc里面是配置文件,bin里面是執(zhí)行文件,logs里面是日志文件。
8、安裝結(jié)束后就是調(diào)試服務(wù)器,使其按照您的要求工作。Squid的配置文件只有一個,在etc目錄里,名字是squid.conf,所有的配置選項都在這個文件里面。而且每個配置項目都有注釋說明。首先,在squid文件里面找到下列配置項:
cache_mem ---這里可以添上您準(zhǔn)備給squid作為高速緩存使用的內(nèi)存大小。注意,如果您的機(jī)器有N兆內(nèi)存,那么,推薦您在這里添的數(shù)字是N/3。
cache_dir /usr/local/squid/cache 100 16 256 這里的第一個數(shù)字100是您準(zhǔn)備給squid作為cache使用的硬盤空間大小,單位是兆。如果您想劃100M空間當(dāng)作cache,那么這里就寫100。
cache_mgr
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
linux下jdk,tomcat安裝以及環(huán)境變量的配置
linux Apache 編譯安裝
在Linux上架設(shè)支持JSP+PHP的Web服務(wù)器
LINUX下Web服務(wù)器配置
Linux安裝JDK1.7和tomcat
Linux下安裝、配置、啟動Apache
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服