ex B

ある意味新しい手法を用いた、はじめ男爵である(キリッ

ウェブ制作 - あぷろだ設置メモ

mod_uploaderに関して

mod_uploaderはApache/lighttpdの追加モジュール。軽いらしい。モジュール形式なので軽そうなイメージはあったが、アップロードファイルのテンポラリとしてメモリを必要としないのは素晴らしい。

インストール

ImageMagick-c++-develとhttpd-develが必要なのでyumで追加。

# yum install ImageMagick-c++-devel
# yum install httpd-devel

ソースファイルのダウンロード。

$ wget http://iij.dl.sourceforge.jp/mod-uploader/26249/mod_uploader-2.4
.9.tgz
$ gzip -dc mod_uploader-2.4.9.tgz | tar xvf -
$ cd mod_uploader-2.4.9

コンパイルとインストール。configureオプションは空コメントとサムネイル生成を有効、Pentium Dに最適化(無意味かも)。

$ ./configure --enable-thumbnail --enable-empty-comment --with-march = pentiumD
$ make apache-module
$ su
# make -f GNUmakefile.apache install

これでmod_uploader.soが組み込まれたらしい。

初期設定

続いてApacheの設定変更。

# vi /etc/httpd/conf.d/virtualhost.conf

<VirtualHost *:80>
ServerName    b-area.org
DocumentRoot  /home/b-area/html
ErrorLog      /home/b-area/logs/error_log
CustomLog     /home/b-area/logs/access_log combined
<Directory /home/b-area/html>
AllowOverRide All
Options       Includes ExecCGI NoIndexes
</Directory>
<Location  /uploader>
SetHandler    uploader
</Location>
<Location  /uploader/admin>
Order         Deny,Allow
Deny          From All
Allow         From 127.0.0.1
</Location>
UploaderBaseUrl               http://b-area.org/uploader

UploaderDataDirectory         /home/b-area/html/uploader/data
UploaderFileDirectory         /home/b-area/html/uploader/files
UploaderThumbDirectory        /home/b-area/html/uploader/thumb
UploaderTempDirectory         /home/b-area/html/uploader/tmp

UploaderTotalFileSizeLimit    100000000
UploaderTotalFileNumberLimit  9999
UploaderFileSizeLimit         10000000
UploaderPerPageItemNumber     66
    
UploaderIndexViewTemplate     /home/b-area/html/uploader/tmpl/index.htm
UploaderProgressViewTemplate  /home/b-area/html/uploader/tmpl/progress.htm
UploaderDownloadViewTemplate  /home/b-area/html/uploader/tmpl/download.htm
UploaderThumbnailViewTemplate /home/b-area/html/uploader/tmpl/thumbnail.htm
UploaderAdminViewTemplate     /home/b-area/html/uploader/tmpl/admin.htm
UploaderErrorViewTemplate     /home/b-area/html/uploader/tmpl/error.htm
Alias /up_img                 "/home/b-area/html/uploader/img"
Alias /up_css                 "/home/b-area/html/uploader/css"
Alias /up_js                  "/home/b-area/html/uploader/js"
</VirtualHost>

補記

  • テンプレートを変更した場合httpdの再起動が必要になるが、restartではなくgracefulを使うようにする。
  • 転送進捗表示のJavaScriptを有効の際、転送中ブラウザが非常に重くなるときがある。速度が出ないときに顕著。さらにこの状態でベーシック認証などのダイアログを表示すると転送終了までブラウザがフリーズする(IE6)。