<linux下extmail服务的搭建>
下载2个软件包: extmail-1.1.0.tar.gz extman-1.1.tar.gz
下载地址:http://www.cpan.org/
创建extsuite目录
mkdir /var/www/extsuite
解压这2个包到这个目录下:
tar zxf extman-1.1.tar.gz -C /var/www/extsuite
tar zxf extmail-1.1.0.tar.gz -C /var/www/extsuite
改个短的名字
mv extmail-1.1.0 extmail mv extman-1.1 extman
切换到后台目录:
/var/www/extsuite/extman/docs
cp三个文件 别名 域 mailbox配置文件
cp mysql_virtual_alias_maps.cf mysql_virtual_domains_maps.cf mysql_virtual_mailbox_maps.cf /etc/postfix/
安装mysql数据库 yum isnatll mysql-server.x86_64 -y
给mysql加个密码: mysql_secure_installation
切换到次目录: /var/www/extsuite/extman/docs
看到2个文件: extmail.sql init.sql mysql -pwestos < extmail.sql
vim init.sql 把密码项改成明文的:
mysql -pwestos < init.sql mysql -uextmail -pextmail
降下面的参数加入postfix主配置文件:
useradd -u 800 vmail
postconf -d | grep virtual
postconf -e virtual_uid_maps=static:800
postconf -e virtual_gid_maps=static:800
postconf -e virtual_mailbox_base=/home/vmail/
postconf -e virtual_alias_maps=mysql:/etc/postfixmysql_virtual_alias_maps.cf
postconf -e virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf
postconf -e virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf
分别校验是否ok
postmap -q "support@extmail.org" mysql:/etc/postfix/mysql_virtual_alias_maps.cf
postmap -q "postmaster@extmail.org" mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
postmap -q "extmail.org" mysql:/etc/postfix/mysql_virtual_domains_maps.cf
cd /var/www/extsuite/extmail/
less INSTALL
找到以下行写入http。
NameVirtualHost *:80
<VirtualHost *:80>
ServerName mail.extmail.org
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
SuexecUserGroup vmail vmail
</VirtualHost>
cd cgi/ chown vmail.vmail . -R
要是在真机上测试Apache服务,注意配置解析:
vim /etc/hosts
/etc/init.d/httpd restart /etc/init.d/mysqld restart /etc/init.d/postfix restart
浏览器中输入:mail@extmail.org
下面进入报错的解决方案:
extmail报错:
Can't locate CGI.pm in @INC (@INC contains: /var/www/extsuite/extmail/libs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /var/www/extsuite/extmail/libs/Ext/CGI.pm line 20. BEGIN failed--compilation aborted at /var/www/extsuite/extmail/libs/Ext/CGI.pm line 20. Compilation failed in require at /var/www/extsuite/extmail/libs/Ext/App.pm line 23. BEGIN failed--compilation aborted at /var/www/extsuite/extmail/libs/Ext/App.pm line 23. Compilation failed in require at /var/www/extsuite/extmail/libs/Ext/App/Login.pm line 16. BEGIN failed--compilation aborted at /var/www/extsuite/extmail/libs/Ext/App/Login.pm line 16. Compilation failed in require at index.cgi line 20.
解决:yum install perl-CGI
报错: Can't locate /var/www/cgi-bin/extmail//lang//en_US in @INC (@INC contains: /var/www/extsuite/extmail/libs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /var/www/extsuite/extmail/libs/Ext/Lang.pm line 65.
解决:没有主文件
[root@vm1 extmail]# cp webmail.cf.default webmail.cf
[root@vm1 extmail]# pwd /var/www/extsuite/extmail
报错:
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.
解决方案:
没有这个包: Unix-Syslog-1.1.tar.gz
# perl Makefile.PL
安装这个包的报错
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 1. BEGIN failed--compilation aborted at Makefile.PL line 1.
解决
yum install -y perl-ExtUtils-MakeMaker
# perl Makefile.PL # make install
报错
DBI connect('database=extmail;host=localhost;mysql_socket=/var/lib/mysql/mysql.sock','db_user',...) failed: Access denied for user 'db_user'@'localhost' (using password: YES) at /var/www/extsuite/extmail/libs/Ext/Auth/MySQL.pm line 45
解决:进入数据库失败,修改主配置文件。 SYS_MYSQL_USER = extmail SYS_MYSQL_PASS = extmail
报错 Can't chdir to /home/domains/extmail.org/postmaster/Maildir/, No such file or directory
解决:
SYS_MAILDIR_BASE = /home/vmail
# mail support@extmail.org 发封邮件让它创建邮件目录
extmail后台的配置
后台的操作 同样的操作
NameVirtualHost *:80 <VirtualHost *:80> ServerName mail.example.com DocumentRoot /path/to/your/document/root/ ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi Alias /extman /var/www/extsuite/extman/html SuexecUserGroup vuser vgroup </VirtualHost>
只需要下面2行插入,mail前台配置中 ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi Alias /extman /var/www/extsuite/extman/html
最终Apache写入的配置:
<VirtualHost *:80>
ServerName mail.extmail.org
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
SuexecUserGroup vmail vmail
</VirtualHost>
/var/www/extsuite/extman chown vmail.vmail . -R
验证码
/var/www/extsuite/extman
cp webman.cf.default webman.cf
vim webman.cf SYS_CAPTCHA_ON = 1
SYS_CAPTCHA_LEN = 4
关于主页的显示:
vim /etc/rc.local
/var/www/extsuite/extman/daemon/cmdserver &
后台图形监控报错:
Can't locate RRDs.pm in @INC (@INC contains: /var/www/extsuite/extman/libs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /var/www/extsuite/extman/libs/Ext/GraphLog.pm line 23. BEGIN failed--compilation aborted at /var/www/extsuite/extman/libs/Ext/GraphLog.pm line 23. Compilation failed in require at /var/www/extsuite/extman/libs/Ext/MgrApp/ViewLog.pm line 22. BEGIN failed--compilation aborted at /var/www/extsuite/extman/libs/Ext/MgrApp/ViewLog.pm line 22. Compilation failed in require at viewlog.cgi line 18.
解决方法: 下载软件包:rrdtool-perl-1.3.8-6.el6.x86_64.rpm yum localinstall rrdtool-perl-1.3.8-6.el6.x86_64.rpm
虽然显示出来监控目录,但是点击没反映:
# cp mailgraph_ext/ /usr/local/ -r 为什么要cp到/usr/local/下?
/usr/local/mailgraph_ext vim mailgraph-init会发现执行脚本的路经:BASEDIR=/usr/local/mailgraph_ext
# /usr/local/mailgraph_ext/mailgraph-init start
报错: Starting mail statistics grapher: mailgraph_ext Can't locate File/Tail.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/mailgraph_ext/mailgraph_ext.pl line 296. BEGIN failed--compilation aborted at /usr/local/mailgraph_ext/mailgraph_ext.pl line 296. Starting queue statistics grapher: qmonitor
下载包: File-Tail-0.99.3.tar.gz
tar -zxf File-Tail-0.99.3.tar.gz # cd File-Tail-0.99.3 # perl Makefile.PL
报错: File::Tail will be installed without debugging information. This information isn't usefull unless you intend to tinker with the code. To install with debugging enabled, use: perl Makefile.PL LOGIT Checking if your kit is complete... Looks good Warning: prerequisite Time::HiRes 1.12 not found. Writing Makefile for File::Tail
解决方法: # yum install perl-Time-HiRes -y # perl Makefile.PL # make install
# /usr/local/mailgraph_ext/mailgraph-init start
之后就会看到图形化监控。
<linux下extmail服务的搭建>的更多相关文章
- 简单物联网:外网访问内网路由器下树莓派Flask服务器
最近做一个小东西,大概过程就是想在教室,宿舍控制实验室的一些设备. 已经在树莓上搭了一个轻量的flask服务器,在实验室的路由器下,任何设备都是可以访问的:但是有一些限制条件,比如我想在宿舍控制我种花 ...
- 利用ssh反向代理以及autossh实现从外网连接内网服务器
前言 最近遇到这样一个问题,我在实验室架设了一台服务器,给师弟或者小伙伴练习Linux用,然后平时在实验室这边直接连接是没有问题的,都是内网嘛.但是回到宿舍问题出来了,使用校园网的童鞋还是能连接上,使 ...
- 外网访问内网Docker容器
外网访问内网Docker容器 本地安装了Docker容器,只能在局域网内访问,怎样从外网也能访问本地Docker容器? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Docker容器 ...
- 外网访问内网SpringBoot
外网访问内网SpringBoot 本地安装了SpringBoot,只能在局域网内访问,怎样从外网也能访问本地SpringBoot? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装Java 1 ...
- 外网访问内网Elasticsearch WEB
外网访问内网Elasticsearch WEB 本地安装了Elasticsearch,只能在局域网内访问其WEB,怎样从外网也能访问本地Elasticsearch? 本文将介绍具体的实现步骤. 1. ...
- 怎样从外网访问内网Rails
外网访问内网Rails 本地安装了Rails,只能在局域网内访问,怎样从外网也能访问本地Rails? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Rails 默认安装的Rails端口 ...
- 怎样从外网访问内网Memcached数据库
外网访问内网Memcached数据库 本地安装了Memcached数据库,只能在局域网内访问,怎样从外网也能访问本地Memcached数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装 ...
- 怎样从外网访问内网CouchDB数据库
外网访问内网CouchDB数据库 本地安装了CouchDB数据库,只能在局域网内访问,怎样从外网也能访问本地CouchDB数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Cou ...
- 怎样从外网访问内网DB2数据库
外网访问内网DB2数据库 本地安装了DB2数据库,只能在局域网内访问,怎样从外网也能访问本地DB2数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动DB2数据库 默认安装的DB2 ...
- 怎样从外网访问内网OpenLDAP数据库
外网访问内网OpenLDAP数据库 本地安装了OpenLDAP数据库,只能在局域网内访问,怎样从外网也能访问本地OpenLDAP数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动 ...
随机推荐
- Math(2)
Math(2) public static void main(String[] args) { System.out.println(Math.floor(-32.8)); //常数 System. ...
- USACO-Your Ride Is Here(你的飞碟在这儿)-Section1.2<1>
[英文原题] Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. These UFOs o ...
- [matlab]一道笔试题
x=[1 1; 1 -1; -1 -1; -1 1]'; X=-2:0.01:2; Y=X; N=length(X); [X,Y]=meshgrid(X,Y); Z1=0;Z2=0;Z3=0;Z4=0 ...
- 怀旧系列(1)----FBasic
小时候,老爸斥巨资给我买了一台小霸王学习机.玩遍了所有游戏后,里面有个F-Basic语言,黑乎乎的,一点也不好玩.直到杰兄从学校带回一本BASIC语言,才知道这玩意儿还可以编辑**图案.由于没有人指导 ...
- C#中的单体设计模式Singleton
经典的单体设计模式的实现就是 有一个Public的类,在这个类中,有一个私有的private的构造函数. 然后有一个静态方法,这个静态方法返回这个类的实例 举个例子如下 Public class My ...
- 移除KVO的风险
为之前项目添加一个功能用到了一个开源库XMTextView,然后运行报错提示: 显示没有注册一个叫font的观察者,所以闪退.但是我的UITextView没有添加观察者呀,怎么会删除呢? 原来是由分类 ...
- iscsi使用教程(下)
动态创建目标 安装iscsi服务端 # yum install -y scsi-target-utils.x86_64 修改配置文件 # mkdir -p ~/volumes # sed -i '$ ...
- rgbdslam_v2编译过程中引起的needed by错误
Ubuntu16.04,ROS kinectic 报错信息为“ make[2]: *** No rule to make target '/home/william/slam/g2o/lib/libg ...
- Spark BlockManager 概述
Application 启动的时候: 1. 会在 SparkEnv 中实例化 BlockManagerMaster 和 MapOutputTracker,其中 (a) BlockManagerMast ...
- Solr 6.1学习笔记 -- spellcheck 组件
<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> <s ...