2017年1月のサーバ移行により、WEBサーバのソフトウェア(Apache)のバージョンが上がりました。これにより、アクセス制限の記述方法も新しくなりました。古い.htaccessの記述方法も動作しますが、古い記述方法は非推奨です。本ページでは新しい記述方法を例示します。
WWWサーバで行えるアクセス制限は簡単なものであり、確実なセキュリティは確保できないことに御注意ください。
ここで紹介するのは設定例ですが、設定が有効に働いている確認はユーザ自身で確実に行って下さい。例の通りに記載しても、正しく機能していなかった場合の責任は負いかねます。
With the server migration in January 2017, the web server's software (Apache) version was upgraded, which entailed renewing the description of access restriction. Although the old description of ".htaceess" still works, we do not recommend using it. Renew the access restriction as instructed below.
Note that the access restriction performed on the web server is basic, and the security management is not complete by itself.
Below is an example of a description. Please understand that it is not our responsibility but yours in case the restriction does not work correctly even if you followed our instructions. Therefore, check if the restriction is working effectively.
学内で利用されているIPアドレスを持ったマシンからだけアクセスを受け付けます。アクセス制限をかけたいディレクトリに.htaccessを設置し、下記の内容にします。
Require ip 133.11.
Require ip 130.69.
Require ip 157.82.
Require ip 202.175.144.0/20
To accept access only from machines with campus-only IP addresses, set .htacess to the directory you want to restrict and configure it as follows
Require ip 133.11.
Require ip 130.69.
Require ip 157.82.
Require ip 202.175.144.0/20
1..htdigestファイルを作成し、認証のユーザ名とパスワードを保管します。
書式: htdigest -c ファイル名 'レルム' ユーザ名 (-cは最初にファイルを作成するときのみ)
例:htdigest -c .htdigest 'Require Auth' USER_NAME
2.パスワードをかけたいディレクトリに.htaccessを設置します。
AuthType Digest
AuthName "Require Auth"
AuthUserFile /home/username/docs/.htdigest (例)
Require all denied
Require valid-user
AuthNameは、.htdigest作成時のレルムと一致させてください。
AuthUserFileはフルパス(/から始まるパス)で指定します。
1.Create an ".htdigest" file and store the username and password for authentication in there.
Syntax: htdigest [-c] passwdfile realm username
(Note: [-c ]is needed only the first time you create a file.)
Example) htdigest -c .htdigest 'Require Auth' USER_NAME
2.Set .htaccess to the directory to which you want to set a password.
Example)
AuthType Digest
AuthName "Require Auth"
AuthUserFile /home/username/docs/.htdigest
Require all denied
Require valid-user
The AuthName should be the same as the realm when you created the ".htdigest" file.
AuthUserFile must be specified in a full path (path starting with /).
AuthType Digest
AuthName "Require Auth"
AuthUserFile /home/username/docs/.htdigest
Require all denied
Require ip 133.11.
Require ip 130.69.
Require ip 157.82.
Require ip 202.175.144.0/20
Require valid-user
AuthType Digest
AuthName "Require Auth"
AuthUserFile /home/username/docs/.htdigest
<RequireAll>
<RequireAny>
Require all denied
Require ip 133.11.
Require ip 130.69.
Require ip 157.82.
Require ip 202.175.144.0/20
</RequireAny>
Require valid-user
</RequireAll>