brat_howto.txt
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
PREFIX=/home/mkopec/local
BRAT_INST_DIR=/home/mkopec/public_html
##### instalacja lighttpd na glassie: #######
mkdir $PREFIX
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.32.tar.gz
tar -xzf lighttpd-1.4.32.tar.gz
rm lighttpd-1.4.32.tar.gz
cd lighttpd-1.4.32
./configure --prefx=$PREFIX
make
make install
# to dodac do bashrc
export PATH=$PATH:$PREFIX/sbin
##### instalacja brata ##########
mkdir $BRAT_INST_DIR
cd BRAT_INST_DIR
wget http://weaver.nlplab.org/~brat/releases/brat-v1.3_Crunchy_Frog.tar.gz
tar -xzf brat-v1.3_Crunchy_Frog.tar.gz
rm brat-v1.3_Crunchy_Frog.tar.gz
mv brat-v1.3_Crunchy_Frog brat-1.3-core
cd brat-1.3-core
mkdir -p data work
#edit lighttpd.conf
# 1. set path to brat directory in server.document-root
# 2. change port number in lighttpd.conf for something free (server.port)
# 3. change server.username and server.group for your username
# 4. server.pid-file = "<BRAT_INST_DIR>/brat-1.3-core.pid"
#####tworzymy w folderze wyzej niz bart sktrypy:
##### brat-1.3-core-start.sh ######
#!/bin/bash
/home/mkopec/local/sbin/lighttpd -f /home/mkopec/public_html/brat-1.3-core/lighttpd.conf
##### brat-1.3-core-stop.sh ######
#!/bin/bash
kill `cat /home/mkopec/public_html/brat-1.3-core.pid`
##### brat-1.3-core-autostart.sh ######
#!/bin/bash
wget --tries=1 --timeout=5 -O /dev/null http://localhost:11111/
if [ $? -ne 0 ]; then
(/home/mkopec/public_html/brat-1.3-core-stop.sh; /home/mkopec/public_html/brat-1.3-core-start.sh)
fi
# komenda
# crontab -e
# i dodajemy na koncu:
0 * * * * /home/mkopec/public_html/brat-1.3-core-autostart.sh