技术交流QQ群:①185473046   ②190706903   ③203744115   网站地图
登录注册

下次自动登录
jdbxn168老虎机官网
现在的位置: 首页Apache>正文
Linux服务器安全狗Apache版本安装
2016年09月22日 Apache 暂无评论 ⁄ 被围观 3,789次+

说明:

在CentOS下使用yum命令默认安装的httpd版本,直接安装服务器安全狗Apache版本没有问题。

但是,如果Apache是自定义路径并且增加??楸嘁氚沧暗?,这个时候默认安装服务器安全狗Apache版本会报错,提示安装失败。

httpd-2.2.31

php-5.2.17

注意:咨询安全狗官方人员得到的回复是php版本太低,高版本的php直接安装不会有问题,这里是php-5.2.17的版本,其他的版本没试过。

解决办法:

1、下载安全狗

cd /usr/local/src

wget? http://www.diytrs.com/safedog_linux64.tar.gz?? #下载安全狗64位版本

tar? zxvf? safedog_linux64.tar.gz? #解压

cd?? /usr/local/src/safedog_linux64/install_files/safedogwz_linux64? #进入目录

vi? install.sh? #编辑修改,注释掉function find_apache()function clean_install()这两个???/span>

#find apache
#function find_apache()
#{
#?????? for progname in httpd apache2 apached
#?????? do
#?????????????? #find apache service
#?????????????? testcmd="service "$progname" status"
#?????????????? $testcmd>/dev/null 2>&1
#?????????????? ret=$?
#?????????????? if [ "$ret" == "0" ] || [ "$ret" == "2" ] || [ "$ret" == "3" ]; then
#?????????????????????? g_ExistApache="true"
#?????????????????????? g_ApacheExePath=$progname
#?????????????????????? g_ApacheRestartCmd="service "$progname" restart"
#?????????????????????? g_ApacheReloadCmd="service "$progname" graceful"
#?????????????????????? g_ApacheStopCmd="service "$progname" stop"
#?????????????????????? g_ApacheExeName=$progname
#?????????????????????? get_apache_confpath
#?????????????????????? if [ ! -z $g_ApacheConfPath ]; then
#?????????????????????????????? return? 1
#?????????????????????? fi
#?????????????? else
#?????????????????????? testcmd="service "$progname" stop"
#?????????????????????? $testcmd>/dev/null 2>&1
#?????????????????????? ret=$?
#?????????????????????? if [ "$ret" == "0" ]; then
#?????????????????????????????? g_ExistApache="true"
#?????????????????????????????? g_ApacheExePath=$progname
#?????????????????????????????? g_ApacheRestartCmd="service "$progname" restart"
#?????????????????????????????? g_ApacheReloadCmd="service "$progname" graceful"
#?????????????????????????????? g_ApacheStopCmd="service "$progname" stop"
#?????????????????????????????? g_ApacheExeName=$progname
#?????????????????????????????? get_apache_confpath
#?????????????????????????????? if [ ! -z $g_ApacheConfPath ]; then
#?????????????????????????????????????? return? 1
#?????????????????????????????? fi
#?????????????????????? fi
#?????????????? fi
#
#?????????????? #"find apache process"
#?????????????? g_ApacheExePath=`ps -ef | grep $progname | grep -v grep | tail -3 | head -1 | awk '{print $8}'`
#?????????????? if [ ! -z $g_ApacheExePath ];then
#?????????????????????? g_ExistApache="true"
#?????????????????????? g_ApacheRestartCmd=$g_ApacheExePath" -k restart"
#?????????????????????? g_ApacheReloadCmd=$g_ApacheExePath" -k graceful"
#?????????????????????? g_ApacheStopCmd=$g_ApacheExePath" -k stop"
#?????????????????????? g_ApacheExeName=$progname
#?????????????????????? return 1
#?????????????? fi
#
#?????? done
#
#?????? # not found
#?????? g_ExistApache="false"
#}

#function clean_install()
#{
#?????? ./uninstall.sh 1 >/dev/null 2>&1
#}

:wq!? #保存退出

2、安装安全狗

cd?? /usr/local/src/safedog_linux64

chmod? +x? *.py? #添加执行权限

./install.py? #安装

安装过程中,要求输入apache的??槁肪?/span>

/usr/local/apache/bin

3、设置apache配置文件

vi /usr/local/apache/conf/httpd.conf? #编辑

#Begin SafeDogSite-ApacheFilter edits - remove only on uninstall

Include "/etc/safedog/apache/SafeDogSiteApacheFilter.Conf"

LoadModule php5_module??????? modules/libphp5.so??? #在配置文件中找到这一行,移动到安全狗配置文件的下面

service httpd restart? #重启apache

service safedog status #查看安全狗状态

service safedog start? #启动

service safedog stop? #停止

至此,Linux服务器安全狗Apache版本安装完成。

     

  系统运维技术交流QQ群:①185473046 系统运维技术交流□Ⅰ ②190706903 系统运维技术交流?Ⅱ ③203744115 系统运维技术交流?Ⅲ

给我留言

您必须 [ 登录 ] 才能发表留言!

?

Copyright© 2011-2017 系统运维 All rights reserved
版权声明:本站所有文章均为作者原创内容,如需转载,请注明出处及原文链接