分享知识的快乐,尊重他人创造的知识 注册 | 登陆
浏览模式: 标准 | 列表2009年09月的文章

rsync 中文手册

Tags: rsync

ISAPI_Rewrite 支持二级域名重写

今天有一个网友问我,怎么使用安装有ISAPI_Rewrite支持二级域名重写为目录。

我给他写了一个httpd.ini

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32
RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]    


RewriteCond Host:  www\.sddgo\.com
RewriteRule ^(.*) /$1 [I,L]
RewriteCond Host:  ([a-zA-Z0-9_-]+)\.sddgo\.com
RewriteRule ^(.*) /$1/$2 [I,L]

 

» 阅读全文

Tags: iis, rewrite

安装有cPanel 添加SOAP支持

今天遇到一台服务器,机器安装有cPanel管理平台。

PHP程序,需要有SOAP支持,于是想安装。本来想进入SSH 使用 yum install php-soap

发现 提示 找不到包。no package php-soad available

后台找呀找,发现 /etc/yum.conf  里面 有一条排除语句。exclude php* ....

把该句注销,运行 yum install php-soap ,成功以后以为OK了,现在还是没用

后来Google一下。找到一篇文章

http://forums.cpanel.net/f4/soap-extension-cpanel-php-98129.html#post448857

http://forums.cpanel.net/f4/installing-soap-cpanel-php-binary-not-easy-apache-128661.html

于是发现需要使用cPanel的easyApache 添加模块Soap 然后经过 半个小时左右生成。才Ok

» 阅读全文

$_SERVER['REQUEST_URI'] 和 $_SERVER['SCRIPT_NAME']

$_SERVER['REQUEST_URI'] 

这个会获取 文件名及参数 如:

index.php?a=1&b=1

但是在 .htaccess 重写为/a/b的情况下,该值返回为:/a/b

$_SERVER['SCRIPT_NAME']

返回执行的脚本文件。index.php

在重写的状态下,也是返回这个index.php

所以我平时获取真实地址使用:$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING']

» 阅读全文

Tags: $_server

apache .htaccess 转换到IIS ISAPI_Rewrite的 httpd.ini

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule News-([a-zA-Z0-9\-\+\&\_]{1,})-([0-9]{1,})\.html$ news.php?action=$1&aid=$2
RewriteRule ([a-zA-Z0-9]{1,})-([0-9]{1,})\.html$ product_infor.php?action=$1&itemno=$2
RewriteRule ([a-zA-Z0-9\-\_\&\+]{1,})\.html$ product.php?cate_name=$1
</IfModule>

» 阅读全文

Tags: apaches, rewrite, htaccess, iis

ssh_config 中文入门

Tags: ssh, ssh_config

为什么sshd_config设PasswordAuthentication no还可以用passwo

为什么sshd_config设PasswordAuthentication no还可以用password登陆

vi /etc/ssh/sshd_config
我们按照 网上的文章。把下面几项改了以后,用户还是可以密码登陆

#以下三行没什么要改的,把默认的#注释去掉就行了
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile    .ssh/authorized_keys

PasswordAuthentication no
PermitEmptyPasswords no

还是会提示:
Using keyboard-interactive authentication 是键盘交互认证模式,不是传统的passwd.


修改方法:

Protocol 2  #仅仅是2, SSH2 服务。
PermitRootLogin no
PasswordAuthentication no
PermitEmptyPasswords no

#其实在OpenSSH 3_8 里以上都是默认值#

最关键的是下面

# Change to no to disable PAM authentication
ChallengeResponseAuthentication no

# Set this to 'no' to disable PAM authentication (via challenge-response)
# and session processing.
UsePAM no

# 只要这两个设置为 no ,就解决问题,只能用 公钥 认证登陆(绝大部分人,不用Passwd 就是用 公钥吧?)。


文章参考:

http://www.freebsdchina.org/forum/viewtopic.php?t=20739&start=0&postdays=0&postorder=asc&highlight=&sid=e235f00c8acd1d929707b8013caf9074

http://bbs2.chinaunix.net/thread-853441-1-1.html

» 阅读全文

Tags: ssh, password