CentOS7搭建邮件服务器+Roundcube webMail

最近需要搭建邮件服务器,搭建记录如下:

准备工作:

LAMP环境:lnmp1.8【apache2.4+mysql5.6+php5.5.38】需要安装扩展:fileinfo、exif、ldap、Imagick

webMail:Roundcube 1.5.2

一、搭建LAMP环境

安装命令如下:

wget http://soft.vpser.net/lnmp/lnmp1.8.tar.gz -cO lnmp1.8.tar.gz
tar zxf lnmp1.8.tar.gz 
cd lnmp1.8 && ./install.sh lamp

二、安装相关PHP扩展

1、安装ImageMagic

切换到lnmp1.8的src目录
cd ~/lnmp1.8/src
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar -xzvf ImageMagick.tar.gz
cd ImageMagick-7.1.0-27
./configure --prefix=/usr/local/imagemagick
make && make install

检查是否安装成功

/usr/local/imagemagick/bin/convert -version
出现下面类似信息表示安装成功;
Version: ImageMagick 7.0.7-22 Q16 x86_64 2018-01-26 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP 
Delegates (built-in): fontconfig freetype jng jpeg png x xml zlib

2、安装php扩展:imagick

cd ..
wget http://pecl.php.net/get/imagick-3.4.3.tgz
tar -xzvf imagick-3.4.3.tgz
cd imagick-3.4.3
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
make && make install

编辑php.ini,添加extension=imagick.so

vim /usr/local/php/etc/php.ini

3、安装php扩展:fileinfo、exif、ldap

返回到src目录
cd ..
解压php5.5.38.tar.bz2
tar -xvf php-5.5.38.tar.bz2
进入扩展目录
cd php-5.5.38/ext/fileinfo
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
继续编译安装exif
cd ~/lnmp1.8/src/php-5.5.38/ext/exif
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
继续编译安装ldap
cd ~/lnmp1.8/src/php-5.5.38/ext/ldap
yum install openldap openldap-devel  -y
cp -frp /usr/lib64/libldap* /usr/lib/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

编辑php.ini,添加extension=fileinfo.so、extension=exif.so、extension=ldap.so

三、安装Roundcube1.5.2

1、创建主机a.com

lnmp vhost add
按提示创建好主机

2、下载Roundcube到主机目录

cd /home/wwwroot/a.com
wget https://github.com/roundcube/roundcubemail/releases/download/1.5.2/roundcubemail-1.5.2-complete.tar.gz
tar -xvf roundcubemail-1.5.2-complete.tar.gz
mv roundcubemail-1.5.2/* .

3、浏览器打开a.com/installer/index.php安装

具体配置参考:http://www.jack361.com/learn/host/1397.html

四、安装配置Postfix、Dovecot

参考:linux搭建邮件服务器 - 阳台 - 博客园

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
CentOS+Postfix+Dovecot+Postfixadmin+Roundcube邮件服务器搭建步骤如下: 1. 安装 CentOS 操作系统,并更新至最新版。 2. 安装 Postfix 邮件服务器,并进行基本配置。 3. 安装 Dovecot IMAP/POP3 服务器,并进行基本配置。 4. 安装 Postfixadmin 邮箱管理系统,并进行基本配置。 5. 安装 Roundcube Webmail 邮件客户端,并进行基本配置。 具体步骤如下: 1. 安装 CentOS 操作系统,并更新至最新版。 在安装 CentOS 操作系统时,选择最小化安装,并根据实际情况进行分区和网络配置。安装完成后,使用以下命令更新系统: ``` yum update ``` 2. 安装 Postfix 邮件服务器,并进行基本配置。 使用以下命令安装 Postfix: ``` yum install postfix ``` 安装完成后,修改 /etc/postfix/main.cf 文件,使其支持 TLS 和 SASL 认证: ``` smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt smtpd_tls_key_file = /etc/pki/tls/private/server.key smtpd_tls_security_level = may smtp_tls_security_level = may smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination ``` 然后重启 Postfix 服务: ``` systemctl restart postfix ``` 3. 安装 Dovecot IMAP/POP3 服务器,并进行基本配置。 使用以下命令安装 Dovecot: ``` yum install dovecot ``` 安装完成后,修改 /etc/dovecot/dovecot.conf 文件,使其支持 TLS 和 SASL 认证: ``` ssl_cert = </etc/pki/tls/certs/server.crt ssl_key = </etc/pki/tls/private/server.key auth_mechanisms = plain login ``` 然后重启 Dovecot 服务: ``` systemctl restart dovecot ``` 4. 安装 Postfixadmin 邮箱管理系统,并进行基本配置。 使用以下命令安装 Postfixadmin: ``` yum install postfixadmin ``` 安装完成后,修改 /etc/httpd/conf.d/postfixadmin.conf 文件,使其支持 SSL: ``` SSLEngine on SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/private/server.key ``` 然后重启 Apache 服务: ``` systemctl restart httpd ``` 访问 https://your-domain.com/postfixadmin,使用管理员账号登录,创建邮箱账号和域名等相关配置。 5. 安装 Roundcube Webmail 邮件客户端,并进行基本配置。 使用以下命令安装 Roundcube: ``` yum install roundcubemail ``` 安装完成后,修改 /etc/httpd/conf.d/roundcubemail.conf 文件,使其支持 SSL: ``` SSLEngine on SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/private/server.key ``` 然后重启 Apache 服务: ``` systemctl restart httpd ``` 访问 https://your-domain.com/roundcubemail,使用邮箱账号登录,即可使用 Roundcube 邮件客户端。 以上就是 CentOS+Postfix+Dovecot+Postfixadmin+Roundcube邮件服务器搭建步骤,如有问题可以参考相关文档或者咨询技术人员。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值