Small Q: When others delete you, the system will not tell you, is afraid of you sad, when you delete others, the system will
Remind you, is afraid you regret, the system is so, people that ....
Today, finish yesterday's unfinished task, Apache configuration; But in the dormitory, the efficiency feeling has declined, although the quiet has the atmosphere of learning, but I really do not think so, at least for me, not. The mood is not good, so always stay.
Apache prohibits the specified user_agent:
When we set the partition log format, we used the combine format, all kinds of end is user_agent, representing the network logo or search engine kernel?
Sometimes when our website is very large, at least half of the spider-like spiders are caused by some search engines (such as 360. Youdao. Some foreign websites, etc.), crawlers can browse your website like a human.
This will cause a lot of load on our website, so we have to ban them.
Enter the virtual host profile:
Vim/ysr/local/apache2/conf/extrs/httpd-vhosts.conf
Add the rewrite module, and we set the domain name jump has been done, so directly add in the good
Rewritecond%{http_user_agant} ^.*chrome* [Nc,or] NC case insensitive
Rewritecond%{http_user_agant} ^.*wo.* [NC]
Rewriterule. *-[F] prohibit chrom mark
Save Detection Reload
Testing: Web site testing, or curl testing
Curl-a "Asdchromds"-x127.0.0.1:80 www.test.com
Curl-a "Asdcmds"-x127.0.0.1:80 Www.test.com-I
To restrict a directory through the rewrite module:
In some cases, we have some important files in the website directory, do not want to let people see, we need to encrypt; before we learned to restrict IP users to visit, this time we use another way to encrypt the directory.
Enter the virtual host profile:
Under the Rewrite module, add:
Rewritecond%{request_uri} ^.*/tmp/.* [NC]
Rewriterule. *-[F]
Day 20th: The basic configuration of Apache under Architecture (ii)