2010年1月11日月曜日

How to install BNCweb 4.3

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

First, install the following packages, if not installed yet.
apache2
mysql-server-5.0
libparse-recdescent-perl
flex
bison
libncurses5-dev
subversion



$ sudo mkdir /BNC_XML (* or whatever)
$ tar xvzfBNCweb_version_4.3.tar.gz
$ sudo mv ~/BNCweb_version_4.3 /BNC_XML/
$ cd /BNC_XML/BNCweb_version_4.3
$ sudo chmod -R 755 cgi-bin
$ sudo chmod -R 755 lib_files
$ svn export https://cwb.svn.sourceforge.net/svnroot/cwb/cwb/trunk cwb-3.0
$ cd cwb-3.0
modify "config.mk"
---
(line 41)
include $(TOP)/config/platform/linux
---
$ make clean
$ make depend
$ make all
$ sudo make install
$ tar xvzf Perl-CWB-2.2.101.tar.gz
$ cd CWB
$ rm ._Makefile.PL
$ alias gtar='COPYFILE_DISABLE=true tar'
$ perl Makefile.PL
$ make
$ sudo make install
$ tar xvzf Perl-CWB-CL-2.2.101.tar.gz
$ cd CWB-CL
$ rm ._Makefile.PL
$ make
$ sudo make install
$ sudo mkdir /usr/local/share/cwb
$ sudo mkdir /usr/local/share/cwb/registry
$ sudo mkdir /usr/local/share/cwb/data
$ sudo 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
$ sudo cd ../BNCweb_version_4.3/BNC_encoder/
$ sudo perl BNCweb/EncodeBNC.perl -n BNC-XML -M 1000 -f -v /usr/local/share/cwb/data/ /BNC_XML/Texts/
(* "-M 1000" specifies the allocated memory size (in MB).
It took more about 3.5 hours on a PC with Athlon X2 BE-2400 and 3GB memory.)
$ sudo perl BNCweb/MakeFreqTables.perl -n BNC-XML -M 1000 -f -v
(* It took about 30 minutes on my PC.)
$ cd ../lib_files
(modify "bncConfigXML.pm")
---
(line 51)
$bwWebServer = "http(s)://your.server.name.com";
(line 62)
$bwCorpus = "BNC-XML";
(line 114)
$bwSuperuser = 'your_account'; (specify the administrative account)
---
$ sudo mkdir /usr/local/share/bncweb
$ sudo chmod 777 /usr/local/share/bncweb
$ cd ../BNC_encoder
$ sudo perl ../setup/make_MySQL_tables.pl
(When asked for the directory and prefix of the tables, just press [Enter].)
(* It took about 5 minutes 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 /bncweb/ /BNC_XML/BNCweb_version_4.3/
Alias /bncweb /BNC_XML/BNCweb_version_4.3/
ScriptAlias /bncweb-cgi/ /BNC_XML/BNCweb_version_4.3/cgi-bin/
<Directory /BNC_XML/BNCweb_version_4.3>
Options Indexes FollowSymLinks ExecCGI
AuthType Basic
AuthName bncweb
AuthUserFile /etc/bncpass
require valid-user
SetEnv PERL5LIB /BNC_XML/BNCweb_version_4.3/lib_files
</Directory>
---
Restart apache2.
Set the password for each user.
$ sudo htpasswd /etc/bncpass [username]
(Add -c option (htpasswd -c /etc/bncpass [username]) when you add the first user.)
Edit /etc/apparmor.d/usr.sbin.mysqld and add the following line befor the "}" at the end of the file:
---
/usr/local/share/bncweb/* rw,
---
$ sudo /etc/init.d/apparmor restart
$ sudo /etc/init.d/mysql restart
This enables MySQL to write a file to /usr/local/share/bncweb/.
Now access the site: http(s)://hostname/bncweb-cgi/BNCweb.pl
The interface of BNCweb will appear.

0 件のコメント:

コメントを投稿