1、 关闭系统的防火墙和selinux,以防出现异常的问题
确认iptables和ip6tables服务关闭
- [root@jdserver named]# chkconfig --list |grep tables
- ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
- iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
确认selinux关闭,打开/etc/sysconfig/selinux文件,修改成一下内容:
- # This file controls the state of SELinux on the system.
- # SELINUX= can take one of these three values:
- # enforcing - SELinux security policy is enforced.
- # permissive - SELinux prints warnings instead of enforcing.
- # disabled - SELinux is fully disabled.
- SELINUX=disabled
- # SELINUXTYPE= type of policy in use. Possible values are:
- # targeted - Only targeted network daemons are protected.
- # strict - Full SELinux protection.
- SELINUXTYPE=targeted
以上设置后需要重启系统。
2、 首先确保OS未开启其他mail服务器,否则会冲突
RedHat Enterprise Linux 5安装时默认会安装sendmail,并启动,需要我们关闭
- [root@jdserver selinux]# chkconfig --list |grep sendmail
- sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
- [root@jdserver selinux]# service sendmail stop
3、 安装jdmail
- cd /opt/ //安装在/opt目录下
- tar zxvf jdmail_linux_x86_393.tar.gz //解压jdmail
4、 修改jdmail相关shell脚本的路径
/opt/jdmail/startjd.sh
- #!/bin/sh
- JDMAIL_ROOT=/opt/jdmail
/opt/jdmail/safestart.sh
- #!/bin/bash
- cd /opt/jdmail
/opt/jdmail/onestart.sh
- #!/bin/bash
- /opt/jdmail/startjd.sh
- /opt/jdmail/web/bin/startup.sh
- #sleep 3
- #/opt/jdmail/safestart.sh &
/opt/jdmail/shutdown.sh
- #!/bin/sh
- JDMAIL_ROOT=/opt/jdmail
/opt/jdmail/web/bin/startup.sh
- #!/bin/sh
- # -----------------------------------------------------------------------------
- # Start Script for the CATALINA Server
- #
- # $Id: startup.sh,v 1.3 2002/08/04 18:19:43 patrickl Exp $
- # -----------------------------------------------------------------------------
- # resolve links - $0 may be a softlink
- PRG="$0"
- JAVA_HOME="/opt/jdmail/jdk"
- export JAVA_HOME
/opt/jdmail/sa/sa_server.sh
- #!/bin/sh
- SA_ROOT=/opt/jdmail/sa
- export SA_ROOT
- PERL_ROOT=/opt/jdmail/perl
- export PERL_ROOT
5、 将jdmail设置为随系统启动
在/etc/rc.local文件中加入如下内容:
- #!/bin/sh
- #
- # This script will be executed *after* all the other init scripts.
- # You can put your own initialization stuff in here if you don't
- # want to do the full Sys V style init stuff.
- touch /var/lock/subsys/local
- /opt/jdmail/startjd.sh &
- /opt/jdmail/web/bin/startup.sh &
6、 关闭反病毒引擎功能,否则jdmail进程启动后会自动退出
反垃圾\发病毒→ClamAV反病毒引擎设置
将病毒库自动升级间隔设置为-1,保存,重启jdmail即可。
7、 修改金笛邮件系统的登录端口号为80
默认金笛邮件系统的登录端口号为8080,我们便于访问修改为80
配置文件为/opt/jdmail/web/conf/server.xml
- <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
- <Connector port="80"
- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" redirectPort="8443" acceptCount="100"
- debug="0" connectionTimeout="20000"
- disableUploadTimeout="true" />
10、重启jdmail服务
11、检查jdmail
默认会打开80、25、110、143四个端口。
- [root@jdserver2 conf]# lsof -i :25
- COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
- jdmail 18567 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18571 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18572 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18573 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18574 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18575 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18576 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- jdmail 18577 root 23u IPv4 155106 TCP *:smtp (LISTEN)
- [root@jdserver2 conf]# ps aux |grep web
- root 18583 1.1 9.7 267292 49380 pts/1 Sl 16:01 0:06 /opt/jdmail/jdk/bin/java -Djava.awt.headless=true -Djava.endorsed.dirs=/opt/jdmail/web/common/endorsed -classpath /opt/jdmail/jdk/lib/tools.jar:/opt/jdmail/web/bin/bootstrap.jar:/opt/jdmail/web/bin/commons-logging-api.jar -Dcatalina.base=/opt/jdmail/web -Dcatalina.home=/opt/jdmail/web -Djava.io.tmpdir=/opt/jdmail/web/temp org.apache.catalina.startup.Bootstrap start
- root 18905 0.0 0.1 3924 676 pts/1 R+ 16:11 0:00 grep web
- [root@jdserver2 conf]# ps aux |grep jdmail
- root 18567 0.1 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18571 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18572 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18573 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18574 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18575 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18576 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
- root 18577 0.0 2.2 428728 11316 pts/1 S 16:01 0:00 ./jdmail
12、登录邮件服务器,默认用户名postmaster,密码为空,域名为root。
13、问题:
(1)、升级jdmail,需要备份accounts目录,然后升级完后覆盖新accounts,这时在jdmail管理界面上是无法看到先前用户和组的,但是这些用户可以正常登录?
需要“重建辅助用户数据库”,
用户管理→ 重建辅助用户数据库
这样用户和组就出现了!
(2)、如果修改了DNS设置(A、MX记录等),那么jdmail需要清除一下dns缓存,否则dns修改后并不会自动更新dns缓存。
rm –rf /opt/jdmail/dnscache/*
- [root@jdserver2 dnscache]# pwd
- /opt/jdmail/dnscache
- [root@jdserver2 dnscache]# ls
- a mx
- [root@jdserver2 dnscache]#
如果不修改的话,默认jdmail的dnscache的生存时间同bind的TTL值,也就是说要等到过了这个时间后dnscache才会自动向bind更新,这样jdmail才会获得修改后的bind记录。
(3)、如果日志一直显示发邮件,可能是因为队列堵塞了,可以删除以下队列,然后重启jdmail
删除/opt/jdmail/spool下面的东西,记得删除后,要建立一个local目录。
转载于:https://blog.51cto.com/yritech/473078