2005年6月16日

Linux | Subversionでパーミッションエラー

subversion: Subversion FAQ

Note for SELinux / Fedora Core 3 / RedHat Enterprise users:

In addition to regular Unix permissions, under SELinux every file, directory, process, etc. has a 'security context'. When a process attempts to access a file, besides checking the Unix permissions the system also checks to see if the security context of the process is compatible with the security context of the file.

Fedora Core 3, among other systems, comes with SELinux installed by default, configured so that Apache runs in a fairly restricted security context. To run Subversion under Apache, you have to set the security context of the repository to allow Apache access (or turn off the restrictions on Apache, if you think all this is overkill). The chcon command is used to set the security context of files (similarly to how the chmod sets the traditional Unix permissions). For example, one user had to issue this command

$ chcon -R -h -t httpd_sys_content_t PATH_TO_REPOSITORY

to set the security context to be able to successfully access the repository.

CentOS上でSubversionにWebDav経由でアクセスしようとしたら、「Could not open the requested SVN filesystem」とエラーが出て、埒が明かなくなった。SVNリポジトリにはApacheの実行ユーザが読み書きできるようにしてあるのに。と思いつつ、調べてみたらSELinuxでの制限に因るものらしい。

とりあえず何も分からないまま上記コマンドを打ってみたら、エラーなく動作するようになった。SELinuxについては無知だったけど、ちょっと勉強しないとなあ。

買うならどっちだ!?
・SELinux徹底ガイド
・SELinuxシステム管理

Posted by otsuka : 19:16 | Comment (0) | Trackback (0)
Comment









名前、アドレスを登録しますか?