这是一个自我解答的问题,描述了如何解决在启用SELinux的普通Linux机器上安装brat annotation tool时发生的问题,该文件用于创建带注释的语料库以供NLP使用。这基于该工具的1.3版。
documented的安装过程包括以下步骤:
/var/www/html或$HOME/public_html brat-v1.3_Crunchy_Frog重命名为简单的名称,例如brat sudo ./install.sh sudo service httpd start)(如果尚未运行)问题:遵循此过程时,在浏览器中尝试使用brat的任何尝试(将其定向到
http://localhost/brat/index.xhtml都会失败,并在屏幕上显示以下错误消息:
Error: ActiongetCollectionInformation failed on error Internal Server Error
Error: Actionwhoami failed on error Internal Server Error
Error: ActionloadConf failed on error Internal Server Error
Apache错误日志(通常在
/var/log/httpd/error_log中找到)还显示错误:
(13)Permission denied: exec of '/var/www/html/new/ajax.cgi' failed, referer: http://localhost/new/index.xhtml
Premature end of script headers: ajax.cgi, referer: http://localhost/new/index.xhtml
如何解决这个问题呢?
请您参考如下方法:
这是由SELinux引起的。解决此问题的一种方法是禁用SELinux,但较不那么激进的方法是根据brat的要求设置访问权限。
问题的根源是:
html目录默认情况下,
还配置了
要修改SELinux配置,您需要授予对特定文件和目录的访问权限,如下所示(在brat安装目录中执行此操作):
$> chcon -t httpd_sys_content_t .
$> chcon -t httpd_sys_script_exec_t *.cgi
$> sudo chcon -R -t httpd_sys_script_rw_t work data
(
$>代表命令提示符。)
第一个命令启用对当前目录的读取访问(有时可能是不必要的)。第二个命令启用所有以
.cgi结尾的文件的CGI脚本执行(这是必需的)。第三个命令启用对
work和
data目录的写访问(也是必需的);每当您将文件或子目录添加到
work或`data中时,都需要再次应用它。

