Monthly Archives: 11月 2009
linux系统更换sshd的方法手记[from科学院]
朋友的服务器让人给黑了,把sshd都给更换了,拿到root用户名密码直接用curl往外传。绝对是老毛子的手法,非常娴熟,入侵涉及的方案有perl服务、c、shell、curl、php exec等等。 在最简单的分析下,采取更换sshd服务的办法来去除老毛子的垃圾sshd. 第一步、下载、安装 wget -c "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.0p1.tar.gz" tar zxvf openssh-5.0p1.tar.gz cd openssh-5.0p1 请确认Zlib和OpenSSL的版本: openssh-5.0p1要求Zlib的版本在1.2.1.2以上,OpenSSL版本在0.9.6以上.下面是Zlib和 OpenSSL的官方地址: http://www.gzip.org/zlib/ http://www.openssl.org/ 在安装过程中我遇到了zlib的版本过低。从上边的网址去下一个 zlib-1.2.3.tar.gz tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure make && make install 然后重新进入 openssh-5.0p1: ./configure --sysconfdir=/etc/ssh make 这一步后面很牛B,要去到那个修改过的openssh的目录里 make uninstall (就是要把老毛子的病毒sshd给全部rm掉),然后再执行下面的步骤: make in
多nginx单php-fpm的配置方法[from科学院]
用php fastcgi和nginx搭配的形式是很常见的,在很BT的需求下,可能会需要多个nginx走不同的端口,而进程只用一个php-fpm。 本文所讲的环境比上述一句话还要BT,存在一个php-fpm,而且每个nginx都以一个非超级用户所有来进行运行。 这样就存在了一个BT的情况,php-fpm默认不能以root权限运行,而普通用户来运行的话,对其他用户的目录,php-fpm将没有权限,页面在运行php的时候,会提示404。 于是有以下的解决方案: 找到php的源代码 $src_path/sapi/cgi/fpm/fpm_unix.c 在文件顶部增加一个宏定义:#define I_REALLY_WANT_ROOT_PHP 重新 configure make make install 此时再修改php-fpm.conf 将user group都修改成root(经过上面的修改php-fpm已经支持root了)。 重启php-fpm. 配置各nginx.conf: location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } 点到即止,不再多说。。。
Posted in linux, php
6 Comments
SEARCH
Update
- rose手册第三章三节:controller层:ErrorHandler支持
- 54chen Twitter memo 2012-05-13
- 54chen Twitter memo 2012-05-06
- rose手册第三章二节:controller层:拦截器支持
- 54chen Twitter memo 2012-04-29
- rose手册第三章一节:controller层:url对照规则与返回结果规则
- 54chen Twitter memo 2012-04-22
- 54chen Twitter memo 2012-04-15
- rose手册第二章:配置与使用
- 54chen Twitter memo 2012-04-08
- 54chen Twitter memo 2012-04-01
- rose手册第一章:入门指引
- 54chen Twitter memo 2012-03-25
- 54chen Twitter memo 2012-03-18
- senseidb使用手记
