服务组件:
Web 服务器 | Apache 2.2.x | |
数据库/目录服务 | MySQL 5.6.X | |
邮件传输代理(MTA) | postfix-2.6.2 | |
邮件投递代理(MDA) | maildrop 2.0.x | 支持过滤和强大功能 |
Web帐户管理后台 | ExtMan 1.0 | 支持无限域名、无限用户 |
WebMail 系统 | ExtMail 1.1.0 | 支持多语言、全部模板化,功能基本齐全 |
其他数据认证库 | Courier Authlb 0.62 | 负责courier-imap,maildrop的认证 |
SMTP认证库 | Cyrus SASL 2.1.x | 标准的SASL实现库,可以支持Courier authlib |
本文涉及到的安装包有:
[root@mail extmail_install]# pwd
/root/extmail_install
[root@mail extmail_install]# ll
courier-authlib-0.69.0.tar.bz2
courier-unicode-2.1.tar.bz2
extmail-1.2.tar.gz
extman-1.1.tar.gz
Percona-Server-56-debuginfo-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-client-56-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-devel-56-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-server-56-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-shared-56-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-test-56-5.6.25-rel73.1.el6.x86_64.rpm
Percona-Server-tokudb-56-5.6.25-rel73.1.el6.x86_64.rpm
postfix #postfix服务脚本
postfix-3.4-20181202.tar.gz
Unix-Syslog-1.1.tar.gz
一、安装依赖包
在线安装
我使用的是CentOS6.9 的最小化安装,所以有些工具没有。
yum install httpd openssl-devel dovecot dovecot-mysql perl-DBD-MySQL perl-CGI tcl tcl-devel libart_lgpl libart_lgpl-devel libtool-ltdl libtool-ltdl-devel expect db4-devel -y
yum groupinstall "Development tools" "Development Libraries" -y
yum install telnet htop man mail -y
二、数据库组件
如果系统已经有mysql则跳过。
2.1 安装数据库mysql
方式一:离线安装 Percona mysql 5.6 ,优点:速度快
rpm -ivh Percona-Server-shared-56-5.6.25-rel73.1.el6.x86_64.rpm
rpm -ivh Percona-Server-devel-56-5.6.25-rel73.1.el6.x86_64.rpm
rpm -ivh Percona-Server-client-56-5.6.25-rel73.1.el6.x86_64.rpm
rpm -ivh Percona-Server-server-56-5.6.25-rel73.1.el6.x86_64.rpm
方式二:在线安装
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
yum install Percona-Server-server-56
注意:Percona Mysql 在安装 Percona-Server-server-56-*之后,会自动使用默认配置初始化库,相当于执行mysql_install_db。
2.2 数据库相关配置:
关闭系统SELINUX
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
配置my.cnf
cp -rf /etc/my.cnf /etc/my.cnf.bak
echo '[mysqld]
datadir = /opt/data/mysql
tmpdir = /opt/data/tmp
socket= /opt/data/mysql/mysql.sock
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
max_allowed_packet=32M
lower_case_table_names=1
max_connections=5000
max_connect_errors = 5000
sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
wait_timeout=120000
interactive_timeout=60000
connect_timeout = 60000
innodb_file_per_table=1
innodb_read_io_threads = 16
innodb_write_io_threads = 16
#thread_concurrency=96
sort_buffer_size = 10M
join_buffer_size = 10M
query_cache_size = 32M
query_cache_limit = 10M
tmp_table_size = 1024M
max_heap_table_size = 256M
binlog_cache_size = 10M
key_buffer_size = 769M
read_buffer_size = 1M
myisam_sort_buffer_size = 128M
thread_cache_size = 16
innodb_buffer_pool_size = 5480M
innodb_log_buffer_size = 412M
innodb_log_file_size = 1024M
server-id=2
#log-bin=mysql-bin
#binlog_format=mixed
#expire_logs_days=1
#binlog_ignore_db = information_schema
#binlog_ignore_db = performance_schema
#binlog_ignore_db = mysql
#binlog_ignore_db = activemq
#binlog_ignore_db = datacenter
#
#binlog_do_db = gms
#replicate_ignore_db = mysql
#replicate_ignore_db = information_schema
#replicate_ignore_db = performance_schema
#replicate_ignore_db = activemq
#replicate_ignore_db = gms
#
#replicate_do_db = datacenter
#
#sync_binlog = 500
innodb_flush_log_at_trx_commit = 2
innodb_flush_method=O_DIRECT
#innodb_io_capacity=200
innodb_stats_on_metadata=OFF
innodb_adaptive_flushing=ON
#innodb_locks_unsafe_for_binlog = 1
#log_slow_queries = /opt/data/mysql/slow_queries.log
slow-query-log = 1
long_query_time = 10
slow-query-log-file = /opt/data/mysql/slow_queries.log
#log-queries-not-using-indexes = 1
[mysql]
default-character-set=utf8
socket=/opt/data/mysql/mysql.sock
[client]
default-character-set=utf8
socket=/opt/data/mysql/mysql.sock
' > /etc/my.cnf
创建mysql数据目录
这里我做了修改,默认路径是/var/lib/mysql/.
#创建目录
mkdir -p /opt/data/mysql /opt/data/log /opt/data/tmp
chown -R mysql.mysql /opt/data
使用新配置文件my.cnf重新初始化数据库
mysql_install_db --user=mysql
打开服务并启动mysql
chkconfig mysql on
service mysql start
修改root密码
mysqladmin password TestPass123
二、postfix组件
1.1 安装postfix
卸载系统自带postfix