ラベル Apache の投稿を表示しています。 すべての投稿を表示
ラベル Apache の投稿を表示しています。 すべての投稿を表示

2011/08/28

Apache Killer

http://mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/browser
Advisory: Range header DoS vulnerability Apache HTTPD 1.3/2.x (CVE-2011-3192)

http://blog.tokumaru.org/2011/08/apache-killerapache-killer.html

http://pooh.gr.jp/?p=9538

2011/06/21

Apache Traffic Server

インストール
# yum install gcc gcc-c++ openssl-devel tcl-devel expat-devel sqlite-devel pcre-devel libdbi-devel libtool db4-devel
# cd /usr/local/src
# wget http://www.apache.org/dist//trafficserver/trafficserver-3.0.0.tar.bz2
# tar jxvf trafficserver-3.0.0.tar.bz2
# cd /usr/local/src/trafficserver-3.0.0
# ./configure
# make
# make install
設定
/usr/local/etc/trafficserver/records.configを編集
CONFIG proxy.config.reverse_proxy.enabled INT 0
CONFIG proxy.config.url_remap.remap_required INT 0
開始
# /usr/local/bin/trafficserver start

ブラウザで、ポート8080接続

2010/10/28

mp4 m4v の apache MIME設定

mime.typesファイルに以下を追加。
video/mpeg4 .mp4
video/x-m4v(m4v) .m4v

MIME Type Description Extensions
audio/3gpp 3GPP media 3gp, 3gpp
audio/3gpp2 3GPP2 media 3g2, 3gp2
audio/aiff
audio/x-aiff AIFF audio aiff, aif, aifc, cdda
audio/amr AMR audio amr
audio/mp3
audio/mpeg3
audio/x-mp3
audio/x-mpeg3 MP3 audio mp3, swa
audio/mp4 MPEG-4 media mp4
audio/mpeg
audio/x-mpeg MPEG audio mpeg, mpg, mp3, swa
audio/wav
audio/x-wav WAVE audio wav,bwf
audio/x-m4a AAC audio m4a
audio/x-m4b AAC audio book m4b
audio/x-m4p AAC audio (protected) m4p
video/3gpp 3GPP media 3gp, 3gpp
video/3gpp2 3GPP2 media 3g2, 3gp2
video/mp4 MPEG-4 media mp4
video/quicktime QuickTime Movie mov,qt,mqv
video/x-m4v Video m4v

2010/04/18

リバースプロキシ

Apache 2.2

mod_headers
このモジュールは HTTP のリクエストヘッダと応答ヘッダを制御し、 変更するためのディレクティブを提供します。ヘッダを追加したり、 置き換えたり、削除したりすることができます。
mod_ext_filter
標準入力から読み込んで、標準出力に書き出すプログラム (すなわち Unix 形式のフィルタコマンド) をリクエスボディと応答ボディのフィルタにすることが できます。
mod_proxy
AJP13 (Apache JServe Protocol version 1.3), FTP, CONNECT (SSL 用), HTTP/0.9, HTTP/1.0, HTTP/1.1 のプロキシ機能を実装しています。
mod_proxy_balancer
HTTP, FTP と AJP13 プロトコルのロードバランス機能を持っています。
mod_proxy_ftp
リバースプロキシにはいらない。
mod_proxy_http
HTTPおよびHTTPS要求をプロキシするために使用します。
mod_proxy_connect
CONNECT HTTP メソッドをサポートします。主にプロキシに SSL リクエストに使われます。

mod_substitute Available in Apache 2.2.7 and later
リクエストとレスポンスのボディの両方を正規表現と固定文字列の置換を実行するメカニズムを提供します。
<Location />
 AddOutputFilterByType SUBSTITUTE text/html
 Substitute s/foo/bar/ni
</Location>
Syntax: Substitute s/pattern/substitution/[infq]
i 大文字と小文字を区別しない。
n デフォルトでは、パターンは正規表現として扱われます。パターンをnフラグを使用すると固定文字列として扱われます。
f The f flag causes mod_substitute to flatten the result of a substitution allowing for later substitutions to take place on the boundary of this one. This is the default.
q The q flag causes mod_substitute to not flatten the buckets after each substitution. This can result in much faster response and a decrease in memory utilization, but should only be used if there is no possibility that the result of one substitution will ever match a pattern or regex of a subsequent one.

mod_rewrite
リクエストされたURLを、正規表現の解析に基づき書き換えます。

telnet で wget

サンプル
# telnet localhost 80[Enter]
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET / HTTP/1.0[Enter]
User-Agent: ABC [ja][Enter]
[Enter]
HTTP/1.1 403 Forbidden
Date: Sun, 18 Apr 2010 02:18:49 GMT
Server: Apache/2.2.14 (EL)
Accept-Ranges: bytes
Content-Length: 3878
Connection: close
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
:
:

2010/04/04

コンテンツ変換

いままで mod_ext_filter で行っていたが、apache2.2.7以降は mod_substitute でできるみたい。

2010/03/11

Location と Directory

<location> ディレクティブは、ファイルシステム外のコンテンツにディレクティブを適用するときに使用する。
<directory>ディレウティブは、ファイルシステムに存在するコンテンツに対して使用する。<files>も可能。
例外は、<location />で、これはサーバ全体に対して 設定を適用する簡単な方法です。

mod_headersでeditを利用するには

mod_headersでeditを利用するには、apache 2.2.4以降が必要。