「Apache」の版間の差分
提供: Wikinote
細 |
細 |
||
| 行4: | 行4: | ||
== 設定 == | == 設定 == | ||
* <code>httpd -t</code> で設定の記述が正しいかテストできる。 | * <code>httpd -t</code> で設定の記述が正しいかテストできる。 | ||
| + | |||
| + | === core を吐かせる === | ||
| + | |||
| + | httpd は、RHEL の他のデーモンで必要となるような設定はなく、 | ||
| + | 以下のディレクティブを記載しておきさえすれば、core が吐かれるようだ。 | ||
| + | |||
| + | CoreDumpDirectory /tmp | ||
=== リバースプロキシ === | === リバースプロキシ === | ||
2011年5月13日 (金) 20:54時点における版
もう数年使ってるけどマジ初心者な Apache について。 セキュリティのことを考えると、まずはじめに熟知しておくべきなのだが…。
設定
-
httpd -tで設定の記述が正しいかテストできる。
core を吐かせる
httpd は、RHEL の他のデーモンで必要となるような設定はなく、 以下のディレクティブを記載しておきさえすれば、core が吐かれるようだ。
CoreDumpDirectory /tmp
リバースプロキシ
ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /foo http://foo.example.com/bar ProxyPassReverse /foo http://foo.example.com/bar
アクセス制限
Basic 認証
Basic 認証では、パスワードは暗号化されないので、セキュリティ上はザルであることを認識しておくべきである。 単にちょっとアクセス制限をかける程度にしか使えないということ。
まず、htpasswd でパスワードファイルを作成する。
# htpasswd -c /path/to/passwd_file user_name
ほんで、/etc/httpd/conf/httpd.conf の Dicrectory セクションで以下のように設定する。
<Directory "/path/to/secret_dir">
AuthType Basic
AuthName "Secret Directory"
AuthUserFile /path/to/passwd_file
Require user user_name
</Directory>
このサイトの Apache について
とりあえず編集した設定は:
ServerName hagio.org:80 DocumentRoot "/home/hagio/public_html" <Directory "/home/hagio/public_html"> ... DirectoryIndex intex.html index.html.var index.php
$ chmod 711 /home/hagio $ chmod 755 /home/hagio/public_html