« Posts tagged Apache

Apache ALERT – configured POST variable limit exceeded

最近公司有用户反应系统表单的数据没有办法完整保存。测试后发现确实有问题,post提交表单后只能收到200个项目。查Apache日志发现如下记录:

[Fri Mar 11 11:34:13 2011] [error] [client 10.229.9.171]
ALERT - configured POST variable limit exceeded -
dropped variable 'test[]' (attacker '10.229.9.171', file '/web/www/Nerr/post.php'),
referer: http://10.229.8.16/Nerr/post.php

查了些资料:

http://blog.motane.lu/2009/09/15/alert-configured-post-variable-limit-exceeded/

http://blog.yam.com/ymwen/article/15330907

两篇文章分别都提到了[suhosin],像第一篇中提到的,我的apache conf中没有suhosin,咋办内?Just create it,重起apache,搞定。

[suhosin]
suhosin.request.max_vars = 1000
suhosin.post.max_vars = 1000

在Ubuntu下配置Apache基于AD的Kerberos验证

kerberosloginwindow
前段时间因为项目需要在Ubuntu+Apache的环境下配置了基本Active Directory的Kerberos验证, 主要为了实现WEB应用基于AD的单点登陆SSO(即SingleSignOn).

下面将配置过程做简单记录:
0. 先说一下我的环境
Ubuntu9.04 + Apache2.2x + Win2k8 & AD

1.    因为Apache本身是不支持Kerberos的, 所以我们第一步是安装Kerberos Module for Apache即Mod_auth_kerb , 关于这个mod的文档资料和下载可以在官网找到. 在Ubuntu下不需要编译安装, 执行下面的apt-get搞定mod的安装. 安装后Apache的配置中会自动加载mod_auth_kerb.so, 不需要手工修改配置文件.

LINUX
# sudo apt-get install libapache2-mod-auth-kerb

2. 装好Mod_auth_kerb后, 我们来对Kerberos进行配置, 编辑/etc/krb5.conf, 这里建议将原配置文件备份(cp /etc/krb5.conf /etc/krb5_bak.conf), 然后清空原配置文件内容, 贴入如下配置信息并按实际需求进行相应修改(default_realm, kdc, example.com).
»Read More

PHP connect AD with LDAP over SSL (LDAPs)

《Server is unwilling to perform》之后的三个多月,终于有了测试环境。节后的第一个工作日,用了一个下午的时间进行测试,终于成功了。

主要参考文档为adldapLDAP over SSL

环境:win2003 server 用于安装ad和ca,ubuntu做为webserver,安装apache2和php

准备工作:运行phpinfo(),确认php环境已经支持openssl和openldap,关于php环境的配置不多说了。

step 1:安装CA,用来颁发证书,微软或者第三方的都可以,我装的微软的CA,这里很简单

参考文档:安装windows server 2003 证书服务(CA) 企业数字证书认证服务

setp 2:创建证书,并使ad下的ldap开启对ssl的支持,配置完成之后可以使用ldp.exe来测试ldaps连接是否成功,这里也很简单,照着文档做就OK。 »Read More

让Apache支持中文域名

向apache中添加n个virtualhost,两个中文域名没起作用,google一下,豁然开朗…

中国互联网信息中心(CNNIC)有专门的中文域名在线编码转换工具
http://www.cnnic.net.cn/html/Dir/2003/10/29/1112.htm

将URL转成punycode Url 放到Apache 的Servername 中就行了。