首先感谢gadfly老大的帮助,没有他的大力帮忙,我的qmail就做不下去。谢谢!!!谢谢!!!!!!!
还要感谢peng姐的安装文档和帮助,没有他的文档和帮助,我也做不了,谢谢!!!谢谢!!!!!!!
还要感谢所有写过安装指南、FAQ的人,他们的资料是我在迷雾中的指明灯。谢谢!!!!!
偶D文档修改了部分peng姐D错误。
有问题需要我帮忙的话可以找我,QQ:298613,hojo,身份认证写上chinaunix。
操作系统是trustix linux。
1、安装mysql
groupadd mysql
useradd –g mysql mysql
tar –xzvf mysql-xxxxx.tar.gz
cd mysql-xxxxx
./configure –prefix=/usr/local/mysql
make
make install
/usr/local/mysql/bin/mysql_install_db
chown -R root:mysql /usr/local/mysql
chmod -R 640 /usr/local/mysql
chmod -R u+X,g+X /usr/local/mysql
chmod -R ug+x /usr/local/mysql/bin
chmod -R g+w /usr/local/mysql/data
(# chmod -R g+w /usr/local/mysql/var)
chmod 755 /usr/local/mysql/libexec/mysqld
/usr/local/mysql/bin/safe_mysqld --user=mysql &
修改mysql密码
usr/local/mysql/bin/mysqladmin -u root password 'password'
修改启动:
vi /etc/rc.d/rc.local
/usr/local/mysql/bin/safe_mysqld --user=mysql &
/usr/local/apache/bin/apachectl start & (启动apache,装完apache才写)
2 、安装apache 2
cd apache-2.xxx
groupadd vchkpw
useradd -g vchkpw -d /home/vpopmail vpopmail
./configure --prefix=/usr/local/apache --enable-cgi --enable-cgid --enable-so
make
make install
修改/usr/local/apache/conf/httpd.conf
启动apache用户、组改为:
User vpopmail
Group vchkpw
增加cgi头
AddHandler cgi-script .cgi .pl
启动apache:
/usr/local/apache/bin/apache start
访问:http://x.x.x.x/index.html.en测试
访问:http://x.x.x.x/cgi-bin/test-cg 测试cgi
3、安装Qmail
设定qmail用户和组
mkdir /usr/local/qmail
groupadd nofiles
useradd -g nofiles -d /usr/local/qmail/alias alias
useradd -g nofiles -d /usr/local/qmail qmaild
useradd -g nofiles -d /usr/local/qmail qmaill
useradd -g nofiles -d /usr/local/qmail qmailp
groupadd qmail
useradd -g qmail -d /usr/local/qmail qmailq
useradd -g qmail -d /usr/local/qmail qmailr
useradd -g qmail -d /usr/local/qmail qmails
chmod 755 /usr/local/qmail
chgrp qmail /usr/local/qmail
# tar xzf qmail-1.03.tar.gz
# patch -p0 < qmail-103.patch
(用ls命令要可以看到 qmail-1.03(目录)和qmail-103.patch(文件))
cd qmail-1.03
make setup check
./config-fast test.domain.com
建立系统别名
cd /usr/local/qmail/alias
touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
chmod 644 /usr/local/qmail/alias/.qmail*
cp /usr/local/qmail/boot/home /usr/local/qmail/rc
chmod 755 /usr/local/qmail/rc
ln -s /usr/local/qmail/bin/sendmail /usr/lib/sendmail
ln -s /usr/local/qmail/bin/sendmail /usr/sbin/sendmail
chmod 755 /usr/local/qmail/bin/sendmail
vi /usr/local/qmail/rc
修改其中./Mailbox为./Maildir/
设定qmail自启动
mkdir /etc/qmail
touch /etc/qmail/startvi /usr/local/qmail/rc
echo "csh -cf '/usr/local/qmail/rc &'">/etc/qmail/start
echo "/etc/qmail/smtp.sh">>/etc/qmail/start
3、安装php
cd php-4.3.2RC3
./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs
--enable-track-vars --enable-force-cgi-redirect --enable-pic --enable-inline-optimiation
--enable-memory-limit --enable-bcmath --enable-shmop --enable-versioning -enable-calendar
--enable-dbx --enable-dio --enable-mcal --with-config-file-path=/usr/local/apache/conf
make
make install
cp php.ini-dist /usr/local/apache/conf/php.ini
vi /usr/local/apache/conf/httpd.conf
让apache识别php
AddType application/x-httpd-php .php
# 加入以下行(装载php4模块并指定.php 文件)
# LimitRequestBody (指定php处理的请求数据大小,以下指定为 20M)
LoadModule php4_module modules/libphp4.so
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 20971520
</Files>
#注解以下行(在文本前加#),使apache显示中文,具体原因未知
ForceLanguagePriority Prefer Fallback
修改AddDefaultCharset ISO-8859-1为:
AddDefaultCharset gb2312
#加入默认的引导文件index.php(找到DirectoryIndex,修改如下:)
DirectoryIndex index.html index.html.var index.php
#指定网站目录(假设为 /apache 目录)
DocumentRoot "/apache"
vi /usr/local/apache/conf/php.ini
#找到并修改以下参数
max_execution_time = 600 ;最大运行时间 600 秒
max_input_time = 600 ;最大输出时间 600秒
memory_limit = 20M ;最大内存限制 20M
file_uploads = On ;允许上载文件
upload_max_filesize = 20M ;最大文件大小 20M
post_max_size = 20M ;php可接受的 post 方法大小 20M
session.auto_start = 1 ;session自动启动
把register_globals = Off 改为register_globals = On
测试php,写个test.php文件放到html目录下:
<?
phpinfo();
?>
chmod 555 test.php
5、安装ucspi-t
# tar zxvf ucspi-tcp-0.88.tar.gz
# cd ucspi-tcp-0.88
# make
# make setup check
执行档将被安装于 /usr/local/bin 中
touch /etc/qmail/smtp.sh
chmod 755 /etc/qmail/smtp.sh
smtp.sh装完vpopmail再编辑
编写tcp.smtp规则
touch /etc/qmail/tcp.smtp
echo "127.0.0.1:allow,RELAYCLIENT="\"\" > /etc/qmail/tcp.smtp
echo ":allow" >> /etc/qmail/tcp.smtp
编译tcp.smtp规则
/usr/local/qmail/bin/tcprules /etc/qmail/tcp.smtp.cdb /etc/qmail/tcp.smtp.tmp <
/etc/qmail/tcp.smtp
echo “/etc/qmail/start” >> /etc/rc.d/rc.locad
7、安装vpopmail
增加vpopmail用户、组(前面装apache的时候已经做了,现在可以省略,没有做的一定要增加
vpopmail用户、组)
# groupadd vchkpw
# useradd -g vchkpw -d /home/vpopmail vpopmail
tar vpopmail-5.2.tar.gz
cd vpopmail-5.2
vi vmysql.h
根据你的MYSQL的设置,更改下面的配置
#define MYSQL_SERVER "localhost"
#define MYSQL_USER "root"
#define MYSQL_PASSWD "123456"
#define MYSQL_SERVER "localhost"
#define MYSQL_USER&n