
Wednesday, August 5th, 2009
重新编译 Squid ,原来2.6 的一些参数要修改的:
关键字 protocol 变成了 proto
acl myhttp proto HTTP
no_cache 变成了 cache:
cache deny getip
加入 forwarded_for on 到 squid.conf ,可以把 客户端 IP 地址传递给后台的 Apache ,方法是采用 X-FORWARDED-FOR 的 HTTP 头。
用 PHP 抓取:
$ip = getenv(‘REMOTE_ADDR’);
if ( $ip == “127.0.0.1″ ) $ip=getenv(‘HTTP_X_FORWARDED_FOR’);
Apache 日志显示,修改日志记录方式为:
LogFormat ‘%{X-Forwarded-For}i %v %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i”‘ cached
检查客户端 IP 地址的例子: http://myip.freelamp.com/

No Comments
Posted by albertxu in Apache, Squid 

Sunday, February 8th, 2009
做一些简单的设置就能实现需要编程的功能,这样的懒人工具就是 Apache 的 mod_autoindex
我的设置:
IndexOptions NameWidth=* Charset=GBK FoldersFirst HTMLTable SuppressDescription SuppressSize SuppressIcon
IndexOrderDefault Descending Date
IndexIgnore README .htaccess *.bak get.log *~

No Comments
Posted by albertxu in Apache 

Monday, October 20th, 2008
以前写过关于 mod_auth_mysql 的文章,新系统上马了 Cacti 和 Awstats 想到用认证机制保护起来,就想到了那篇文章。但是去 SourceForge 下载的 3.0.0 版本在 RHEL5 上安装时,报错: Read the rest of this entry »

No Comments
Posted by albertxu in Apache 

Tuesday, April 24th, 2007
由 徐永久 发表于 2007年04月24日 08:10。
刚才用标题的关键字去 Google 搜索居然都是 IIS 的错误代码汇总。 很愤然。 决定发布这个页面。
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, defaultcat 

Sunday, April 16th, 2006
由 徐永久 发表于 2006年04月16日 18:42。
.htaccess 用来控制目录权限,能细分权限粒度。
.htaccess 权限管理的几个要点有:
1、httpd.conf 文件中目录的权限需要加上:
AllowOverride AuthConfig
2、在具有 Indexes 选项的情况下,
AllowOverride FileInfo Indexes AuthConfig
Options Indexes SymLinksIfOwnerMatch
如果某子目录内有 .htaccess 文件,则该子目录被列表时不可见。
3、.htaccess 格式为:
Authname “My Private Area”
AuthType Basic
AuthUserFile /somewhere/.htuser
require user user1 user2
require group group1 group2
.htuser 用 htpasswd -c .htuser user1 产生。
.htuser 和 .htaccess 都必须对 apache 的启动用户可读。
4、 可以通过仅仅赋给给定子目录 x 权限来实现对该子目录内部文件可读但是不可列表,这和文件系统的管理类似。
例如要给可列表的 download 下的子目录 private 目录内的某 abc.ppt 文件可读但是对 private 目录不可列表,则可对 private 对 Apache 的启动用户(www)仅仅赋予 x 权限。
drwx–x— 2 albertxu www 512 2006-04-16 18:08 private
目录下的普通文件可以通过类似文件系统的权限来设置。
采用和 MySQL 数据库结合实现用户基本认证的办法可以阅读该文:
http://www.freelamp.com/1110816137/index_html

No Comments
Posted by albertxu in Apache, defaultcat 

Monday, February 27th, 2006
由 徐永久 发表于 2006年02月27日 00:33。
为什么要调戏 Baidu ,因为它愚蠢。
为什么他愚蠢? 因为它会集中,大批量的发送 Spider 信息给一个网站。
怎么调戏?两个方法:
第一个:如果是通过 Baidu 网站引用过来的,利用 Squid 的 功能提示错误信息,让用户再次点击连接才能阅读文章。 Squid 实现方法:
acl BAIDU referer_regex baidu.com
http_access deny BAIDU
deny_info ERR_BAIDU BAIDU
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, Squid, defaultcat 

Tuesday, March 15th, 2005
由 徐永久 发表于 2005年03月15日 00:02。
前面谈到 Samba 服务器的 MySQL 用户认证,实际上我老早就写过 Apache 针对 MySQL 的认证。不过以前只是测试而已,没有实际使用。前文提到知识管理,实际上在公司内部我们运行着一个基于 pLog 的博客系统。原先的系统没有发布到互联网,后来为了能让公司异地的各分支机构也能使用该博客系统,所以,决定发布到互联网。为了最小程度的降低对博客系统的 Hack ,所以我决定采用外挂的 mod_auth_mysql 模块来实现用户认证,从而降低公司内部系统暴露给非授权用户的风险。
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, defaultcat 

Friday, December 10th, 2004
由 徐永久 发表于 2004年12月10日 17:42。
为加快大陆地区用户下载,部署 Apache 相关产品的速度,FreeLAMP.com 决定牺牲宝贵的磁盘空间,镜像 Apache 下载网站。
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, defaultcat 

Wednesday, May 29th, 2002
由 徐永久 发表于 2002年05月29日 23:55。
mod_auth_mysql 是一款很好的基于数据库对 Apache 用户认证的模块,目前已经加入 Apache 模块库,而且最新版本支持 Apache 2.0。
这款软件已经在 FreeLAMP.com 上实施,现把实施过程作简要介绍。
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, defaultcat 

Saturday, May 11th, 2002
由 徐永久 发表于 2002年05月11日 16:12。
今天的电子商务对数据的可靠性提出更高的要求,对数据的保护工作也同样重要。采用 mod_ssl 模块来实现 SSL 协议,能有效提高稳定性,安全性。
业界加密 TCP/IP 网络产品的标准是 SSL ,对于 Internet 上普遍使用的超文本传输协议(HTTP)而言,其加密后的协议称为 HTTPS,缺省采用 443 端口。
HTTPS 数据是加密以后传输的,因此能有效保护在网络上传输的个人隐私信息。
本文将一步一步介绍 mod_ssl 和 Apache 的结合。
Read the rest of this entry »

No Comments
Posted by albertxu in Apache, defaultcat 