修改linux的shell限制,Nginx下解决WebShell访问限制问题
直入主题公布修改方法
wget http://www.php.net/get/php-5.2.10.tar.gz/from/this/mirror
wget http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz
tar zxvf php-5.2.10.tar.gz
gzip -cd php-5.2.10-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1 //如果你用补丁的话先打补丁再改比较妥当,我没检查过补丁有没动这个文件
cd php-5.2.10/
./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-iconv-dir –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-discard-path –enable-magic-quotes –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-fastcgi –enable-fpm –enable-force-cgi-redirect –enable-mbstring –with-mcrypt –enable-ftp –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –without-pear –with-gettext –with-mime-magic –enable-suhosin
vi main/fopen_wrappers.c
找到/* {{{ php_check_open_basedir
*/
PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
{
/* Only check when open_basedir is available */
if (PG(open_basedir) && *PG(open_basedir)) {
char *pathbuf;
char *ptr;
char *end;
// add by anxsoft.com
char *env_doc_root;
if(PG(doc_root)){
env_doc_root = estrdup(PG(doc_root));
}else{
env_doc_root = sapi_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
}
if(env_doc_root){
intres_root = php_check_specific_open_basedir(env_doc_root, path TSRMLS_CC);
efree(env_doc_root);
if (res_root == 0) {
return 0;
}
if (res_root == -2) {
errno = EPERM;
return -1;
}
}
// add by anxsoft.com
pathbuf = estrdup(PG(open_basedir));
ptr = pathbuf;
while (ptr && *ptr) {
end = strchr(ptr, DEFAULT_DIR_SEPARATOR);
if (end != NULL) {
*end = '\0';
end++;
}
if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) {
efree(pathbuf);
return 0;
}
ptr = end;
}
if (warn) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s)", path, PG(open_basedir));
}
efree(pathbuf);
errno = EPERM; /* we deny permission to open it */
return -1;
}
/* Nothing to check... */
return 0;
}
/* }}} */
两个 add by anxsoft.com 中间的是修改加上去的
然后保存,退出。
make ZEND_EXTRA_LIBS=’-liconv’
make install
php.in的open_basedir配置
open_basedir = “/tmp/:/var/tmp/”
修改linux的shell限制,Nginx下解决WebShell访问限制问题相关推荐
- Linux系统shell脚本实战之解决生产ddos攻击
Linux系统shell脚本实战之解决生产ddos攻击 一.脚本于鏊求 二.脚本内容 三.执行脚本 一.脚本于鏊求 要求屏蔽掉ddos攻击的IP 二.脚本内容 [root@192 scripts]# ...
- linux内核并发教程,修改Linux内核参数提高Nginx服务器并发性能
当linux下Nginx达到并发数很高,TCP TIME_WAIT套接字数量经常达到两.三万,这样服务器很容易被拖死.事实上,我们可以简单的通过修改Linux内核参数,可以减少Nginx服务器 的TI ...
- 拯救者 linux 无线网卡驱动下载,Ubuntu下解决拯救者笔记本无法使用无线网卡
#解决Ubuntu下无线网卡无法使用的问题 为了能够更快地跑完实验,刚刚换了台笔记本电脑,GTX960M的显卡,想着在theano下可以跑得更快一些.最初在win10下使用,安装 theano遇到了无 ...
- 修改linux bash shell PS1
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明 http://riusksk.blogbus.com/logs/62891140.html 由于在终端下,命令提示符.输入及输出均为一 ...
- linux shc shell脚本_CentOS 下使用 shc 加密你的 linux shell 脚本
说明: shc(generic shell script compiler)是一个专业的加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件,这样可以很好地隐藏脚本中IP. ...
- mac访问linux桌面文件夹路径,mac下“远程桌面”访问linux
有一天,坐在pc机前敲代码,脑袋突然闪过一个高端的画面,然后自我反省:为什么我只能蜷在台式机前噼里啪啦,而不能靠沙发.腿蹬茶几.手捧MBA噼里啪啦呢? 首先MBA没有安装开发环境,但台式机上装着deb ...
- linux 脚本停止自身,Linux系统定时任务时shell脚本停止执行如何解决?
Linux系统在进行定时任务的时候,shell脚本突然停止执行了,很多用户不明所以,是什么导致shell不执行了呢?其实原因很简单,下面小编就给大家介绍下Linux定时任务shell脚本停止执行的解决 ...
- 八、Linux 常用 Shell 命令,控制台的快捷键以及 Shell 编程(中)
@Author : Runsen @Date:2020/9/11 文章是Runsen在Gitchat付费文章分享:Linux 常用 Shell 命令,控制台的快捷键以及 Shell 编程 顺便同步到C ...
- linux mysql端口启动失败怎么办,Linux下apache mysql等服务修改默认端口后无法正常启动解决办法...
Linux下apache mysql等服务修改默认端口后无法正常启动解决办法 linux下 apache 等服务修改默认端口后无法正常启动解决办法 服务器上装了两个webserver,一个是nginx ...
最新文章
- 24张GIF图,让你秒懂非标自动化机构的原理
- oracle手工收集awr报告_oracle手工生成AWR报告方法记录-阿里云开发者社区
- 计算机数据采集管理系统的结构和功能,计算机数据采集系统简介
- ddk7600驱动开发环境搭建
- google chrome的图标成一页纸了_10 款 Chrome 扩展,让你的浏览器好用到飞起
- 论文解读:Unprocessing Images for Learned Raw Denoising
- MySQL:连接错误
- 详细讲解vue2组件通信(一)——父传子props
- Renesas:初步使用CS+ for CC 的注意事项
- 向阅读致敬!微信读书产品设计策略推导
- Android .mk文件语法规范及使用模板
- What is a Digital Signature?
- 四个视频营销策略,让你火过傅园慧,Papi酱
- 以下不是python内置数据类型的是_以下不是python内置数据类型的是
- Oracle数据导入导出详解
- 6.s081 lab 4
- Apache Geode/GemFire 数据分区和路由机制浅析
- CC2540 USB dongle 分析蓝牙协议包
- python怎么设置画布大小_python画图时设置分辨率和画布大小的实现(plt.figure())
- 小米ac2100刷openwrt教程