Enterprise-level Nginx service Optimization (iii) apache+ anti-theft chain

Source: Internet
Author: User

Apache Worker/prefork

/application/apache/bin/apachectl-l | Sed-n '/worker\|prefork/p '

Worker.c

Server Mpm:worker

./configure--with-mpm=worke//compile-time specified, default is Prefork

Prefork Default

Use multiple child processes, with only one thread per child process

High efficiency, stability, security, more resources than worker consumption

vim/application/apache/conf/extra/httpd-mpm.conf

<ifmodule mpm_prefork_module>

Startservers 10//Service START process number

Minspareservers 10//Minimum Idle quantity

Maxspareservers 15//Maximum idle Quantity

Serverlimit 2000

MaxClients 1000//MAX process concurrency

Maxrequestsperchild 5000//The maximum number of processes processed by the child process 0 = Unlimited

</IfModule>

Ps-ef | grep http| Grep-v grep | WC-L//View concurrent connections

6

worker threads are combined with processes

vim/application/apache/conf/extra/httpd-mpm.conf

<ifmodule mpm_worker_module>

Startservers 2

maxclients Number of client connections//concurrent

Serverlimit 25//Total process Count

Minsparethreads 50

Maxsparethreads 200

Thread Limit

Threadsperchild The number of worker threads per server that lasts//

maxrequestsperchild 0//single subprocess accumulates up to less requests, default 0, unlimited meaning

</IfModule>


maxclient <= serverlimit* Threadsperchild

maxclient %threadsperchild =0

Cat/application/apache/conf/extra/httpd-default.conf

Timeout 300

KeepAlive on

Maxkeepaliverequests 100

KeepAliveTimeout 5

Usecanonicalname OFF

Accessfilename. htaccess

Servertokens full

Serversignature on

Hostnamelookups OFF

Number of concurrent connections

pstree-a | grep http |grep-v grep | Wc-l

110

Apache Web Services anti-theft chain


<directory "/usr/local/apache2/htdocs/cfan/pic/" >

Rewriteengine on

Rewritecond%{http_referer}!^http://website domain name/.*$ [NC]

Rewriterule. *\. (gif|jpg) $/HTTP instead of icon [R,NC]

</Directory>

configuration of Nginx anti-theft chain

Location ~* \. (gif|jpg|png|swf|flv|bmp) $ {

Valid_referers None blocked *.hequan.com Hequan z.com;

if ($invalid_referer) {

#rewrite ^/Http://www.hequan. com/403.html;

return 403;

}

}



This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1770655

Enterprise-level Nginx service Optimization (iii) apache+ anti-theft chain

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.