mbermejo17 / php-tail

Automatically exported from code.google.com/p/php-tail
0 stars 0 forks source link

phptail and selinux? #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SELINUX enabled doesn't work

with default selinux context
-rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 access_log
the script doesnt work.

if change the context 
chcon -t httpd_sys_content_t /var/log/httpd/access_log
it doesn't work too.

if I disable selinux it works.

I know perhaps it is not the forum to get this question, but perhaps some 
people have same issues.

Suggestions (other than disable selinux)?

Original issue reported on code.google.com by vazro...@gmail.com on 13 Jul 2012 at 9:02

GoogleCodeExporter commented 8 years ago
I have been able to do a workaround regarding this mentioned issue.
Perhaps some security guy will have some comments about it.

Stop apache
   #service httpd stop

move the log files to a destination folder with apache access
   #mv /var/log/httpd /var/www/html

create a symbolic link to this folder (it allows not to reconfigure the apache 
conf files)
   #ln -s /var/www/html/httpd /var/log/httpd

change the selinux context to the symbolic link
   #chcon -h unconfined_u:object_r:httpd_log_t:s0 /var/log/httpd

change the owner to the log folder
   #chown -R apache:apache /var/log/httpd

change the context to the logs folder
   #chcon -R unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/httpd

restart apache
   #service httpd start

this will allow PHPTail to read the logs.

Original comment by vazro...@gmail.com on 13 Jul 2012 at 10:56

GoogleCodeExporter commented 8 years ago
Did this fix the issue for you? 

Original comment by Peeter.T...@gmail.com on 17 Jul 2012 at 7:27

GoogleCodeExporter commented 8 years ago
Yes, it is working.
CentOS 6.

Original comment by vazro...@gmail.com on 17 Jul 2012 at 9:45