4 月 102013
 

安装必要条件

为Horde Groupware编译受支持的PHP5.3.22运行环境

# yum install openssl-devel libpng-devel \
libjpeg-devel libicu-devel libtidy-devel \
libc-client-devel \
autoconf ImageMagick-devel libssh2-devel

配置并编译PHP

 ./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--with-libxml-dir=/usr/local/libxml2 \

--enable-mbstring \
--with-kerberos --with-imap-ssl \
--with-imap=/usr/local/dovecot/include/dovecot/ \

--with-gettext --with-tidy \
--with-gd --with-png-dir --with-jpeg-dir \
--with-openssl --enable-intl \

--enable-ftp --with-zlib \

错误分析–enable-intl

checking for location of ICU headers and libraries... not found
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU
 install prefix and make sure icu-config works.

#yum install libicu-devel

错误分析 –with-tidy

checking for TIDY support... yes
configure: error: Cannot find libtidy

# yum install libtidy-devel

 

Horde建议安装的PHP Extension Community Library

错误分析 pecl install

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

# yum install autoconf

安装imagick

# pecl install imagick

安装成功并在配置文件中添加PHP扩展

install ok: channel://pecl.php.net/imagick-3.0.1
configuration option “php_ini” is not set to php.ini location
You should add “extension=imagick.so” to php.ini

horde-groupware-504-01

错误分析 pecl install imagick

checking ImageMagick MagickWand API configuration program... 
configure: error: not found. Please provide a path to
 MagickWand-config or Wand-config program.
ERROR: `/tmp/pear/temp/imagick/configure --with-imagick' failed

# yum install ImageMagick-devel

安装lzf

horde-groupware-504-02 horde-groupware-504-03

安装memcache

horde-groupware-504-04

horde-groupware-504-05

使用PEAR在线安装horde groupware

1

[root@localhost ~]# pear channel-discover pear.horde.org
Adding Channel "pear.horde.org" succeeded
Discovery of channel "pear.horde.org" succeeded
[root@localhost ~]#

2

[root@localhost ~]# pear install horde/horde_role
downloading Horde_Role-1.0.1.tgz ...
Starting to download Horde_Role-1.0.1.tgz (10,977 bytes)
.....done: 10,977 bytes
install ok: channel://pear.horde.org/Horde_Role-1.0.1
horde/Horde_Role has post-install scripts:
/usr/share/pear/PEAR/Installer/Role/Horde/Role.php
Horde_Role: Use "pear run-scripts horde/Horde_Role" to finish setup.
DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES
[root@localhost ~]#

3

[root@localhost ~]# pear run-scripts horde/Horde_Role
Including external post-installation script "/usr/local/php/lib/php/PEAR
/Installer/Role/Horde/Role.php" - any errors are in this script
Inclusion succeeded
running post-install script "Horde_Role_postinstall->init()"
init succeeded
Filesystem location for the base Horde application : /usr/local/apache/htdocs
Configuration successfully saved to PEAR config.
Install scripts complete
[root@localhost ~]#

4

# pear install horde/webmail

安装成功

install ok: channel://pear.horde.org/Horde_Crypt-2.1.3
install ok: channel://pear.horde.org/Horde_Notification-2.0.1
install ok: channel://pear.horde.org/Horde_Core-2.4.3
install ok: channel://pear.horde.org/content-2.0.2
install ok: channel://pear.horde.org/timeobjects-2.0.3
install ok: channel://pear.horde.org/Horde_Form-2.0.3
install ok: channel://pear.horde.org/Horde_Rpc-2.0.3
install ok: channel://pear.horde.org/horde-5.0.4
install ok: channel://pear.horde.org/imp-6.0.4
install ok: channel://pear.horde.org/ingo-3.0.3
install ok: channel://pear.horde.org/kronolith-4.0.4
install ok: channel://pear.horde.org/mnemo-4.0.3
install ok: channel://pear.horde.org/nag-4.0.2
install ok: channel://pear.horde.org/turba-4.0.3
install ok: channel://pear.horde.org/webmail-5.0.4

查看文件

horde-groupware-504-06

为HORDE GROUPWARE 5.0.4创建数据并授权

mysql> create database groupware;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on groupware.* to groupware;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on groupware.* to groupware@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> set password for groupware@localhost=password(‘gwpasswd’);
Query OK, 0 rows affected (0.00 sec)

 

[root@localhost ~]# pear config-get bin_dir
/usr/local/php/bin

horde-groupware-504-07

 

horde-groupware-504-08

horde-groupware-504-09

 

horde-groupware-504-10

修改配置文件启用测试页面

[root@localhost ~]# vi /usr/local/apache/htdocs/config/conf.php
$conf['testdisable'] = false;

horde-groupware-504-11

修改Webmail目录及文件所有者为apache用户和组

[root@localhost ~]# cd /usr/local/apache/htdocs/
[root@localhost htdocs]# chown -R apache.apache .

……

horde-groupware-504-12

[root@localhost ~]# pear install HTTP_WebDAV_Server
Failed to download pear/HTTP_WebDAV_Server within preferred state “stable”, latest release is version 1.0.0RC8, stability “beta”, use “channel://pear.php.net/HTTP_WebDAV_Server-1.0.0RC8” to install
install failed
[root@localhost ~]# pear install channel://pear.php.net/HTTP_WebDAV_Server-1.0.0RC8
downloading HTTP_WebDAV_Server-1.0.0RC8.tar …
Starting to download HTTP_WebDAV_Server-1.0.0RC8.tar (Unknown size)
…………………………….done: 159,744 bytes
install ok: channel://pear.php.net/HTTP_WebDAV_Server-1.0.0RC8
[root@localhost ~]#

horde-groupware-504-13

[root@localhost ~]# pear install Net_SMTP
WARNING: “pear/Auth_SASL” is deprecated in favor of “pear/Auth_SASL2”
downloading Net_SMTP-1.6.1.tar …
Starting to download Net_SMTP-1.6.1.tar (Unknown size)
…………….done: 65,024 bytes
install ok: channel://pear.php.net/Net_SMTP-1.6.1
[root@localhost ~]#

horde-groupware-504-14

[root@localhost ~]# pear install XML_Serializer
Failed to download pear/XML_Serializer within preferred state “stable”, latest release is version 0.20.2, stability “beta”, use “channel://pear.php.net/XML_Serializer-0.20.2” to install
install failed
[root@localhost ~]# pear install channel://pear.php.net/XML_Serializer-0.20.2
WARNING: “pear/XML_Parser” is deprecated in favor of “pear/XML_Parser2”
downloading XML_Serializer-0.20.2.tar …
Starting to download XML_Serializer-0.20.2.tar (Unknown size)
…………………………………………………done: 273,408 bytes
downloading XML_Parser-1.3.4.tar …
Starting to download XML_Parser-1.3.4.tar (Unknown size)
…done: 90,624 bytes
install ok: channel://pear.php.net/XML_Parser-1.3.4
install ok: channel://pear.php.net/XML_Serializer-0.20.2
[root@localhost ~]#

horde-groupware-504-15

配置IMP邮件服务器端参数

[root@localhost ~]# cd /usr/local/apache/htdocs/imp/config/
[root@localhost config]# cp backends.php backends.local.php
[root@localhost config]# vi backends.local.php

登录

horde-groupware-504-16

horde-groupware-504-17

 

horde-groupware-504-18

关闭测试页面

horde-groupware-504-19

错误分析

# cat /usr/local/apache/logs/error_log
[Wed Apr 10 02:16:46 2013] [error] [client 192.168.1.151] PHP Warning:  phpinfo() [<a href=’function.phpinfo’>function.phpinfo</a>]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead in /usr/local/apache/htdocs/php.php on line 1

修改php.ini时区设置

# vi /usr/local/php/lib/php.ini
date.timezone = Asia/Chongqing

3 月 302013
 

为Horde Webmail 1.2.11编译的PHP 5.2.17环境配置

horde-webmail-03

ss

horde-webmail-04

 

horde-webmail-05

修改Horde日志文件路径

horde-webmail-06

错误分析1 登录webmail页面反应缓慢且产生错误日志信息

Apr 08 13:54:18 HORDE [warning] [imp] Could not complete request. 
Reason Given: [AUTHENTICATIONFAILED] Authentication 
failed.: NO [pid 12547 on line 384 of "/usr/local/horde/imp/lib/IMAP/Client.php"]

修改dovecot验证方法配置

# vi /usr/local/dovecot/etc/dovecot/conf.d/10-auth.conf
auth_mechanisms = plain login

错误分析2 通过Horde Webmail发送邮件失败

horde-webmail-07

发送邮件失败时的Horde错误日志

Apr 01 11:27:25 HORDE [error] [imp] sendmail returned error code 127 
[pid 23321 on line 754 of "/usr/local/horde/imp/lib/Compose.php"]

发送邮件失败时的Apache错误日志

sh: /usr/lib/sendmail: 没有那个文件或目录

解决方法

[root@mail ~]# cd /usr/lib/
[root@mail lib]# ln -s /usr/sbin/sendmail sendmail

相关下载:(1) Horde Webmail 1.2.11

3 月 272013
 

Postfix日志(/var/log/maillog)显示有关防火墙设置的信息

 Mar 27 12:05:02 pfx postfix/smtp[7463]: AF67B212CA6: enabling PIX workarounds: 
 disable_esmtp delay_dotcrlf for mx1.hotmail.com[65.55.37.104]:25 

使用Telnet从本地LAN网络或本机连接服务器25端口时显示的正常信息

220 pfx.sample.com ESMTP Postfix (2.8.14)
EHLO test.sample.com
250-pfx.sample.om
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN CRAM-MD5
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Continue reading »

3 月 252013
 

错误分析1

C:\Users\Administrator>telnet mail.linuxcache.net 110 
+OK Dovecot ready. 
user hello@mail.linuxcache.net 
+OK 
pass mypasswd 
-ERR [IN-USE] Internal error occurred. Refer to server log for more information. 

Mar 25 17:56:39 pop3(hello@mail.linuxcache.net): Error: user 
hello@mail.linuxcache.net: Initialization failed: Namespace '': 
mkdir(/var/vmail/mail.linuxcache.net/hello@mail.linuxcache.net) failed: 
Permission denied (euid=8(mail) egid=12(mail) missing +w perm: /var/vmail, 
dir owned by 0:0 mode=0755)

Continue reading »

3 月 202013
 

安装Dovecot服务

添加用户

[root@mail dovecot-2.1.15]# groupadd dovenull 
[root@mail dovecot-2.1.15]# useradd -M dovenull -s /sbin/nologin -g dovenull 
[root@mail dovecot-2.1.15]# groupadd dovecot 
[root@mail dovecot-2.1.15]# useradd -M dovecot -s /sbin/nologin -g dovecot

编译安装

[root@mail dovecot-2.1.15]# ./configure --prefix=/usr/local/dovecot --with-mysql 
[root@mail dovecot-2.1.15]# make 
[root@mail dovecot-2.1.15]# make install

Continue reading »

3 月 192013
 

安装Postfix

安装依赖包

[root@mail ~]# yum install db4-devel perl

创建用户和组

[root@mail ~]# useradd -M -s /sbin/nologin postfix
 [root@mail ~]# groupadd postdrop

编译安装

[root@mail postfix-2.8.14]# make -f Makefile.init makefiles \
 > 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql \
 > -DUSE_SASL_AUTH \
 > -DDEF_SERVER_SASL_TYPE=\"/usr/local/dovecot/include/dovecot\"' \
 > 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm'
 [root@mail postfix-2.8.14]# make
 [root@mail postfix-2.8.14]# make install

Continue reading »

3 月 142013
 

安装Apache服务

安装perl(编译apache模块依赖)

[root@mail httpd-2.2.24]# yum install perl

添加用户

[root@mail httpd-2.2.24]# groupadd -r apache 
[root@mail httpd-2.2.24]# useradd -r -M -g apache apache

编译安装

[root@mail httpd-2.2.24]# ./configure --prefix=/usr/local/apache \
 > --enable-so --enable-rewrite 
[root@mail httpd-2.2.24]# make 
[root@mail httpd-2.2.24]# make install

Continue reading »

3 月 022013
 

添加DNS记录

postfix-install-01

 

在Juniper SSG140防火墙接口添加公网IP地址映射并设置访问策略

postfix-install-02

设置映射IP与主机IP及子网掩码

postfix-install-03

postfix-install-03 postfix-install-04

安装PostfixAdmin 2.3.6的必要条件
– You are using Postfix 2.0 or higher.
– You are using Apache 1.3.27 / Lighttpd 1.3.15 or higher.
– You are using PHP 5.1.2 or higher.
– You are using MySQL 3.23 or higher (5.x recommended) OR PostgreSQL 7.4 (or higher)

 

查看当前主机MTA代理程序

[root@localhost ~]# alternatives --display mta
mta - status is auto.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
Current `best' version is /usr/sbin/sendmail.postfix.
[root@localhost ~]#

测试postfix与mysql和dovecot兼容性

[root@mail postfix]# postconf -m |grep mysql
 mysql
 [root@mail postfix]# postconf -a |grep dovecot
 dovecot
 [root@mail postfix]#