qmail+rt+dns+apache
生活随笔
收集整理的這篇文章主要介紹了
qmail+rt+dns+apache
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Qmail安裝配置
===============================Qmail安裝配置============================
官方網(wǎng)站http://www.qmailtoaster.com/ 前期準備 清掉防火墻防止影響后面的安裝配置過程
iptables -F
iptables -X
service iptables save 關(guān)閉selinux
vi /etc/selinux/config
SELINUX=disabled yum -y update //更新到最新的
yum install yum-plugin-fastestmirror? //安裝下下載比較快
yum install vim-enhanced //安裝vim編輯器
yum install wget //安裝wget下載軟件 創(chuàng)建兩個文件夾 qmail和src
[root@mail ~]# mkdir qmail
[root@mail qmail]# mkdir src 下載fedora12-deps.sh安裝相關(guān)的包
[root@mail src]# wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-deps.sh [root@mail src]# sh fedora12-deps.sh //根據(jù)實際情況添加刪除里面的內(nèi)容,內(nèi)容如下:
rpm -e --nodeps sendmail
yum -y remove evolution
rpm -e --nodeps exim
yum -y install aspell autoconf automake automake17 bzip2 bzip2-devel compat-gcc-34 compat-gcc-34-c++ curl curl-devel expect expect-devel gcc gcc-c++ gdbm gdbm-devel gmp gmp-devel httpd httpd-devel krb5-devel krb5-libs libidn libidn-devel libtool mysql mysql-devel mysql-server mrtg openssh openssh-clients openssh-server openssl openssl-devel pcre pcre-devel perl-Digest-HMAC perl-Digest-SHA1 perl-Net-DNS perl-CPAN perl-Net-DNS perl-Mail-SPF perl-IO-Zlib perl-Archive-Tar perl-libwww-perl php php-imap php-mysql php-pear redhat-rpm-config rpm-build rpm-devel rpm-libs rpm-python sed setup stunnel which libtool-ltdl libtool-ltdl-devel groff make diffutils perl-HTML-Parser pam-devel procmail ntp ncurses-devel 下載qmail所需的包
[root@mail src]#vim url.txt? //內(nèi)容為包的下載地址見內(nèi)容見附件
[root@mail src]#vim dl.sh
cat url.txt|wc -l
let n=0
while read name; do
let n=$n+1
echo $n
wget -q $name
done <url.txt
[root@mail src]#sh dl.sh?? //執(zhí)行腳本下載安裝qmail所需的包 下載fedora12-perl.sh安裝所需求的包
[root@mail src]#wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-perl.sh [root@mail src]#yum install perl-Test-Pod 下載fedora12-svcs.sh 安裝所需求的包
[root@mail src]# wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-svcs.sh
fedora12-svcs.sh 內(nèi)容見附件 [root@mail src]#rpmbuild --reubild --with fedora_11 XXXXXX? //X代表所需包的名字一個個包編譯下去 編譯的包會出現(xiàn)在: /root/rpmbuild/RPMS/i686/
????????????????? /root/rpmbuild/RPMS/noarch/
rpmbuild --rebuild --with fedora_11 daemontools-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/daemontools-toaster-0.76-1.3.6.i686.rpm rpmbuild --rebuild --with fedora_11 ucspi-tcp-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ucspi-tcp-toaster*.rpm rpmbuild --rebuild --with fedora_11 vpopmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/vpopmail-toaster*.rpm rpmbuild --rebuild --with fedora_11 libdomainkeys-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/libdomainkeys-toaster*.rpm rpmbuild --rebuild --with fedora_11 libsrs2-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/libsrs2-toaster*.rpm rpmbuild --rebuild --with fedora_11 qmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmail-toaster*.rpm
rpm -Uvh ../../rpmbuild/RPMS/i686/qmail-pop3d*.rpm rpmbuild --rebuild --with fedora_11 courier-authlib-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/courier-authlib-toaster*.rpm rpmbuild --rebuild --with fedora_11 courier-imap-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/courier-imap-toaster*.rpm rpmbuild --rebuild --with fedora_11 autorespond-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/autorespond-toaster*.rpm rpmbuild --rebuild --with fedora_11 control-panel-toaster
rpm -Uvh ../../rpmbuild/RPMS/noarch/control-panel-toaster*.rpm
rpm -Uvh ../../rpmbuild/RPMS/noarch/send-emails-toaster rpmbuild --rebuild --with fedora_11 ezmlm-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ezmlm*.rpm rpmbuild --rebuild --with fedora_11 qmailadmin-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmailadmin-toaster*.rpm rpmbuild --rebuild --with fedora_11 qmailmrtg-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmailmrtg-toaster*.rpm rpmbuild --rebuild --with fedora_11 maildrop-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/maildrop-toaster*.rpm rpmbuild --rebuild --with fedora_11 isoqlog-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/isoqlog-toaster*.rpm rpmbuild --rebuild --with fedora_11 vqadmin-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/vqadmin-toaster*.rpm rpmbuild --rebuild --with fedora_11 squirrelmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/noarch/squirrelmail-toaster*.rpm rpmbuild --rebuild --with fedora_11 spamassassin-toaster
rpm -Uvh --nodeps ../../rpmbuild/RPMS/i686/spamassassin-toaster*.rpm rpmbuild --rebuild --with fedora_11 clamav-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/clamav-toaster*.rpm rpmbuild --rebuild --with fedora_11 ripmime-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ripmime-toaster*.rpm rpmbuild --rebuild --with fedora_11 simscan-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/simscan-toaster*.rpm
安裝完成后啟動qmail
reboot ------------------------------------------------------------------------
默認情況下按tab不會顯示出如下信息:
[root@mail etc]# va
vaddaliasdomain? vadddomain?????? vadduser???????? valias
需要編輯profile在后面添加如下信息: [root@mail etc]# vim profile
........
unset i
unset pathmunge
PATH=$PATH:/var/qmail/bin:/home/vpopmail/bin
export PATH [root@mail etc]# source profile 添加域名example.com
[root@mail etc]# vadddomain example.com
Please enter password for postmaster:
enter password again: 查看是否生成新的域名
[root@mail etc]# ls /home/vpopmail/domains/
example.com 添加用戶
[root@mail qmail]# vadduser ganlin@example.com -r
Random password: Dt*SobeI 設(shè)置密碼為ganlin
[root@mail ~]# vpasswd ganlin@example.com ganlin 安裝nmap
[root@mail ~]# yum install nmap 為本地主機host文件添加如下內(nèi)容:
192.168.2.222 mail.example.com
192.168.2.222 web.example.com
192.168.2.222 www.example.com
192.168.2.222 webmail.example.com ===============================Qmail安裝配置============================
Apache配置
================================Apache================================== 在/var/www/目錄下創(chuàng)建example_com文件夾,以及分別創(chuàng)建www mail rt文件夾
Aache配置 [root@mail etc]# cd /var/www/
[root@mail www]# mkdir example_com
[root@mail www]# cd example_com/
[root@mail example_com]# mkdir www mail rt
[root@mail example_com]# cd mail/
[root@mail mail]# mkdir htdocs backups
[root@mail mail]# cd htdocs/
[root@mail htdocs]# cd /etc/httpd/conf.d/
[root@mail conf.d]# vim vhost_mail.conf
------------------------------------------------------------------------
NameVirtualHost *:80
<VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /var/www/example_com/mail/htdocs
??? ServerName mail.example.com
??? ServerAlias webmail.example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/mail_example_com-error_log
??? CustomLog logs/mail_example_com-access_log common
</VirtualHost> ----------------------------------------------------------------------- [root@mail mail]# cd htdocs/
[root@mail htdocs]# ls
[root@mail htdocs]# echo 'mail server works' > index.html
[root@mail conf.d]# cp vhost_mail.conf vhost_www.conf
[root@mail conf.d]# vim vhost_www.conf
------------------------------------------------------------------------
<VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /var/www/example_com/www/htdocs
??? ServerName www.example.com
??? ServerAlias example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/www_example_com-error_log
??? CustomLog logs/www_example_com-access_log common
</VirtualHost>
------------------------------------------------------------------------ [root@mail www]# vim /etc/httpd/conf/httpd.conf
修改Servername localhost
[root@mail www]# service httpd restart
Stopping httpd:??????????????????????????????????????????? [? OK? ]
Starting httpd:??????????????????????????????????????????? [? OK? ] ================================Apache================================== RT ================================RT系統(tǒng)安裝配===========================
參照官網(wǎng)文檔--》http://wiki.bestpractical.com/view/ManualInstallation [root@mail ~]# mkdir rt
[root@mail ~]#wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz
[root@mail ~]#mv rt.tar.gz rt/
[root@mail rt]# tar xzvf rt.tar.gz
[root@mail rt-3.8.7]# ./configure --prefix /opt/rt3 --with-db-database=rt3? --with-db-rt-user=rt --with-db-rt-pass=rt --with-web-user=apache --with-web-group=apache --enable-graphviz --enable-gd --enable-gpg
//參數(shù)含義見http://wiki.bestpractical.com/view/ManualInstallation 用yum來安裝依賴的包
yum -y install perl-Class-ReturnValue perl-TermReadKey perl-Text-Quoted perl-CSS-Squish perl-Module-Versions-Report perl-MIME-Entity perl-Locale-Maketext-Lexicon perl-Tree-Simple perl-Text-Template perl-HTML-Scrubber perl-Calendar-Simple perl-DBIx-SearchBuilder perl-Mail-Mailer perl-File-ShareDirperl-Regexp-Common perl-Cache-Simple-TimedExpiry perl-Locale-Maketext-Fuzzy perl-Text-Wrapper perl-Log-Dispatchperl-UNIVERSAL-require perl-Email-Address perl-HTML-RewriteAttributes perl-MIME-Types perl-CGI-Fast perl-FCGI perl-GD-Text perl-GD perl-GD-Graph perl-PerlIO-eol perl-GnuPG-Interface perl-IPC-Run perl-GraphViz perl-IPC-Run-SafeHandles perl-Data-ICal perl-CSS-Squish perl-Apache-Session perl-HTTP-Server-Simple perl-HTTP-Server-Simple-Mason perl-Net-Server perl-HTML-Mason perl-Apache-Session perl-Text-WikiFormat perl-XML-RSS perl-CSS-Squish perl-MIME-Types perl-HTML-RewriteAttributes perl-Data-ICal perl-TermReadKey perl-PerlIO-eol perl-GnuPG-Interface perl-IPC-Run perl-GraphViz perl-IPC-Run-SafeHandles perl-GD perl-CGI-Fast perl-FCGI perl-HTML-Scrubber perl-Text-Quoted perl-Calendar-Simple perl-DBIx-SearchBuilder perl-CSS-Squish perl-Mail-Mailer perl-Regexp-Common perl-File-ShareDir perl-Module-Versions-Report perl-Cache-Simple-TimedExpiry perl-Locale-Maketext-Lexicon perl-Locale-Maketext-Fuzzy perl-Text-Wrapper perl-Time-ParseDate perl-Log-Dispatch perl-UNIVERSAL-require perl-Tree-Simple perl-Text-Template perl-Email-Address perl-HTML-TreeBuilder-XPath.noarch perl-HTML-FormatText-WithLinks perl-GDTextUtil perl-GDGraph perl-MIME-tools perl-Time-modules.noarch 查看是否還有依賴的包沒有安裝--make testdeps
------------------------------------------------------------------------
下面兩個包一時找不到只好用make fixdeps 修復(fù)了
CGI::Fast ...MISSING
FCGI ...MISSING? make fixdeps //不建議用fixdeps修復(fù)一般用yum安裝
make testdeps發(fā)現(xiàn)所有的包都安裝好了
make install
------------------------------------------------------------------------[root@mail etc]# pwd
/opt/rt3/etc
[root@mail etc]# ls
acl.Informix? acl.Pg?????? RT_Config.pm????? schema.mysql-4.0? schema.Pg
acl.mysql???? acl.Sybase?? RT_SiteConfig.pm? schema.mysql-4.1? schema.SQLite
acl.Oracle??? initialdata? schema.Informix?? schema.Oracle???? schema.Sybase
[root@mail etc]# vim RT_SiteConfig.pm
參照RT_Config.pm配置進行添加有需要的信息
例子:附件為RT_SiteConfig.pm添加的配置信息可以參考
------------------------------------------------------------------------
安裝依賴的包
wget http://cpan.uwinnipeg.ca/cpan/authors/id/J/JE/JESSE/RT-Extension-QuickDelete-0.03.tar.gz
tar xzvf RT-Extension-QuickDelete-0.03.tar.gz
perl Makefile.PL
make install wget http://download.bestpractical.com/pub/rt/release/RTFM-2.4.2.tar.gz
tar xzvf RTFM-2.4.2.tar.gz
perl Makefile.PL
make install wget http://cpan.uwinnipeg.ca/cpan/authors/id/J/JE/JESSE/RT-Extension-QuickDelete-0.03.tar.gz
tar xzvf RT-Extension-QuickDelete-0.03.tar.gz
perl Makefile.PL
make install
[root@mail rt-3.8.7]# make initialize-database
make initialize-database提示如下: /usr/bin/perl -I/opt/rt3/local/lib -I/opt/rt3/lib sbin/rt-setup-database --action drop --dba root --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as root
Please specify that user's database password below. If the user has no database
password, just press return. 默認用戶是root 密碼password
------------------------------------------------------------------------ 配置apache
http://wiki.bestpractical.com/view/ManualApacheConfig
參照Configuring Apache vi /etc/httpd/conf.d/vhost_rt.conf <VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /opt/rt3/share/html
??? ServerName rt.example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/rt_example_com-error_log
??? CustomLog logs/rt_example_com-access_log common
?AddDefaultCharset UTF-8
?? PerlRequire /opt/rt3/bin/webmux.pl
?? <Directory /opt/rt3/share/html>
?????? Order allow,deny
?????? Allow from all
?????? SetHandler perl-script
?????? PerlResponseHandler RT::Mason
?? </Directory>
</VirtualHost>
------------------------------------------------------------------------ 添加郵件配置 添加sales、rt和support郵件賬戶
[root@mail rt]# vadduser sales@example.com -r
Random password: 8OICqjPI
[root@mail rt]# vpasswd sales@example.com welcome
[root@mail rt]# vadduser support@example.com -r
Random password: 6f.7wMfn
[root@mail rt]# vpasswd support@example.com welcome [root@mail named]# vadduser rt@example.com -r
Random password: sHapSzkL
[root@mail named]# vpasswd rt@example.com welcome 添加郵件
參考文檔http://wiki.bestpractical.com/view/ManualEmailConfig [root@mail example.com]# pwd
/home/vpopmail/domains/example.com
[root@mail example.com]# ls -a
.? ..? ganlin? postmaster? .qmail-default? rt? sales? support? test [root@mail example.com]# vim .qmail-sales-comment
|/opt/rt/bin/rt-mailgate --queue Sales --action comment --url http://rt.example.com
[root@mail example.com]# vim .qmail-support-comment
|/opt/rt/bin/rt-mailgate --queue Support --action comment --url http://rt.example.com [root@mail example.com]# ls -a
.?? aaaaa?? postmaster????? .qmail-sales-comment??? rt
..? ganlin? .qmail-default? .qmail-support-comment? test 安裝RT-IR
http://wiki.bestpractical.com/view/RTIR
http://wiki.bestpractical.com/view/Installation 下載包
wget http://download.bestpractical.com/pub/rt/release/RT-IR-2.4.3.tar.gz
解壓
tar xzf RT-IR-2.4.3.tar.gz
cd RT-IR-2.4.3 編譯
perl Makefile.PL 安裝所需求的包 wget http://dag.wieers.com/rpm/packages/perl-Net-Whois-RIPE/perl-Net-Whois-RIPE-1.22-1.rf.src.rpm
rpmbuild --rebuild perl-Net-Whois-RIPE-1.22-1.rf.src.rpm
rpm -ivh perl-Net-Whois-RIPE-1.22-1.rf.noarch.rpm
?
wget http://dag.wieers.com/rpm/packages/perl-Regexp-Common-net-CIDR/perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm rpmbuild --rebuild perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
rpm -ivh perl-Regexp-Common-net-CIDR-0.01-1.rf.noarch.rpm perl Makefile.PL make install
[root@mail RT-IR-2.4.3]# make initdb
/usr/bin/perl -Ilib -I/opt/rt3/local/lib -I/opt/rt3/lib /opt/rt3/sbin/rt-setup-database --action insert --datadir etc --datafile etc/initialdata --dba rt --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as rt
Please specify that user's database password below. If the user has no database
password, just press return. Password: /etc/init.d/httpd stop
/etc/init.d/httpd start Then edit your RT_Config (or RT_SiteConfig) to replace the line: Set(@Plugins, qw(RT::FM));
by: Set(@Plugins, 'RT::FM', 'RT::IR');
------------------------------------------------------------------------
RTFM 安裝 cd /usr/local/src
wget http://download.bestpractical.com/pub/rt/release/RTFM-2.4.1.tar.gz
tar zxf RTFM-2.4.1.tar.gz
cd RTFM-2.4.1
perl Makefile.PL
wget http://download.bestpractical.com/pub/rt/release/RT-IR-2.4.3.tar.gz wget http://dag.wieers.com/rpm/packages/perl-Net-Whois-RIPE/perl-Net-Whois-RIPE-1.22-1.rf.src.rpm wget http://dag.wieers.com/rpm/packages/perl-Regexp-Common-net-CIDR/perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
rpmbuild --rebuild perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
make install
make initdb Then edit your RT_SiteConfig (or RT_Config) to include this line: Set(@Plugins,qw(RT::FM));
[root@mail RTFM-2.4.2]# make initdb
/usr/bin/perl -Ilib -I/opt/rt3/local/lib -I/opt/rt3/lib /opt/rt3/sbin/rt-setup-database --action schema --datadir etc --dba rt --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as rt
Please specify that user's database password below. If the user has no database
password, just press return. Password:
================================RT系統(tǒng)安裝配=========================== DNS安裝配置 參考文檔鏈接
https://www.isc.org/software/bind/documentation/arm96#id2570296
==============================DNS配置===================================
[root@mail named]# rpm -qa |grep bind*
binutils-2.19.51.0.14-34.fc12.i686
bind-9.6.1-16.P3.fc12.i686
bind-utils-9.6.1-16.P3.fc12.i686
bind-libs-9.6.1-16.P3.fc12.i686
??????
[root@mail etc]# mkdir named
[root@mail etc]# cd named
[root@mail named]# cp /var/named/named.* /etc/named/
[root@mail named]# touch example.com.db
[root@mail named]# vim example.com.db
------------------------------------------------------------------------
$TTL 3H
@?????? IN SOA? @ ns01.example.com. (
??????????????????????????????????????? 0?????? ; serial
??????????????????????????????????????? 1D????? ; refresh
??????????????????????????????????????? 1H????? ; retry
??????????????????????????????????????? 1W????? ; expire
??????????????????????????????????????? 3H )??? ; minimum
??????? NS????? @
$ORIGIN example.com.
example.com.????? IN????? MX????? 10????? mail.example.com.
www???? A?????? 192.168.2.222
mail??? A?????? 192.168.2.222
rt????? A?????? 192.168.2.222
------------------------------------------------------------------------ [root@mail named]# ls
example.com.db? named.ca? named.empty? named.localhost? named.loopback
[root@mail named]# chown root.named *
[root@mail named]# chown 660 *
[root@mail named]# vim /etc/named.conf
------------------------------------------------------------------------
options {
???? directory "/etc/named";?????????? // Working directory
???? allow-query { any; };????????????? // This is the default
}; zone "." IN {
??????? type hint;
??????? file "named.ca";
}; zone "example.com" {
???? type master;
???? file "example.com.db";
???? allow-transfer { any; };
}; include "/etc/pki/dnssec-keys//named.dnssec.keys";
include "/etc/pki/dnssec-keys//dlv/dlv.isc.org.conf";
------------------------------------------------------------------------ [root@mail named]#service named restart
測試解析
[root@mail named]# host -t a mail.example.com
mail.example.com has address 192.168.2.222
[root@mail named]# host -t mx example.com
example.com mail is handled by 10 mail.example.com. ==============================DNS配置===================================
===============================Qmail安裝配置============================
官方網(wǎng)站http://www.qmailtoaster.com/ 前期準備 清掉防火墻防止影響后面的安裝配置過程
iptables -F
iptables -X
service iptables save 關(guān)閉selinux
vi /etc/selinux/config
SELINUX=disabled yum -y update //更新到最新的
yum install yum-plugin-fastestmirror? //安裝下下載比較快
yum install vim-enhanced //安裝vim編輯器
yum install wget //安裝wget下載軟件 創(chuàng)建兩個文件夾 qmail和src
[root@mail ~]# mkdir qmail
[root@mail qmail]# mkdir src 下載fedora12-deps.sh安裝相關(guān)的包
[root@mail src]# wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-deps.sh [root@mail src]# sh fedora12-deps.sh //根據(jù)實際情況添加刪除里面的內(nèi)容,內(nèi)容如下:
rpm -e --nodeps sendmail
yum -y remove evolution
rpm -e --nodeps exim
yum -y install aspell autoconf automake automake17 bzip2 bzip2-devel compat-gcc-34 compat-gcc-34-c++ curl curl-devel expect expect-devel gcc gcc-c++ gdbm gdbm-devel gmp gmp-devel httpd httpd-devel krb5-devel krb5-libs libidn libidn-devel libtool mysql mysql-devel mysql-server mrtg openssh openssh-clients openssh-server openssl openssl-devel pcre pcre-devel perl-Digest-HMAC perl-Digest-SHA1 perl-Net-DNS perl-CPAN perl-Net-DNS perl-Mail-SPF perl-IO-Zlib perl-Archive-Tar perl-libwww-perl php php-imap php-mysql php-pear redhat-rpm-config rpm-build rpm-devel rpm-libs rpm-python sed setup stunnel which libtool-ltdl libtool-ltdl-devel groff make diffutils perl-HTML-Parser pam-devel procmail ntp ncurses-devel 下載qmail所需的包
[root@mail src]#vim url.txt? //內(nèi)容為包的下載地址見內(nèi)容見附件
[root@mail src]#vim dl.sh
cat url.txt|wc -l
let n=0
while read name; do
let n=$n+1
echo $n
wget -q $name
done <url.txt
[root@mail src]#sh dl.sh?? //執(zhí)行腳本下載安裝qmail所需的包 下載fedora12-perl.sh安裝所需求的包
[root@mail src]#wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-perl.sh [root@mail src]#yum install perl-Test-Pod 下載fedora12-svcs.sh 安裝所需求的包
[root@mail src]# wget http://www.qmailtoaster.com/distro/fedora/fedora_12/fedora12-svcs.sh
fedora12-svcs.sh 內(nèi)容見附件 [root@mail src]#rpmbuild --reubild --with fedora_11 XXXXXX? //X代表所需包的名字一個個包編譯下去 編譯的包會出現(xiàn)在: /root/rpmbuild/RPMS/i686/
????????????????? /root/rpmbuild/RPMS/noarch/
rpmbuild --rebuild --with fedora_11 daemontools-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/daemontools-toaster-0.76-1.3.6.i686.rpm rpmbuild --rebuild --with fedora_11 ucspi-tcp-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ucspi-tcp-toaster*.rpm rpmbuild --rebuild --with fedora_11 vpopmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/vpopmail-toaster*.rpm rpmbuild --rebuild --with fedora_11 libdomainkeys-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/libdomainkeys-toaster*.rpm rpmbuild --rebuild --with fedora_11 libsrs2-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/libsrs2-toaster*.rpm rpmbuild --rebuild --with fedora_11 qmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmail-toaster*.rpm
rpm -Uvh ../../rpmbuild/RPMS/i686/qmail-pop3d*.rpm rpmbuild --rebuild --with fedora_11 courier-authlib-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/courier-authlib-toaster*.rpm rpmbuild --rebuild --with fedora_11 courier-imap-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/courier-imap-toaster*.rpm rpmbuild --rebuild --with fedora_11 autorespond-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/autorespond-toaster*.rpm rpmbuild --rebuild --with fedora_11 control-panel-toaster
rpm -Uvh ../../rpmbuild/RPMS/noarch/control-panel-toaster*.rpm
rpm -Uvh ../../rpmbuild/RPMS/noarch/send-emails-toaster rpmbuild --rebuild --with fedora_11 ezmlm-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ezmlm*.rpm rpmbuild --rebuild --with fedora_11 qmailadmin-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmailadmin-toaster*.rpm rpmbuild --rebuild --with fedora_11 qmailmrtg-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/qmailmrtg-toaster*.rpm rpmbuild --rebuild --with fedora_11 maildrop-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/maildrop-toaster*.rpm rpmbuild --rebuild --with fedora_11 isoqlog-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/isoqlog-toaster*.rpm rpmbuild --rebuild --with fedora_11 vqadmin-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/vqadmin-toaster*.rpm rpmbuild --rebuild --with fedora_11 squirrelmail-toaster
rpm -Uvh ../../rpmbuild/RPMS/noarch/squirrelmail-toaster*.rpm rpmbuild --rebuild --with fedora_11 spamassassin-toaster
rpm -Uvh --nodeps ../../rpmbuild/RPMS/i686/spamassassin-toaster*.rpm rpmbuild --rebuild --with fedora_11 clamav-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/clamav-toaster*.rpm rpmbuild --rebuild --with fedora_11 ripmime-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/ripmime-toaster*.rpm rpmbuild --rebuild --with fedora_11 simscan-toaster
rpm -Uvh ../../rpmbuild/RPMS/i686/simscan-toaster*.rpm
安裝完成后啟動qmail
reboot ------------------------------------------------------------------------
默認情況下按tab不會顯示出如下信息:
[root@mail etc]# va
vaddaliasdomain? vadddomain?????? vadduser???????? valias
需要編輯profile在后面添加如下信息: [root@mail etc]# vim profile
........
unset i
unset pathmunge
PATH=$PATH:/var/qmail/bin:/home/vpopmail/bin
export PATH [root@mail etc]# source profile 添加域名example.com
[root@mail etc]# vadddomain example.com
Please enter password for postmaster:
enter password again: 查看是否生成新的域名
[root@mail etc]# ls /home/vpopmail/domains/
example.com 添加用戶
[root@mail qmail]# vadduser ganlin@example.com -r
Random password: Dt*SobeI 設(shè)置密碼為ganlin
[root@mail ~]# vpasswd ganlin@example.com ganlin 安裝nmap
[root@mail ~]# yum install nmap 為本地主機host文件添加如下內(nèi)容:
192.168.2.222 mail.example.com
192.168.2.222 web.example.com
192.168.2.222 www.example.com
192.168.2.222 webmail.example.com ===============================Qmail安裝配置============================
Apache配置
================================Apache================================== 在/var/www/目錄下創(chuàng)建example_com文件夾,以及分別創(chuàng)建www mail rt文件夾
Aache配置 [root@mail etc]# cd /var/www/
[root@mail www]# mkdir example_com
[root@mail www]# cd example_com/
[root@mail example_com]# mkdir www mail rt
[root@mail example_com]# cd mail/
[root@mail mail]# mkdir htdocs backups
[root@mail mail]# cd htdocs/
[root@mail htdocs]# cd /etc/httpd/conf.d/
[root@mail conf.d]# vim vhost_mail.conf
------------------------------------------------------------------------
NameVirtualHost *:80
<VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /var/www/example_com/mail/htdocs
??? ServerName mail.example.com
??? ServerAlias webmail.example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/mail_example_com-error_log
??? CustomLog logs/mail_example_com-access_log common
</VirtualHost> ----------------------------------------------------------------------- [root@mail mail]# cd htdocs/
[root@mail htdocs]# ls
[root@mail htdocs]# echo 'mail server works' > index.html
[root@mail conf.d]# cp vhost_mail.conf vhost_www.conf
[root@mail conf.d]# vim vhost_www.conf
------------------------------------------------------------------------
<VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /var/www/example_com/www/htdocs
??? ServerName www.example.com
??? ServerAlias example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/www_example_com-error_log
??? CustomLog logs/www_example_com-access_log common
</VirtualHost>
------------------------------------------------------------------------ [root@mail www]# vim /etc/httpd/conf/httpd.conf
修改Servername localhost
[root@mail www]# service httpd restart
Stopping httpd:??????????????????????????????????????????? [? OK? ]
Starting httpd:??????????????????????????????????????????? [? OK? ] ================================Apache================================== RT ================================RT系統(tǒng)安裝配===========================
參照官網(wǎng)文檔--》http://wiki.bestpractical.com/view/ManualInstallation [root@mail ~]# mkdir rt
[root@mail ~]#wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz
[root@mail ~]#mv rt.tar.gz rt/
[root@mail rt]# tar xzvf rt.tar.gz
[root@mail rt-3.8.7]# ./configure --prefix /opt/rt3 --with-db-database=rt3? --with-db-rt-user=rt --with-db-rt-pass=rt --with-web-user=apache --with-web-group=apache --enable-graphviz --enable-gd --enable-gpg
//參數(shù)含義見http://wiki.bestpractical.com/view/ManualInstallation 用yum來安裝依賴的包
yum -y install perl-Class-ReturnValue perl-TermReadKey perl-Text-Quoted perl-CSS-Squish perl-Module-Versions-Report perl-MIME-Entity perl-Locale-Maketext-Lexicon perl-Tree-Simple perl-Text-Template perl-HTML-Scrubber perl-Calendar-Simple perl-DBIx-SearchBuilder perl-Mail-Mailer perl-File-ShareDirperl-Regexp-Common perl-Cache-Simple-TimedExpiry perl-Locale-Maketext-Fuzzy perl-Text-Wrapper perl-Log-Dispatchperl-UNIVERSAL-require perl-Email-Address perl-HTML-RewriteAttributes perl-MIME-Types perl-CGI-Fast perl-FCGI perl-GD-Text perl-GD perl-GD-Graph perl-PerlIO-eol perl-GnuPG-Interface perl-IPC-Run perl-GraphViz perl-IPC-Run-SafeHandles perl-Data-ICal perl-CSS-Squish perl-Apache-Session perl-HTTP-Server-Simple perl-HTTP-Server-Simple-Mason perl-Net-Server perl-HTML-Mason perl-Apache-Session perl-Text-WikiFormat perl-XML-RSS perl-CSS-Squish perl-MIME-Types perl-HTML-RewriteAttributes perl-Data-ICal perl-TermReadKey perl-PerlIO-eol perl-GnuPG-Interface perl-IPC-Run perl-GraphViz perl-IPC-Run-SafeHandles perl-GD perl-CGI-Fast perl-FCGI perl-HTML-Scrubber perl-Text-Quoted perl-Calendar-Simple perl-DBIx-SearchBuilder perl-CSS-Squish perl-Mail-Mailer perl-Regexp-Common perl-File-ShareDir perl-Module-Versions-Report perl-Cache-Simple-TimedExpiry perl-Locale-Maketext-Lexicon perl-Locale-Maketext-Fuzzy perl-Text-Wrapper perl-Time-ParseDate perl-Log-Dispatch perl-UNIVERSAL-require perl-Tree-Simple perl-Text-Template perl-Email-Address perl-HTML-TreeBuilder-XPath.noarch perl-HTML-FormatText-WithLinks perl-GDTextUtil perl-GDGraph perl-MIME-tools perl-Time-modules.noarch 查看是否還有依賴的包沒有安裝--make testdeps
------------------------------------------------------------------------
下面兩個包一時找不到只好用make fixdeps 修復(fù)了
CGI::Fast ...MISSING
FCGI ...MISSING? make fixdeps //不建議用fixdeps修復(fù)一般用yum安裝
make testdeps發(fā)現(xiàn)所有的包都安裝好了
make install
------------------------------------------------------------------------[root@mail etc]# pwd
/opt/rt3/etc
[root@mail etc]# ls
acl.Informix? acl.Pg?????? RT_Config.pm????? schema.mysql-4.0? schema.Pg
acl.mysql???? acl.Sybase?? RT_SiteConfig.pm? schema.mysql-4.1? schema.SQLite
acl.Oracle??? initialdata? schema.Informix?? schema.Oracle???? schema.Sybase
[root@mail etc]# vim RT_SiteConfig.pm
參照RT_Config.pm配置進行添加有需要的信息
例子:附件為RT_SiteConfig.pm添加的配置信息可以參考
------------------------------------------------------------------------
安裝依賴的包
wget http://cpan.uwinnipeg.ca/cpan/authors/id/J/JE/JESSE/RT-Extension-QuickDelete-0.03.tar.gz
tar xzvf RT-Extension-QuickDelete-0.03.tar.gz
perl Makefile.PL
make install wget http://download.bestpractical.com/pub/rt/release/RTFM-2.4.2.tar.gz
tar xzvf RTFM-2.4.2.tar.gz
perl Makefile.PL
make install wget http://cpan.uwinnipeg.ca/cpan/authors/id/J/JE/JESSE/RT-Extension-QuickDelete-0.03.tar.gz
tar xzvf RT-Extension-QuickDelete-0.03.tar.gz
perl Makefile.PL
make install
[root@mail rt-3.8.7]# make initialize-database
make initialize-database提示如下: /usr/bin/perl -I/opt/rt3/local/lib -I/opt/rt3/lib sbin/rt-setup-database --action drop --dba root --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as root
Please specify that user's database password below. If the user has no database
password, just press return. 默認用戶是root 密碼password
------------------------------------------------------------------------ 配置apache
http://wiki.bestpractical.com/view/ManualApacheConfig
參照Configuring Apache vi /etc/httpd/conf.d/vhost_rt.conf <VirtualHost *:80>
??? ServerAdmin root@localhost
??? DocumentRoot /opt/rt3/share/html
??? ServerName rt.example.com
??? ServerAlias 192.168.2.222
??? ErrorLog logs/rt_example_com-error_log
??? CustomLog logs/rt_example_com-access_log common
?AddDefaultCharset UTF-8
?? PerlRequire /opt/rt3/bin/webmux.pl
?? <Directory /opt/rt3/share/html>
?????? Order allow,deny
?????? Allow from all
?????? SetHandler perl-script
?????? PerlResponseHandler RT::Mason
?? </Directory>
</VirtualHost>
------------------------------------------------------------------------ 添加郵件配置 添加sales、rt和support郵件賬戶
[root@mail rt]# vadduser sales@example.com -r
Random password: 8OICqjPI
[root@mail rt]# vpasswd sales@example.com welcome
[root@mail rt]# vadduser support@example.com -r
Random password: 6f.7wMfn
[root@mail rt]# vpasswd support@example.com welcome [root@mail named]# vadduser rt@example.com -r
Random password: sHapSzkL
[root@mail named]# vpasswd rt@example.com welcome 添加郵件
參考文檔http://wiki.bestpractical.com/view/ManualEmailConfig [root@mail example.com]# pwd
/home/vpopmail/domains/example.com
[root@mail example.com]# ls -a
.? ..? ganlin? postmaster? .qmail-default? rt? sales? support? test [root@mail example.com]# vim .qmail-sales-comment
|/opt/rt/bin/rt-mailgate --queue Sales --action comment --url http://rt.example.com
[root@mail example.com]# vim .qmail-support-comment
|/opt/rt/bin/rt-mailgate --queue Support --action comment --url http://rt.example.com [root@mail example.com]# ls -a
.?? aaaaa?? postmaster????? .qmail-sales-comment??? rt
..? ganlin? .qmail-default? .qmail-support-comment? test 安裝RT-IR
http://wiki.bestpractical.com/view/RTIR
http://wiki.bestpractical.com/view/Installation 下載包
wget http://download.bestpractical.com/pub/rt/release/RT-IR-2.4.3.tar.gz
解壓
tar xzf RT-IR-2.4.3.tar.gz
cd RT-IR-2.4.3 編譯
perl Makefile.PL 安裝所需求的包 wget http://dag.wieers.com/rpm/packages/perl-Net-Whois-RIPE/perl-Net-Whois-RIPE-1.22-1.rf.src.rpm
rpmbuild --rebuild perl-Net-Whois-RIPE-1.22-1.rf.src.rpm
rpm -ivh perl-Net-Whois-RIPE-1.22-1.rf.noarch.rpm
?
wget http://dag.wieers.com/rpm/packages/perl-Regexp-Common-net-CIDR/perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm rpmbuild --rebuild perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
rpm -ivh perl-Regexp-Common-net-CIDR-0.01-1.rf.noarch.rpm perl Makefile.PL make install
[root@mail RT-IR-2.4.3]# make initdb
/usr/bin/perl -Ilib -I/opt/rt3/local/lib -I/opt/rt3/lib /opt/rt3/sbin/rt-setup-database --action insert --datadir etc --datafile etc/initialdata --dba rt --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as rt
Please specify that user's database password below. If the user has no database
password, just press return. Password: /etc/init.d/httpd stop
/etc/init.d/httpd start Then edit your RT_Config (or RT_SiteConfig) to replace the line: Set(@Plugins, qw(RT::FM));
by: Set(@Plugins, 'RT::FM', 'RT::IR');
------------------------------------------------------------------------
RTFM 安裝 cd /usr/local/src
wget http://download.bestpractical.com/pub/rt/release/RTFM-2.4.1.tar.gz
tar zxf RTFM-2.4.1.tar.gz
cd RTFM-2.4.1
perl Makefile.PL
wget http://download.bestpractical.com/pub/rt/release/RT-IR-2.4.3.tar.gz wget http://dag.wieers.com/rpm/packages/perl-Net-Whois-RIPE/perl-Net-Whois-RIPE-1.22-1.rf.src.rpm wget http://dag.wieers.com/rpm/packages/perl-Regexp-Common-net-CIDR/perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
rpmbuild --rebuild perl-Regexp-Common-net-CIDR-0.01-1.rf.src.rpm
make install
make initdb Then edit your RT_SiteConfig (or RT_Config) to include this line: Set(@Plugins,qw(RT::FM));
[root@mail RTFM-2.4.2]# make initdb
/usr/bin/perl -Ilib -I/opt/rt3/local/lib -I/opt/rt3/lib /opt/rt3/sbin/rt-setup-database --action schema --datadir etc --dba rt --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your? mysql instance on localhost as rt
Please specify that user's database password below. If the user has no database
password, just press return. Password:
================================RT系統(tǒng)安裝配=========================== DNS安裝配置 參考文檔鏈接
https://www.isc.org/software/bind/documentation/arm96#id2570296
==============================DNS配置===================================
[root@mail named]# rpm -qa |grep bind*
binutils-2.19.51.0.14-34.fc12.i686
bind-9.6.1-16.P3.fc12.i686
bind-utils-9.6.1-16.P3.fc12.i686
bind-libs-9.6.1-16.P3.fc12.i686
??????
[root@mail etc]# mkdir named
[root@mail etc]# cd named
[root@mail named]# cp /var/named/named.* /etc/named/
[root@mail named]# touch example.com.db
[root@mail named]# vim example.com.db
------------------------------------------------------------------------
$TTL 3H
@?????? IN SOA? @ ns01.example.com. (
??????????????????????????????????????? 0?????? ; serial
??????????????????????????????????????? 1D????? ; refresh
??????????????????????????????????????? 1H????? ; retry
??????????????????????????????????????? 1W????? ; expire
??????????????????????????????????????? 3H )??? ; minimum
??????? NS????? @
$ORIGIN example.com.
example.com.????? IN????? MX????? 10????? mail.example.com.
www???? A?????? 192.168.2.222
mail??? A?????? 192.168.2.222
rt????? A?????? 192.168.2.222
------------------------------------------------------------------------ [root@mail named]# ls
example.com.db? named.ca? named.empty? named.localhost? named.loopback
[root@mail named]# chown root.named *
[root@mail named]# chown 660 *
[root@mail named]# vim /etc/named.conf
------------------------------------------------------------------------
options {
???? directory "/etc/named";?????????? // Working directory
???? allow-query { any; };????????????? // This is the default
}; zone "." IN {
??????? type hint;
??????? file "named.ca";
}; zone "example.com" {
???? type master;
???? file "example.com.db";
???? allow-transfer { any; };
}; include "/etc/pki/dnssec-keys//named.dnssec.keys";
include "/etc/pki/dnssec-keys//dlv/dlv.isc.org.conf";
------------------------------------------------------------------------ [root@mail named]#service named restart
測試解析
[root@mail named]# host -t a mail.example.com
mail.example.com has address 192.168.2.222
[root@mail named]# host -t mx example.com
example.com mail is handled by 10 mail.example.com. ==============================DNS配置===================================
轉(zhuǎn)載于:https://blog.51cto.com/steven2/275318
總結(jié)
以上是生活随笔為你收集整理的qmail+rt+dns+apache的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: blog推荐 - 软件产品管理之Tyne
- 下一篇: IT服务台的进化(3)--虚拟服务台