-
Notifications
You must be signed in to change notification settings - Fork 50
/
install.txt
158 lines (104 loc) · 4.44 KB
/
install.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
GreenSQL Database Firewall Installation
For installation you have a number of options:
1. Download installation package for your favorite distribution
from the following url and install it:
http://www.greensql.net/download
2. Build your own installation package.
3. Manual installation: compile & install from source.
Building your own installation package
--------------------------------------
If you distribution is not listed in the project download page, you
can try to build a package for your operation system. We have build a
special script that takes all steps required to build package for
popular operating systems. It automatically builds deb/rpm/bsd packages.
Before proceeding with the instalation you need to download source
code of the greensql firewall. Download it from the project download
page: http://www.greensql.net/download
Run the following commands:
shell> tar -xzvf greensql-fw-X.X.X.tar.gz
shell> cd greensql-fw
shell> ./build.sh
Last script - build.sh will create package for your OS. After installing
newly created package you need to install GreenSQL configuration db stored
in MySQL. You can do it by running the following shell script:
shell> greensql-create-db.sh
Next step is to start the application. You can simply do it by running
the following command as a root user:
shell> /etc/init.d/greensql-fw start
For application troubleshooting check the log file:
shell> tail -f /var/log/greensql.log
Manual Installation
-------------------
Before installing the application you need to compile it. Without going
into much details you can do it as followed:
shell> tar -xzvf greensql-fw-X.X.X.tar.gz
shell> cd greensql-fw
shell> ./build.sh
There are a number of steps to perform in order to install application.
They are:
1. Create dedicated user for greensql service.
2. Creating MySQL config db and a db user.
3. Setting up configuration files.
3. Setting log file.
4. Configure start up scripts
Creating greensql system group and user
---------------------------------------
In order to create greensql group and user run the following
commands (run these commands as a root user):
shell> groupadd greensql
shell> useradd -M -g greensql -s /dev/null greensql
Alternatively you do the ame by execurting the following commands:
shell> cd scripts/
shell> ./setup_user.sh
Creating MySQL DB and user
--------------------------
Just run the following script: greensql-create-db.sh . It will
automatically create configuration database.
shell> cd scripts/
shell> ./greensql-create-db.sh
Setting up configuration files
------------------------------
You will find a number of configuration files in the ./conf/ directory.
GreenSQL start up script expects to find the configuration files in the
following directory:
/etc/greensql/
You simply need to copy files from ./conf/* to /etc/greensql . You can do it
as followed:
shell> mkdir -p /etc/greensql
shell> cp ./conf/* /etc/greensql/ -r
shell> chown greensql:greensql /etc/greensql -R
shell> chmod 700 /etc/greensql
Alternativly you can run setup_conf.sh file located in the scripts
directory.
shell> cd scripts/
shell> ./setup_conf.sh
Next step is to alter /etc/greensql/greensql.conf file and specify correct
db name, server, port, user and password.
Setting log file
----------------
By default greensql expects to find log file in:
/var/log/greensql.log
In addition, log file rotation must be enabled. You can do it by running
the following commands:
shell> touch /var/log/greensql.log
shell> chown greensql:greensql /var/log/greensql.log
shell> chmod 600 /var/log/greensql.log
shell> cp scripts/greensql.rotate /etc/logrotate.d/greensql
Alternatively you can run ./setup_log.sh script located in the scripts/
directory.
Configure start up scripts
--------------------------
As a final step you need to copy greensql-fw binary to the /user/sbin/
or /sbin directory and copy greensql service initialization script to the
/etc/init.d/ directory.
Run the following commands:
shell> cp greensql-fw /usr/sbin/
shell> cp scripts/rc.greensql /etc/init.d/greensql
Another alternative is to run ./setup_binary.sh script located in the scripts/
directory.
After that you can start the application by running the following command:
shell> /etc/init.d/greensql start
In order to stop the application use the following command:
shell> /etc/init.d/greensql stop
For application troubleshooting check the log file:
shell> tail -f /var/log/greensql.log