|
沙发
楼主 |
发表于 2004-7-19 00:05:11
|
只看该作者
Re:qmail + webmail on Linux9 安装全过程
################################ <br>
# Install mysql <br>
################################ <br>
groupadd mysql <br>
useradd -g mysql mysql <br>
<br>
cd /usr/local <br>
tar -xvzf /usr/local/src/mysql-standard-4.0.20-pc-linux-i686.tar.gz <br>
ln -s mysql-standard-4.0.20-pc-linux-i686 mysql <br>
<br>
cd mysql <br>
scripts/mysql_install_db <br>
<br>
cd .. <br>
chown -R root.mysql mysql-standard-4.0.20-pc-linux-i686 <br>
chmod -R 640 mysql <br>
chmod -R u+X,g+X mysql <br>
chmod -R ug+x mysql/bin <br>
chmod -R g+w mysql/data <br>
chmod -R u+x mysql/scripts <br>
<br>
cp /usr/local/mysql/support-files/my-medium.cnf /usr/local/mysql/data/my.cnf <br>
chgrp mysql /usr/local/mysql/data/my.cnf <br>
<br>
cd /usr/local/mysql <br>
bin/safe_mysqld --user=mysql & <br>
<br>
# Set the root password <br>
/usr/local/mysql/bin/mysqladmin -u root password 'secret' <br>
<br>
# Configure MySQL so it is running all the time from bootup onwards <br>
cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql <br>
chmod 744 /etc/rc.d/init.d/mysql <br>
chkconfig --add mysql <br>
<br>
################################ <br>
# Install apache <br>
################################ <br>
cd /usr/local/src <br>
chown -R root.root apache_1.3.31.tar.gz <br>
tar -xvzf apache_1.3.31.tar.gz <br>
<br>
groupadd www <br>
useradd -g www www <br>
<br>
cd /usr/local/src/apache_1.3.31 <br>
./configure \ <br>--prefix=/usr/local/apache \ <br>--enable-module=so \ <br>--enable-module=rewrite \ <br>--enable-shared=rewrite \ <br>--server-uid=www \ <br>--server-gid=www <br>
<br>
make <br>
make install <br>
<br>
################################ <br>
# Install php <br>
################################ <br>
cd /usr/local/src <br>
tar -xvzf php-4.3.7.tar.gz <br>
chown -R root.root php-4.3.7.tar.gz <br>
<br>
cd php-4.3.7 <br>
./configure \ <br>--with-mysql=/usr/local/mysql \ <br>--with-apxs=/usr/local/apache/bin/apxs <br>
<br>
make <br>
make install <br>
<br>
cp php.ini-dist /usr/local/lib/php.ini <br>
<br>
vi /usr/local/lib/php.ini <br>
######## Modify the /usr/local/lib/php.ini file and make sure it contains the following commands. ######## <br>
max_execution_time=60 <br>
memory_limit=10M <br>
post_max_size=8M <br>
upload_max_filesize=8M <br>
file_uploads=On <br>
log_errors=On <br>
error_log=/usr/local/apache/logs/php_error_log <br>
######## End ######## <br>
<br>
chown -R root.www /usr/local/lib/php <br>
chmod -R g-w,o-rwx /usr/local/lib/php <br>
<br>
vi /usr/local/apache/conf/httpd.conf <br>
######## Modify the /usr/local/apache/conf/httpd.conf file and make sure it contains the following commands. ######## <br>
User www <br>
Group www <br>
ServerAdmin postmaster@myqmail.com <br>
ServerName mail.five-star.cn <br>
# Following line should be present already as it would be inserted by the PHP make <br>
# Make sure you move it outside of the IfDefineSSL section if the make (incorrectly) put it there <br>
LoadModule php4_module libexec/libphp4.so <br>
# uncomment (or add) the following line <br>
AddType application/x-httpd-php .php <br>
# Add the index.php into this line so apache will use this file as a default in addition to index.html <br>
DirectoryIndex index.php index.html <br>
######## End ######## <br>
<br>
rm -Rf /usr/local/apache/htdocs/* <br>
rm -f /usr/local/apache/index.html.* <br>
rm -Rf /usr/local/apache/cgi-bin/* <br>
<br>
cd /usr/local <br>
chown -R root.root apache <br>
chmod 755 apache <br>
chmod -R 600 apache/* <br>
chmod -R u+X apache <br>
<br>
cd apache <br>
chmod -R u+x bin <br>
chgrp -R www cgi-bin <br>
chmod -R u+x,g+x cgi-bin <br>
chgrp -R www icons <br>
chmod -R g+rX icons <br>
chgrp -R www logs <br>
chmod g+wX logs <br>
chgrp -R www htdocs <br>
chmod -R g+rX htdocs <br>
<br>
# Run apache every time at bootup. <br>
rm -rf /etc/rc.d/init.d/httpd <br>
<br>
vi /etc/rc.d/init.d/httpd <br>
######## Create the /etc/rc.d/init.d/httpd file with the following commands. ######## <br>
#!/bin/sh <br>
# <br>
# Startup script for the Apache Web Server <br>
# <br>
# chkconfig: 345 85 15 <br>
# description: Apache is a World Wide Web server. It is used to serve \ <br>
# HTML files and CGI. <br>
# processname: httpd <br>
# pidfile: /var/run/httpd.pid <br>
<br>
<br>
# Source function library. <br>
./etc/rc.d/init.d/functions <br>
<br>
# See how we were called. <br>
case "$1" in <br>start) <br>
echo -n "Starting httpd: " <br>
daemon /usr/local/apache/bin/httpd <br>
echo <br>
touch /var/lock/subsys/httpd <br>;; <br>stop) <br>
echo -n "Shutting down http: " <br>
killproc httpd <br>
echo <br>
rm -f /var/lock/subsys/httpd <br>
rm -f /var/run/httpd.pid <br>;; <br>status) <br>
status httpd <br>;; <br>restart) <br>
$0 stop <br>
$0 start <br>;; <br>reload) <br>
echo -n "Reloading httpd: " <br>
killproc httpd -HUP <br>
echo <br>;; <br>*) <br>
echo "Usage: $0 {start|stop|restart|reload|status}" <br>
exit 1 <br>
esac <br>
<br>
exit 0 <br>
######## End ######## <br>
<br>
chown root.root /etc/rc.d/init.d/httpd <br>
chmod 744 /etc/rc.d/init.d/httpd <br>
chkconfig --add httpd <br>
<br>
################################ <br>
# Install vpopmial <br>
################################ <br>
groupadd vchkpw <br>
useradd -g vchkpw vpopmail <br>
<br>
cd /usr/local/src <br>
tar -xvzf vpopmail-5.4.0.tar.gz <br>
chown -R root.root vpopmail-5.4.0 <br>
cd vpopmail-5.4.0 <br>
<br>
mkdir ~vpopmail/etc <br>
chown vpopmail.vchkpw ~vpopmail/etc <br>
echo "localhost|0|vpopmailuser|vpoppasswd|vpopmail" > ~vpopmail/etc/vpopmail.mysql <br>
chown vpopmail.vchkpw ~vpopmail/etc/vpopmail.mysql <br>
chmod 640 ~vpopmail/etc/vpopmail.mysql <br>
<br>
/usr/local/mysql/bin/mysql --password="secret" <br>
CREATE DATABASE vpopmail; <br>
GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY 'vpoppasswd'; <br>
quit <br>
<br>
./configure \ <br>--disable-roaming-users \ <br>--enable-logging=p \ <br>--disable-passwd \ <br>--enable-clear-passwd \ <br>--disable-domain-quotas \ <br>--enable-auth-module=mysql \ <br>--disable-many-domains \ <br>--enable-auth-logging \ <br>--enable-mysql-logging \ <br>--enable-valias \ <br>--disable-mysql-limits <br>
<br>
make <br>
make install-strip <br>
<br>
vi ~vpopmail/etc/vlimits.default <br>
default_quota 20971520 # Set the mail box default size 20M. <br>
<br>
echo "myqmail.com" > /home/vpopmail/etc/defaultdomain <br>
<br>
# Setup the quota warning message that is sent to users when they are at 90% quota. <br>
vi quotawarn.msg <br>
######## Create the quotawarn.msg file with the following commands. ######## <br>
From: SomeCompany Postmaster <postmaster@myqmail.com> <br>
Reply-To: postmaster@myqmail.com <br>
To: SomeCompany User:; <br>
Subject: Mail quota warning <br>
Mime-Version: 1.0 <br>
Content-Type: text/plain; charset=iso-8859-1 <br>
Content-Transfer-Encoding: 7bit <br>
<br>
Your mailbox on the server is now more than 90% full. <br>
<br>
So that you can continue to receive mail, <br>
you need to remove some messages from your mailbox. <br>
<br>
If you require assistance with this, <br>
please contact our support department : <br>
<br>email : support@myqmail.com <br>Tel : xx xxxx xxxx <br>
######## End ######## <br>
<br>
cp quotawarn.msg /home/vpopmail/domains/.quotawarn.msg <br>
<br>
echo "Message rejected. Not enough storage space in user's mailbox to accept message." > /home/vpopmail/domains/.over-quota.msg <br>
<br>
# add a domain <br>
/home/vpopmail/bin/vadddomain myqmail.com myqmail <br>
<br>
# add a test account <br>
/home/vpopmail/bin/vadduser stone@myqmail.com stone <br>
<br>
# delete a user <br>
# /home/vpopmail/bin/vdeluser stone@myqmail.com <br>
<br>
# delete a domain <br>
# /home/vpopmail/bin/vdeldomain myqmail.com <br>
<br>
################################ <br>
# Install autoresponder <br>
################################ <br>
cd /usr/local/src <br>
tar -xvzf autorespond-2.0.4.tar.gz <br>
chown -R root.root autorespond-2.0.4 <br>
<br>
cd autorespond-2.0.4 <br>
make <br>
make install <br>
<br>
################################ <br>
# Install ezmlm / ezmlm-idx <br>
################################ <br>
cd /usr/local/src <br>
tar -xvzf ezmlm-0.53.tar.gz <br>
chown -R root.root ezmlm-0.53 <br>
<br>
cd /usr/local/src <br>
tar -xvzf ezmlm-idx-0.40.tar.gz <br>
chown -R root.root ezmlm-idx-0.40 <br>
<br>
cp -R ezmlm-idx-0.40/* ezmlm-0.53/ <br>
# (you need to press y quite a few times to allow the patch files to overwrite the original files) <br>
cd ezmlm-0.53 <br>
patch < idx.patch <br>
patch -p1 < ../ezmlm-idx-0.53.400.unified_41.patch <br>
<br>
make <br>
make man <br>
make setup <br>
<br>
################################ <br>
# Install qmailadmin <br>
################################ <br>
cd /usr/local/src <br>
tar -xvzf qmailadmin-1.2.0.tar.gz <br>
chown -R root.root qmailadmin-1.2.0 <br>
<br>
cd qmailadmin-1.2.0 <br>
./configure \ <br>--enable-htmldir=/usr/local/apache/htdocs \ <br>--enable-cgibindir=/usr/local/apache/cgi-bin \ <br>--enable-maxusersperpage=12 \ <br>--enable-maxaliasesperpage=12 \ <br>--enable-modify-quota \ <br>--disable-ezmlm-mysql \ <br>--disable-help <br>
<br>
make <br>
make install-strip <br>
<br>
# Chinese qmailadmin <br>
# Backup the orginal files. <br>
mv /usr/local/share/qmailadmin/lang/en /usr/local/share/qmailadmin/lang/en_bak <br>
mv /usr/local/src/qmailadmin_zh /usr/local/share/qmailadmin/lang/en <br>
<br>
# Test the qmailadmin <br>
<a target=_blank href=http://mail.myqmail.com/cgi-bin/qmailadmin>http://mail.myqmail.com/cgi-bin/qmailadmin</a> <br>
<br>
################################ <br>
# Install sqwebmail <br>
################################ <br>
cd /usr/local/src <br>
tar -xvzf sqwebmail-3.5.3.tar.gz <br>
chown -R root.root sqwebmail-3.5.3.tar.gz <br>
<br>
cd sqwebmail-3.5.3 <br>
./configure \ <br>--without-authpwd --without-authshadow --without-authpam \ <br>--without-authuserdb --without-authldap --without-authdaemon \ <br>--with-authvchkpw --with-fcgi --enable-unicode=gb2312 \ <br>--enable-webpass=vpopmail \ <br>--enable-cgibindir=/usr/local/apache/cgi-bin \ <br>--enable-imagedir=/usr/local/apache/htdocs/leadbbsfile/webmail \ <br>--enable-mimetypes=/usr/local/apache/htdocs \ <br>--enable-mimecharset=gb2312 \ <br>--with-defaultlang=zh <br>
<br>
make <br>
make install <br>
make install-configure <br>
<br>
cp -a /usr/local/apache/htdocs/leadbbsfile/webmail /usr/local/apache/htdocs/ <br>
mv -f /usr/local/src/zh-cn/* /usr/local/share/sqwebmail/html/zh-cn <br>
mv /usr/local/src/leadbbsfile/webmail/* /usr/local/apache/htdocs/leadbbsfile/webmail/ <br>
<br>
# Test the webmail <br>
<a target=_blank href=http://mail.myqmail.com/cgi-bin/sqwebmail>http://mail.myqmail.com/cgi-bin/sqwebmail</a> <br>
<br>
Download the source <br>
* qmail, <a target=_blank href=http://www.qmail.org/netqmail-1.05.tar.gz>http://www.qmail.org/netqmail-1.05.tar.gz</a> <br>
* ucspi-tcp, <a target=_blank href=ftp://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz>ftp://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz</a> <br>
* daemontools, <a target=_blank href=ftp://cr.yp.to/daemontools/daemontools-0.76.tar.gz>ftp://cr.yp.to/daemontools/daemontools-0.76.tar.gz</a> <br>
<br>
References: <br>
<a target=_blank href=http://www.lifewithqmail.org/lwq.html>http://www.lifewithqmail.org/lwq.html</a> <br>
<a target=_blank href=http://www.pipeline.com.au/staff/mbowe/isp/webmail-server.htm>http://www.pipeline.com.au/staff/mbowe/isp/webmail-server.htm</a> <br>
<a target=_blank href=http://cr.yp.to>http://cr.yp.to</a> <br>
|
|