Apache with Turbolinux 8 server

とりあえず

  • Turbolinux 8 Server
  • インストールは既にパッケージでインストールされているはずなので省略
    • 変更したところのメモだけ。
    • は増えたか変わったところ。
  • このページは Apache 1.3 系に関する記述
    • Apache2系は /Tips/Linux/Apache2 へ。

/etc/httpd/conf/httpd.conf

  • Apacheは nobody なんかじゃなく www 権限で
    • User www
    • Group www
  • エラードキュメントなんかの管理者宛メアド
    • ServerAdmin serveradmin@robo.tec.fukuoka-u.ac.jp
  • サーバー名
    • ServerName Robo.Tec.Fukuoka-u.ac.jp
  • ドメインのトップページのディレクトリ。
    • /var/www なんかにすると FTP がめんどくさいので
      ルート専用ユーザー作ってそこを読み込ませた。
    • DocumentRoot "/home/aramaki-lab/public_html"
  • そのドメイン直下の設定
    • <Directory />
    • AllowOverride All
    • Options All MultiViews
    • </Directory>
  • 一般ユーザーのディレクトリの設定
    • もうなんか出血大サービス
    • <Directory /home/*/public_html>
    • AllowOverride All
    • Options All MultiViews
    • # <Limit GET POST OPTIONS PROPFIND>
    • # Order allow,deny
    • # Allow from all
    • # </Limit>
    • # <LimitExcept GET POST OPTIONS PROPFIND>
    • # Order deny,allow
    • # Deny from all
    • # </LimitExcept>
  • ファイル名を省略したときの標準で表示するファイル
    • <IfModule mod_dir.c>
    • DirectoryIndex index.html index.html.var index.htm index.shtml index.cgi index.php
    • </IfModule>
  • ディレクトリのファイル一覧のアイコンディレクトリ
    • 普通に icons ディレクトリを使うときにウザいので
    • Alias /ICONs/ "/var/www/icons/"
  • ディレクトリファイル一覧で gzip とかに説明文を付ける
    • それがカッコイイと思っているから
    • 基本的に # 抜くだけ
    • AddDescription "GZIP compressed document" .gz
    • AddDescription "tar archive" .tar
    • AddDescription "GZIP compressed tar archive" .tgz
  • 優先する言語
    • ja(日本語)をひいきする
    • <IfModule mod_negotiation.c>
    • LanguagePriority ja en da nl et fr de el it kr no pl pt pt-br ru ltz ca es sv tw
    • </IfModule>
  • CGI とか SSI とかを許可
    • AddHandler cgi-script .cgi
    • AddType application/x-httpd-php3 .php3
    • AddType application/x-httpd-php3-source .phps
    • AddType application/x-httpd-php .php
    • AddType application/x-httpd-php-source .phps
    • AddType text/html .shtml
    • AddHandler server-parsed .shtml
    • AddHandler send-as-is asis
    • AddHandler imap-file map
    • AddHandler type-map var

参考文献

作成したユーザにデフォルトで public_html を掘る

Directory Index などで URL に日本語を含むとリンクが開けない

  • WebDAV 絡みらしい。
    • IE は ShiftJIS で送ろうとしたり、WebDAV 関係は UTF-8 で送ろうとしたり、、、
    • ということで、エンコードがうまくいっていない模様。
  • mod_encoding を導入して、文字コードを正しくエンコードしてやればいい模様。
    • Turbolinux 10 server は標準インストール済み
  • vi /etc/httpd/conf.d/mod_encoding.conf
    #SetServerEncoding     UTF-8
    SetServerEncoding     EUC-JP
    • サーバのファイルシステムに使われている文字コードに切り替えてみた。

おまけ

  • ディレクトリファイル一覧でアイコンを KDE 仕様に
    • KDE3系のアイコンをごっそりコピー
      • mkdir /var/www/html/icons
      • cp /usr/share/icons/crystalsvg/32x32/* /var/www/icons/
      • chown -R apache:apache /var/www/icons/
    • httpd.confのアイコン設定をごっそり書き換える。
  • オリジナル404メッセージ
  • 簡易プロクシ(パス付き)

添付ファイル: filehttpd-icons.conf.txt 959件 [詳細]