亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1876 | 回復: 0
打印 上一主題 下一主題

基于Freebsd5.4的全能服務(wù)器安裝 [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-07-14 08:03 |只看該作者 |倒序瀏覽

改版聲明:此次改版主要增加了相應(yīng)的說明文字特別是在ftp服務(wù)器方面
版權(quán)聲明:本著開源的思想,大家盡可以轉(zhuǎn)載也希望大家不要壟斷技術(shù)
強烈建議:安裝系統(tǒng)時安裝src和ports
理由:經(jīng)過試驗可以提升同步src和ports的速度
基本設(shè)置
setenv PACKAGEROOT "ftp://ftp.jp.freebsd.org" 設(shè)置環(huán)境變量使pkg_add -r 源代碼安裝方式選擇較快的服務(wù)器下載二進制軟件安裝 pkg_add -r cvsup-without-gui 下載并安裝二進制代碼程序cvsup-without-gui(cvsup-without-gui無圖形支持在文本方式下工作的軟件,用來同步代碼及ports用。)
編輯/etc/rc.conf
ee /etc/rc.conf
增加以下(用來停止sendmail)
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
mkdir /usr/home/chb/pkg_info
reboot
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_cvsup-without-gui.txt
(主要是記錄安裝的軟件,用來以后分析軟件包的關(guān)聯(lián)性)
同步系統(tǒng)代碼
cvsup -g -L 2 -h cvsup.jp.FreeBSD.org /usr/share/examples/cvsup/standard-supfile 注意:standard-supfile這個文件同步前一定要查看里面內(nèi)容是否正確!即:[*default release=cvs tag= ] 默認的情況下可能會把代碼同步到當前的最新版本,當然這個最新版本可能是current版!所以一定要指定!我的寫法是:
*default release=cvs tag=RELENG_5_4 意思是同步到FreeBSD5.4的當前穩(wěn)定版代碼 還有就是值得注意的是:目前同步代碼可以選擇兩個文件
一是:stable-supfile
二是:standard-supfile
stable-supfile 一般已經(jīng)指定了同步代碼的版本,一般也不需要設(shè)定!但是用FreeBSD5.2.1的朋友們就需要注意了因為FreeBSD5.2.1會把代碼同步到4系的最新版,我一直沒明白FreeBSD開發(fā)小組為什么會這么做!一旦沒有修改就同步的話,輕則造成部分軟件無法使用重則造成內(nèi)核錯誤根本就無法進入系統(tǒng)!我可親身經(jīng)歷過
standard-supfile 我認為同步前最好核對一下里面關(guān)于同步代碼版本的部分。
至于為什么選擇standard-supfile而不選擇stable-supfile我可是經(jīng)過N次的重做才確定用standard-supfile
登陸系統(tǒng)后運行uname -v查看系統(tǒng)版本號你會發(fā)現(xiàn)以standard-supfile同步的系統(tǒng)顯示的是FreeBSD 5.4-RELEASE-p4 #0: Sat Jul 16 09:29:22 CST 2005 chb@ns1.tjhaina.net:/usr/obj/usr/src/sys/GENERIC
注意這里的5.4-RELEASE-p4用stable-supfile是不會出現(xiàn)p4的!
當然這只是我個人的做法!
編譯系統(tǒng)內(nèi)核
cd /usr/src make -j4 buildworld 上面命令-j4表示使用多線程支持加快編譯速度(注意:cpu的占用率會升高)
編輯內(nèi)核
cd /usr/src/sys/i386/conf
cp GENERIC /root/GENERIC.OLD
ee NS1
建立內(nèi)核
cd /usr/src
make buildkernel
安裝內(nèi)核
make installkernel
重新啟動
shutdown -r now
更新系統(tǒng)配置文件
mergemaster -p
這個命令后會跟隨多個提示問題建議仔細閱讀后做出選擇,如果是安裝系統(tǒng)后第一次同步代碼,并是在沒有安裝任何軟件的情況下,可以考慮執(zhí)行 mergemaster -ai 跳過詢問信息選擇全部跟新
cd /usr/src
make installworld
mergemaster
重新啟動
shutdown -r now
刪除/usr/obj(以防影響下一次編譯內(nèi)核)
/usr/obj
cd /usr/obj
chflags -R noschg *
rm -rf *
同步ports軟件包
cvsup -g -L 2 -h cvsup.jp.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
DNS服務(wù)器
設(shè)置bind9.3.1
%%%%%%%%%%%%%%%%%建立正反向解析目錄%%%%%%%%%%%%%%
mkdir /etc/namedb/rev
mkdir /etc/namedb/hosts
%%%%%%%%%%%%%%%改變正反向解析目錄屬性%%%%%%%%%%%%%%
chown bind:bind /etc/namedb/rev
chown bind:bind /etc/namedb/hosts
chmod 750 /etc/namedb/rev
chmod 750 /etc/namedb/hosts
%%%%%%%%%%%%%生成正反向解析文件的例子文件%%%%%%%%%%%%
cd /etc/namedb
sh make-localhost
%%%%%%%%%%%%%%%%生成這正反向解析文件%%%%%%%%%%%%%%
cp /etc/namedb/master/localhost.rev /etc/namedb/rev/192.168.0.rev
cp /etc/namedb/master/localhost.rev /etc/namedb/hosts/tjhaina.net.hosts
%%%%%%%%%%%%%%%%設(shè)置DNS服務(wù)器的主域%%%%%%%%%%%%%%%
ee /etc/namedb/named.conf
zone "0.168.192.IN-ADDR.ARPA" {
type master;
file "/etc/namedb/rev/192.168.0.rev";
};
zone "tjhaina.net" {
type master;
file "/etc/namedb/hosts/tjhaina.net.hosts";
};
%%%%%%%%%%%%%設(shè)置DNS服務(wù)器反向解析文件%%%%%%%
ee /etc/namedb/rev/192.168.0.rev
$TTL 3600
@ IN SOA ns1.tjhaina.net. root.ns1.tjhaina.net. (
20050430 ; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS ns1.tjhaina.net.
205 IN PTR ns1.tjhaina.net.
205 IN PTR www.tjhaina.net.
205是你的IP地址
(增加反向解析PTR記錄 注意:不建議全部的域名及二級域名增加PTR記錄)
%%%%%%%%%%%%%設(shè)置DNS服務(wù)器的正向解析文件%%%%%%%
ee /etc/namedb/hosts/tjhaina.net.hosts
$TTL 3600
@ IN SOA ns1.tjhaina.net. root.ns1.tjhaina.net. (
20050621 ; Serial
3600 ; Refresh
900 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS ns1.tjhaina.net.
ns1 IN A 192.168.0.205
www IN A 192.168.0.205
mail IN A 192.168.0.205
tjhaina.net. IN MX 10 mail.tjhaina.net
(注意:MX記錄的添加要先做一個mail的A記錄再做MX記錄。MX記錄添加的原則是用你的域名指向你的mail的二級域名。不過還有其他的添加方法大家自己可以找一下相關(guān)資料)
%%%%%%%%%%%%%生成DNS服務(wù)器的key文件%%%%%%%%%%%%%%%
/usr/sbin/rndc-confgen > /etc/namedb/rndc.conf
%%%%%%%%%%%%%將key文件導入named.conf文件%%%%%%%%%%%%%
cd /etc/namedb
tail -n10 rndc.conf | head -n9 | sed -e s/#\ //g >> named.conf
(這個命令我也不知道為什么這么寫!希望大家一起討論)
%%%%%%%%%%%%%啟動DNS服務(wù)器%%%%%%%%%%%%%%%%%%%%%
/usr/sbin/named -gc /etc/namedb/named.conf &
(& 表示后臺運行)
/usr/sbin/rndc status
(查看DNS的啟動情況)
%%%%%%%%%%%%%設(shè)置本機DNS服務(wù)器地址%%%% %%%%%%%%%%%%
ee /etc/resolv.conf
添加
nameserver 127.0.0.1
nameserver 211.98.2.4
nameserver 202.99.104.68
nameserver 202.99.96.68
nameserver 202.102.128.68
nameserver 202.103.0.117
nameserver 202.103.44.5
(所以選這么多DNS是考慮到了冗余設(shè)計防止萬一出錯)
%%%%%%%%%%%%刪除或注釋掉DNS服務(wù)器的監(jiān)聽地址%%%%%%
ee /etc/namedb/named.conf
刪除
20 listen-on { 127.0.0.1; };
注釋掉
// listen-on { 127.0.0.1; };
rndc reload
(由于bind9在默認的情況下只是給自己,所以要去除監(jiān)聽地址listen-on { 127.0.0.1; };)
%%%%%%%%%%%%使DNS服務(wù)器和系統(tǒng)一起啟動%%%%%%%%
ee /etc/rc.conf
添加
named_enable="YES"
安裝perl5.8.X
cd /usr/ports/lang/perl5.8
make WITH_DEBUGGING=yes \
WITH_GDBM=yes \
WITHOUT_PERL_MALLOC=yes \
WITHOUT_PERL_64BITINT=yes \
WITH_THREADS=yes \
ENABLE_SUIDPERL=yes
(注意:以上命令及參數(shù)是按行輸入)
make test
make install
make clean
make rmconfig
shutdown -r now
perl -v
ps auwx|grep perl
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_perl5.8.txt
###############更改ports軟件包的默認下載路徑(因為只有安裝了perl后才會有/etc/make.conf)#######
ee /etc/make.conf
添加
MASTER_SITE_OVERRIDE=ftp://ftp3.jp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}
(更改ports默認的下載路徑,可以根據(jù)自己的實際情況進行設(shè)置)
################################安裝openssl####################################
cd /usr/ports/security/openssl
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_openssl.txt
#################################安裝web管理系統(tǒng)##############################
cd /usr/ports/sysutils/webmin
make
make install
make clean
make rmconfig
/usr/local/lib/webmin/setup.sh
ee /etc/rc.conf
添加
webmin_enable="YES"
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_webmin.txt
#################################安裝數(shù)據(jù)庫mysql4.0############################
cd /usr/ports/databases/mysql40-server
make WITH_CHARSET=gbk \
WITH_XCHARSET=all \
SKIP_DNS_CHECK=yes \
BUILD_OPTIMIZED=yes \
BUILD_STATIC=yes
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40-server.txt
%%%%%%%%%%%%安裝mysql40組件%%%%%%%%%%%%%%
cd /usr/ports/databases/p5-DBD-mysql40
make
make install
make clean
make rmconfig
%%%%%%%%%%%使mysql40和系統(tǒng)一起啟動%%%%%%%%%%%
ee /etc/rc.conf
mysql_enable="YES"
%%%%%%%%%%%設(shè)置mysql40的密碼%%%%%%%%%%%%%%
/usr/local/bin/mysqladmin -u root password 'password'
mysql -u root -ppassword
%%%%%%%%%%啟動mysql40%%%%%%%%%%%%%%%%%%%
start mysql
#/usr/local/share/mysql/mysql.server start
/usr/local/etc/rc.d/mysql-server.sh start
如果以上兩條命令不能啟動mysql
那么請reboot系統(tǒng)來啟動mysql
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40.txt
###############################安裝expat2#####################################
cd /usr/ports/textproc/expat2
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_expat2.txt
###############################安裝web服務(wù)器apache1.33######################
cd /usr/ports/www/apache13
make
make install
make clean
make rmconfig
%%%%%%%%%%%使apache和系統(tǒng)一起啟動%%%%%%%%%%%
ee /etc/rc.conf
添加
apache_enable="YES"
%%%%%%%%%%%%更改apache的相應(yīng)設(shè)置%%%%%%%%%%%
ee /usr/local/etc/apache/httpd.conf
change 330
ServerAdmin you@your.address ==>ServerAdmin b.s.d@163.com
change 348
#ServerName www.example.com==>ServerName www.tjhaina.net
添加 794
添加Language zh-cn .zh-cn
添加 822
添加charset GB2312 .gb2312
添加 977
NameVirtualHost 192.168.0.205 (your hosts ip)
%%%%%%%%%%%%啟動apache%%%%%%%%%%%%%%%%%
start apache
/usr/local/sbin/apachectl start
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_apache.txt
####################################安裝php###################################
cd /usr/ports/lang/php4
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4.txt
###################################安裝php擴展################################
cd /usr/ports/lang/php4-extensions
make (+ bz2)
make install
make clean
make rmconfig
cd /usr/local/etc
cp php.ini-recommended php.ini
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4-extensions.txt
########################安裝phpSysInfo基于php的系統(tǒng)監(jiān)測#######################
cd /usr/ports/www/phpSysInfo/
make
make install
make clean
make rmconfig
cd /usr/local/www/data/phpSysInfo/
cp config.php.new config.php
chown www:www config.php
(改變config.php的所屬組和用戶)
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpSysInfo.txt
####################安裝phpmyadmin基于php的數(shù)據(jù)庫web管理系統(tǒng)################
cd /usr/ports/databases/phpmyadmin/
make
make install
make clean
make rmconfig
%%%%%%%%%%%%%更改phpMyAdmin的配置%%%%%%%%%%%%
cd /usr/local/www/phpMyAdmin
chmod 755 config.inc.php
ee /usr/local/www/phpMyAdmin/config.inc.php
將84行
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
改成
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
[#將39行
#$cfg['PmaAbsoluteUri'] = ' ';
#改成
#$cfg['PmaAbsoluteUri'] = 'http://192.168.0.205/phpMyAdmin/';
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpmyadmin.txt ]
(我現(xiàn)在不建議更改39行的內(nèi)容雖然phpMyAdmin提示更改!但并沒有發(fā)現(xiàn)39行對phpMyAdmin的運行有影響!改不好反而使phpMyAdmin不能正常顯示)
安裝FTP服務(wù)器
#############################安裝ftp服務(wù)器pure-ftpd#############################
cd /usr/ports/ftp/pure-ftpd
ee /usr/ports/ftp/pure-ftpd/Makefile
添加
--with-everything \
--with-paranoidmsg \
--with-virtualchroot \
--with-tls \
--with-largefile \
--with-welcomemsg \
--with-uploadscript \
--with-cookie \
--with-virtualhosts \
--with-virtualroot \
--with-diraliases \
--with-quotas \
--with-sysquotas \
--with-ratios \
--with-ftpwho \
--with-throttling \
--sysconfdir=${PREFIX}/etc
make WITH_MYSQL=1 \
WITH_LANG=simplified-chinese
make install
make clean
make rmconfig
cd /usr/local/etc
cp pureftpd-mysql.conf.sample pureftpd-mysql.conf
cp pure-ftpd.conf.sample pure-ftpd.conf
ee /usr/local/etc/pure-ftpd.conf
安裝參數(shù)詳解
--with-everything: 編譯一個幾乎所有特性都開啟的“大”服務(wù)器。
--with-paranoidmsg: 當該參數(shù)被開啟,不論何種原因登錄失敗都將顯示同樣的信息給用戶。不開啟該參數(shù)是,密碼問題將顯示“驗證失敗”,被禁止用戶將顯示“對不起,我不信任你”。
--with-virtualchroot:通常一個用戶使用chrooted(使用-A 和 -a 參數(shù))命令不會轉(zhuǎn)出他的home目錄。開啟該功能之后將使其成為可能:符號連接總是一起作用,甚至他們指向的目錄不在用戶的home目錄內(nèi)。這對于共享路徑是一個非常擁有的功能(例如,每一個home目錄下都有一個符號連接到/var/incoming)。該功能默認不開啟。
--with-tls \
--with-largefile: 支持在32位架構(gòu)下下載大于2 gigabytes 的文件。通過FTP傳輸一個如此之大的文件是一個較為奇怪的主意。并且你的文件系統(tǒng),你的系統(tǒng)內(nèi)核、你的FTP客戶端也需要支持才行。并且當該功能被開啟后,下載將會比不開啟變慢(或需要耗費更多的CPU)。簡單的說,不要應(yīng)為好玩而開啟該功能,除非你真的計劃下載大于gigabytes的文件。
--with-welcomemsg: (為兼容)其它FTP服務(wù)器pure-ftp可以閱讀 'welcome.msg' 。這是一個安全的缺陷(匿名用戶可以上載'welcome.msg'文件到隨機顯示)。Pure-ftpd 默認使用 '.banner'文件。
--with-uploadscript: 自從0.98版開始, Pure-FTPd 開始關(guān)注上傳。當一個上傳成功完成之后,任何額外的程序或腳本可以被自動啟動。該功能需要一個稱為“pure-uploadscript”的程序安裝在Pure-FTPd包內(nèi)。
--with-cookie: 在用戶登錄的時候顯示隨機或定制的信息。
--with-virtualhosts: 支持虛擬主機。這意味著每個IP地址可以有不同的匿名FPT區(qū)域。如果服務(wù)器只有一個IP地址,就不需要該功能。但是如果有多個IP地址,并且需要一個客戶端連接到IP xxx 去獲得/etc/pure-ftpd/xxx/而不是~ftp/,就可以開啟該功能。
--with-virtualroot \ //虛擬root支持
--with-diraliases: 支持路徑的別名。
--with-quotas: 開啟虛擬限額,可以限制一個用戶可以在他的帳號下存儲的最大數(shù)字,也可以限制總的大小。
--with-sysquotas: 支持系統(tǒng)限額(非Pure-ftpd的虛擬限額)。只有在計劃使用系統(tǒng)限額的時候啟用。
--with-ratios: 支持上傳/下載比。
--with-ftpwho: 支持'pure-ftpwho' 命令。開啟這個功能需要額外的內(nèi)存。當pure-ftp運行在standalone模式時比較好,在inetd模式下啟用較慢。
--with-throttling: 支持帶寬限制。
其它參數(shù)
--with-altlog: 除了系統(tǒng)輸出,還支持一些特殊的文件格式,目前已實現(xiàn)了:CLF, Stats, W3C 和 xferlog 格式
CLF (通用日志格式)是Apache, WebFS, Roxen以及其它最常用 web 服務(wù)器的基本格式;該日志文件僅僅記錄文件傳輸,可以被web流量統(tǒng)計軟件(Analog, Webalizer, etc.) 所分析。Stats格式是一種專門為日志文件分析軟件設(shè)計的特殊輸出格式。W3C格式是一種商業(yè)日志分析軟件(所有支持IIS日志的分析器)的標準格式。Xferlog 是一種源于wu-ftpd的格式。
--with-brokenrealpath: 一些 Solaris 版本中realpath()運行不可靠。如果altlog和(或)pure-uploadscript沒有很好的運行,請用這個參數(shù)重新編譯。
--with-certfile=: 該file用來做SSL認證,默認為 /etc/ssl/private/pure-ftpd.pem .
--with-extauth: 支持額外的校驗模塊。大多數(shù)用戶不需要此參數(shù)。.
所支持語言
--with-language=english
--with-language=german
--with-language=romanian
--with-language=french
--with-language=polish
--with-language=spanish
--with-language=danish
--with-language=italian
--with-language=brazilian-portuguese
--with-language=slovak
--with-language=dutch
--with-language=korean
--with-language=swedish
--with-language=norwegian
--with-language=russian
--with-language=traditional-chinese
--with-language=simplified-chinese
--with-language=hungarian
--with-language=catalan
--with-language=czech: change the language of server messages.
默認為英語。
--with-ldap: 支持原始的LDAP路徑。當該功能被開啟,系統(tǒng)帳號將被忽略。你同時需要使用OpenLDAP。如果OpenLDAP被安裝在一個特定的位置,你可以使用--with-ldap= 的參數(shù)。
--with-minimal: 為了有效運用現(xiàn)代FTP客戶端的功能,Pure-FTPd采用基本的FTP協(xié)議加擴展(SITE IDLE,SITE CHMOD, MLSD, ...)的方式 。使用 --with-minimal 參數(shù),這些擴展間不會被編譯。同樣的,也就不會有standalone server, 不會有l(wèi)ookup for user/group names, 不會有 humor也不會有 ASCII 的支持。但是執(zhí)行文件將會比默認安裝更小。該參數(shù)你至少需要GCC 3.3 以上來編譯。如果你還想減少(執(zhí)行)文件大小,可以采用--without-globbing 關(guān)聯(lián)--with-minimal參數(shù)。如果你建立一個嵌入系統(tǒng),可以這樣使用;在其它場合,為了避免客戶的抱怨(特別是使用windows客戶端的客戶),請忘記它吧
--with-mysql: 使用MySQL來提供用戶數(shù)據(jù)庫。當開啟該參數(shù),系統(tǒng)帳號被忽略。使用該功能MySQL 客戶端的庫文件將被安裝。如果MySQL安裝在特殊位置,可以使用--with-mysql= 語法。
--with-nonroot: 設(shè)置服務(wù)以非root特權(quán)用戶啟動。任何普通用戶都可以運行服務(wù)。這對于在服務(wù)器上只有一個受限帳號的情況非常有用。但是一些特性將不能使用,而且密碼只能通過LDAP,SQL或PureDB進行校驗。當虛擬 chroot 被開啟,用戶將被限制在服務(wù)啟動的目錄。這是一種不安全的模式,一般用于普通(非root)用戶建立臨時性的服務(wù)器。在standalone模式下,2121端口將被偵聽。如果想采用nonroot模式,需要編譯并安裝該軟件(./configure --prefix=... && make install-strip) . /sbin, /bin and /man 目錄需要被寫入 prefix,同時還需要增加運行pure-ftpd用戶在 /etc 目錄的讀寫權(quán)限。
--with-pam: 使用緊密校驗模式。Don't use this option if your login/passwd pairs are always refused (but the real fix would be to
fix your PAM configuration). 需要創(chuàng)建一個 /etc/pam.d/pure-ftpd 文件來運用PAM校驗。'pam' 路徑中包含該文件的一個樣本。
--with-peruserlimits: 開啟每用戶同時在線限制,在繁忙的服務(wù)器上避免該參數(shù)。
--with-pgsql: 使用 Postgres 提供用戶數(shù)據(jù)庫。當開啟該參數(shù),系統(tǒng)帳號將被忽略,Postgres客戶端庫將被安裝。如果Postgres安裝與特殊位置,可以使用--with-pgsql= 語法。
--with-probe-random-dev: Pure-FTPd 使用 /dev/arandom, /dev/urandom 或者/dev/random 設(shè)備來提供嚴格的隨機數(shù)字。這些設(shè)備通常在編譯時被探測。如果想編譯一個二進制包在其它主機上運行,該參數(shù)將在運行時被探測。該參數(shù)在Linux和BSD系統(tǒng)上無效,但可以使用在Solaris 和 QNX上。
--with-puredb: 支持虛擬用戶,一個本地的用戶數(shù)據(jù)庫,不用于系統(tǒng)帳號。
--with-boring: 顯示 "professionnal-looking" 信息。
--with-privsep: 開啟權(quán)限分離。
--withrendez-vous: 允許在MacOS X上支持Rendezvous。
--without-ascii: 不支持 7-bits 傳輸 (ASCII)。如果有客戶使用windows客戶端程序發(fā)送腳本和HTML文件,不要使用 該參數(shù)或讓他們對你大叫。
--without-banner: 不使用初始標語,這是一種通過隱瞞獲得的愚蠢的安全。
--without-capabilities: 如果性能庫 (libcap) 被找到,Pure-FTPd 將使用其提供安全性。該參數(shù)不測試這個庫是否存在。如果性能庫沒有正常工作,可以到ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/ 下載。
--without-globbing: 不包括全局代碼。能夠減少內(nèi)存消耗但經(jīng)常不能工作。大多數(shù)用戶不需要使用--without-globbing。Globbing是一個不錯的功能。
--without-humor: 如果你沒有查看過源代碼而使用這個參數(shù),就只好祝你幸運了。
--without-inetd: 如果Pure-FTPd總是運行在standalone模式下,這個參數(shù)可以節(jié)約一些代碼字節(jié)。不要同時使用 --without-inetd和
--without-standalone參數(shù),可能會導致服務(wù)不能運行。這些參數(shù)在Pure-FTPd的二進制分發(fā)包上都沒有使用,所以inetd和standalone都被支持。
--without-iplogging: 為了保守機密而不記錄任何IP地址,除非是政治敏感的服務(wù)器。
--without-nonalnum: 非法文件名檢查。只支持基本的字符。不要盲目的使用這個參數(shù),或者接受用戶的抱怨。
--without-unicode: 不接受非拉丁字符。如果服務(wù)器文件名不含特殊字符則推薦使用。
--without-sendfile: 在Linux, Solaris, HPUX 和 FreeBSD 內(nèi)核, Pure-FTPd采用特殊系統(tǒng)調(diào)用(sendfile)嘗試減少CPU和內(nèi)存的使用。在大多數(shù)文件系統(tǒng)中該方式運行良好,但該優(yōu)化并不能在所有文件系統(tǒng)中正常工作。用戶曾經(jīng)報告過SMBFS(Samba)在FreeBSD以及TmpFS和NTFS在Linux(服務(wù)器報告錯誤為“broken pipe”或“Error during write to data connection”)上通過Pure-FTPd下載文件失敗。如果計劃在上述文件系統(tǒng)中運行服務(wù),就不得不使用
--without-sendfile 參數(shù)來定義一個工作區(qū)。同樣來自PA-Risc Linux 的系統(tǒng)也需要這個參數(shù)。
--without-shadow: 忽略shadow密碼,即使他們被自動探測到。這通常是一個壞主意,除非使用的是PAM, LDAP 或 SQL。Pure-FTPd 支持shadow密碼有效期 (包括帳號和密碼)。.
--without-standalone: FTP 服務(wù)器能夠正常地以 standalone 模式運行(沒有任何超級服務(wù))。如果不需要該功能并且想要節(jié)省一些代碼字節(jié)的話,就可以開啟該參數(shù)。一個類似于g2s, xinetd或tcpserver 的超級服務(wù)將強制運行該服務(wù),但是推薦使用standalone模式。
--without-usernames: 從不在在路徑列表里輸出用戶和組名,而代之以UIDs和GIDs。這將提高安全和性能,但會有用戶覺得不夠友好。
--without-capabilities: 如果性能庫 (libcap) 被找到,Pure-FTPd 將使用其提供安全性。該參數(shù)不測試這個庫是否存在。如果性能庫沒有正常工作,可以到ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/ 下載。
--without-usernames: 從不在在路徑列表里輸出用戶和組名,而代之以UIDs和GIDs。這將提高安全和性能,但會有用戶覺得不夠友好。
"--prefix=" 改變安裝路徑,默認為 "/usr/local/".
配置文件詳解
pure-ftpd.conf
ChrootEveryone yes
chroot每一個用戶,等同于Proftpd 中的DefaultRoot~ , 可以限制用戶在某個地方活動,增強服務(wù)器的安全性。使用戶不能通過cd命令進入上一級目錄。
TrustedGID 50
#以上兩者要一起用
BrokenClientsCompatibility no
MaxClientsNumber 50
#最大鏈接數(shù)
Daemonize yes
#Fork in background 以守護進程方式在后臺運行
MaxClientsPerIP 5
#每個ip最多鏈接數(shù),最好設(shè)小點。
VerboseLog no
#是否要把所有client端的指令都log下來
DisplayDotFiles no
#顯示開頭的文件
AnonymousOnly no
#是否只讓匿名登錄
NoAnonymous no
#不開放匿名登入
SyslogFacility ftp
#應(yīng)該是對日志做一下過濾 (auth, authpriv, daemon, ftp, security, user, local*)可以讓日志只記錄想要的信息
DontResolve yes
#不反向解釋客戶端的ip
MaxIdleTime 5
#最大閑置時間
#LDAPConfigFile /usr/local/pureftpd/etc/pureftpd-ldap.conf
#使用LDAP認證,
MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf
#使用MySQL認證
#PGSQLConfigFile /usr/local/pureftpd/etc/pureftpd-pgsql.conf
#使用PGSQL認證
#PureDB /ftp/etc/pureftpd.pdb
#使用者資料的DB存放地點 [由于我是用PureFTPD的內(nèi)建DB.固有此選項]
#ExtAuth /var/run/ftpd.sock
#pure-authd socket 路徑 (詳細請看 README.Authentication-Modules)
#PAMAuthentication yes
#開啟PAM認證
#UnixAuthentication yes
#如果你想要有簡單的Unix(/etc/passwd)的認證的話
FortunesFile /usr/local/pureftpd/etc/.welcome
#顯示的歡迎信息文件,你可以創(chuàng)建該文件,輸入一些文字,然后你重啟你的FTP服務(wù),就會有意外的發(fā)現(xiàn)。
LimitRecursion 2000 8
#ls最多列出3000個文件.最深8層
AnonymousCanCreateDirs no
#匿名用戶可以創(chuàng)建目錄
MaxLoad 4
#當system load超過4時.使用者將不能再下載
PassivePortRange 30000 50000
#被動連接應(yīng)答范圍
ForcePassiveIP 192.168.0.1
#
AnonymousRatio 1 10
#Anonymous連接上傳/下載比率
UserRatio 1 10
#用戶上傳/下載比率(注:如果使用ldap,mysql,pgsql,pam不要啟用該功能,否則你在ldap等中設(shè)置的Ratio無校)
AntiWarez no
#上傳的文件不能被下載(owner is ftp).等到local admin確認
Bind 127.0.0.1,8021
#要綁定和ip/port,在你的系統(tǒng)中有兩個FTP Server這樣你其中一個FTP就要使用其它端口。
#格式-> 127.0.0.1,21 如果只寫port表All ip,port
AnonymousBandwidth 8
#Anonymous 帶寬,單位KB/s
UserBandwidth 8
#用戶帶寬,單位KB/s
Umask 133:022
#上傳文件的Umask.(: )
MinUID 1000
# UID至少多少才能登錄
AllowUserFXP yes
#支不支持FXP
AllowAnonymousFXP no
#Anonymous支不支持FXP
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
#(”.”)開頭的文件能不能被讀/寫,UNIX Like下以點開頭的文件是隱藏文件ls –a才能列出
#Pureftpd Quota模式下做產(chǎn)生” .ftpquota”文件。
AutoRename no
#上傳文件若有相同文件名自動改名(file.1,file.2...)
AnonymousCantUpload no
#匿名用戶上傳文件
TrustedIP 10.1.1.1
#鎖IP.
LogPID
#Log文件添加PID
AltLog stats:/ftp/etc/log/pureftpd.log
#log存放地點,注日志有幾種常用的格式
#clf 類似apache格式,stats UNIX log格式,w3c 標準W3C格式,可能是HTML格式
NoChmod yes
#不給Chmod指令的權(quán)限
KeepAllFiles no
#使用者可續(xù)傳.但不可刪除文件
CreateHomeDir yes
#如果user的home不存在自動建立(我把這個設(shè)為YES)
Quota 1000:10
#Quota :,F(xiàn)TP限制10M空間,可以上傳1000個文件(注:如果使用ldap,mysql,pgsql,pam不要啟用該功能,否則你在ldap等中設(shè)置的Quota無校)
PIDFile /ftp/etc/log/pure-ftpd.pid
#記錄pure-ftpd的PID文件
CallUploadScript yes
#呼叫UploadScript
MaxDiskUsage 99
#當硬盤使用率到多少時將停止上傳
NoRename yes
#用戶不能重命名文件名
CustomerProof yes
PerUserLimits 3:20
#
pureftpd-mysql.conf
MYSQLServer 127.0.0.1
#MYSQL服務(wù)器的 IP
MYSQLPort 3306
#MYSQL 端口號
MYSQLSocket /var/lib/mysql/mysql.sock
#使用UNIX.sock本地連接
注:MYSQLServer 與 MYSQLSocket 選擇一種即可
MYSQLUser ftp
#MYSQLUser 數(shù)據(jù)用戶名
MYSQLPassword 123456
#MYSQL數(shù)據(jù)庫用戶的密碼
MYSQLDatabase ftpusers
#FTP數(shù)據(jù)數(shù)據(jù)庫
MYSQLCrypt md5
#密碼加密方式"cleartext", "crypt", "md5" and "password"
# cleartext 明文,crypt,md5,password是Backend password(‘your-passwd’)函數(shù)(MYSQL數(shù)據(jù)庫所使用的password()函數(shù))
MYSQLGetPW SELECT Password FROM users WHERE User="\L"
# 密碼字段,我使用users表中的Password做為密碼字段
MYSQLGetUID SELECT Uid FROM users WHERE User="\L"
#UID用戶ID字段
MYSQLDefaultUID 1000
#默認的UID (注:如何開啟該選項,MYSQLGetUID將失去作用)
MYSQLGetGID SELECT Gid FROM users WHERE User="\L"
#GID組ID字段
MYSQLDefaultGID 1000
#默認的GID (注:如何開啟該選項,MYSQLGetGID將失去作用)
MYSQLGetDir SELECT Dir FROM users WHERE User="\L"
#FTP用戶目錄如/home/web/www-9812-net
MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"
#磁盤限額,文件數(shù)限制。如1000,允許用戶上傳1千個文件
MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"
#磁盤限額,F(xiàn)TP用戶空間限制(單位為M),如:100M
MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L"
MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L"
#上傳/下載比率。MySQLGetRatioUL為上傳比,MySQLGetRatioDL下載比。如:1:5
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L"
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L"
#下傳/下載帶寬(單位KB/s)。MySQLGetBandwidthUL上傳帶寬,MySQLGetBandwidthDL下載帶寬。如上傳500KB/s,下載50KB/s
MySQLForceTildeExpansion 1
MySQLTransactions On
配置文件實例
pure-ftpd.conf配置文件
###############################################################################
# #
# Configuration file for pure-ftpd wrappers #
# #
###############################################################################
# If you want to run Pure-FTPd with this configuration
# instead of command-line options, please run the
# following command :
#
# /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
#
# RPM binary files use another configuration file by default :
# /etc/sysconfig/pure-ftpd
#
# Please don't forget to have a look at documentation at
# http://www.pureftpd.org/documentation.html for a complete list of
# options.
# Cage in every user in his home directory
ChrootEveryone yes
# If the previous option is set to "no", members of the following group
# won't be caged. Others will be. If you don't want chroot()ing anyone,
# just comment out ChrootEveryone and TrustedGID.
# TrustedGID 100
# Turn on compatibility hacks for broken clients
BrokenClientsCompatibility no
# Maximum number of simultaneous users
MaxClientsNumber 50
# Fork in background
Daemonize yes
# Maximum number of sim clients with the same IP address
MaxClientsPerIP 8
# If you want to log all client commands, set this to "yes".
# This directive can be duplicated to also log server responses.
VerboseLog no
# List dot-files even when the client doesn't send "-a".
DisplayDotFiles yes
# Don't allow authenticated users - have a public anonymous FTP only.
AnonymousOnly no
# Disallow anonymous connections. Only allow authenticated users.
NoAnonymous no
# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is "ftp". "none" disables logging.
SyslogFacility ftp
# Display fortune cookies
# FortunesFile /usr/share/fortune/zippy
# Don't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to "yes" on very busy servers or
# if you don't have a working DNS.
DontResolve yes
# Maximum idle time in minutes (default = 15 minutes)
MaxIdleTime 15
# LDAP configuration file (see README.LDAP)
# LDAPConfigFile /etc/pureftpd-ldap.conf
LDAPConfigFile /usr/local/pureftpd/etc/pureftpd-ldap.conf
# MySQL configuration file (see README.MySQL)
# MySQLConfigFile /etc/pureftpd-mysql.conf
MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf
# Postgres configuration file (see README.PGSQL)
# PGSQLConfigFile /etc/pureftpd-pgsql.conf
PGSQLConfigFile /usr/local/pureftpd/etc/pureftpd-pgsql.conf
# PureDB user database (see README.Virtual-Users)
# PureDB /etc/pureftpd.pdb
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
# Path to pure-authd socket (see README.Authentication-Modules)
# ExtAuth /var/run/ftpd.sock
# If you want to enable PAM authentication, uncomment the following line
# PAMAuthentication yes
# If you want simple Unix (/etc/passwd) authentication, uncomment this
# UnixAuthentication yes
# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
# UnixAuthentication can be used only once, but they can be combined
# together. For instance, if you use MySQLConfigFile, then UnixAuthentication,
# the SQL server will be asked. If the SQL authentication fails because the
# user wasn't found, another try # will be done with /etc/passwd and
# /etc/shadow. If the SQL authentication fails because the password was wrong,
# the authentication chain stops here. Authentication methods are chained in
# the order they are given.
# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth
LimitRecursion 2000 8
# Are anonymous users allowed to create new directories ?
AnonymousCanCreateDirs no
# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.
MaxLoad 4
# Port range for passive connections replies. - for firewalling.
# PassivePortRange 30000 50000
# Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
# Symbolic host names are also accepted for gateways with dynamic IP
# addresses.
# ForcePassiveIP 192.168.0.1
# Upload/download ratio for anonymous users.
# AnonymousRatio 1 10
# Upload/download ratio for all users.
# This directive superscedes the previous one.
# UserRatio 1 10
# Disallow downloading of files owned by "ftp", ie.
# files that were uploaded but not validated by a local admin.
AntiWarez yes
# IP address/port to listen to (default=all IP and port 21).
# Bind 127.0.0.1,21
Bind 127.0.0.1,8021
# Maximum bandwidth for anonymous users in KB/s
# AnonymousBandwidth 8
# Maximum bandwidth for *all* users (including anonymous) in KB/s
# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.
# UserBandwidth 8
# File creation mask. : .
# 177:077 if you feel paranoid.
Umask 133:022
# Minimum UID for an authenticated user to log in.
MinUID 100
# Allow FXP transfers for authenticated users only.
AllowUserFXP yes
# Allow anonymous FXP for anonymous and non-anonymous users.
AllowAnonymousFXP no
# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.
ProhibitDotFilesWrite no
# Prohibit *reading* of files beginning with a dot (.history, .ssh...)
ProhibitDotFilesRead no
# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...
AutoRename no
# Disallow anonymous users to upload new files (no = upload is allowed)
AnonymousCantUpload no
# Only connections to this specific IP address are allowed to be
# non-anonymous. You can use this directive to open several public IPs for
# anonymous FTP, and keep a private firewalled IP for remote administration.
# You can also only allow a non-routable local IP (like 10.x.x.x) to
# authenticate, and keep a public anon-only FTP server on another IP.
#TrustedIP 10.1.1.1
# If you want to add the PID to every logged line, uncomment the following
# line.
#LogPID yes
# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
# This log file can then be processed by www traffic analyzers.
# AltLog clf:/var/log/pureftpd.log
# Create an additional log file with transfers logged in a format optimized
# for statistic reports.
# AltLog stats:/var/log/pureftpd.log
#AltLog stats:/var/log/pureftpd.log
# Create an additional log file with transfers logged in the standard W3C
# format (compatible with most commercial log analyzers)
# AltLog w3c:/var/log/pureftpd.log
# Disallow the CHMOD command. Users can't change perms of their files.
#NoChmod yes
# Allow users to resume and upload files, but *NOT* to delete them.
#KeepAllFiles yes
# Automatically create home directories if they are missing
#CreateHomeDir yes
# Enable virtual quotas. The first number is the max number of files.
# The second number is the max size of megabytes.
# So 1000:10 limits every user to 1000 files and 10 Mb.
#Quota 1000:10
# If your pure-ftpd has been compiled with standalone support, you can change
# the location of the pid file. The default is /var/run/pure-ftpd.pid
#PIDFile /var/run/pure-ftpd.pid
# If your pure-ftpd has been compiled with pure-uploadscript support,
# this will make pure-ftpd write info about new uploads to
# /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and
# spawn a script to handle the upload.
#CallUploadScript yes
# This option is useful with servers where anonymous upload is
# allowed. As /var/ftp is in /var, it save some space and protect
# the log files. When the partition is more that X percent full,
# new uploads are disallowed.
MaxDiskUsage 99
# Set to 'yes' if you don't want your users to rename files.
#NoRename yes
# Be 'customer proof' : workaround against common customer mistakes like
# 'chmod 0 public_html', that are valid, but that could cause ignorant
# customers to lock their files, and then keep your technical support busy
# with silly issues. If you're sure all your users have some basic Unix
# knowledge, this feature is useless. If you're a hosting service, enable it.
CustomerProof yes
# Per-user concurrency limits. It will only work if the FTP server has
# been compiled with --with-peruserlimits (and this is the case on
# most binary distributions) .
# The format is : :
# For instance, 3:20 means that the same authenticated user can have 3 active
# sessions max. And there are 20 anonymous sessions max.
# PerUserLimits 3:20
pureftpd-mysql.conf配置文件
###############################################################################
# #
# Sample Pure-FTPd Mysql configuration file. #
# See README.MySQL for explanations. #
# #
###############################################################################
# Optional : MySQL server name or IP. Don't define this for unix sockets.
#MYSQLServer 127.0.0.1
# Optional : MySQL port. Don't define this if a local unix socket is used.
#MYSQLPort 3306
# Optional : define the location of mysql.sock if the server runs on this host.
MYSQLSocket /var/lib/mysql/mysql.sock
# Mandatory : user to bind the server as.
MYSQLUser pureftpd
# Mandatory : user password. You must have a password.
MYSQLPassword qKiscCbwbXAkWp.
# Mandatory : database to open.
MYSQLDatabase pureftpd
# Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "password"
# ("password" = MySQL password() function)
# You can also use "any" to try "crypt", "md5" *and* "password"
#MYSQLCrypt leartext
MYSQLCrypt crypt
# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute in order to fetch the password
MYSQLGetPW SELECT Password FROM users WHERE User="\L"
# Query to execute in order to fetch the system user name or uid
MYSQLGetUID SELECT Uid FROM users WHERE User="\L"
# Optional : default UID - if set this overrides MYSQLGetUID
#MYSQLDefaultUID 1000
# Query to execute in order to fetch the system user group or gid
MYSQLGetGID SELECT Gid FROM users WHERE User="\L"
# Optional : default GID - if set this overrides MYSQLGetGID
#MYSQLDefaultGID 1000
# Query to execute in order to fetch the home directory
MYSQLGetDir SELECT Dir FROM users WHERE User="\L"
# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"
# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"
# Optional : ratios. The server has to be compiled with ratio support.
# MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L"
# MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L"
# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s .
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L"
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L"
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match.
# MySQLForceTildeExpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (
DocumentRoot "/home/chb/ftp"
ServerName www.chb.com
allow from all
Options +Indexes
###################################增加ftp啟動項###############################
ee /etc/rc.conf
添加
pureftpd_enable="YES"
qmail服務(wù)器安裝
###################################下載軟件包##################################
Part 1 - Download the Software(http://www.qmailrocks.org/downloads/qmailrocks.tar.gz)
mkdir /downloads
cd /downloads
tar zxvf qmailrocks.tar.gz
##################################安裝qmail主程序##############################
Part 2 - Installing Qmail Itself
/downloads/qmailrocks/scripts/install/qmr_install_freebsd-s1.script
############qmr_install_freebsd-s1.script內(nèi)容##############
#!/bin/sh
#An automation script to start the installation of qmail, ucspi-tcp and daemontools
#Specially formulated for Redhat, Fedora, RHEL and Whitebox Linux. :)
echo "Creating initial qmail directories..."
echo
sleep 2
cd /downloads/qmailrocks
mkdir -p /var/qmail
mkdir /usr/src/qmail
echo "Done!"
echo
sleep 2
echo "Creating all needed users and groups..."
echo
sleep 2
#######
#Script to add users and groups for FreeBSD
#Add all need Qmail users and groups
pw groupadd nofiles
pw useradd alias -g nofiles -d /var/qmail/alias -s /sbin/nologin
pw useradd qmaild -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmaill -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmailp -g nofiles -d /var/qmail -s /sbin/nologin
pw groupadd qmail
pw useradd qmailq -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmailr -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmails -g qmail -d /var/qmail -s /sbin/nologin
#Add vpopmail users/groups
pw groupadd vchkpw
pw useradd vpopmail -g vchkpw -m -d /usr/home/vpopmail -s /sbin/nologin
#######
echo "Done!"
echo
sleep 2
echo "Unpacking qmail, ucspi-tcp and daemontools..."
echo
sleep 2
cd /usr/src/qmail
tar zxvf /downloads/qmailrocks/qmail-1.03.tar.gz
tar zxvf /downloads/qmailrocks/ucspi-tcp-0.88.tar.gz
mkdir -p /package
chmod 1755 /package
cd /package
tar zxvf /downloads/qmailrocks/daemontools-0.76.tar.gz
echo "Done!"
echo
sleep 2
echo "Next, we setup special logging directories..."
echo
sleep 2
mkdir /var/log/qmail
cd /var/log/qmail
mkdir qmail-send qmail-smtpd qmail-pop3d
chown -R qmaill:wheel /var/log/qmail
chmod -R 750 /var/log/qmail
echo "Done!"
echo
sleep 2
echo "And set up the supervise script directories..."
echo
sleep 2
mkdir /var/qmail/supervise
cd /var/qmail/supervise
mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log
chmod +t qmail-smtpd qmail-send qmail-pop3d
echo "Setting conf-split and conf-spawn"
echo
sleep 2
echo 211 > /usr/src/qmail/qmail-1.03/conf-split
echo 255 > /usr/src/qmail/qmail-1.03/conf-spawn
echo "All steps completed!"
echo
sleep 2
######################### qmr_install_freebsd-s1.script內(nèi)容#########################
###############################################################################
/downloads/qmailrocks/scripts/util/qmail_patches.script
############### qmail_patches.script內(nèi)容##############
#!/bin/sh
#An automation script to start the installation of qmail, ucspi-tcp and daemontools
#Specially formulated for Redhat, Fedora, RHEL and Whitebox Linux. :)
echo "Creating initial qmail directories..."
echo
sleep 2
cd /downloads/qmailrocks
mkdir -p /var/qmail
mkdir /usr/src/qmail
echo "Done!"
echo
sleep 2
echo "Creating all needed users and groups..."
echo
sleep 2
#######
#Script to add users and groups for FreeBSD
#Add all need Qmail users and groups
pw groupadd nofiles
pw useradd alias -g nofiles -d /var/qmail/alias -s /sbin/nologin
pw useradd qmaild -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmaill -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmailp -g nofiles -d /var/qmail -s /sbin/nologin
pw groupadd qmail
pw useradd qmailq -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmailr -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmails -g qmail -d /var/qmail -s /sbin/nologin
#Add vpopmail users/groups
pw groupadd vchkpw
pw useradd vpopmail -g vchkpw -m -d /usr/home/vpopmail -s /sbin/nologin
#######
echo "Done!"
echo
sleep 2
echo "Unpacking qmail, ucspi-tcp and daemontools..."
echo
sleep 2
cd /usr/src/qmail
tar zxvf /downloads/qmailrocks/qmail-1.03.tar.gz
tar zxvf /downloads/qmailrocks/ucspi-tcp-0.88.tar.gz
mkdir -p /package
chmod 1755 /package
cd /package
tar zxvf /downloads/qmailrocks/daemontools-0.76.tar.gz
echo "Done!"
echo
sleep 2
echo "Next, we setup special logging directories..."
echo
sleep 2
mkdir /var/log/qmail
cd /var/log/qmail
mkdir qmail-send qmail-smtpd qmail-pop3d
chown -R qmaill:wheel /var/log/qmail
chmod -R 750 /var/log/qmail
echo "Done!"
echo
sleep 2
echo "And set up the supervise script directories..."
echo
sleep 2
mkdir /var/qmail/supervise
cd /var/qmail/supervise
mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log
chmod +t qmail-smtpd qmail-send qmail-pop3d
echo "Setting conf-split and conf-spawn"
echo
sleep 2
echo 211 > /usr/src/qmail/qmail-1.03/conf-split
echo 255 > /usr/src/qmail/qmail-1.03/conf-spawn
echo "All steps completed!"
echo
sleep 2
############################## qmail_patches.script內(nèi)容###########################
###############################################################################
cd /usr/src/qmail/qmail-1.03
make man
make setup check
./config-fast mail.tjhaina.net
/usr/ports/mail/qmail
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cd /usr/src/qmail/ucspi-tcp-0.88/
make
make setup check
/usr/ports/sysutils/ucspi-tcp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cd /package/admin/daemontools-0.76
package/install
reboot
/usr/ports/sysutils/daemontools
################################Part 3 - EZmlm##################################
Part 3 - EZmlm
cd /downloads/qmailrocks/
tar zxvf ezmlm-0.53-idx-0.41.tar.gz
cd ezmlm-0.53-idx-0.41
make
make setup
/usr/ports/mail/ezmlm
############################Part 4 - Qmail-Autoresponder ##########################
Part 4 - Qmail-Autoresponder
#pkg_add -r qmail-autoresponder
cd /downloads/qmailrocks
pkg_add qmail-autoresponder-0.96.1.tbz
/usr/ports/mail/qmail-autoresponder
################################art 5 - Vpopmail#################################
Part 5 - Vpopmail(I would like to install vpopmail with MySQL integration)
mkdir -p ~vpopmail/etc
mysql -u root -p
CREATE DATABASE vpopmail;
GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY 'password';
quit
mysql -u vpopmailuser -p
quit
upload
iGENUS.mysql
mysql -u root -p  ~vpopmail/etc/vpopmail.mysql
chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql
chmod 640 ~vpopmail/etc/vpopmail.mysql
/home/vpopmail/bin/vadddomain 你的域名
之后回提示輸入域管理員的密碼
/home/vpopmail/bin/vadduser 郵件用戶@你的域名
之后回提示輸入郵件用戶的密碼
/usr/ports/mail/vpopmail
#############################Part 6 - Vqadmin###################################
Part 6 - Vqadmin
cd /downloads/qmailrocks
tar zxvf vqadmin-2.3.6.tar.gz
cd vqadmin-2.3.6
./configure \
--enable-cgibindir=/usr/local/www/cgi-bin \
--enable-htmldir=/usr/local/www/html
make
make install-strip
Now you will need to add the following to your server's Apache configuration file (usually called httpd.conf)
ee /usr/local/etc/apache/httpd.conf
在末尾添加
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
cd /usr/local/www/cgi-bin/vqadmin
ee .htaccess
AuthType Basic
AuthUserFile /usr/local/etc/apache/conf/vqadmin.passwd
AuthName vQadmin
require valid-user
satisfy any
mkdir /usr/local/etc/apache/conf
chown www .htaccess
chmod 644 .htaccess
htpasswd -bc /usr/local/etc/apache/conf/vqadmin.passwd admin password
chmod 644 /usr/local/etc/apache/conf/vqadmin.passwd
apachectl stop
apachectl start
http://192.168.0.205/cgi-bin/vqadmin/vqadmin.cgi
/usr/ports/mail/vqadmin
##############################Part 7 - Maildrop###################################
Part 7 - Maildrop
cd /downloads/qmailrocks
tar zxvf maildrop-1.6.3.tar.gz
cd maildrop-1.6.3
./configure \
--prefix=/usr/local \
--exec-prefix=/usr/local \
--enable-maildrop-uid=root \
--enable-maildrop-gid=vchkpw \
--enable-maildirquota
make
make install-strip
make install-man
/usr/ports/mail/maildrop
##############################Part 8 - Qmailadmin#############################
Part 8 - Qmailadmin
cd /downloads/qmailrocks
tar zxvf qmailadmin-1.2.3.tar.gz
cd qmailadmin-1.2.3
./configure \
--enable-cgibindir=/usr/local/www/cgi-bin \
--enable-htmldir=/usr/local/www/html/directory \
--enable-autoresponder-path=/usr/local/bin/qmail-autoresponder
make
make install-strip
/usr/ports/mail/qmailadmin
####################################Part 9 - Finalizing Qmail#######################
Part 9 - Finalizing Qmail
/downloads/qmailrocks/scripts/finalize/freebsd/finalize_freebsd.script
################# finalize_freebsd.script##############
#!/bin/sh
echo "This scripts will perform 3 functions:\n
1. Copy all supervise scripts to their proper locations.\n
2. Copy the qmail rc and qmailctl scripts to their proper locations and create needed symlinks.\n
3. Set all needed permisions on all supervise scripts.\n"
echo
echo "Press ENTER to proceeed"
read
echo
sleep 2
echo "Copying supervise scripts to their correct locations..."
echo
sleep 2
cp /downloads/qmailrocks/scripts/finalize/freebsd/pop3d_run /var/qmail/supervise/qmail-pop3d/run
cp /downloads/qmailrocks/scripts/finalize/freebsd/pop3d_log /var/qmail/supervise/qmail-pop3d/log/run
cp /downloads/qmailrocks/scripts/finalize/freebsd/smtpd_run /var/qmail/supervise/qmail-smtpd/run
cp /downloads/qmailrocks/scripts/finalize/freebsd/smtpd_log /var/qmail/supervise/qmail-smtpd/log/run
cp /downloads/qmailrocks/scripts/finalize/freebsd/send_run /var/qmail/supervise/qmail-send/run
cp /downloads/qmailrocks/scripts/finalize/freebsd/send_log /var/qmail/supervise/qmail-send/log/run
echo Done!
echo
sleep 2
echo "Copying rc and qmailctl scripts to proper locations..."
echo
sleep 2
cp /downloads/qmailrocks/scripts/finalize/rc /var/qmail/
cp /downloads/qmailrocks/scripts/finalize/qmailctl /var/qmail/bin/
echo Done!
echo
sleep 2
echo "Setting needed permisions..."
echo
sleep 2
chmod 755 /var/qmail/rc /var/qmail/bin/qmailctl
chmod 751 /var/qmail/supervise/qmail-pop3d/run
chmod 751 /var/qmail/supervise/qmail-pop3d/log/run
chmod 751 /var/qmail/supervise/qmail-smtpd/run
chmod 751 /var/qmail/supervise/qmail-smtpd/log/run
chmod 751 /var/qmail/supervise/qmail-send/run
chmod 751 /var/qmail/supervise/qmail-send/log/run
echo ./Maildir > /var/qmail/control/defaultdelivery
echo 255 > /var/qmail/control/concurrencyremote
chmod 644 /var/qmail/control/concurrencyremote
echo 30 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
ln -s /var/qmail/bin/qmailctl /usr/bin
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /var/qmail/supervise/qmail-pop3d /service
echo "Done!"
echo
sleep 2
echo "Script Complete!"
echo
################# finalize_freebsd.script##############
#######################################################
ee /var/qmail/supervise/qmail-pop3d/run
Find "mail.example.com" and change it to your server's hostname. For example: mail.mydomain.com.
ee /var/qmail/supervise/qmail-smtpd/run
Find "mail.example.com" and change it to your server's hostname. For example: mail.mydomain.com
qmailctl stop
echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
qmailctl cdb
echo b.s.d@163.com > /var/qmail/alias/.qmail-root
where "some_address" is the system user or email address you want these addresses aliased to.
echo b.s.d@163.com > /var/qmail/alias/.qmail-postmaster
where "some_address" is the system user or email address you want these addresses aliased to.
echo b.s.d@163.com > /var/qmail/alias/.qmail-mailer-daemon
where "some_address" is the system user or email address you want these addresses aliased to.
ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous
chmod 644 /var/qmail/alias/.qmail*
##########################Part 10 - Uninstalling Sendmail###########################
Part 10 - Uninstalling Sendmail
killall sendmail
mv /usr/sbin/sendmail /usr/sbin/sendmail.old
mv /usr/lib/sendmail /usr/lib/sendmail.old(this may not apply if there is no sendmail link or binary in this location)
chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old
Now we will need to instruct FreeBSD not to attempt to start Sendmail upon startup. This is done by make the following
modification to the /etc/rc.conf file:
Change sendmail_enable="YES" to sendmail_enable="NONE"
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
#ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
########################Part 11 - Starting up qmail#################################
Part 11 - Starting up qmail
/downloads/qmailrocks/scripts/util/qmr_inst_check
################# qmr_inst_check內(nèi)容###################
#!/bin/sh
# Qmailrocks, 2003-12-05
# I've modified Dave Sill's script slightly to accomodate
# the variations between his Qmail installation and the
# Qmailrocks.org installation. The Qmailrocks version
# of this script takes into account the slightly different
# loggind directory setup and a few permissions differences.
# http://www.qmailrocks.org/downloads/scripts/qmr_inst_check
# Dave Sill, 2003-11-10
# http://lifewithqmail.org/inst_check
# set to n if you're not running a pop3 server, y if you are
CHECKPOP=y
CHECKSEND=y
QMHOME=/var/qmail
LBIN=/usr/local/bin
OK=1
if [ $# -eq 1 ]; then
if [ "$1" = "-v" ]; then
VERB=y
else
VERB=n
fi
fi
if [ ! -d $QMHOME ]; then
echo "! Couldn't find qmail's home directory, $QMHOME!"
else
if [ "$VERB" = y ]; then
echo "$QMHOME exists"
fi
for i in alias bin boot control doc man queue supervise users; do
if [ ! -d $QMHOME/$i ]; then
echo "! Couldn't find $QMHOME/$i!"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/$i exists"
fi
done
if [ ! -f $QMHOME/rc ]; then
echo "! $QMHOME/rc is missing"
OK=0
elif [ ! -x $QMHOME/rc ]; then
echo "! $QMHOME/rc is not executable"
echo "...try: chmod 755 $QMHOME/rc"
OK=0
elif [ `head -1 $QMHOME/rc|cat -vet` != '#!/bin/sh$' ]; then
echo "! $QMHOME/rc has bad magic cookie"
echo "...try: dos2unix $QMHOME/rc"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/rc is executable and has a valid magic cookie"
fi
fi
for i in alias qmaild qmaill qmailp qmailq qmailr qmails; do
grep "^$i:" /etc/passwd >/dev/null
if [ $? -ne 0 ]; then
echo "! Couldn't find $i user in /etc/passwd"
OK=0
elif [ "$VERB" = y ]; then
echo "$i user exists"
fi
done
for i in qmail nofiles; do
grep "^$i:" /etc/group >/dev/null
if [ $? -ne 0 ]; then
echo "! Couldn't find $i group in /etc/group"
OK=0
elif [ "$VERB" = y ]; then
echo "$i group exists"
fi
done
for i in tcprules tcpserver; do
if [ ! -x $LBIN/$i ]; then
echo "! Couldn't find $LBIN/$i from ucspi-tcp"
OK=0
elif [ "$VERB" = y ]; then
echo "$i from ucspi-tcp is installed"
fi
done
for i in multilog softlimit setuidgid supervise svok svscan tai64nlocal; do
if [ ! -x $LBIN/$i ]; then
echo "! Couldn't find $LBIN/$i from daemontools"
OK=0
elif [ "$VERB" = y ]; then
echo "$i from daemontools is installed"
fi
done
if [ ! -d /service ]; then
echo "! /service directory is missing"
OK=0
elif [ "$VERB" = y ]; then
echo "/service directory exists"
fi
if [ -f /etc/inittab ]; then
grep "^SV" /etc/inittab >/dev/null
if [ $? -ne 0 ]; then
echo "! Couldn't find SV entry in inittab"
OK=0
elif [ "$VERB" = y ]; then
echo "svscan /service is configured to run via /etc/inittab"
fi
PS="ps -ef"
else
grep "svscanboot" /etc/rc.local >/dev/null
if [ $? -ne 0 ]; then
echo "! Couldn't find 'csh -cf '/command/svscanboot &' in /etc/rc.local"
OK=0
elif [ "$VERB" = y ]; then
echo "/command/svscanboot is configured to run via /etc/rc.local"
fi
PS="ps -waux"
fi
SVRUN=`$PS | grep "svscan /service" | grep -v grep`
if [ -z "$SVRUN" ]; then
echo "'! svscan /service' doesn't seem to be running"
OK=0
elif [ "$VERB" = y ]; then
echo "svscan /service is running"
fi
if [ ! -f $QMHOME/control/defaultdelivery ]; then
echo "! Couldn't find $QMHOME/control/defaultdelivery"
OK=0
elif [ ! -s $QMHOME/control/defaultdelivery ]; then
echo "! $QMHOME/control/defaultdelivery is empty"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/control/defaultdelivery looks OK"
fi
if [ ! -f $QMHOME/bin/qmailctl ]; then
echo "! $QMHOME/bin/qmailctl is missing"
OK=0
elif [ ! -s $QMHOME/bin/qmailctl ]; then
echo "! $QMHOME/bin/qmailctl is empty"
OK=0
elif [ `head -1 $QMHOME/bin/qmailctl|cat -vet` != '#!/bin/sh$' ]; then
echo "! $QMHOME/bin/qmailctl has bad magic cookie"
echo "...try: dos2unix $QMHOME/bin/qmailctl"
OK=0
elif [ ! -x $QMHOME/bin/qmailctl ]; then
echo "! $QMHOME/bin/qmailctl is not executable"
echo "...try: chmod 755 $QMHOME/bin/qmailctl"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/bin/qmailctl looks OK"
fi
if [ ! -L /usr/bin/qmailctl ]; then
echo "! /usr/bin/qmailctl is missing"
echo "...try: ln -s $QMHOME/bin/qmailctl /usr/bin"
OK=0
elif [ "$VERB" = y ]; then
echo "/usr/bin/qmailctl exists"
fi
SVCDIRS="qmail-send qmail-send/log qmail-smtpd qmail-smtpd/log"
if [ "$CHECKPOP" = "y" ]; then
SVCDIRS="$SVCDIRS qmail-pop3d qmail-pop3d/log"
fi
for i in $SVCDIRS; do
if [ ! -f $QMHOME/supervise/$i/run ]; then
echo "! $QMHOME/supervise/$i/run file is missing"
OK=0
elif [ `head -1 $QMHOME/supervise/$i/run|cat -vet` != '#!/bin/sh$' ]; then
echo "! $QMHOME/supervise/$i/run has bad magic cookie"
echo "...try: dos2unix $QMHOME/supervise/$i/run"
OK=0
elif [ ! -x $QMHOME/supervise/$i/run ]; then
echo "! $QMHOME/supervise/$i/run file is not executable"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/supervise/$i/run looks OK"
fi
done
if [ ! -f $QMHOME/control/concurrencyincoming ]; then
echo "! $QMHOME/control/concurrencyincoming is missing"
echo "...try: echo 30 >$QMHOME/control/concurrencyincoming"
OK=0
elif [ "$VERB" = y ]; then
echo "$QMHOME/control/concurrencyincoming looks OK"
fi
LOGDIRS="/var/log/qmail /var/log/qmail/qmail-smtpd"
if [ "$CHECKPOP" = "y" ]; then
LOGDIRS="$LOGDIRS /var/log/qmail/qmail-pop3d"
fi
if [ "$CHECKSEND" = "y" ]; then
LOGDIRS="$LOGDIRS /var/log/qmail/qmail-send"
fi
for i in $LOGDIRS; do
if [ ! -d $i ]; then
echo "! $i is missing"
echo "...try: mkdir -p $i"
OK=0
elif [ "`ls -ld $i|awk '{print $3}'`" != "qmaill" ]; then
echo "! $i has wrong owner, should be qmaill"
echo "...try: chown qmaill $i"
OK=0
elif [ "`ls -ld $i|awk '{print $1}'`" != "drwxr-x---" ]; then
echo "! $i has wrong mode, should be 750"
echo "...try: chmod 750 $i"
OK=0
elif [ "$VERB" = y ]; then
echo "$i looks OK"
fi
done
SVCLINKS="/service/qmail-send /service/qmail-smtpd"
if [ "$CHECKPOP" = "y" ]; then
SVCLINKS="$SVCLINKS /service/qmail-pop3d"
fi
for i in $SVCLINKS; do
if [ ! -L $i ]; then
echo "! $i is missing"
echo "...try: ln -s $QMHOME$i $i"
OK=0
elif [ "$VERB" = y ]; then
echo "$i exists"
fi
done
if [ ! -f /etc/tcp.smtp ]; then
echo "! /etc/tcp.smtp is missing"
echo "...try: echo '127.:allow,RELAYCLIENT=\"\"' >>/etc/tcp.smtp"
OK=0
elif [ "$VERB" = y ]; then
echo "/etc/tcp.smtp exists"
fi
if [ ! -f /etc/tcp.smtp.cdb ]; then
echo "! /etc/tcp.smtp.cdb is missing"
echo "...try: $QMHOME/bin/qmailctl cdb"
OK=0
elif [ "$VERB" = y ]; then
echo "/etc/tcp.smtp.cdb exists"
fi
AHOME=`grep "^alias:" /etc/passwd | awk -F: '{print $6}'`
if [ -z "$AHOME" ]; then
echo "! Couldn't find user alias's home directory"
OK=0
else
for i in root postmaster mailer-daemon; do
if [ ! -f $AHOME/.qmail-$i ]; then
echo "! Alias for $i is missing"
echo "...try: echo me >$AHOME/.qmail-$i"
OK=0
elif [ "$VERB" = y ]; then
echo "$i alias exists"
fi
done
fi
if netstat -a | grep smtp | grep -i listen >/dev/null; then
if $PS | grep sendmail | grep -v grep >/dev/null; then
echo "! Sendmail is still running"
echo "...try: $RCDIR/init.d/sendmail stop"
OK=0
elif $LBIN/svok /service/qmail-smtpd; then
if [ "$VERB" = y ]; then
echo "/service/qmail-smtpd is running"
fi
else
echo "! Something is listening on port 25 (not tcpserver/qmail-smtpd)"
echo "...try: disabling current MTA"
OK=0
fi
fi
if [ "$CHECKPOP" = "y" ]; then
if netstat -a | grep pop | grep -i listen >/dev/null; then
if $LBIN/svok /service/qmail-pop3d; then
if [ "$VERB" = y ]; then
echo "/service/qmail-pop3d is running"
fi
else
echo "! Something is listening on port 110 (not tcpserver/qmail-pop3d)"
echo "...try: disabling other POP server"
OK=0
fi
fi
fi
for i in /usr/lib/sendmail /usr/sbin/sendmail; do
if [ -f $i -a ! -L $i ]; then
echo "! $i is a file, should be a link"
echo "...try: uninstalling current MTA or: mv $i $i.old; ln -s $QMHOME/bin/sendmail $i"
OK=0
elif [ ! -f $i ];then
echo "! $i is missing"
echo "...try: ln -s $QMHOME/bin/sendmail $i"
OK=0
elif [ "$VERB" = y ]; then
echo "$i exists"
fi
done
if [ $OK -eq 1 ]; then
echo "Congratulations, your Qmailrocks.org Qmail installation looks good!"
elif [ "$VERB" = y ]; then
echo "! Potential problems were found with your LWQ installation"
fi
################# qmr_inst_check內(nèi)容###################
#######################################################
qmailctl stop
qmailctl start
telnet localhost 110
you should see something like this:
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
+OK  
user postmaster@mydomain.com (enter your username here. remember to use the full e-mail address)
+OK
pass your_password
+OK
quit
+OK
Connection closed by foreign host.
This is the sign of a successfull POP connection to the server!
Now try sending mail to that same user from another location. Telnet to 110 again and run the "list" command and you should
see the message that your send...
telnet localhost 110
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
+OK  
user postmaster@mydomain.com (again, remember to log in with the full email address of the user)
+OK
pass your_password
+OK
list
+OK
1 323 (there's your message!)
.
quit
+OK
Connection closed by foreign host.
########################Part 12 - Installing Courier IMAP & IMAP SSL################
Part 12 - Installing Courier IMAP & IMAP SSL
cd /downloads/qmailrocks/
/usr/bin/bunzip2 courier-imap-3.0.8.tar.bz2 (Note: some systems may use bunzip2 instead of bunzip)
#bunzip courier-imap-3.0.8.tar.bz2
tar xvf courier-imap-3.0.8.tar
cd courier-imap-3.0.8
./configure \
--prefix=/usr/local \
--exec-prefix=/usr/local \
--without-authdaemon \
--with-authvchkpw \
--without-authldap \
--disable-root-check \
--with-ssl
make
make install-strip
cd /usr/local/etc
cp imapd.dist imapd
cp imapd-ssl.dist imapd-ssl
/usr/local/sbin/mkimapdcert
ee imapd-ssl
#make sure IMAPDSSLSTART=YES
cp /usr/local/libexec/imapd.rc /usr/local/etc/rc.d/imap.sh
cp /usr/local/libexec/imapd-ssl.rc /usr/local/etc/rc.d/imaps.sh
/usr/local/etc/rc.d/imap.sh start
/usr/local/etc/rc.d/imaps.sh start
telnet localhost 143
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE STARTTLS]
Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc. See COPYING for distribution information.
a login postmaster@mydomain.com my_password
a OK LOGIN Ok. (successful login!)
a logout (logs you out)
* BYE Courier-IMAP server shutting down
a OK LOGOUT completed
Connection closed by foreign host.
#########################Part 14 - Clam Antivirus & Spamassassin####################
Part 14 - Clam Antivirus & Spamassassin
安裝Clamav
cd /usr/ports/security/clamav
make
make install
make clean
注:選中CURL
reboot
測試
/usr/local/bin/clamscan -r -i /usr/local/www/data
----------- SCAN SUMMARY -----------
Known viruses: 32358
Scanned directories: 47
Scanned files: 866
Infected files: 0
Data scanned: 10.32 MB
I/O buffer size: 131072 bytes
Time: 41.750 sec (0 m 41 s)
升級病毒庫
/usr/local/bin/freshclam -l /var/log/clamav/clam-update.log
ClamAV update process started at Fri May 6 00:12:24 2005
WARNING: Your ClamAV installation is OUTDATED - please update immediately!
WARNING: Local version: 0.83 Recommended version: 0.84
Downloading main.cvd

  • main.cvd updated (version: 31, sigs: 33079, f-level: 4, builder: tkojm)
    Downloading daily.cvd

  • daily.cvd updated (version: 871, sigs: 1178, f-level: 4, builder: ccordes)
    Database updated (34257 signatures) from database.clamav.net (IP: 61.8.0.16)
    Clamd successfully notified about the update.


    本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/19204/showart_140436.html
  • 您需要登錄后才可以回帖 登錄 | 注冊

    本版積分規(guī)則 發(fā)表回復

      

    北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年舉報專區(qū)
    中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
    感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP