2007年7月26日木曜日

How to install BNCweb (CQP-Edition)

Here's how to install the latest version of BNCweb (CQP-Edition) on Ubuntu 7.04.

The following procedure is based on my installation of BNCweb 4.0 beta on Ubuntu 7.04. Please make necessary changes according to the version of BNCweb and to your system environment.


First, install the following packages, if not installed yet.
mysql-server-5.0
libdbi-perl
libdbd-mysl-perl
libhtml-parser-perl
libparse-recdescent-perl
flex
bison
libncurses5-dev



# mkdir /BNC_XML (* or whatever)
(unzip BNCweb-distribution_Beta.zip)
# mv ~/BNCweb-distribution_Beta/BNCweb-distribution_Beta /BNC_XML/
# cd /BNC_XML/BNCweb-distribution_Beta
# chmod -R 755 cgi-bin
# chmod -R 755 lib_files
# mkdir /BNC_XML/CQP-tempXML
# chmod 777 /BNC_XML/CQP-tempXML
# cd CQP_source
# tar xvzf cwb-2.2.b98a-src.tgz
# cd cwb-3.0
(modify "Makefile.inc")
---
line 36
PLATFORM = linux
line 62
SITE = standard
---
# make clean
# make depend
# make all
# make install
# cd ..
# tar xvzf CWB-Perl-Public-1.1.3b.tar.gz
# cd CWB-Perl-Public
# cd CWB
# perl Makefile.PL
# make
# make test
# make install
# cd ../CQP
# perl Makefile.PL
# make
# make install
# cd ../CL
# perl Makefile.PL
# make
# make install
# cd../WebCqp
# perl Makefile.PL
# make
# make install
# mkdir /BNC_XML/Texts
# cd /BNC_XML/Texts
(copy texts.tar.gz on Disk 1 of BNC-XML to /BNC_XML/Texts/)
# tar xvzf texts.tar.gz
# cd ../BNCweb-distribution_Beta/BNCweb-encoder-0.5b
# mkdir /BNC_XML/registry
# perl EncodeBNC.perl -n BNC-XML -r /BNC_XML/registry/ -f -M 800 -v /BNC_XML/Index/ /BNC_XML/Texts/
(* "-M 800" specifies the allocated memory size (in MB).
It took about 5 hours on a PC with Sempron 3200+ and 2GB memory.)
# perl MakeFreqTables.perl -n BNC-XML -r /BNC_XML/registry/ -f -M 800 -v
(* It took about 50 mins on my PC.)
# cd ../lib_files
(modify "bncConfigXML.pm")
---
line 45
$bwCorpusPath = '/BNC_XML/Texts/';
line 49
$bwTempPath = 'BNC_XML/CQP-tempXML';
line 91
$bwMysqlUser = 'root';
comment out line 92
#$bwMysqlUser = 'bncweb';
comment out line 95
#$bwMysqlPwd = 'test';
line 128
$bwSuperuser = 'your_account'; (specify the administrative account)
line 130
$bwDevelopers = 'your_account'; (specify the administrative account)
---
# cd ../BNCweb-encoder-0.5b
# perl make_MySQL_tables.pl
(When asked the username of MySQL admin and its password, just press [Enter]. When asked about the directory of the tables, just press [Enter].)
(* It took about 1.5 hours on my PC.)
Configure the apache files.
Add the following lines into the appropriate apache config file.
(e.g. just before "</VirtualHost>" in /etc/apache2/sites-available/ssl)
---
Alias /bncwebXML/ /BNC_XML/BNCweb-distribution_Beta/
Alias /bncwebXML /BNC_XML/BNCweb-distribution_Beta/
<Directory /BNC_XML/BNCweb-distribution_Beta>
Options Indexes FollowSymLinks ExecCGI
AuthType Basic
AuthName bncweb
AuthUserFile /etc/bncpass
require valid-user
SetEnv PERL5LIB /BNC_XML/BNCweb-distribution_Beta/lib_files
SetEnv CORPUS_REGISTRY /BNC_XML/registry
</Directory>
ScriptAlias /cgi-binbncXML/ /BNC_XML/BNCweb-distribution_Beta/cgi-bin/
---
Restart apache(2).
Set the password for each user.
Now access http(s)://hostname/cgi-binbncXML/BNCquery.pl?theQuery=search&urlTest=yes.
The interface of BNCweb will appear.

0 件のコメント:

コメントを投稿