这是一个自我回答的问题,描述了如何解决在普通Linux机器上安装brat注释工具时出现的问题,该问题用于创建用于NLP的带注释的语料库,该机器启用了SELinux。这是基于1.3版本的工具。
记录在案的安装过程包括以下步骤:
/var/www/html或$HOME/public_htmlbrat-v1.3_Crunchy_Frog重命名为简单的目录,如bratsudo ./install.shsudo 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 ErrorApache日志(通常可以在/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如何解决这个问题?
发布于 2013-01-25 09:33:55
这是由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添加文件或子目录时,需要再次应用它。
发布于 2018-10-22 10:53:34
我也有同样的问题。能够通过以下更改/etc/apache2/apache2.conf文件来解决这个问题。
<Directory /var/www>
Options Indexes FollowSymLinks
#AllowOverride Options Indexes FileInfo
Require all granted
AddType application/xhtml+xml .xhtml
AddType font/ttf .ttf
# For CGI support
AddHandler cgi-script .cgi
# Comment out the line above and uncomment the line below for FastCGI
#AddHandler fastcgi-script fcgi
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks
#AllowOverride Options Indexes FileInfo
Require all granted
AddType application/xhtml+xml .xhtml
AddType font/ttf .ttf
# For CGI support
AddHandler cgi-script .cgi
# Comment out the line above and uncomment the line below for FastCGI
#AddHandler fastcgi-script fcgi
</Directory>
<Directory /var/www/html/brat>
Options Indexes FollowSymLinks
AllowOverride Options Indexes FileInfo
Require all granted
AddType application/xhtml+xml .xhtml
AddType font/ttf .ttf
# For CGI support
#AddHandler cgi-script .cgi
# Comment out the line above and uncomment the line below for FastCGI
AddHandler fastcgi-script fcgi
# For FastCGI, Single user installs should be fine with anything over 8
#FastCgiConfig -maxProcesses 8
</Directory>参考文献:Brat问题
https://stackoverflow.com/questions/14518961
复制相似问题