返回列表 发帖

CentOS7_云锁+Apache

服务器信息:
[root@ser1 ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[root@ser1 ~]#
[root@ser1 ~]# uname -r
3.10.0-1127.el7.x86_64

[root@ser1 ~]# hostname
ser1.zhuohua.store
[root@ser1 ~]# cat /etc/hostname
ser1.zhuohua.store


[root@ser1 ~]# ifconfig
-bash: ifconfig: 未找到命令
[root@ser1 ~]#
[root@ser1 ~]# yum -y install net-tools

[root@ser1 ~]# ifconfig ens33 |grep netmask |awk '{print $2}'
192.168.168.190



安装Apache:
[root@ser1 ~]# yum -y install http* elinks lsof

启动Apache:
[root@ser1 ~]# systemctl start httpd

开机自动启动Apache:
[root@ser1 ~]# systemctl enable httpd
[root@ser1 ~]#
[root@ser1 ~]# systemctl is-enabled httpd
enabled


查看Apache的版本:
[root@ser1 ~]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Apr  2 2020 13:13:23


服务器本地测试Apache:
elinks 127.0.0.1
图片1.png
2021-2-21 16:12



[root@ser1 ~]# lsof -nP -iTCP:80
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd   10211   root    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10213 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10214 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10215 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10216 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10217 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10253 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10254 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)
httpd   10255 apache    4u  IPv6  32997      0t0  TCP *:80 (LISTEN)



在防火墙(Firewalld)打开TCP 80端口:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

查看防火墙所有打开的端口:
[root@ser1 ~]# firewall-cmd --zone=public --list-ports
80/tcp



关闭SELinux:(默认是开启的,要关闭)
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config





云锁的下载官网:
http://www.yunsuo.com.cn/download.html


下载云锁服务器端(64位Linux版):
[root@ser1 ~]# yum -y install wget
[root@ser1 ~]# wget https://download.yunsuo.com.cn/v3/yunsuo_agent_64bit.tar.gz

安装云锁:
[root@ser1 ~]# tar -zxvf yunsuo_agent_64bit.tar.gz
[root@ser1 ~]# chmod a+x yunsuo_install/install
[root@ser1 ~]# yunsuo_install/install
Welcome.
If you encounter any problems during installation, you can use 'ctrl-c' to cancel.

checking installation environment:[ OK ]
decompression package:[ OK ]
Install Selinux Policy Module:[ OK ]
Initialize Configuration Information:[ OK ]
Install Auto-start Script:[ OK ]
Install Protection Driver:[ OK ]
Starting SoftWare:[ OK ]

Install Complete.



云锁会自动启动:
[root@ser1 ~]# service yunsuo status
● yunsuo.service - SYSV: start and stop mainserver
   Loaded: loaded (/etc/rc.d/init.d/yunsuo; bad; vendor preset: disabled)
   Active: active (running) since 六 2021-02-20 09:28:21 CST; 16s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1119 ExecStart=/etc/rc.d/init.d/yunsuo start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/yunsuo.service
           └─1604 ./yunsuo_agent_service -c config.xml -l runlog/run_log.log ...

2月 20 09:28:15 ser1.zhuohua.store systemd[1]: Starting SYSV: start and sto....
2月 20 09:28:21 ser1.zhuohua.store yunsuo[1119]: Starting yunsuo: [  确定  ]
2月 20 09:28:21 ser1.zhuohua.store systemd[1]: Started SYSV: start and stop....
Hint: Some lines were ellipsized, use -l to show in full.



云锁的进程:
[root@ser1 ~]# ps aux |grep yunsuo_agent |grep -v grep
root       1203  0.0  0.2 175632  4540 ?        Ssl  09:28   0:00 ./yunsuo_agent_guard
root       1604  2.9  3.3 1270164 61644 ?       Sl   09:28   0:01 ./yunsuo_agent_service -c config.xml -l runlog/run_log.log -e ALL -t ALL -s safe -m daemon



停止云锁:
[root@ser1 ~]# service yunsuo stop
Stopping yunsuo (via systemctl):  [  确定  ]
[root@ser1 ~]#
[root@ser1 ~]# ps aux |grep yunsuo_agent |grep -v grep
root       1203  0.0  0.2 175632  4540 ?        Ssl  09:28   0:00 ./yunsuo_agent_guard



启动云锁:
[root@ser1 ~]# service yunsuo start
[root@ser1 ~]# ps aux |grep yunsuo_agent |grep -v grep
root       1203  0.0  0.2 175632  4540 ?        Ssl  09:28   0:00 ./yunsuo_agent_guard
root       1889 19.5  1.9 983324 36536 ?        Sl   09:31   0:00 ./yunsuo_agent_service -c config.xml -l runlog/run_log.log -e ALL -t ALL -s safe -m daemon




重启云锁:
[root@ser1 ~]# service yunsuo restart
Restarting yunsuo (via systemctl):  [  确定  ]



服务器重启后,云锁会自动启动的:
[root@ser1 ~]# systemctl is-enabled yunsuo
yunsuo.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig yunsuo --level=5
enabled



添加服务器到云中心,输入以下命令即可绑定自己的服务器:(要到云锁官网注册账号)
[root@ser1 ~]# /usr/local/yunsuo_agent/agent_smart_tool.sh -u 133921xxx -p Jackxxx
Bind Server Success.



Windows客户端管理云锁:(要到云锁的官网下载云锁PC控制端)
图片2.png
2021-2-21 16:16



图片3.png
2021-2-21 16:16



可以看到刚刚添加的服务器:
图片4.png
2021-2-21 16:17



可以在这里重启Apache:
图片5.png
2021-2-21 16:17



图片6.png
2021-2-21 16:17






######

对指定的服务器进行远程SSH连接:
图片7.png
2021-2-21 16:18



图片8.png
2021-2-21 16:18



图片9.png
2021-2-21 16:18






######

双击进入,可以针对指定的服务器进行管理:
图片10.png
2021-2-21 16:19



服务器信息》开启所有的常用功能防护:
图片11.png
2021-2-21 16:19




应用防护:(这里可以看到Web服务器软件为Apache)
图片12.png
2021-2-21 16:19



安装Apache插件:
图片13.png
2021-2-21 16:20



图片14.png
2021-2-21 16:20



Apache的Web防护开启成功:
图片15.png
2021-2-21 16:20



点击上面的“Web防护”》进入网站漏洞防护:
图片16.png
2021-2-21 16:21



将网站漏洞防护设置为“防护模式”:(默认是监控模式)
图片17.png
2021-2-21 16:21



点击“白名单设置”:
图片18.png
2021-2-21 16:21



图片19.png
2021-2-21 16:21

注释:这里可以自定义拦截信息提示的内容。


客户端通过浏览器,测试Apache的Web防护:
http://192.168.168.190/?order%20by
图片20.png
2021-2-21 16:22


图片21.png
2021-2-21 16:22






############
############

在默认站点的根目录创建测试页:
[root@ser1 ~]# cd /var/www/html/
[root@ser1 html]# echo '886' > login.html


客户端远程测试:
http://192.168.168.190/login.html
图片22.png
2021-2-21 16:23



网站后台防护:(修改网页的名称)
图片23.png
2021-2-21 16:23



图片24.png
2021-2-21 16:24



完成的效果:
图片25.png
2021-2-21 16:24



客户端使用旧的后台地址:
http://192.168.168.190/login.html
图片26.png
2021-2-21 16:24


图片27.png
2021-2-21 16:24




客户端使用新的后台地址:(网页会自动跳转)
http://192.168.168.190/mylogin.html
图片28.png
2021-2-21 16:25


图片29.png
2021-2-21 16:25






相关文章:
CentOS8_云锁+Apache

返回列表