Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SELinux出现CentOS Java应用程序错误_Java_Drupal_Solr_Centos_Selinux - Fatal编程技术网

SELinux出现CentOS Java应用程序错误

SELinux出现CentOS Java应用程序错误,java,drupal,solr,centos,selinux,Java,Drupal,Solr,Centos,Selinux,我有一个CentOS盒子,里面有一个Drupal 7站点。我尝试在其上运行一个名为Tika的Java应用程序,使用ApacheSolr搜索为文件编制索引 只有在启用SELinux时,我才不断遇到问题: extract using tika: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f1ed9000000, 2555904, 1) failed; error='Permission denied' (errn


我有一个CentOS盒子,里面有一个Drupal 7站点。我尝试在其上运行一个名为Tika的Java应用程序,使用ApacheSolr搜索为文件编制索引

只有在启用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吗?),所以我不确定从这里到哪里…

您的所有上下文消息都引用了
httpd\u t
,所以我会运行

/usr/sbin/getsebool -a | grep httpd
并尝试启用显示为
off
的属性。我在CentOS上运行数据库支持的网站(Drupal、WordPress等)已经有一段时间了,但我记得,这两个网站必须启用:

httpd_can_network_connect
httpd_can_network_connect_db
要启用具有持久性的属性,请运行

setsebool -P httpd_can_network_connect on

等等。

您的所有上下文消息都引用了
httpd\u t
,因此我将运行

/usr/sbin/getsebool -a | grep httpd
并尝试启用显示为
off
的属性。我在CentOS上运行数据库支持的网站(Drupal、WordPress等)已经有一段时间了,但我记得,这两个网站必须启用:

httpd_can_network_connect
httpd_can_network_connect_db
要启用具有持久性的属性,请运行

setsebool -P httpd_can_network_connect on

等等。

你要找的布尔人是:

httpd_execmem

httpd_read_user_content
如何查找:

audit2why-i/var/log/audit/audit.log
将告诉您这一点


包的一部分:
policycoreutils-python-utils

您要查找的布尔值是:

httpd_execmem

httpd_read_user_content
如何查找:

audit2why-i/var/log/audit/audit.log
将告诉您这一点

包的一部分:
policycoreutils-python-utils

这对我很有用。。。 我在/var/apache-tika/tika-app-1.14.jar上有tika

setsebool -P httpd_execmem 1
chcon -t httpd_exec_t /var/apache-tika/tika-app-1.14.jar
使用sealert工具()有助于找到正确的selinux类型。

这对我很有用。。。 我在/var/apache-tika/tika-app-1.14.jar上有tika

setsebool -P httpd_execmem 1
chcon -t httpd_exec_t /var/apache-tika/tika-app-1.14.jar

使用sealert工具()有助于找到正确的selinux类型。

不起作用,在没有任何日志输出的情况下导致500错误设置setsebool-p httpd_execmem 1,根据Josh C为我在Fedora 28/Tika 1.13 selinux上工作内存不足问题无法工作,在没有任何日志输出的情况下导致500个错误根据Josh C为我处理Fedora 28/Tika 1.13 SELinux内存不足问题设置错误-P httpd_execmem 1