Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache security optimization

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, what is the hotlink protection system that cannot download the corresponding resources while ensuring that the address is correct, which is affected by the hotlink protection system, so what exactly is the hotlink protection system? Hotlink protection is naturally to prevent hotlink, so let's talk about what is hotlink first. Hotlink refers to displaying some content on your own page that is not on your server. The common practice is to obtain the resource address on someone else's server through technical means, bypass other people's resource display page, and provide this content directly to the end user on your own page. It is more common that some small stations embezzle the resources of large stations (pictures, music, videos, software, etc.). For these small stations, the burden of their own servers can be reduced by stealing links, because the real space and traffic come from other people's servers. Hotlink protection system is a system that prevents others from bypassing the resource display page of this site through some technical means, embezzling the resources of this site, and invalidating the resource links that bypass the resource display page of this site. After the implementation of the hotlink protection system, because it shields the indirect resource requests of those hotlinks, which can greatly reduce the pressure on the server and bandwidth, more and more sites begin to implement hotlink protection technology. Second, the experimental environment

1. The IP address of a Linux system (192.168.100.184)

2. Two Win10 hosts, one as a hotlink website and one as a test client

3. Start the experiment

1. Install the DNS service

[root@localhost ~] # yum install bind-y

2. Go to the configuration file to modify the address and domain name

[root@localhost ~] # vim / etc/named.conf

[root@localhost ~] # vim / etc/named.rfc1912.zones

[root@localhost ~] # cd / var/named/ [root@localhost named] # cp-p named.localhost kgc.com.zone [root@localhost named] # vim kgc.com.zone

3. Turn off the firewall and enhanced security features

[root@localhost named] # systemctl stop firewalld.service [root@localhost named] # setenforce 0

4. Install the compiler

[root@localhost httpd-2.4.29] # yum install gcc gcc-c++ pcre pcre-devel zlib-devel-y

5. Under the httpd-2.4.29 path, compile Apache, and add the content of mod_rewrite module to the parameters

. / configure\-prefix=/usr/local/httpd\-enable-deflate\-enable-so\-enable-rewrite\-enable-charset-lite\-enable-cgi

Next, make&&make install.

6. Open the module, modify the listening address and resolve the domain name

LoadModule rewrite_module modules/mod_rewrite.so / / enable mod_rewrite module ServerName www.kgc.com:80 / / enable domain name Listen 192.168.220.129 ServerName www.kgc.com:80 80 / / Open listening address and port # Listen 80 / / cancel ipv6 listening port

7. Insert a picture in the Apache page

Start the service in / usr/local/httpd/bin

8. Verify whether the picture can be seen on the client

9. Configure hotlink websites

1. Copy photo attributes http://www.kgc.com/zwq.jpg

2. Build a website on Windows and write a html document

Modify the suffix of asking price to .html

Put this page in C:\ inetpub\ wwwroot

At this time, if you visit Win10, you can see that you can

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report