11月19日任務php
11.25 配置防盜鏈html
11.26 訪問控制Directorylinux
11.27 訪問控制FilesMatchapache
11.25 配置防盜鏈vim
[root@zgxlinux-01 ~]# vim /usr/local/apache2.4.37/conf/extra/httpd-vhosts.conf
curl
[root@zgxlinux-01 ~]# /usr/local/apache2.4.37/bin/apachectl -t
Syntax OK
[root@zgxlinux-01 ~]# /usr/local/apache2.4.37/bin/apachectl graceful
測試
#把猿課論壇加入白名單就能夠進行訪問了。this
11.26 訪問控制Directoryurl
核心配置文件內容
<Directory /data/wwwroot/www.123.com/admin/>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
curl測試狀態碼爲403則被限制訪問了3d
[root@zgxlinux-01 111.com]# curl -x127.0.0.1:80 111.com/admin/index.php
121212
[root@zgxlinux-01 111.com]# curl -x192.168.56.128:80 111.com/admin/index.php
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /admin/index.php
on this server.<br />
</p>
</body></html>
11.27 訪問控制FilesMatch
核心配置文件內容
<Directory /data/wwwroot/www.123.com>
<FilesMatch "admin.php(.*)">
Order deny,allow
Deny from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>