VirtualHostカスタムログファイルがApache Webサーバーでは機能しません。

VirtualHostカスタムログファイルがApache Webサーバーでは機能しません。

私が知っていることすべてを試しましたが、httpd Webサーバーはまだカスタムログファイルに記録しません。不思議なことに、同じディレクトリにあるaccess.logは問題ありません。 error.logを削除してsudo systemctl restart httpdを実行すると、ルートがファイルの所有者になります。 Apacheユーザーはこのグループのメンバーです。

私がしたこと:

  1. chcon --reference /var/log/httpd/error_log /var/www/example.com/logs/error.log
  2. sudo setebool -P httpd_unified 1
  3. sudo semanage fcontext -a -t httpd_log_t "/var/www/example.com/logs(/.*)?"
  4. sudo Restorecon -R -v /var/www/example.com/logs

example.com.confエラーログ/var/www/example.com/logs/error.log

ls -dlZ は drwxrwxr-x を記録します。 2つのユーザーグループunconfined_u:object_r:httpd_log_t:s0 41 6月17日08:37ログ

ls -lhZ error.log -rw-rw-r--。 1ユーザーグループsystem_u:object_r:httpd_log_t:s0 0 6月17日08:37 error.log

ls -lhZ access.log -rw-rw-r--。 1 ユーザーグループ system_u:object_r:httpd_log_t:s0 318K 7月9日 06:51 access.log

オペレーティングシステム:Centos8サーバー:Apache VirtualHost:はいSELinux:必須

ベストアンサー1

おすすめ記事