2014/12/19

linux apache2.4 module memo

■proxyモジュール多いね
LoadModule proxy_module modules/mod_proxy.so
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_express_module modules/mod_proxy_express.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so


/etc/httpd/conf.d/proxy.conf
=->/etc/httpd/conf.modules.d/00-proxy.conf

・apache 設定ファイル

UseCanonicalName
    サーバが自分自身の名前とポートを決定する方法を設定する
    canonical--->正典的。ネーミングは良くない。自分自身でown?

==>onの場合
 ServerName ディレクティブで指定されている ホスト名とポート番号を使って、その正規名 (自己参照の名前) を生成します
 じゃないと、ServerNameは意味がないだね。
==>offの場合
 UseCanonicalName Off の場合、 クライアントがホスト名とポートを指定したときには、 それらを元に自己参照 URL を作成します (指定がなかったときは 上の定義と同様にして正規名を解決します)

これぐらいだね。。。。
====>URL が最後のスラッシュ無しの ディレクトリになっている http://www/splat のようなとき、 Apache はリクエストを http://www.domain.com/splat/ へリダイレクトします


★apache Access Control
=->mod_authz_core
   mod_authz_host
  
・mod_rewrite
   ==>
   RewriteEngine On
   RewriteCond %{TIME_HOUR} >= 20 {OR}
   RewriteCond %{TIME_HOUR} < 07
   RewriteRule ^/fridge - [F]
   ==>The [F] RewriteRule flag causes a 403 Forbidden response to be sent
   07-20の間にOK
  
・ Require
  RequireAll
  RequireAny
  RequireNone
  =>Allow Deny Orderはdeprecated...........

<RequireAll>
    Require all granted
    Require not ip 10.252.46.165
    Require not host host.example.com
</RequireAll>

Require expr %{HTTP_USER_AGENT} != 'BadBot'
==>あいつだけだめ。。。


 Options Includes,FollowSymLinks
  =->FollowSymLinks シンボリックリンクファイルを認識させるかを設定します。
  =->Includes SSI を実行できるかどうかを設定します
 
.htaccess ファイル
==>AllowOverrideはnone、httpd.confで設定すれば、htaccessの設定は無効になる



★apache httpd module

apache mod-dav-------------
文字や画像、音声、動画などの要素を組み合わせて一つのソフトウェアやコンテンツ作品を組み立てること。

異なる種類の素材データを組み合わせ、配置や出現順、利用者の操作に対する反応などを設定していく編集作業を意味するが、(従来は必須であった)プログラミング言語やマークアップ言語などによるコードの記述を極力廃し、マウス操作など直感的な方法で作業を進めるという含意がある。

多くの場合、そのような作業に対応した専用のソフトウェアが用いられ、「オーサリングソフト」「オーサリングツール」などと呼ばれる。多くのツールは上級者が複雑な設定を行うことができるよう、補助的にプログラミングができるようになっていることが多い。

Apache Module mod_lua-------
==>this module allows the server to be extended with scripts written in the Lua programming language

Luaは、C言語のホストプログラムに組み込まれることを目的に設計されており、高速な動作と、高い移植性、組み込みの容易さが特徴である。いったんバイトコードにコンパイルされ、Lua VMで実行される。LuaJITは The Computer Language Benchmarks Game によると、変数に型のないスクリプト言語では最速の言語・処理系である[1]。


event------------------------------------
The event MPM handles some connections in an asynchronous way, where request worker threads are only allocated for short periods of time as needed, and other connections with one request worker thread reserved per connection. This can lead to situations where all workers are tied up and no worker thread is available to handle new work on established async connections.

To mitigate this problem, the event MPM does two things: Firstly, it limits the number of connections accepted per process, depending on the number of idle request workers. Secondly, if all workers are busy, it will close connections in keep-alive state even if the keep-alive timeout has not expired. This allows the respective clients to reconnect to a different process which may still have worker threads available.

This directive can be used to fine-tune the per-process connection limit. A process will only accept new connections if the current number of connections (not counting connections in the "closing" state) is lower than:

ThreadsPerChild + (AsyncRequestWorkerFactor * number of idle workers)

This means the absolute maximum numbers of concurrent connections is:

(AsyncRequestWorkerFactor + 1) * MaxRequestWorkers

MaxRequestWorkers was called MaxClients prior to version 2.3.13. The above value shows that the old name did not accurately describe its meaning for the event MPM.

AsyncRequestWorkerFactor can take non-integer arguments, e.g "1.5".

モジュールhttpd-------------
httpd -l
===>Compiled in modules

httpd -M==>モジュールの一覧

★TraceEnable off
HTTPのメソッドには、よく使うものとしてGETやPOSTというものがありますが、TRACEメソッドというものがありまして、これを有効にしておくと危ないよという話

==>なんか情報漏れので、無効にする


<IfModule mime_module>
 TypesConfig /etc/mime.types

</IfModule>


★mod_filter
This module enables smart, context-sensitive configuration of output content filters.
For example, apache can be configured to process different content-types through different filters,
even when the content-type is not known in advance (e.g. in a proxy).

★indirection -->間接参照、遠回し
AddOutputFilter
complex boolean expressions

FilterDeclare

★Register Providers
    FilterProviders
   
   

★2.4系
LogLevel alert rewrite:trace3