IT pass HikiWiki - [Memo2011][ITPASS]ika 構築作業ログ 3 (WWW1) Diff
- Added parts are displayed like this.
- Deleted parts are displayed
like this.
11/10/11 に apache2のインストールと設定を関, 大西で行った.(ロガー: 大西)
{{toc_here}}
[((<ITPASSサーバ構築ドキュメント>)) へ戻る]
== ビルドのための設定
ソースからインストールした. インストール先は apache2 のデフォルト
である /usr/local/apache2 とした. この場合, configure で --prefix
の設定は不要. apache-ssl を動作させたいため --enable-ssl を,
mod_rewrite を使用したいため --enable-rewrite を (gate の
登録窓口を http から https へ移動させたい),
DSO (Dynamic shared object: 動的共有オブジェクト) を使用したいため
--enable-so をオプションとして指定した.
また, ビルド時に "Cannot use an external APR-util with the bundled APR"
とエラーが生じる場合があるため, --with-included-apr オプションも指定した.
# cd /usr/local/src
# wget http://www.meisei-u.ac.jp/mirror/apache/httpd/httpd-2.2.21.tar.gz
# tar xvfz httpd-2.2.21.tar.gz
# cd httpd-2.2.21
# ./configure --enable-ssl --enable-rewrite --enable-so --with-included-apr
configure の結果は config.log や build/config_vars.mk を参照.
apache の最新バージョンは((<URL:http://www.meisei-u.ac.jp/mirror/apache/httpd/>))から確認した.
※ 2011 年 10 月 11 日時点の最新バージョンは 2.2.21 である.
== ビルドとインストール
# make
# make install
/usr/local/apache2 以下に複数のディレクトリが作成されていることを確認した.
== インストールした実行ファイルへのパスの設定
インストールされた Apache のバイナリファイル群へパスを通した.
((<[ITPASS2009]パスの設定>)) の((* <一般ユーザ用コマンドのパス> *)) と ((* <システム管理用コマンドのパス> *)) の両方に ((*/usr/local/apache2/bin*)) を追加した.
(システム用コマンドも一般ユーザ用コマンドと同じ場所に
インストールされているため, システム用コマンド用の設定を
別途行う必要は無い).
具体的には, /etc/profile の末尾に
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
と追記し, /etc/bash.bashrc の冒頭を
# add PATH for local installed softwares
PATH="${PATH}:/usr/local/apache2/bin"
# add PATH for local installed softwares (for root)
if [ "`id -u`" -eq 0 ]; then
PATH="${PATH}:/usr/local/apache2/bin"
fi
export PATH
のようにした. 以下 csh, tcsh, zsh についても同様に追加した.
また, /etc/zsh/zshenv の内容がマニュアルと違っていたが, 以下のように書き込んだ.
#
# This file should contain commands to set the command
# search path, plus other important environment variables.
# This file should not contain commands that produce
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]
then
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
# add PATH for local installed softwares
export PATH=/usr/local/apache2/bin:$PATH
# add PATH for local installed softwares (for root)
if [ "`id -u`" -eq 0 ]; then
export PATH=/usr/local/apache2/bin:$PATH
fi
# delete duplicated path setting
typeset -U path
== インストールしたマニュアルへのパスの設定
/etc/manpath.config に以下の行を追加した.
詳しくは ((<[ITPASS2009]パスの設定#man 関連のパスの設定>)) を参照.
MANDATORY_MANPATH /usr/local/apache2/man
MANPATH_MAP /usr/local/apache2/bin /usr/local/apache2/man
MANDB_MAP /usr/local/apache2/man /usr/local/apache2/man
== モジュールの確認, 追加
インストールした apache2 で有効になっているモジュールを
# apachectl -t -D DUMP_MODULES
で確認しようとしたが, エラーが出た. エラー内容は,
root@tako-itpass:/usr/local/src/httpd-2.2.21# apachectl -t -D DUMP_MODULES
/usr/sbin/apachectl: 148: /usr/sbin/apache2: not found
Action '-t -D DUMP_MODULES' failed.
The Apache error log may have more information.
となっている.
# cd /usr/local/apache2/
# echo $PATH
で, PATH が通っていることを確認した. また,
/usr/sbin/apachectl
の 148 行目を確認したが,
esac
となっていてメッセージ内容と一致していなかった.
他の確認方法も調べたが, よく分からないので先に進むことにした.
== 設定ファイルの編集
各種設定ファイルは以下のとおり.
マニュアルの設定作業の中に, cps グループについて設定を行う項目が
いくつかあるが, cps 関連は別サーバに移行されたため, グループとしては
itpass サーバ内に存在しているが, cps グループ用の各種設定は行わなかった.
必要であれば後から追加することにした.
httpd 用 -> /usr/local/apache2/conf/httpd.conf
httpd-ssl 用 -> /usr/local/apache2/conf/extra/httpd-ssl.conf
各ユーザの public_html 以下の設定用 -> /usr/local/apache2/conf/extra/httpd-userdir.conf
これらを編集した.
変更の要点は以下の通りである(以下は変更点の概要であり, 実際に行った作業はこのあとに記述).
* httpd.conf
* HTTP デーモンを起動するユーザを www-data にする.
* サーバ管理者 (ServerAdmin) のメールアドレスを設定
* サーバ名 (ServerName) を設定
* サーバのデフォルトルート (DefaultRoot) を /~itpass に設定
* ディレクトリのインデックスファイルに index.html 以外に
index.htm index.htm.en index.html.en index.htm.ja index.html.ja
も追加.
* エラーログファイルを /var/log/httpd-error.log に設定
* アクセスログファイルを /var/log/httpd-access.log に設定
* CGI に関する設定を変更
* extra/httpd-vhosts.confをロード
* extra/httpd-userdir.conf をロード
* extra/httpd-ssl.conf をロード
* /~gate, および /cgi-bin に対してのアクセスは
HTTPS へ移動させる.
* 以下の 4 つの Hiki 領域
~epalab/hiki , ~itpass/hiki, ~itpass/hiki-secret,
~tansaku/hiki に関する設定を,
各領域毎の .htaccess により可能にする
(AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks).
* httpd-vhosts.conf
* {epa,aoe}.scitec.kobe-u.ac.jp 宛の接続を受ける(virtual host).
* ドキュメントルートは /home/{epalab,aoelab}/public_html にする.
* 管理者メールアドレスは itpadmin _at_ ... にする.
* http://{epa,aoe}.scitec.kobe-u.ac.jp/~gate/
以下にアクセスされた場合には,
https://itpass.scitec.kobe-u.ac.jp/~gate に飛ばす.
* itpass.scitec.kobe-u.ac.jp 宛の接続のときのみ,
/hiki, /~epalab/hiki, /~itpass/hiki に対してのアクセスは
HTTPS へ移動させる. その際, URI のエンコードは行わない.
* httpd-userdir.conf
* 所有者がマッチしなくてもシンボリックリンクの公開を許可する.
(SymLinksIfOwnerMatch -> FollowSymLinks).
* httpd-ssl.conf
* ドキュメントルート (DocumentRoot),
サーバ名 (ServerName),
サーバ管理者アドレス (ServerAdmin),
エラーログ (ErrorLog),
アクセスログ (TransferLog) の設定.
* epa.scitec, aoe.scitec の場合の https 接続を設定しておく
オリジナルとの diff は以下の通り.
=== httpd.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/httpd.conf httpd.conf
--- original/httpd.conf 2011-10-11 16:11:04.000000000 +0900
+++ httpd.conf 2011-10-11 17:44:36.000000000 +0900
@@ -50,7 +50,7 @@
#
# Example:
# LoadModule foo_module modules/mod_foo.so
-#
+# LoadModule rewrite_module modules/mod_rewrite.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
@@ -62,8 +62,8 @@
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
-User daemon
-Group daemon
+User www-data
+Group www-data
</IfModule>
</IfModule>
@@ -85,7 +85,7 @@
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
-ServerAdmin you@example.com
+ServerAdmin itpadmin@itpass.scitec.kobe-u.ac.jp
#
# ServerName gives the name and port that the server uses to identify itself.
@@ -94,14 +94,14 @@
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
-#ServerName www.example.com:80
+ServerName itpass.scitec.kobe-u.ac.jp:80
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
-DocumentRoot "/usr/local/apache2/htdocs"
+DocumentRoot "/home/itpass/public_html"
#
# Each directory to which Apache has access can be configured with respect
@@ -115,7 +115,7 @@
Options FollowSymLinks
AllowOverride None
Order deny,allow
- Deny from all
+
</Directory>
#
@@ -128,7 +128,7 @@
#
# This should be changed to whatever you set DocumentRoot to.
#
-<Directory "/usr/local/apache2/htdocs">
+<Directory "/home/itpass/public_html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
@@ -163,7 +163,8 @@
# is requested.
#
<IfModule dir_module>
- DirectoryIndex index.html
+ DirectoryIndex index.html index.htm index.htm.en index.html.en index.htm.ja index.html.ja
+
</IfModule>
#
@@ -183,7 +184,7 @@
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
-ErrorLog "logs/error_log"
+ErrorLog "/var/log/httpd-error.log"
#
# LogLevel: Control the number of messages logged to the error_log.
@@ -212,13 +213,13 @@
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
- CustomLog "logs/access_log" common
+ #CustomLog "logs/access_log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
- #CustomLog "logs/access_log" combined
+ CustomLog "/var/log/httpd-access_org" combined
</IfModule>
<IfModule alias_module>
@@ -265,10 +266,8 @@
# CGI directory exists, if you have that configured.
#
<Directory "/usr/local/apache2/cgi-bin">
- AllowOverride None
- Options None
- Order allow,deny
- Allow from all
+ AllowOverride AuthConfig Limit
+ Options ExecCGI FollowSymLinks IncludesNoExec
</Directory>
#
@@ -315,7 +314,7 @@
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
- #AddHandler cgi-script .cgi
+ AddHandler cgi-script .cgi .rb
# For type maps (negotiated resources):
#AddHandler type-map var
@@ -385,13 +384,13 @@
#Include conf/extra/httpd-languages.conf
# User home directories
-#Include conf/extra/httpd-userdir.conf
+Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# Virtual hosts
-#Include conf/extra/httpd-vhosts.conf
+Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf
@@ -403,7 +402,7 @@
#Include conf/extra/httpd-default.conf
# Secure (SSL/TLS) connections
-#Include conf/extra/httpd-ssl.conf
+Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
@@ -413,3 +412,61 @@
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
+
+#
+# Setting for Hiki Area
+#
+<Directory "/home/epalab/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/itpass/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/itpass/public_html/hiki-secret">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/tansaku/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/uwabami/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/gpgpu/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/gridcomp/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/ayako/public_html/suzuhiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/pschool/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/bldg3/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/fourtran/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
=== extra/httpd-ssl.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-ssl.conf extra/httpd-ssl.conf
--- original/extra/httpd-ssl.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-ssl.conf 2011-10-11 17:50:07.000000000 +0900
@@ -71,14 +71,15 @@
## SSL Virtual Host Context
##
-<VirtualHost _default_:443>
+NameVirtualHost *:443
+<VirtualHost *:443>
# General setup for the virtual host
-DocumentRoot "/usr/local/apache2/htdocs"
-ServerName www.example.com:443
-ServerAdmin you@example.com
-ErrorLog "/usr/local/apache2/logs/error_log"
-TransferLog "/usr/local/apache2/logs/access_log"
+DocumentRoot "/home/itpass/public_html"
+ServerName itpass.scitec.kobe-u.ac.jp:443
+ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ErrorLog "/var/log/httpd-ssl-error.log"
+TransferLog "/var/log/httpd-ssl-access.log"
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
@@ -96,7 +97,7 @@
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
-SSLCertificateFile "/usr/local/apache2/conf/server.crt"
+SSLCertificateFile "/usr/local/apache2/conf/ca/itpass/server.crt"
#SSLCertificateFile "/usr/local/apache2/conf/server-dsa.crt"
# Server Private Key:
@@ -104,7 +105,7 @@
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
-SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
+SSLCertificateKeyFile "/usr/local/apache2/conf/ca/itpass/server.key"
#SSLCertificateKeyFile "/usr/local/apache2/conf/server-dsa.key"
# Server Certificate Chain:
@@ -114,7 +115,7 @@
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
-#SSLCertificateChainFile "/usr/local/apache2/conf/server-ca.crt"
+#SSLCertificateChainFile "/usr/local/apache2/conf/server.crt"
# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
@@ -228,4 +229,29 @@
CustomLog "/usr/local/apache2/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
-</VirtualHost>
+</VirtualHost>
+
+<VirtualHost *:443>
+ DocumentRoot "/home/aoelab/public_html"
+ ServerName aoe.scitec.kobe-u.ac.jp:443
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-ssl-error.log
+ TransferLog /var/log/httpd-ssl-access.log
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+ SSLCertificateFile "/usr/local/apache2/conf/ca/aoe/server.crt"
+ SSLCertificateKeyFile "/usr/local/apache2/conf/ca/aoe/server.key"
+</VirtualHost>
+
+
+<VirtualHost *:443>
+ DocumentRoot "/home/epalab/public_html"
+ ServerName epa.scitec.kobe-u.ac.jp:443
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-ssl-error.log
+ TransferLog /var/log/httpd-ssl-access.log
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+ SSLCertificateFile "/usr/local/apache2/conf/ca/epa/server.crt"
+ SSLCertificateKeyFile "/usr/local/apache2/conf/ca/epa/server.key"
+ </VirtualHost>
=== extra/httpd-vhosts.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-vhosts.conf extra/httpd-vhosts.conf
--- original/extra/httpd-vhosts.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-vhosts.conf 2011-10-11 17:39:51.000000000 +0900
@@ -25,21 +25,72 @@
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
- ServerAdmin webmaster@dummy-host.example.com
- DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com"
- ServerName dummy-host.example.com
- ServerAlias www.dummy-host.example.com
- ErrorLog "logs/dummy-host.example.com-error_log"
- CustomLog "logs/dummy-host.example.com-access_log" common
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/itpass/public_html"
+ ServerName itpass.scitec.kobe-u.ac.jp
+ ErrorLog "/var/log/httpd-error.log"
+ CustomLog "/var/log/httpd-access.log" combined
+
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki-secret/$1 [L,R,NE]
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ RewriteRule ^/~bldg3/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~bldg3/hiki/$1 [L,R,NE]
+ RewriteRule ^/~epalab/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~epalab/hiki/$1 [L,R,NE]
+ RewriteRule ^/~itpass/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~itpass/hiki/$1 [L,R,NE]
+ RewriteRule ^/~itpass/hiki-secret/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~itpass/hiki-secret/$1 [L,R,NE]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
</VirtualHost>
+# ---- aoelab ----
<VirtualHost *:80>
- ServerAdmin webmaster@dummy-host2.example.com
- DocumentRoot "/usr/local/apache2/docs/dummy-host2.example.com"
- ServerName dummy-host2.example.com
- ErrorLog "logs/dummy-host2.example.com-error_log"
- CustomLog "logs/dummy-host2.example.com-access_log" common
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/aoelab/public_html"
+ ServerName aoe.scitec.kobe-u.ac.jp
+ ErrorLog "/var/log/httpd-error.log"
+ CustomLog "/var/log/httpd-access.log" combined
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
+ </VirtualHost>
+
+
+# ---- epalab ----
+<VirtualHost *:80>
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/epalab/public_html"
+ ServerName epa.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-error.log
+ CustomLog /var/log/httpd-access.log combined
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://epa.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
</VirtualHost>
+
=== extra/httpd-userdir.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-userdir.conf extra/httpd-userdir.conf
--- original/extra/httpd-userdir.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-userdir.conf 2011-10-11 17:58:18.000000000 +0900
@@ -1,3 +1,4 @@
+# -*- apache -*-
# Settings for user home directories
#
# Required module: mod_userdir
@@ -15,7 +16,7 @@
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
- Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
+ Options MultiViews Indexes FollowSymLinks IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
@@ -24,5 +25,12 @@
Order deny,allow
Deny from all
</LimitExcept>
+ <IfModule negotiation_module>
+ AddLanguage ja .ja
+ AddLanguage ja-JP .ja
+ AddLanguage en .en
+ LanguagePriority en ja
+ ForceLanguagePriority Prefer Fallback
+ </IfModule>
</Directory>
== ログローテートの設定
/etc/logrotate.conf を編集して圧縮オプションを追加した. (compressのコメントアウトを外した).
/etc/logrotate.d/ 以下の apache2 ファイルに, 以下の内容を書き込み, もともとあった内容はコメントアウトした.
#/var/log/apache2/*.log {
# weekly
# missingok
# rotate 52
# compress
# delaycompress
# notifempty
# create 640 root adm
# sharedscripts
# postrotate
# /etc/init.d/apache2 reload > /dev/null
# endscript
#}
/var/log/httpd-access.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-error.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-ssl-access.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-ssl-error.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
本日行った作業はここまで.
{{toc_here}}
[((<ITPASSサーバ構築ドキュメント>)) へ戻る]
== ビルドのための設定
ソースからインストールした. インストール先は apache2 のデフォルト
である /usr/local/apache2 とした. この場合, configure で --prefix
の設定は不要. apache-ssl を動作させたいため --enable-ssl を,
mod_rewrite を使用したいため --enable-rewrite を (gate の
登録窓口を http から https へ移動させたい),
DSO (Dynamic shared object: 動的共有オブジェクト) を使用したいため
--enable-so をオプションとして指定した.
また, ビルド時に "Cannot use an external APR-util with the bundled APR"
とエラーが生じる場合があるため, --with-included-apr オプションも指定した.
# cd /usr/local/src
# wget http://www.meisei-u.ac.jp/mirror/apache/httpd/httpd-2.2.21.tar.gz
# tar xvfz httpd-2.2.21.tar.gz
# cd httpd-2.2.21
# ./configure --enable-ssl --enable-rewrite --enable-so --with-included-apr
configure の結果は config.log や build/config_vars.mk を参照.
apache の最新バージョンは((<URL:http://www.meisei-u.ac.jp/mirror/apache/httpd/>))から確認した.
※ 2011 年 10 月 11 日時点の最新バージョンは 2.2.21 である.
== ビルドとインストール
# make
# make install
/usr/local/apache2 以下に複数のディレクトリが作成されていることを確認した.
== インストールした実行ファイルへのパスの設定
インストールされた Apache のバイナリファイル群へパスを通した.
((<[ITPASS2009]パスの設定>)) の((* <一般ユーザ用コマンドのパス> *)) と ((* <システム管理用コマンドのパス> *)) の両方に ((*/usr/local/apache2/bin*)) を追加した.
(システム用コマンドも一般ユーザ用コマンドと同じ場所に
インストールされているため, システム用コマンド用の設定を
別途行う必要は無い).
具体的には, /etc/profile の末尾に
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
と追記し, /etc/bash.bashrc の冒頭を
# add PATH for local installed softwares
PATH="${PATH}:/usr/local/apache2/bin"
# add PATH for local installed softwares (for root)
if [ "`id -u`" -eq 0 ]; then
PATH="${PATH}:/usr/local/apache2/bin"
fi
export PATH
のようにした. 以下 csh, tcsh, zsh についても同様に追加した.
また, /etc/zsh/zshenv の内容がマニュアルと違っていたが, 以下のように書き込んだ.
#
# This file should contain commands to set the command
# search path, plus other important environment variables.
# This file should not contain commands that produce
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]
then
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
# add PATH for local installed softwares
export PATH=/usr/local/apache2/bin:$PATH
# add PATH for local installed softwares (for root)
if [ "`id -u`" -eq 0 ]; then
export PATH=/usr/local/apache2/bin:$PATH
fi
# delete duplicated path setting
typeset -U path
== インストールしたマニュアルへのパスの設定
/etc/manpath.config に以下の行を追加した.
詳しくは ((<[ITPASS2009]パスの設定#man 関連のパスの設定>)) を参照.
MANDATORY_MANPATH /usr/local/apache2/man
MANPATH_MAP /usr/local/apache2/bin /usr/local/apache2/man
MANDB_MAP /usr/local/apache2/man /usr/local/apache2/man
== モジュールの確認, 追加
インストールした apache2 で有効になっているモジュールを
# apachectl -t -D DUMP_MODULES
で確認しようとしたが, エラーが出た. エラー内容は,
root@tako-itpass:/usr/local/src/httpd-2.2.21# apachectl -t -D DUMP_MODULES
/usr/sbin/apachectl: 148: /usr/sbin/apache2: not found
Action '-t -D DUMP_MODULES' failed.
The Apache error log may have more information.
となっている.
# cd /usr/local/apache2/
# echo $PATH
で, PATH が通っていることを確認した. また,
/usr/sbin/apachectl
の 148 行目を確認したが,
esac
となっていてメッセージ内容と一致していなかった.
他の確認方法も調べたが, よく分からないので先に進むことにした.
== 設定ファイルの編集
各種設定ファイルは以下のとおり.
マニュアルの設定作業の中に, cps グループについて設定を行う項目が
いくつかあるが, cps 関連は別サーバに移行されたため, グループとしては
itpass サーバ内に存在しているが, cps グループ用の各種設定は行わなかった.
必要であれば後から追加することにした.
httpd 用 -> /usr/local/apache2/conf/httpd.conf
httpd-ssl 用 -> /usr/local/apache2/conf/extra/httpd-ssl.conf
各ユーザの public_html 以下の設定用 -> /usr/local/apache2/conf/extra/httpd-userdir.conf
これらを編集した.
変更の要点は以下の通りである(以下は変更点の概要であり, 実際に行った作業はこのあとに記述).
* httpd.conf
* HTTP デーモンを起動するユーザを www-data にする.
* サーバ管理者 (ServerAdmin) のメールアドレスを設定
* サーバ名 (ServerName) を設定
* サーバのデフォルトルート (DefaultRoot) を /~itpass に設定
* ディレクトリのインデックスファイルに index.html 以外に
index.htm index.htm.en index.html.en index.htm.ja index.html.ja
も追加.
* エラーログファイルを /var/log/httpd-error.log に設定
* アクセスログファイルを /var/log/httpd-access.log に設定
* CGI に関する設定を変更
* extra/httpd-vhosts.confをロード
* extra/httpd-userdir.conf をロード
* extra/httpd-ssl.conf をロード
* /~gate, および /cgi-bin に対してのアクセスは
HTTPS へ移動させる.
* 以下の 4 つの Hiki 領域
~epalab/hiki , ~itpass/hiki, ~itpass/hiki-secret,
~tansaku/hiki に関する設定を,
各領域毎の .htaccess により可能にする
(AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks).
* httpd-vhosts.conf
* {epa,aoe}.scitec.kobe-u.ac.jp 宛の接続を受ける(virtual host).
* ドキュメントルートは /home/{epalab,aoelab}/public_html にする.
* 管理者メールアドレスは itpadmin _at_ ... にする.
* http://{epa,aoe}.scitec.kobe-u.ac.jp/~gate/
以下にアクセスされた場合には,
https://itpass.scitec.kobe-u.ac.jp/~gate に飛ばす.
* itpass.scitec.kobe-u.ac.jp 宛の接続のときのみ,
/hiki, /~epalab/hiki, /~itpass/hiki に対してのアクセスは
HTTPS へ移動させる. その際, URI のエンコードは行わない.
* httpd-userdir.conf
* 所有者がマッチしなくてもシンボリックリンクの公開を許可する.
(SymLinksIfOwnerMatch -> FollowSymLinks).
* httpd-ssl.conf
* ドキュメントルート (DocumentRoot),
サーバ名 (ServerName),
サーバ管理者アドレス (ServerAdmin),
エラーログ (ErrorLog),
アクセスログ (TransferLog) の設定.
* epa.scitec, aoe.scitec の場合の https 接続を設定しておく
オリジナルとの diff は以下の通り.
=== httpd.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/httpd.conf httpd.conf
--- original/httpd.conf 2011-10-11 16:11:04.000000000 +0900
+++ httpd.conf 2011-10-11 17:44:36.000000000 +0900
@@ -50,7 +50,7 @@
#
# Example:
# LoadModule foo_module modules/mod_foo.so
-#
+# LoadModule rewrite_module modules/mod_rewrite.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
@@ -62,8 +62,8 @@
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
-User daemon
-Group daemon
+User www-data
+Group www-data
</IfModule>
</IfModule>
@@ -85,7 +85,7 @@
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
-ServerAdmin you@example.com
+ServerAdmin itpadmin@itpass.scitec.kobe-u.ac.jp
#
# ServerName gives the name and port that the server uses to identify itself.
@@ -94,14 +94,14 @@
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
-#ServerName www.example.com:80
+ServerName itpass.scitec.kobe-u.ac.jp:80
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
-DocumentRoot "/usr/local/apache2/htdocs"
+DocumentRoot "/home/itpass/public_html"
#
# Each directory to which Apache has access can be configured with respect
@@ -115,7 +115,7 @@
Options FollowSymLinks
AllowOverride None
Order deny,allow
- Deny from all
+
</Directory>
#
@@ -128,7 +128,7 @@
#
# This should be changed to whatever you set DocumentRoot to.
#
-<Directory "/usr/local/apache2/htdocs">
+<Directory "/home/itpass/public_html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
@@ -163,7 +163,8 @@
# is requested.
#
<IfModule dir_module>
- DirectoryIndex index.html
+ DirectoryIndex index.html index.htm index.htm.en index.html.en index.htm.ja index.html.ja
+
</IfModule>
#
@@ -183,7 +184,7 @@
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
-ErrorLog "logs/error_log"
+ErrorLog "/var/log/httpd-error.log"
#
# LogLevel: Control the number of messages logged to the error_log.
@@ -212,13 +213,13 @@
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
- CustomLog "logs/access_log" common
+ #CustomLog "logs/access_log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
- #CustomLog "logs/access_log" combined
+ CustomLog "/var/log/httpd-access_org" combined
</IfModule>
<IfModule alias_module>
@@ -265,10 +266,8 @@
# CGI directory exists, if you have that configured.
#
<Directory "/usr/local/apache2/cgi-bin">
- AllowOverride None
- Options None
- Order allow,deny
- Allow from all
+ AllowOverride AuthConfig Limit
+ Options ExecCGI FollowSymLinks IncludesNoExec
</Directory>
#
@@ -315,7 +314,7 @@
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
- #AddHandler cgi-script .cgi
+ AddHandler cgi-script .cgi .rb
# For type maps (negotiated resources):
#AddHandler type-map var
@@ -385,13 +384,13 @@
#Include conf/extra/httpd-languages.conf
# User home directories
-#Include conf/extra/httpd-userdir.conf
+Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# Virtual hosts
-#Include conf/extra/httpd-vhosts.conf
+Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf
@@ -403,7 +402,7 @@
#Include conf/extra/httpd-default.conf
# Secure (SSL/TLS) connections
-#Include conf/extra/httpd-ssl.conf
+Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
@@ -413,3 +412,61 @@
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
+
+#
+# Setting for Hiki Area
+#
+<Directory "/home/epalab/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/itpass/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/itpass/public_html/hiki-secret">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/tansaku/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/uwabami/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/gpgpu/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/gridcomp/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/ayako/public_html/suzuhiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/pschool/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/bldg3/public_html/hiki">
+ AllowOverride ALL
+ Options -MultiViews
+</Directory>
+
+<Directory "/home/fourtran/public_html/hiki">
+ AllowOverride FileInfo AuthConfig Limit Indexes Options=ExecCGI,FollowSymlinks
+ Options -MultiViews
+</Directory>
=== extra/httpd-ssl.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-ssl.conf extra/httpd-ssl.conf
--- original/extra/httpd-ssl.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-ssl.conf 2011-10-11 17:50:07.000000000 +0900
@@ -71,14 +71,15 @@
## SSL Virtual Host Context
##
-<VirtualHost _default_:443>
+NameVirtualHost *:443
+<VirtualHost *:443>
# General setup for the virtual host
-DocumentRoot "/usr/local/apache2/htdocs"
-ServerName www.example.com:443
-ServerAdmin you@example.com
-ErrorLog "/usr/local/apache2/logs/error_log"
-TransferLog "/usr/local/apache2/logs/access_log"
+DocumentRoot "/home/itpass/public_html"
+ServerName itpass.scitec.kobe-u.ac.jp:443
+ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ErrorLog "/var/log/httpd-ssl-error.log"
+TransferLog "/var/log/httpd-ssl-access.log"
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
@@ -96,7 +97,7 @@
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
-SSLCertificateFile "/usr/local/apache2/conf/server.crt"
+SSLCertificateFile "/usr/local/apache2/conf/ca/itpass/server.crt"
#SSLCertificateFile "/usr/local/apache2/conf/server-dsa.crt"
# Server Private Key:
@@ -104,7 +105,7 @@
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
-SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
+SSLCertificateKeyFile "/usr/local/apache2/conf/ca/itpass/server.key"
#SSLCertificateKeyFile "/usr/local/apache2/conf/server-dsa.key"
# Server Certificate Chain:
@@ -114,7 +115,7 @@
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
-#SSLCertificateChainFile "/usr/local/apache2/conf/server-ca.crt"
+#SSLCertificateChainFile "/usr/local/apache2/conf/server.crt"
# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
@@ -228,4 +229,29 @@
CustomLog "/usr/local/apache2/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
-</VirtualHost>
+</VirtualHost>
+
+<VirtualHost *:443>
+ DocumentRoot "/home/aoelab/public_html"
+ ServerName aoe.scitec.kobe-u.ac.jp:443
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-ssl-error.log
+ TransferLog /var/log/httpd-ssl-access.log
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+ SSLCertificateFile "/usr/local/apache2/conf/ca/aoe/server.crt"
+ SSLCertificateKeyFile "/usr/local/apache2/conf/ca/aoe/server.key"
+</VirtualHost>
+
+
+<VirtualHost *:443>
+ DocumentRoot "/home/epalab/public_html"
+ ServerName epa.scitec.kobe-u.ac.jp:443
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-ssl-error.log
+ TransferLog /var/log/httpd-ssl-access.log
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+ SSLCertificateFile "/usr/local/apache2/conf/ca/epa/server.crt"
+ SSLCertificateKeyFile "/usr/local/apache2/conf/ca/epa/server.key"
+ </VirtualHost>
=== extra/httpd-vhosts.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-vhosts.conf extra/httpd-vhosts.conf
--- original/extra/httpd-vhosts.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-vhosts.conf 2011-10-11 17:39:51.000000000 +0900
@@ -25,21 +25,72 @@
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
- ServerAdmin webmaster@dummy-host.example.com
- DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com"
- ServerName dummy-host.example.com
- ServerAlias www.dummy-host.example.com
- ErrorLog "logs/dummy-host.example.com-error_log"
- CustomLog "logs/dummy-host.example.com-access_log" common
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/itpass/public_html"
+ ServerName itpass.scitec.kobe-u.ac.jp
+ ErrorLog "/var/log/httpd-error.log"
+ CustomLog "/var/log/httpd-access.log" combined
+
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki-secret/$1 [L,R,NE]
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ RewriteRule ^/~bldg3/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~bldg3/hiki/$1 [L,R,NE]
+ RewriteRule ^/~epalab/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~epalab/hiki/$1 [L,R,NE]
+ RewriteRule ^/~itpass/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~itpass/hiki/$1 [L,R,NE]
+ RewriteRule ^/~itpass/hiki-secret/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~itpass/hiki-secret/$1 [L,R,NE]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
</VirtualHost>
+# ---- aoelab ----
<VirtualHost *:80>
- ServerAdmin webmaster@dummy-host2.example.com
- DocumentRoot "/usr/local/apache2/docs/dummy-host2.example.com"
- ServerName dummy-host2.example.com
- ErrorLog "logs/dummy-host2.example.com-error_log"
- CustomLog "logs/dummy-host2.example.com-access_log" common
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/aoelab/public_html"
+ ServerName aoe.scitec.kobe-u.ac.jp
+ ErrorLog "/var/log/httpd-error.log"
+ CustomLog "/var/log/httpd-access.log" combined
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/hiki/$1 [L,R]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
+ </VirtualHost>
+
+
+# ---- epalab ----
+<VirtualHost *:80>
+ ServerAdmin itpadmin_at_itpass.scitec.kobe-u.ac.jp
+ DocumentRoot "/home/epalab/public_html"
+ ServerName epa.scitec.kobe-u.ac.jp
+ ErrorLog /var/log/httpd-error.log
+ CustomLog /var/log/httpd-access.log combined
+ <IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteLog "/var/log/httpd-rewrite.log"
+ RewriteLogLevel 0
+ RewriteCond %{SERVER_PORT} !^443$
+ # ---- hiki
+ RewriteRule ^/hiki/(.*)?$ https://epa.scitec.kobe-u.ac.jp/hiki/$1 [L,R,NE]
+ # ---- gate
+ RewriteRule ^/~gate/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/~gate/$1 [L,R,NE]
+ RewriteRule ^/cgi-bin/(.*)?$ https://itpass.scitec.kobe-u.ac.jp/cgi-bin/$1 [L,R,NE]
+ </IfModule>
</VirtualHost>
+
=== extra/httpd-userdir.conf の diff
root@tako-itpass:/usr/local/apache2/conf# diff -u original/extra/httpd-userdir.conf extra/httpd-userdir.conf
--- original/extra/httpd-userdir.conf 2011-10-11 16:11:05.000000000 +0900
+++ extra/httpd-userdir.conf 2011-10-11 17:58:18.000000000 +0900
@@ -1,3 +1,4 @@
+# -*- apache -*-
# Settings for user home directories
#
# Required module: mod_userdir
@@ -15,7 +16,7 @@
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
- Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
+ Options MultiViews Indexes FollowSymLinks IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
@@ -24,5 +25,12 @@
Order deny,allow
Deny from all
</LimitExcept>
+ <IfModule negotiation_module>
+ AddLanguage ja .ja
+ AddLanguage ja-JP .ja
+ AddLanguage en .en
+ LanguagePriority en ja
+ ForceLanguagePriority Prefer Fallback
+ </IfModule>
</Directory>
== ログローテートの設定
/etc/logrotate.conf を編集して圧縮オプションを追加した. (compressのコメントアウトを外した).
/etc/logrotate.d/ 以下の apache2 ファイルに, 以下の内容を書き込み, もともとあった内容はコメントアウトした.
#/var/log/apache2/*.log {
# weekly
# missingok
# rotate 52
# compress
# delaycompress
# notifempty
# create 640 root adm
# sharedscripts
# postrotate
# /etc/init.d/apache2 reload > /dev/null
# endscript
#}
/var/log/httpd-access.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-error.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-ssl-access.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
/var/log/httpd-ssl-error.log {
missingok
weekly
rotate 12
postrotate
/usr/bin/killall -HUP httpd 2> /dev/null || true
endscript
}
本日行った作業はここまで.