# cp /usr/server/courier-imap/etc/imapd.dist /usr/server/courier-imap/etc/imapdhQuLinux联盟
# cp /usr/server/courier-imap/etc/imapd-ssl.dist /usr/server/courier-imap/etc/imapd-ssl5.10测试系统
按以下步骤启动服务
启动MySQL
# /usr/server/mysql/share/mysql/mysql.server start
为了确保postfix以及以后的进程能够正确的搜索到libmysqlclient,在这里将mysql的lib设置到ldconfig的搜索路径中:hQuLinux联盟
# ldconfig -m /usr/server/mysql/lib/mysql
启动PostfixhQuLinux联盟
# /usr/sbin/postfix start
启动Courier-imaphQuLinux联盟
# /usr/server/courier-imap/libexec/authlib/authdaemond starthQuLinux联盟
# /usr/server/courier-imap/libexec/pop3d.rc starthQuLinux联盟
# /usr/server/courier-imap/libexec/imapd.rc start
首先建立一个测试用户:hQuLinux联盟
$ /usr/server/mysql/bin/mysql -upostfix -phQuLinux联盟
mysql> use postfix;hQuLinux联盟
mysql> insert into domain(domain,active) values('mgpc.com.cn','1');hQuLinux联盟
mysql> insert into mailbox(username,password,name,maildir,domain,active) values('daifubing@mgpc.com.cn','123456','TESTER','mgpc.com.cn/daifubing/Maildir/','mgpc.com.cn','1');hQuLinux联盟
mysql> quit;
测试postfix:hQuLinux联盟
$ echo "hello world" | mail daifubing@mgpc.com.cn
$ ls -al /var/mailboxhQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 mgpc.com.cnhQuLinux联盟
$ ls -al /var/mailbox/mgpc.com.cnhQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 .hQuLinux联盟
drwxr-xr-x 7 www www 512 Oct 16 23:24 ..hQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 testhQuLinux联盟
$ ls -al /var/mailbox/mgpc.com.cn/daifubinghQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 .hQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 ..hQuLinux联盟
drwx------ 5 www www 512 Oct 16 23:15 MaildirhQuLinux联盟
$ ls -al /var/mailbox/mgpc.com.cn/daifubing/MaildirhQuLinux联盟
drwx------ 5 www www 512 Oct 16 23:15 .hQuLinux联盟
drwx------ 3 www www 512 Oct 16 23:15 ..hQuLinux联盟
drwx------ 2 www www 512 Oct 16 23:15 curhQuLinux联盟
drwx------ 2 www www 512 Oct 16 23:18 newhQuLinux联盟
drwx------ 2 www www 512 Oct 16 23:18 tmp
上面ls反回的结果可以看到,一个名为mgpc.com.cn的目录已经被postfix建立,同时可以看到目录结构为/var/mailbox/DOMAIN.LTD/USERNAME/Maildir/,这与我们设置的完全相同。
测试SMTP认证:hQuLinux联盟
$ telnet localhost 25hQuLinux联盟
Trying 127.0.0.1...hQuLinux联盟
Connected to localhost.hQuLinux联盟
Escape character is '^]'.hQuLinux联盟
220 mail.mgpc.com.cn ESMTP PostfixhQuLinux联盟
EHLO mgpc.com.cnhQuLinux联盟
250-mail.mgpc.com.cnhQuLinux联盟
250-PIPELININGhQuLinux联盟
250-SIZE 10240000hQuLinux联盟
250-VRFYhQuLinux联盟
250-ETRNhQuLinux联盟
250-AUTH LOGIN PLAINhQuLinux联盟
250-AUTH=LOGIN PLAINhQuLinux联盟
250 8BITMIMEhQuLinux联盟
AUTH LOGINhQuLinux联盟
334 VXNlcm5hbWU6hQuLinux联盟
输入用户名的Base64位编码hQuLinux联盟
334 UGFzc3dvcmQ6hQuLinux联盟
输入密码的Base64位编码hQuLinux联盟
235 Authentication successfulhQuLinux联盟
测试中使用的用户名是daifubing@mgpc.com.cn密码是123456,我们的测试成功了。
测试pop3hQuLinux联盟
$ telnet localhost 110hQuLinux联盟
Trying 127.0.0.1...hQuLinux联盟
Connected to localhost.hQuLinux联盟
Escape character is '^]'.hQuLinux联盟
+OK Hello there.hQuLinux联盟
USER daifubing@mgpc.com.cnhQuLinux联盟
+OK Password required.hQuLinux联盟
PASS 123456hQuLinux联盟
+OK logged in.hQuLinux联盟
上面的提示表示我们的pop3登录也成功了。
5.11安装Apache
下载源代码包hQuLinux联盟
www#cd /usr/home/peng/srchQuLinux联盟
www#tar –zvxf httpd-2.0.47.tar.gzhQuLinux联盟
www#cd httpd-2.0.47hQuLinux联盟
www#./configure --prefix=/usr/local/apache --enable-sohQuLinux联盟
www#makehQuLinux联盟
www#make install
5.12安装PHP
下载源代码包hQuLinux联盟
www#tar –zxvf php-4.4.0.tar.gzhQuLinux联盟
www#cd php-4.4.0hQuLinux联盟
www#./configure --with-mysql=/usr/server/mysql --with-apxs2=/usr/local/apache/bin/apxs hQuLinux联盟
--enable-track-vars --enable-force-cgi-redirect --enable-pic --enable-inline-optimiation hQuLinux联盟
--enable-memory-limit --enable-bcmath --enable-shmop --enable-versioning --enable-calendarhQuLinux联盟
--enable-dbx --enable-dio --enable-mcal --with-config-file-path=/usr/local/apache/conf?hQuLinux联盟
www#makehQuLinux联盟
www#make installhQuLinux联盟
www#cp php.ini-dist /usr/local/apache/conf/php.ini
#ee /usr/local/apache/conf/httpd.confhQuLinux联盟
更改httpd.conf中的user和group为www
找到DocumentRoot将路径改为/usr/local/www/hQuLinux联盟
加入
AddType application/x-httpd-php .phphQuLinux联盟
AddType application/x-httpd-php .php3hQuLinux联盟
AddType application/x-httpd-php .phtmlhQuLinux联盟
AddType application/x-httpd-php-source .phps
更改igenus的权限为hQuLinux联盟
#chown -R www:www igenushQuLinux联盟
更改mailbox权限为www?hQuLinux联盟
#chown -R www:www / var/mailbox
5.13安装postfixadmin-2.0.5
postfixadmin可以在http://high5.net/postfixadmin处得到,下载后是一个名为postfixadmin-2.0.5.tgz的文件hQuLinux联盟
$ tar -zxvf postfixadmin-2.0.5.tgzhQuLinux联盟
$ mv postfixadmin-2.0.5 postfixadminhQuLinux联盟
$ cd postfixadminhQuLinux联盟
为了让postfixadmin正常工作,需要进行一些小的设置,将postfixadmin目录中的config.inc.php.sample复制为config.inc.php,然后编辑其中的参数:hQuLinux联盟
$ cp config.inc.php.sample config.inc.phphQuLinux联盟
$ vi config.inc.phphQuLinux联盟
本例中的配置如下:hQuLinux联盟
// Language confighQuLinux联盟
// Language files are located in './languages'.hQuLinux联盟
$CONF['default_language'] = 'cn';
// Database ConfighQuLinux联盟
// 'database_type' is for future reference.hQuLinux联盟
$CONF['database_type'] = 'mysql';hQuLinux联盟
$CONF['database_host'] = 'localhost';hQuLinux联盟
$CONF['database_user'] = 'postfixadmin';hQuLinux联盟
$CONF['database_password'] = 'postfixadmin';hQuLinux联盟
$CONF['database_name'] = 'postfix';
$CONF['encrypt'] = 'cleartext';
// MailboxeshQuLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论