正在加载……
apache添加二级域名
Posted in LAMP on May 28, 2007 / 评论(0) »
<VirtualHost 202.103.57.20>
ServerAdmin zxs@fwcn.com
DocumentRoot  d:/home/fwcn.com/
ServerName www.fwcn.com
ServerAlias fwcn.com wwww.fwcn.com
ErrorLog  logs/www.fwcn.com-error_log
CustomLog logs/www.fwcn.com-access_log  common
ErrorDocument 404 /404.html
</VirtualHost>
Apache模块 mod_deflate
Posted in LAMP on October 12, 2006 / 评论(0) »
说明 压缩发送给客户端的内容
状态 扩展(E)
模块名 deflate_module
源文件 mod_deflate.c

概述

mod_deflate模块提供了DEFLATE输出过滤器,允许服务器在将输出内容发送到客户端以前进行压缩,以节约带宽。

top

配置举例

这是一个针对心急者的示范配置:

仅仅压缩少数几种类型

AddOutputFilterByType DEFLATE text/html text/plain  text/xml

以下允许压缩更多内容的配置更加复杂。除非你明白所有的配置细节,否则请不要使用。

Compress everything except images

<Location />
# 插入过滤器
SetOutputFilter DEFLATE

#  Netscape 4.x 有一些问题...
BrowserMatch ^Mozilla/4 gzip-only-text/html

#  Netscape 4.06-4.08 有更多的问题
BrowserMatch ^Mozilla/4\.0[678] no-gzip

#  MSIE 会伪装成 Netscape ,但是事实上它没有问题
BrowserMatch \bMSIE !no-gzip  !gzip-only-text/html
# 不压缩图片
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip  dont-vary

# 确保代理不会发送错误的内容
Header append Vary User-Agent  env=!dont-vary
</Location>

top

启用压缩

输出压缩

压缩是由DEFLATE过滤器实现的。下面的指令会对其所在容器中的文档启用压缩:

SetOutputFilter DEFLATE

一些流行的浏览器不能正确处理所有压缩内容,因此你可能需要将gzip-only-text/html标记设为"1"来仅仅允许压缩html文件(见下面)。如果你设置了"1"以外的任何值,都将被忽略。

如果你想将压缩限制在几种特定的MIME类型上,可以使用AddOutputFilterByType指令。下面的例子仅仅允许对html文档进行压缩:

<Directory  "/your-server-root/manual">
AddOutputFilterByType DEFLATE  text/html
</Directory>

对于那些不能正确处理所有压缩内容的浏览器,可以使用BrowserMatch指令针对特定的浏览器设置no-gzip标记以取消压缩。为了取得更好的效果,你可以将no-gzipgzip-only-text/html配合使用。在这种情况下,下面的设置将会覆盖上面的设置。看看从配置示例中摘录的片断:

BrowserMatch ^Mozilla/4  gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch  \bMSIE !no-gzip !gzip-only-text/html

第一条指令表示如果User-Agent字符串表示它是一个Navigator  4.x的浏览器,这种浏览器不能正确处理除text/html之外的所有类型。而4.06,  4.07, 4.08版的Navigator完全不能处理任何压缩内容,因此第二条指令对这些浏览器完全禁用压缩。

第三个BrowserMatch指令修正了上面两条对浏览器的推测,因为微软的IE也将它自己标识成"Mozilla/4"但是它实际上能够处理所有的压缩内容。因此又在User-Agent头中额外匹配了字符串"MSIE"("\b"表示"单词边界"),并且取消了前面的限制。

注意

DEFLATE过滤器总是在类似于PHP或SSI之类的资源过滤器之后插入,它永远不会触及到内部请求。

注意

通过SetEnv设置force-gzip环境变量将会忽略浏览器的"accept-encoding",始终发送经过压缩的内容。

输出解压

mod_deflate模块还提供了一个解压gzip格式的应答体的功能。为了激活这个特性你必须使用SetOutputFilterAddOutputFilter指令将INFLATE过滤器插入到输入过滤器链:

<Location /dav-area>
ProxyPass  http://example.com/
SetOutputFilter  INFLATE
</Location>

这个例子将会解压来自example.com的输出,这样其它过滤器就可以做进一步的处理了。

输入解压

mod_deflate模块还提供了一个解压gzip格式的请求体的功能。为了激活这个特性你必须使用SetInputFilterAddInputFilter指令将DEFLATE过滤器插入到输入过滤器链。例如:

<Location /dav-area>
SetInputFilter  DEFLATE
</Location>

这样,如果包含"Content-Encoding:  gzip"头的请求体将会被自动解压。极少有浏览器压缩请求体。然而有些程序的确这么做了,比如一些WebDAV客户端程序。

注意 Content-Length

如果你自己处理请求体,请注意Content-Length头仅仅表示客户端输入的数据长度,而不是解压后的实际数据长度。

top

代理服务器

mod_deflate模块发送一个"Vary:  Accept-Encoding"HTTP应答头以提醒代理服务器:只对发送了正确"Accept-Encoding"头的客户端发送缓存的应答。这样可以防止不能正确处理压缩内容的浏览器接受到经过压缩的内容。

如果你按照某些特殊的条件拒绝了某些客户端的访问(比如User-Agent头),你必须手动配置一个额外的Vary头提醒代理服务器做额外的限制。比如,在一个典型的配置中的某处,如果额外的DEFLATE过滤器是否生效取决于User-Agent头,你应当在此处添加:

Header append Vary User-Agent

如果依照除请求头以外的其他条件决定是否使用压缩(例如:HTTP版本),你必须设置Vary头的值为"*"来完全阻止代理服务器的缓存。

示例

Header set Vary *

top

DeflateBufferSize指令

说明 用于zlib一次压缩的片断大小(字节)
语法 DeflateBufferSizevalue
默认值 DeflateBufferSize 8096
作用域 server config, virtual host
状态 扩展(E)
模块 mod_deflate

DeflateBufferSize指令定义了zlib一次压缩的片断的字节数。

top

DeflateCompressionLevel指令

说明 将输出内容压缩的程度
语法 DeflateCompressionLevelvalue
默认值 Zlib的默认值
作用域 server config, virtual host
状态 扩展(E)
模块 mod_deflate
兼容性 仅在 Apache 2.0.45  及以后的版本中可用

DeflateCompressionLevel指令设置压缩程度,越高的压缩程度就会有越好的压缩效果,同时也意味着占用越多的CPU资源。

取值范围在 1(最低压缩率) 到 9(最高压缩率)之间。

top

DeflateFilterNote指令

说明 在日志中放置压缩率标记
语法 DeflateFilterNote  [type]notename
作用域 server config, virtual host
状态 扩展(E)
模块 mod_deflate
兼容性 type仅在2.0.45以后版本中可用

DeflateFilterNote指令指定将一个指示压缩率的标记附加在请求之后。notename就表示这个标记的名字。你可以为了某种统计目的将这个标记的名字添加到访问日志中。

示例

DeflateFilterNote ratio

LogFormat '"%r" %b  (%{ratio}n) "%{User-agent}i"' deflate
CustomLog logs/deflate_log  deflate

如果你想从日志中得到更多精确的数据,可以使用type参数指定notename标记所记录的数据类型。type的取值范围如下:

Input
在标记中存储过滤器输入流的字节数。
Output
在标记中存储过滤器输出流的字节数。
Ratio
在标记中存储过滤器的压缩比(输出/输入*100)。这是type的默认值。

于是,就可以这样记录:

Accurate Logging

DeflateFilterNote Input instream
DeflateFilterNote  Output outstream
DeflateFilterNote Ratio ratio

LogFormat '"%r"  %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log  deflate

参见

top

DeflateMemLevel指令

说明 zlib在压缩时最多可以使用多少内存
语法 DeflateMemLevelvalue
默认值 DeflateMemLevel 9
作用域 server config, virtual host
状态 扩展(E)
模块 mod_deflate

DeflateMemLevel指令指定zlib在压缩时最多可以使用多少内存(取值范围在1到9之间)。

top

DeflateWindowSize指令

说明 Zlib压缩窗口(compression window)的大小
语法 DeflateWindowSizevalue
默认值 DeflateWindowSize 15
作用域 server config, virtual host
状态 扩展(E)
模块 mod_deflate

DeflateWindowSize指令设定zlib压缩窗口(compression  window)的大小(取值范围在1到15之间)。通常窗口越大压缩效果越好。

中小规模POSTFIX邮件系统(转载)
Posted in LAMP on October 11, 2006 / 评论(0) »
整个安装描述过程是基于FreeBSD  4.7环境下的,全部功能都安装在一台服务器上,并且拥有mail.localhost.com域名。

1.安装webmin
下载webmin-1.070.tar.gz
#tar  zxvf webmin-1.070.tar.gz
#cd  webmin-1.070
#./setup.sh
安装后可以对mysql数据库进行管理,比如添加用户,向表里添加数据。

2.数据库的设置

2.1、安装mysql数据库

本系统使用的是FreeBSD  4.7下ports安装的mysql数据库(当时使用原码安装时在安装postfix时出错,所以使用ports安装就解决了该问题)。

#cd  /usr/ports/databases/mysql323-server/
#make install
#cd  work/mysql-3.23.52/
#scripts/mysql_install_db
#cp  support-files/my-medium.cnf /etc/my.cnf
#echo “/usr/local/bin/safe_mysqld  --user=mysql &” >> /etc/rc.local
#/usr/local/bin/safe_mysqld  --user=mysql &  启动mysql服务

2.2、设置数据库

2.2.1、添加mysql用户:

1、使用webmin->mysql数据库服务器->用户权限,添加用户postfix,密码postfix,主机localhost,并设置拥有相应的权限。

2、使用SQL语句添加用户:
#cd  /usr/local/bin
#./mysql –D mysql –p
Password:
mysql>INSERT INTO user  (host,user,password)
->VALUES (‘localhost’,‘postfix’,’’);
Query OK. I  row affected (0.00 sec)
mysql>UPDATA user SET  password=password(‘postfix’)
->WHERE user=’postfix’;
Rows matched: 1  Changed: 1 Warnings: 0
mysql>FLUSH PRIVILEGES;
Query OK. 0 rows  affected (0.01 sec)
mysql>GRANT select,insert,update on mail.* TO  postfix
Query OK. 0 rows affected (0.01  sec)
mysql>exit

2.2.2、向数据库中添加表

#cd /usr/local/bin/
#ee  postfix.sql

CREATE DATABASE;
GRANT ALL ON mail.* mail@localhost  IDENTIFIED BY “postfix”;
FLUSH PRIVILEGES;
use mail;
CREATE TABLE  forward (
username varchar(255) NOT NULL default ‘’, //本机地址
forward_addr  varchar(255) default NULL, //转发地址
PRIMARY KEY (username)
)  TYPE=MyISAM;
CREATE TABLE transport (
domain varchar(255) NOT NULL default  ‘’, //邮件域
transport varchar(icon_cool.gif default NULL, //处理方式
PRIMARY KEY  (domain)
) TYPE=MyISAM;
CREATE TABLE users (
username varchar(128) NOT  NULL default ‘’, //用户名
domain varchar(128) NOT NULL default ‘’,  //邮件域
address varchar(128) NOT NULL default ‘’, //邮件地址
password  varchar(128) NOT NULL default ‘’, //用户密码(明文)
uid int(6) NOT NULL default  ‘1024’, //uid
gid int(6) NOT NULL default ‘1024’, //gid
home varchar(255)  NOT NULL default ‘/’, //home目录
maildir varchar(255) NOT NULL default ‘’,  //maildir目录
quota varchar(255) NOT NULL default ‘’, //邮箱容量
mailok  tinyint(3) NOT NULL default ‘1’,
bool1 tinyint(3) NOT NULL default  ‘1’,
bool2 tinyint(3) NOT NULL default ‘1’,
PRIMARY KEY  (address),
UNIQUE KEY address (address),
KEY address_2 (address)
)  TYPE=MyISAM;

输入完毕后保存退出。
#./mysql –u postfix –p <  postfix.sql
#password:postfix

2.2.3、向表中添加数据

#/usr/local/bin
#./mysql  –u postfix –p
password:******
mysql>use mail
mysql>INSERT INTO  transport (domain,transport)
->VALUES  (’localhost.com’,’virtual:’);
mysql>INSERT INTO users  (username,domain,address,password,uid,gid,
home,maildir,quota,mailok,bool1,bool2)
->VALUES  (‘test’,’localhost.com’,’test.localhost.com’,
’test’,’1024’,’1024’,’/’,
’/var/postfix_mail/test/Maildir/’,’5000000’,’1’,’1’,’1’);
mysql>exit

3.安装CYRUS-SASL

#tar  –zxvf cyrus-sasl-1.5.27
#cd cyrus-sasl-1.5.27
#./configure  --with-pwcheck=/var/pwcheck --enable-login
--enable-plain
#make
#make  install

#echo /usr/local/lib/ >> /etc/ld.so.conf
#echo  /usr/local/lib/mysql/ >> /etc/ld.so.conf
#ldconfig

#cp  /usr/local/include/* /usr/include
#cp /usr/local/lib/lib*.*  /usr/lib

#ln –s /usr/local/lib/sasl /usr/lib/sasl
#ln –s  /usr/local/include/mysql /usr/include/mysql
#ln –s /usr/local/lib/mysql  /usr/lib/mysql

在/usr/local/lib/sasl下建立文件smtpd.conf,添加一下内容:
pwcheck_method:mysql
mysql_user:postfix
mysql_passwd:postfix
mysql_host:localhost
mysql_database:mail
mysql_table:users
mysql_uidcol:address
mysql_pwdcol:password

4.安装和设置postfix

4.1、安装postfix

4.4.1、编译/etc/rc.conf,设置sendmail_enable=”NO”

#mv  /usr/bin/newaliases /usr/bin/newaliases.OFF
#mv /usr/bin/mailq  /usr/bin/mailq.OFF
#mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
#pw  groupadd postfix –g 1024
#pw groupadd postdrop –g 1025
#pw useradd postfix  –u 1024 –g postfix
#echo ‘postfix:root’ >>  /etc/aliases

4.4.2、安装postfix和相应的quota补丁

#tar zxvf  postfix-1.1.11.tar.gz
#patch <  postfix-1.1.11_quota_maildirsize.patch
#make –f Makefile.init makefiles  ‘CCARGS=-DUSE_SASL_AUTH –DHAS_MYSQL –I/usr/include/mysql’  ‘AUXLIBS=-L/usr/lib/mysql –lmysqlclient –lasal –lz –lm’
#make
#make  install  按照默认路径一路回车就可以安装成功postfix,如果出错,在提示“tempdir”时输入:/tmp,这样一般就可以通过。

4.2、设置postfix

postfix默认安装到/etc/postfix目录下,设置文件也在这
#cd  /etc/postfix

4.2.1、编译主配置文件main.cf

#ee main.cf 添加如下内容

#Base  configure
myhostname = mail.localhost.com //本机的机器名
mydomain = local.com  //域名
mynetworks = 127.0.0.0/8 192.168.0.0/16  //允许不经smtp认证能发信的ip段
home_mailbox = Maildir/  //使用的邮箱格式为Maildir/
smtpd_banner = Welcome to localhost.com mail system!  //smtp的欢迎信息

#Mysql configure
transport_maps =  mysql:/etc/postfix/transport.cf //指定那些域的邮件可以被postfix收下来
virtual_mailbox_base  =/ //指定用户邮箱所在的根目录
virtual_uid_maps = mysql:/etc/postfix/ids.cf  //指定postfix帐号的ID
virtual_gid_maps = mysql:/etc/postfix/gds.cf  //指定postfix组的ID
virtual_mailbox_maps = mysql:/etc/postfix/users.cf  //指定用户邮箱的目录
virtual_maps = mysql:/etc/postfix/forward.cf  //指定自动转发邮件的设置
#Quota configure
message_size_limit = 5000000  //单个邮件大小的限制
virtual_mailbox_limit = 5000000  //默认的邮箱大小
virtual_mailbox_limit_maps = mysql:/etc/postfix/quota.cf  //每个用户的邮箱大小
virtual_mailbox_limit_override = yes //是否允许覆盖默认的邮箱大小

#smtp  configure
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =  $myhostname
smtpd_recipient_restrictions = permit_mynetworks  permit_sasl_authenticated permit_auth_destination  reject
smtpd_sasl_security_options = noanonymous
smtpd_client_restrictions  = permit_sasl_authenticated

inet_interfaces = all  //监听所有端口
inet_interfaces = 192.168.80.21  //是外面的用户也可以发送邮件

4.2.2、查看master.cf文件必须包含下面一行

virtual unix - n n - -  virtual

4.2.3、编译transport.cf

#touch transport.cf
#ee  transport.cf 添加如下内容
user = postfix
password = postfix
dbname =  mail
table = transport
select_field = transport
where_field =  domain
hosts = localhost

4.2.4、编译ids.cf

#touch ids.cf
#ee  ids.cf
user = postfix
password = postfix
dbname = mail
table =  users
select_field = uid
where_field = address
hosts =  localhost
4.2.5、编译gds.cf

#touch gds.cf
#ee gds.cf
user =  postfix
password = postfix
dbname = mail
table = users
select_field  = gid
where_field = address
hosts =  localhost

4.2.6、编译forward.cf

#touch forward.cf
#ee  forward.cf
user = postfix
password = postfix
dbname = mail
table =  forward
select_field = forward_addr
where_field = username
hosts =  localhost

4.2.7、编译users.cf

#touch users.cf
#ee users.cf
user  = postfix
password = postfix
dbname = mail
table =  users
select_field = maildir
where_field = address
hosts =  localhost

4.2.8、编译quota.cf

#touch quota.cf
#ee quota.cf
user  = postfix
password = postfix
dbname = mail
table =  users
select_field = quota
where_field = address
hosts =  localhost

4.3、启动postfix

#/usr/sbin/postfix  start
postfix/postfix-script: starting the Postfix mail  system

#echo “/usr/sbin/postfix start” >>  /etc/rc.local

#telnet localhost 25
Connected to  localhost.localhost.com.
Escape character is ‘^]’.
220 Welcome to  localhost mail system!

4.4、测试postfix

4.4.1、建立mail邮件存放目录
#cd  /var
#mkdir postfix_mail
#chown –R postfix:postfix  /var/postfix_mail

4.4.2、使用客户端发邮件
此时可以使用客户端的foxmail或者outlook向用户test.localhost.com发送邮件,然后到/var/postfix/test/Maildir/下查看邮件,如果能收到说明SMTP已经工作正常了,如果有问题仔细检查自己的每个步骤。

5.安装设置courier-imap

5.1、安装courier-imap

#cd  /usr/ports/mail/courier-imap
#make
#cd  work/courier-imap-1.5.3
#./configure –with-db=db –without-socks  –disable-root-check
#make
#make  install
#/usr/lib/courier-imap/libexec/authlib/authdaemon start
#echo  “/usr/lib/courier-imap/libexec/authlib/authdaemon start” >>  /etc/rc.local

5.2、添加用户

#cd /usr/local/bin
#./mysql –D mysql  –p
password:*******
mysql>INSERT INTO user  (host,user,password)
->VALUES  (‘localhost’,’courier’,’’);
mysql>UPDATA user SET  password=password(‘haha’)
->WHERE user=’courier’;
mysql>FLUSH  PRIVILEGES;
mysql>GRAN select,insert,update on mail.* TO  courier;
mysql>exit

5.3、设置courier-imap

#cd  /usr/lib/courier-imap/etc
#cp authdaemonrc.dist authdaemonrc
#cp  authmysqlrc.dist authmysqlrc
#cp imapd.dist imapd
#cp imapd-ssl.dist  imapd-ssl
#cp pop3d.dist pop3d
#cp pop3d-ssl pop3d-ssl

#ee  pop3d

prefix=/usr/lib/courier-imap
exec_prefix=/usr/lib/courier-imap
sbindir=”/usr/lib/courier-imap/sbin”

PIDFILE=/var/run/pop3d.pid
MAXDAEMONS=40
MAXPERIP=4
AUTHMODULES=”authdaemon”
AUTHMODULES_ORIG=”authdaemon”
POP3AUTH=””
POP3AUTH_ORIG=”LOGIN  CRAM-MD5 CRAM-SHA1”
POP3AUTH_TLS=””
POP3AUTH_TLS_ORIG=”LOGIN  PLAIN”
PORT=110
ADDRESS=0
TCPDOPTS=”-nodnslookup  -noidentlookup”
POP3DSTART=YES

#ee  imapd

IMAPDSTART=YES

#ee authdaemonrc
authmodulelist=”authmysql  authpam”
authmodulelistorig=”authcustom authcram authuserdb authmysql  authpam”
daemons=5
version=”authdaemond.mysql”
authdaemonvar=”/usr/lib/courier-imap/var/authdaemon”

#ee  authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME  courier
MYSQL_PASSWORD haha
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT  3306
MYSQL_OPT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE  users
#MYSQL_CRYPT_PWFIELD password
MYSQL_CLEAR_PWFIELD  password
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD  address
MYSQL_HOME_FIELD home
MYSQL_NAME_FIELD  username
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD  quota
MYSQL_WHERE_CLAUSE mailok=1

#cd ..
#ln -s  /usr/lib/courier-imap/libexec/imapd.rc imapd
#ln -s  /usr/lib/courier-imap/libexec/pop3d.rc pop3d
#./imapd start
#echo  “/usr/lib/courier-imap/imap start” >> /etc/rc.local
#./pop3d  start
#echo “/usr/lib/courier-imap/pop3 start” >>  /etc/rc.local
#netstat –an | grep LISTEN
tcp4 0 0 *:110 *:*  LISTEN
tcp46 0 0 *:110 *:* LISTEN
tcp4 0 0 *:143 *.* LISTEN
tcp46 0 0  *.143 *.* LISTEN

#telnet localhost 110
Trying  127.0.0.1...
Connected to localhost.cw-isquare.com.
Escape character is  ‘^]’.
+OK Hello there
#quit

#telnet localhost 143
*OK  Courier-IMAP ready. Copyright 1998-2002 Double Precision, Inc. See COPYING for  distribution  information.
#quit

5.安装设置sqwebmail

5.1、安装sqwebmail-3.5.0-cn.tar.gz

#tar  zxvf sqwebmail-3.5.0.tar.gz
#cd sqwebmail-3.5.0
#./configure  --without-authpam –with-db=db --enable-webpass=no --without-authpwd  --without-authshadow
#make configure-check
#make
#make  install-strip
#make  install-configure

#/usr/local/share/sqwebmail/libexec/authlib/authdaemond  start
#echo “/usr/local/share/sqwebmail/libexec/authlib/authdaemond start”  >> /etc/rc.local

5.2、配置sqwebmail-3.5.0

5.2.1、安装apache
#tar  apache_1.3.22.tar.gz
#cd apache_1.3.22
#./configure  –prefix=/usr/local/apache
#make
#make  install

5.2.2、设置sqwebmail
#cd /usr/local/share/sqwebmail
#ee  authdaemonrc
authmodulelist=”authmysql  authpam”
authmodulelistorig=”authcustom authcram authuserdb authmysql  authpam”
daemons=5
version=”authdaemond.mysql”
authdaemonvar=”/usr/local/share/sqwebmail/var/authdaemon”

#ee  authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME  courier
MYSQL_PASSWORD haha
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT  3306
MYSQL_OPT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE  users
#MYSQL_CRYPT_PWFIELD password
MYSQL_CLEAR_PWFIELD  password
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD  address
MYSQL_HOME_FIELD home
MYSQL_NAME_FIELD  username
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD  quota
MYSQL_WHERE_CLAUSE  mailok=1


5.2.3、测试sqwebmail-3.5.0

在客户端的浏览器的地址栏输入
http://mail.localhost.com/cgi-bin/sqwebmail
输入用户名和密码就可以登录进去收发邮件了。
注意:用户名一定要输入全称,也就是连域名一起输入。

5.2.4、设置apache页面跳转

#cd  /usr/local/apache/htdocs
#touch index.html
#ee index.html

<meta  http-equiv=”refresh”  content=”0;URL=http://mail.localhost
.com/cgi-bin/sqwebmail?index=1”>

现在就可以直接在IE的地址栏输入:
http://mail.localhost.com
来访问sqwebmail了

这篇文章没有加入smtp认证,上次有个朋友在帖子里说过加认证的方法,由于没有时间,所以我就没有试。还有没有邮件列表的问题,我找不到解决的方法,如果有朋友看到这篇文章请把smtp认证和邮件列表功能补充一下,这要就比较完整了。在此我先表示感谢~

了解更多详情,参与讨论,请进入GBUNIX论坛

http://www.gbunix.com/bbs/index.php
tar排除目录
Posted in LAMP on October 9, 2006 / 评论(0) »
想备份一下系统,用的下面的命令
> tar cvpzf backup.tgz / --exclude=/proc  --exclude=/lost+found
> --exclude=/backup.tgz --exclude=/mnt  --exclude=/sys
> 但事实上根本没能排除后面那些目录,请问应该怎么做呢?
> 系统是ubuntu breezy, tar  (GNU tar) 1.15.1
>

hi,
如果是排除多个目录,可以将需要排除的目录每个一行写入文件中,如  tar_exclude:
tar -cz --exclude-from tar_exclude -vf from_dir.tar.gz  from_dir
debian下面的防火墙设置
Posted in LAMP on September 26, 2006 / 评论(0) »

rh下面的防火墙设置是保存在/etc/sysconfig/iptables文件中的,这样每次重启都会恢复防火墙设置。

debian木有这个文件,但是他提供了更加灵活的方式。
http://www.debian.org/doc/manuals/securing-debian-howto/ch-sec-services.en.html#s-firewall-setup

看了下,似乎比较简单的就是设置interfaces文件了。

5.14.3.3 Configuring firewall rules through ifup
You can use also the  network configuration in /etc/network/interfaces to setup your firewall rules.  For this you will need to:

Create your firewalling ruleset for when the interface is active.
Save  your ruleset with iptables-save to a file in /etc, for example  /etc/iptables.up.rules
Configure etc/network/interfaces to use the configured  ruleset:
    iface eth0 inet static
            address x.x.x.x
             [.. interface configuration ..]
            pre-up iptables-restore <  /etc/iptables.up.rules
You can optionally also setup a set of rules to be  applied when the network interface is down creating a set of rules, saving it in  /etc/iptables.down.rules and adding this directive to the interface  configuration:

        post-down iptables-restore < /etc/iptables.down.rules
For more  advanced firewall configuration scripts through ifupdown you can use the hooks  available to each interface as in the *.d/ directories called with run-parts  (see run-parts(8)).

可以去http://easyfwgen.morizot.net/gen/在线生成一个防火墙脚本,然后pre-up指定一下。

分页: 15/20 第一页 上页 10 11 12 13 14 15 16 17 18 19 下页 最后页 [ 显示模式: 摘要 | 列表 ]