【发布时间】:2016-05-14 16:27:11
【问题描述】:
我有一个托管 Drupal 7 站点的 CentOS 盒子。我尝试在其上运行一个名为 Tika 的 Java 应用程序,以使用 Apache Solr 搜索来索引文件。
我只有在启用 SELinux 时才会遇到问题:
extract using tika: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f1ed9000000, 2555904, 1) failed; error='Permission denied' (errno=13)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 2555904 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/jvm-2356/hs_error.log
如果我禁用 selinux,这不会发生。如果我从 SSH 运行命令,它可以正常工作——但不能在浏览器中运行。这是它正在运行的命令:
java '-Dfile.encoding=UTF8' -cp '/var/www/drupal/sites/all/modules/contrib/apachesolr_attachments/tika' -jar '/var/www/drupal/sites/all/modules/contrib/apachesolr_attachments/tika/tika-app-1.11.jar' -t '/var/www/drupal/sites/all/modules/contrib/apachesolr_attachments/tests/test-tika.pdf'
这是来自 SELinux 的日志,位于 /var/log/audit/audit.log:
type=AVC msg=audit(1454636072.494:3351): avc: denied { execmem } for pid=11285 comm="java" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=process
type=SYSCALL msg=audit(1454636072.494:3351): arch=c000003e syscall=9 success=no exit=-13 a0=7fdfe5000000 a1=270000 a2=7 a3=32 items=0 ppid=2377 pid=11285 auid=506 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1 comm="java" exe="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre/bin/java" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
有没有办法在启用 SELinux 的情况下运行它?我不知道 Tika 的策略名称(或者我应该使用 Java 吗?)所以我不确定从这里去哪里......
【问题讨论】:
标签: java drupal solr centos selinux