說明:
網上大部分教程是基於ubutu,自己的服務器是centos,期間出現很多問題,記錄如下。
主要問題是谷歌瀏覽器中訪問8001端口下載了一個index.xhtml,而不是直接打開
原因:需要圖形化界面,解決方案,httpd,firefox,Xmanager
1.安裝brat
下載,http://brat.nlplab.org/installation.html,brat-v1.3_Crunchy_Frog.tar.gz這個文件
tar -xzf brat-v1.3_Crunchy_Frog.tar
cd brat-v1.3_Crunchy_Frog
./install.sh
注:基本不會有問題
2.安裝httd
機器python 環境問題
由於機器使用了python3。所以要切換到python2的環境
vi ~/.bashrc
alias python='/usr/bin/python2.7'
vi /etc/profile path 也要修改
yum的python環境問題
vi /usr/bin/yum 和vi /usr/libexec/urlgrabber-ext-down
修改頭 #!/usr/bin/python => #!/usr/bin/python2.7
http服務問題
Job for httpd.service failed because the control process exited with error code.see “systomctl status httpd.service” and “journalctl -xe” for details.
先用yum卸載httpd和mod_wsgi,
命令:yum remove httpd mod_wsgi;
然后再安裝yun -y install httpd mod_wsgi 就可以了
安裝完成后 service httpd restart 即可 問題基本排除
3.安裝firefox:
遇到的坑使用官網下載的Firefox-latest.tar.bz2安裝包遇到了各種問題,
解決了很多問題,不知道會對下面操作是否有影響
解決方案:使用yum install firefox
4.安裝Xmanager
參考 https://blog.csdn.net/yongwan5637/article/details/84060709
網盤地址 https://pan.baidu.com/s/1jsSeCAv3VHBZiqGh_HURlA
遇到問題:Xmanager6遇到一個無法解決的問題,所以選擇Xmanager5
5.開啟
在centos中啟動 brat :cd brat-v1.3_Crunchy_Frog 運行python standalone.py
windows啟動Xmanager-Passive
在centos中新窗口執行 expot DISPLAY=windowsip:0.0
在centos執行 xclock 測試是否成功,如果成功會在windows有個鍾表頁面
在centos執行firefox centosIP:8001 (brat服務)
6.中文
在brat-v1.3_Crunchy_Frog/data隨便寫點文件內容為中文
在brat-v1.3_Crunchy_Frog 路徑執行命令 find data -name '*.txt' | sed -e 's|\.txt|.ann|g' | xargs touch
brat-v1.3_Crunchy_Frog/server/src/projectconfig.py
中normalize_to_storage_form(t)函數
注釋#n = re.sub(r'[^a-zA-Z0-9_-]', '_', n)
添加n = re.sub(u'[^a-zA-Z\u4e00-\u9fa5<>,0-9_-]', '_', n)
參考:https://blog.csdn.net/u014028063/article/details/89329306
https://blog.csdn.net/anyedianxia/article/details/96832229
https://blog.csdn.net/yongwan5637/article/details/84060709
https://www.cnblogs.com/xuzhaoyang/p/11264609.html