Bart Anomation

Bart Anomation

下载安装包

step1:进入brat的主页,下载安装包下载安装包brat-v1.3_Crunchy_Frog.tar.gz。链接为:http://brat.nlplab.org/index.html

Step2:解压后,进行安装

1
cd brat-v1.3_Crunchy_Frog

flup python lib

1
cd server/lib && tar xfz flup-1.0.2.tar.gz

如果没有apache,安装:

1
sudo apt-get install apache2

修改apache配置:

1
sudo vim /etc/apache2/apache2.conf

加入如下语句:

1
2
3
4
5
6
7
8
9
10
11
12
<Directory /home/*/public_html>
AllowOverride Options Indexes FileInfo Limit
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>

# For FastCGI, Single user installs should be fine with anything over 8
#FastCgiConfig -maxProcesses 16

userdir赋权:

1
2
3
4
5
6
sudo a2enmod userdir

#提示信息为:
# Enabling module userdir.
# To activate the new configuration, you need to run:
# service apache2 restart

继续执行:

1
2
3
4
5
6
sudo apt-get install libapache2-mod-fastcgi
sudo a2enmod fastcgi
sudo a2enmod rewrite
# Enabling module rewrite.
# To activate the new configuration, you need to run:
# service apache2 restart

重新加载apache的配置:

1
sudo /etc/init.d/apache2 reload

这个时候查看http:127.0.0.1便可以看到apache默认页面。

进入到public_html/brat-v1.3_Crunchy_Frog文件夹,然后:

1
2
sudo chgrp -R www-data data work
chmod -R g+rwx data work

安装standalone server

1
bash install.sh -u

然后运行服务:

1
2
python standalone.py
# Serving brat at http://127.0.0.1:8001

出现错误,使用Python2就行

1
python2 standalone.py

配置alise替换命令

1
vim ~/.bashrc

添加如下命令:

1
2
alias cdbrat="cd /usr/local/brat/brat-v1.3_Crunchy_Frog"
alias runbrat="python2 standalone.py"

使其生效:

1
source ~/.bashrc

下次登录直接使用以下命令

1
cdbrat && runbrat