「Apache」の版間の差分
提供: Wikinote
細 |
細 (→core を吐かせる) |
||
| 行11: | 行11: | ||
CoreDumpDirectory /tmp | CoreDumpDirectory /tmp | ||
| + | |||
| + | ただ、kernel.core_pattern カーネルパラメータを、 | ||
| + | /var/core などパスにしていると吐かれないので注意すること。 | ||
=== リバースプロキシ === | === リバースプロキシ === | ||
2011年5月13日 (金) 20:58時点における最新版
もう数年使ってるけどマジ初心者な Apache について。 セキュリティのことを考えると、まずはじめに熟知しておくべきなのだが…。
設定
-
httpd -tで設定の記述が正しいかテストできる。
core を吐かせる
httpd は、RHEL の他のデーモンで必要となるような設定はなく、 以下のディレクティブを記載しておきさえすれば、core が吐かれるようだ。
CoreDumpDirectory /tmp
ただ、kernel.core_pattern カーネルパラメータを、 /var/core などパスにしていると吐かれないので注意すること。
リバースプロキシ
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