仮想ホストは、SELinux が許可に設定されている場合にのみ機能します。なぜですか?

仮想ホストは、SELinux が許可に設定されている場合にのみ機能します。なぜですか?

私の仮想ホストがSELinuxが「許可」に設定されている場合にのみ機能する理由は疑問に思います。 SELinuxが「Force」に設定されている場合、マイ仮想ホストは無視され、デフォルトホストが表示されます。

Apache/2.2.15(Unix)

これは私のhttpd.comfです。 http://pastebin.com/2LRzLZ8Z

ダミーファイルには以下が含まれます。

<VirtualHost *>
    DocumentRoot "/srv/vhosts/foo.com/htdocs"
    ServerName mysite.com
    <Directory "/srv/vhosts/foo.com/htdocs">
        allow from all
        Options +Indexes
    </Directory>
</VirtualHost>

働く:

SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

動作しません:

SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

ベストアンサー1

迅速かつ汚い修正

# chcon -R -u system_u -t httpd_sys_content_t /srv/vhosts

もっと読むことができます。ここそしてここ

おすすめ記事