搭建Postfix邮件系统
在centos/redhat 上安装邮件系统(extmail) V0.1
一、简介:
本文以最简单,最方便的方法在centos 5.2 上安装一个全功能的邮件系统,此文适合REDHAT所有系列,在文中,能用RPM 安装的,我们将采用rpm 安装,如果rpm没有的,我们将创建自己的rpm。部分软件简介:
1、AMP ---apache(web服务) 、mysql(数据库)、php(非必需)的简称
2、postfix --mta 邮件系统核心
3、courier-authlib--一个为courier-imap,maildrop,sasl2 提供用户信息的后台进程序
4、courier-imap --提供pop3,pop3s,imap,imaps 服务的程序
5、amavisd-new --提供内容过滤
6、clamav -- 著名的杀毒软件
7、extmail --一个著名的webmail程序
8、extman --与extmail集成的后台管理程序
9、slockd --一个基于smtp阶段的反垃圾邮件程序
10、vhmgr --由本文作者编写,用于管理apache,ftp,mysql 的虚拟主机管理程序。
安装环境:
centos 5.2
域名机器名:mail.byeid.org
域名:byeid.org
二、安装系统
安装系统时,选择“customize software selection”(自定义安装),在package group selection 对话框里选择:
[*]base
[*]devlopment libraries
[*]development tools
[*]editors
[*]text-base internet
其它不选择。
在setup agnet(或进入系统后运行setup) 里选择firewall configuration 将security level 与SELinux 改为disabled,目的是为了避免在安装调试时产生不必要的麻烦,在系统安装完成后,可以自己去调试安全部分,在这里将不作详细介绍。
配置yum,在本文中使用的是网通线路,所以选择了http://mirrors.ta139.com/ 作为安装镜像。
# cd /etc/yum.repos.d/
# wget http://mirrors.ta139.com/CentOS-Base.repo.ta139
# mv CentOS-Base.repo CentOS-Base.repo.bak
# mv CentOS-Base.repo.ta139 CentOS-Base.repo
三、安装软件
1、安装AMP
# yum -y install httpd httpd-devel mysql mysql-devel mysql-server php php-xml php-cli php-pdo php-mbstring php-mcrypt php-gd php-common php-devel php-mysql
修改启动配置并启动
# chkconfig --level 345mysqld on
# chkconfig --level 345httpd on
# service mysqld start
# service httpd start
2、安装phpmyadmin(可要可不要)
注意:可以选择自己需要的版本
# wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.bz2
# tar xjf phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.bz2
# mv phpMyAdmin-2.11.9-all-languages-utf-8-only /var/www/html/phpmyadmin
# cp config.sample.inc.php config.inc.php
编辑config.inc.php 改为下面,字符串是任意的。
$cfg['blowfish_secret'] = 'skssiwksksie'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
进入phpmyadmin 请马上修改mysql root 用户的密码。
3、导入extman 后台数据库
将extmail/extman/slockd 上传到服务器,可以使用ftp/winscp 上传
# tar zxf extman-0.2.5b1.tar.gz
# cd extman-0.2.5b1/docs/
# mysql -uroot -p <extmail.sql
Enter password:
# mysql -uroot -p <init.sql
Enter password:
# /usr/bin/mysqladmin -u root password 'admin'
# /usr/bin/mysql -u root –p
Enter password:
mysql> grant all privileges on extmail.* to extmail identified by "extmail";
如何使用了phpmyadmin改了root 密码,记得输入密码,如果密码为空,请按回车。
4、RPM 简介
下面我们将采用rpm 的方式安装软件
/usr/src/redhat/SPEC spec 文件夹,通常是rpm文件夹
/usr/src/redhat/RPMS 是生成rpm 的文件,下面还有i368,i486 等子文件夹,一般我们用i386 架构
/usr/src/redhat/SOURCE 源文件文件夹
为了安装时切换目录的方便,我们将目录存放到一个shell变量里。
# export RPMS=/usr/src/redhat/RPMS
# export SOURCE=/usr/src/redhat/SOURCES
# export SPEC=/usr/src/redhat/SPECS
在下面安装过程中,大家要记住cd $RPMS 与cd /usr/src/redhat/RPMS 的目的是一样的,只是shell变量的替换。
5、安装authlib
A、安装依懒的包
# yum -y install postgresql-devel expect libtool-ltdl-devel
# wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.61.0.tar.bz2
# tar xjf courier-authlib-0.61.0.tar.bz2
# cd courier-authlib-0.61.0
# cp courier-authlib.spec $SPEC
# cd ..
# cp courier-authlib-0.61.0.tar.bz2 $SOURCE
# cd $SPEC
# rpmbuild -bb courier-authlib.spec (创建rpm文件)
B、安装生成的rpm
# cd $RPMS/i386
# rpm -ivh courier-authlib-0.61.0-1.i386.rpm
# rpm -ivh courier-authlib-devel-0.61.0-1.i386.rpm
# rpm -ivh courier-authlib-mysql-0.61.0-1.i386.rpm
C、配置authlibdaemon
# cd /etc/authlib/
# mv authdaemonrc authdaemonrc.bak
# vim authdaemonrc
输入下面的内容:
authmodulelist="authmysql"
authmodulelistorig="authmysql"
daemons=10
authdaemonvar=/var/spool/authdaemon
DEBUG_LOGIN=2
DEFAULTOPTIONS="wbnodsn=1"
LOGGEROPTS=""
D、配置authmysqlrc
# mv authmysqlrc authmysqlrc.bak
# vim authmysqlrc
输入下面的内容:
MYSQL_SERVER localhost
MYSQL_USERNAMEextmail
MYSQL_PASSWORDextmail
MYSQL_PORT 0
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_OPT 0
MYSQL_DATABASEextmail
MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,/
CONCAT('/home/data/domains/',homedir), /
CONCAT('/home/data/domains/',maildir), /
quota, /
name /
FROM mailbox /
WHERE username = '$(local_part)@$(domain)'
E、启动authlib
# service courier-authlib start
Starting Courier authentication services: authdaemond
# chmod 777 /var/spool/authdaemon/
6、安装courier-imap
由于courier-imap 不能用root身份生成rpm那么我们新建一个普通用户,并创建一个rpm环境
# useradd biokee
软件包依懒需要安装openldap-server,rpm创建完成后可以删除
# yum -y install openldap-servers
# su – biokee
$ mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ vim~/.rpmmacros
输入内容:
%_topdir /home/biokee/rpm
$ wget http://prdownloads.sourceforge.net/courier/courier-imap-4.4.1.tar.bz2
$ cp courier-imap-4.4.1.tar.bz2 rpm/SOURCES/
$ tar xjf courier-imap-4.4.1.tar.bz2
$ cd courier-imap-4.4.1
$ cp courier-imap.spec ../rpm/SPECS/
$ cd ../rpm/SPECS/
编辑courier-imap.spec 将下面的内容:
%if %suse_version
BuildPreReq: rpm >= 3.0.5 /usr/bin/sed openldap2 openldap2-devel %([ %{suse_version} -gt 819 ] && echo /usr/include/fam.h)
%else
BuildPreReq: rpm >= 4.0.2 sed /usr/include/fam.h openldap-devel openldap-servers
%endif
改为:
%if %suse_version
BuildPreReq: rpm >= 3.0.5 /usr/bin/sed openldap2 openldap2-devel
%else
BuildPreReq: rpm >= 4.0.2 sed openldap-devel openldap-servers
%endif
创建rpm
$ rpmbuild -bb courier-imap.spec
完成rpm后,输入exit退出当前用户。
# rpm -ivh /home/biokee/rpm/RPMS/i386/courier-imap-4.4.1-1.i386.rpm
# service courier-imap start
7、安装cyrus-sasl
A、安装SRPM
# wget ftp://194.199.20.114/linux/fedora/updates/8/SRPMS/cyrus-sasl-2.1.22-8.fc8.src.rpm
# rpm -ivh cyrus-sasl-2.1.22-8.fc8.src.rpm
# cd $SPEC
编辑cyrus-sasl.spec 将下面:
# Bundling copy of Berkeley DB, for sasldb support.
topdir=`pwd`
pushd db-%{db_version}/build_unix
../dist/configure /
--with-mutex=UNIX/fcntl --disable-shared --enable-static --with-pic /
--with-uniquename=_cyrus_sasl_sasldb_rh /
--prefix=${topdir}/db-instroot /
--includedir=${topdir}/db-instroot/include /
--libdir=${topdir}/db-instroot/lib
改为:
# Bundling copy of Berkeley DB, for sasldb support.
topdir=`pwd`
pushd db-%{db_version}/build_unix
../dist/configure /
--with-mutex=UNIX/fcntl --disable-shared --enable-static --with-pic /
--with-uniquename=_cyrus_sasl_sasldb_rh /
--prefix=${topdir}/db-instroot /
--includedir=${topdir}/db-instroot/include /
--libdir=${topdir}/db-instroot/lib /
--with-authdaemond=/var/spool/authdaemon
B、生成rpm
# rpmbuild -bb cyrus-sasl.spec
# cd $RPMS/i386
# rpm -e --nodeps cyrus-sasl-devel cyrus-sasl-plain cyrus-sasl cyrus-sasl-lib (如果这些包存在)
# rpm -ihv cyrus-sasl-lib-2.1.22-8.i386.rpm
# rpm -ihv cyrus-sasl-2.1.22-8.i386.rpm
# rpm -ihv cyrus-sasl-plain-2.1.22-8.i386.rpm
# rpm -ihv cyrus-sasl-devel-2.1.22-8.i386.rpm
C、配置sasl2
创建/usr/lib/sasl2/smtpd.conf 文件,输入下面的内容:
pwcheck_method:authdaemond
log_level:3
mech_list:PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
8、安装postfix
A、下载软件包
# cd
# wget http://ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.4-2.src.rpm
# rpm -ivh postfix-2.5.4-2.src.rpm
# cd $SPEC
编辑postfix.spec 修改下面的选项
%define distribution rhel-5.0
%define with_mysql_redhat 1
%define with_sasl 2
%define with_vda 1
B、创建rpm
# rpmbuild -bb postfix.spec
# cd $RPMS/i386
# rpm -ivh postfix-2.5.4-2.rhel4.i386.rpm
C、切换mta
# alternatives --config mta (选择2,postfix)
# rpm -e sendmail
# cd /usr/sbin/
# mv sendmail sendmail.bak
# newaliases
# ln -s sendmail.postfix sendmail
D、配置postfix
# cd /etc/postfix/
# mv main.cf main.cf.bak
# vim main.cf
输入下面的内容:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 550
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = /usr/share/doc/postfix-2.5.2-documentation/html
manpage_directory = /usr/share/man
sample_directory = /etc/postfix
readme_directory = /usr/share/doc/postfix-2.5.2-documentation/readme
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
myhostname = mail.byeid.org
mydomain = byeid.org
mydestination = $myhostname
smtpd_banner = byeid.org ESMTP Mail System
message_size_limit = 14680064
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /home/data/domains
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf
virtual_transport = maildrop:
maildrop_destination_recipient_limit = 1
#sasl
smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname
复制extman/docs 目录的cf 文件到/etc/postfix
# cp /root/extman-0.2.5b1/docs/mysql_virtual_* .
因为配置文件的用户、密码与数据库时一样,所以不用修改。
# service postfix start
9、安装maildrop
A、下载生成RPM
# cd
# wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2
# cp maildrop-2.0.4.tar.bz2 $SOURCE
# tar xjf maildrop-2.0.4.tar.bz2
# cd maildrop-2.0.4
# cp maildrop.spec $SPEC
# cd $SPEC
编辑maildrop.spec 把下面:
BuildRequires: /usr/include/fam.h gdbm-devel pcre-devel
改为:
BuildRequires:gdbm-devel pcre-devel
把下面:
%configure --with-devel --enable-userdb --enable-maildirquota/
--enable-syslog=1 --enable-trusted-users='root mail daemon postmaster qmaild mmdf' /
--enable-restrict-trusted=0 /
--enable-sendmail=/usr/sbin/sendmail
改为:
%configure --with-devel --enable-userdb --enable-maildirquota /
--enable-syslog=1 --enable-trusted-users='root mail daemon postmaster qmaild mmdf' /
--enable-restrict-trusted=0 --enable-sendmail=/usr/sbin/sendmail /
--enable-authlib
B、创建安装maildrop rpm
# yum -y install pcre-devel
# rpmbuild -bb maildrop.spec
# cd $RPMS/i386
# rpm -ivh maildrop-2.0.4-1.i386.rpm
C、添加虚似用户及创建目录
# cd
# groupadd -g 1000 vgroup
# useradd -g 1000 -u 1000 -s /sbin/nologin -d /dev/null vuser
编辑/etc/postfix/master.cf ,加入下面的内容:
maildrop unix - n n - - pipe
flags=DRhu user=vuser argv=/usr/bin/maildrop -d ${user}@${nexthop} ${recipient} ${user} ${extension} ${nexthop}
D、创建邮件存储目录
# mkdir -p /home/data/domains/extmail.org/postmaster
# maildirmake /home/data/domains/extmail.org/postmaster/Maildir
# chown -R vuser:vgroup /home/data/domains/
E、测试maildrop
# echo "test" | maildrop -V 10 -d postmaster@extmail.org
maildrop: authlib: groupid=1000
maildrop: authlib: userid=1000
maildrop: authlib: logname=postmaster@extmail.org, home=/home/data/domains/extmail.org/postmaster, mail=/home/data/domains/extmail.org/postmaster/Maildir/
maildrop: Changing to /home/data/domains/extmail.org/postmaster
Message start at 0 bytes, envelope sender=postmaster@extmail.org
maildrop: Attempting .mailfilter
maildrop: Delivery complete.
出现上以信息说明authlib,maildrop 工作正常
F、测试pop3
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Hello there.
user postmaster@extmail.org
+OK Password required.
pass extmail
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 6
.
retr 1
+OK 6 octets follow.
test
.
quit
+OK Bye-bye.
Connection closed by foreign host.
G、测试postfix
# perl -MMIME::Base64 -e 'print encode_base64("postmaster/@extmail.org");'
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
# perl -MMIME::Base64 -e 'print encode_base64("extmail");'
ZXh0bWFpbA==
# service postfix restart (重启一下)
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 byeid.org ESMTP Mail System
ehlo test.com
250-mail.byeid.org
250-PIPELINING
250-SIZE 14680064
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
334 UGFzc3dvcmQ6
ZXh0bWFpbA==
235 2.7.0 Authentication successful
quit
221 2.0.0 Bye
Connection closed by foreign host
10、安装amavisd-new
编辑/etc/yum.repos.d/CentOS-Base.repo 加入下面的内容:
name=Dag RPM Repostory for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
# yum -y install clamav clamav-db clamd clamav-devel amavisd-new
编辑/etc/amavisd.conf,修改下面的内容
$mydomain = 'byeid.com'; # a convenient default for other settings
$myhostname = 'mail.byeid.com';# must be a fully-qualified domain name!
把下面内容去掉注释,并修改为下面
['ClamAV-clamd',
/&ask_daemon, ["CONTSCAN {}/n", "/tmp/clamd.socket"],
qr//bOK$/, qr//bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
# usermod -G amavis clamav
#/usr/sbin/amavisd debug
#/usr/sbin/amavisd stop
# service clamd start
在/etc/postfix/master.cf 增加下面的内容:
smtp-amavisunix - - n - 4 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o receive_override_options=no_header_body_checks
在/etc/postfix/main.cf 加入下面的内容
content_filter = smtp-amavis::10024
# service postfix reload
11、安装extman/extmail
A、配置apache
修改/etc/httpd/conf/httpd.conf,将下面的选项改为:
User vuser
Group vgroup
# cd /etc/httpd/conf.d/
# vim extmail.conf
输入下面的内容:
Alias /extman/cgi/ /var/www/extsuite/extman/cgi/
Alias /extman /var/www/extsuite/extman/html/
<Location "/extman/cgi">
SetHandler cgi-script
Options +ExecCGI
</Location>
# config for ExtMail
Alias /extmail/cgi/ /var/www/extsuite/extmail/cgi/
Alias /extmail /var/www/extsuite/extmail/html/
<Location "/extmail/cgi">
SetHandler cgi-script
Options +ExecCGI
</Location>
# mkdir /var/www/extsuite
# tar zxf extmail-1.0.5b1.tar.gz
# cp -r extmail-1.0.5b1 /var/www/extsuite/extmail
# cp -r extman-0.2.5b1 /var/www/extsuite/extman
B、配置extmail参数
# cd /var/www/extsuite/extmail/
# cp webmail.cf.default webmail.cf
修改webmail.cf 下面的选项
SYS_SESS_DIR = /tmp/extmail
SYS_MAILDIR_BASE = /home/data/domains
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
C、配置extman参数
# cd /var/www/extsuite/extman/
修改webman.cf 下面的选项:
SYS_MAILDIR_BASE = /home/data/domains
D、创建session 目录
# mkdir /tmp/{extman,extmail}
# chown vuser:vgroup /tmp/ext*
E、配置后台日志分析工具
# cd /var/www/extsuite/extman/addon/
# cp -r mailgraph_ext /usr/local/
将下面的内容加入/etc/rc.local
/usr/local/mailgraph_ext/mailgraph-init start
/usr/local/mailgraph_ext/qmonitor-init start
安装所依懒的软件包
# yum -y install rrdtool perl-rrdtool perl-GD perl-File-Tail
F、启动后台进程
# /usr/local/mailgraph_ext/qmonitor-init start
Starting queue statistics grapher: qmonitor
# /usr/local/mailgraph_ext/mailgraph-init start
Starting mail statistics grapher: mailgraph_ext
G、访问extmail/extman
打开浏览器,输入http://your_ip_address/extmail注意:your_ip_address 为你实际的ip (前端用户登录界面)
第一个测试用户为:postmaster 密码:extmail 域:extmail.org
打开浏览器,输入http://your_ip_address/extman (管理后台地址)
extman root 用户为:root@extmail.org 密码为:extmail*123*
注意:进入系统后要修改密码及找回密码的提示问题、答案。
但这,可以正常发送邮件,如果收不到邮件,可以查看日志,可能会看到Command output: pipe: fatal: pipe_command: execvp /usr/local/bin/maildrop: No such file or directory,如果这样,就是maildrop路径出问题了,可以复制maildrop文件到 /usr/local/bin/下面,之后应该就可以正常收发邮件了。
如果出现Unix::Syslog not found, please install it first! (in cleanup) Undefined subroutine &Ext::Logger::do_closelog called at /var/www/extsuite/extmail/libs/Ext/Logger.pm line 86.,则是没有安装perl-Unix-Syslog,只需要用:
# yum -y install perl-Unix-Syslog
说明:创建的虚拟用户和虚拟域在服务器上的/home/data/domains下面,所有的域在domains下,而用户则在对应的域名下面。
如果要用foxmail或者outlook接收邮件,则需要在pop3邮件帐号那写全程,例如:默认情况下写的是zhouy,这样是不行的,需要写全zhouy@.byeid.com,因为是虚拟域和虚拟帐号。
创建虚拟主机:
编辑/etc/httpd/conf/httpd.conf,在最后面添加下面的东西
<VirtualHost *:80>
ServerAdmin admin@byeid.com
DocumentRoot /var/www/extsuite/extmail/html/
ServerName mail.byeid.com
ErrorLog /var/log/mail/ErrorLog
CustomLog /var/log/mail/CustomLog common
</VirtualHost>
说明:
DocumentRoot /var/www/extsuite/extmail/html/ 邮件服务器的路径
ErrorLog /var/log/mail/ErrorLog 错误日志存放地,必须存在
CustomLog /var/log/mail/CustomLog common 真确日志存放地,必须存在
12、安装slockd
slockd 是一个基于策略的垃圾邮件软件,很多用户反映使用后,反垃圾效果非常明显,但是有部分用户由于对该软件的使用,特性不了解,而产生了很多麻烦。
所在在此建议,如果你对该软件不了解,或者系统里的垃圾邮件少,可以暂时不安装。
# tar zxf slockd-0.2.tar.gz
# cp -r slockd-0.2 /usr/local/slockd
# cd /usr/local/slockd
将下面的内容加入/etc/rc.local
/usr/local/slockd/slockd-init start
# vim config/main.cf (编辑slockd/config/main.cf)修改下面的内容
setsid 1(去掉注释,让程序成为后台进程)
修改/etc/postfix/main.cf 将原先的内容:
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname
改为:
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:10030
重载postfix 配置文件
# service postfix reload
13、安装vhmgr
vhostmgr 是一款虚似主机管理软件,可以对apache,pure-ftp,mysql 进行管理,是管理员的好帮手。
vhostmgr 有如下特点:
a、只需要安装一个apache,ftp
b、apache 不需要以root 运行。用普通用户身份运行就行了。
c、可以通过web 进行重读配置文件,系统关机,等操作
d、采用apache+cgi 方式运行,容易配置,安装、使用文档详细。
e、如果你是一个管理员,每为一个用户添加主机而麻烦,使用该软件将为你节省大量时间。
f、开通apache,ftp,mysql 都是即时生效。
更多功能,更多方便,使用后才知道!!!
g、支持freebsd ,linux 等多种系统
vhmgr 还有一个重要特点:开源并完全免费使用。
软件地址
为了不重复劳功,将不再次叙述。
apache 改变运行id 后,php session功能将会出现问题,因为session 的存储目录权限没有跟着改变为新的,只要执行下面的命令即可解决问题。
# chown -R vuser:vgroup /var/lib/php/session/
14、邮件的备份
先创建一个备份邮件的用户,例如bkup@byeid.com,然后在编辑/etc/postfix/main.cf文件,添加一行always_bcc = bkup@byeid.com,记得这里always_bcc一定要仅挨最左边,不要留空格,这样一来,每个进入邮件系统的邮件都会在bkup@byeid.com邮箱内存跟。
页:
[1]