Apache1.3.34でMaxConnectionを256以上にする方法
Apache1.3.34でMaxConnectionを256以上にする方法
0.改訂履歴
1.はじめに
このドキュメントでは,Apache1.3のMaxClientsパラメータを256以上にする方法を説明する. LinuxでApacheを利用する場合,デフォルトでは,MaxConnectionが256となっている. それを2048に変更する. この作業は,ヘッダーファイルを書き換えてコンパイルし直しとなる.
2.設定手順
- Apacheのソースを取得してアーカイブを展開する.
[shinnai@mars apache1]$ wget http://www.apache.jp/dist/httpd/apache_1.3.34.tar.gz
--10:44:08-- http://www.apache.jp/dist/httpd/apache_1.3.34.tar.gz
=> `apache_1.3.34.tar.gz'
Resolving www.apache.jp... done.
Connecting to www.apache.jp[210.188.224.37]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,468,056 [application/x-gzip]
100%[==========================================================================>]
2,468,056 2.02M/s ETA 00:00
10:44:09 (2.02 MB/s) - `apache_1.3.34.tar.gz' saved [2468056/2468056]
[shinnai@mars apache1]$ tar zxf apache_1.3.34.tar.gz
[shinnai@mars apache1]$
|
[shinnai@mars apache1]$ cd apache_1.3.34
[shinnai@mars apache_1.3.34]$ cd src
[shinnai@mars src]$ cd include
[shinnai@mars include]$ ls -la httpd.h
-rw-r--r-- 1 shinnai ujp.jp 44803 Oct 14 08:25 httpd.h
[shinnai@mars include]$
|
変更前 |
/* Limit on the total --- clients will be locked out if more servers than
* this are needed. It is intended solely to keep the server from crashing
* when things get out of hand.
*
* We keep a hard maximum number of servers, for two reasons --- first off,
* in case something goes seriously wrong, we want to stop the fork bomb
* short of actually crashing the machine we're running on by filling some
* kernel table. Secondly, it keeps the size of the scoreboard file small
* enough that we can read the whole thing without worrying too much about
* the overhead.
*/
#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 256
#endif
#endif
|
変更後 |
/* Limit on the total --- clients will be locked out if more servers than
* this are needed. It is intended solely to keep the server from crashing
* when things get out of hand.
*
* We keep a hard maximum number of servers, for two reasons --- first off,
* in case something goes seriously wrong, we want to stop the fork bomb
* short of actually crashing the machine we're running on by filling some
* kernel table. Secondly, it keeps the size of the scoreboard file small
* enough that we can read the whole thing without worrying too much about
* the overhead.
*/
#ifndef HARD_SERVER_LIMIT
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#else
#define HARD_SERVER_LIMIT 2048
#endif
#endif
|
- WindowsとNetwareの場合は,最初から2048のよう.
- 後は普通にコンパイルする.