liquid_feedback_frontend

view INSTALL.html @ 1859:02c34183b6df

Fixed wrong filename in INSTALL file
author bsw
date Tue Nov 28 18:54:51 2023 +0100 (4 months ago)
parents 7d000a357704
children
line source
1 <html><head><title>LiquidFeedback Installation Instructions</title></head><body>
2 <h1>LiquidFeedback Installation Instructions</h1>
4 <p>This document gives a short outline about the necessary steps to setup a
5 LiquidFeedback system.</p>
7 <h2>1. Install necessary dependencies</h2>
9 <p>If you're using a Debian system, make sure that the following packages are
10 installed:</p>
12 <ul>
13 <li>build-essential</li>
14 <li>postgresql</li>
15 <li>postgresql-server-dev-12</li>
16 <li>libbsd-dev</li>
17 <li>lua5.3</li>
18 <li>liblua5.3-dev</li>
19 <li>mercurial</li>
20 <li>bmake</li>
21 <li>lsb-release</li>
22 <li>imagemagick</li>
23 <li>sassc</li>
24 </ul>
26 <p>If you're using any other Linux distribution or BSD system, install the
27 necessary software components accordingly.</p>
29 <h2>2. Ensure that the user account of your webserver has access to the database</h2>
31 <p>The useraccount of Moonbridge server process needs to have access to your
32 PostgreSQL installation. This is done by executing PostgreSQL's shell command
33 <code>createuser</code> as database superuser (usually <code>pgsql</code>, or <code>postgres</code> for
34 Debian installations):</p>
36 <pre><code>su - postgres -s $SHELL
37 createuser --no-superuser --createdb --no-createrole www-data
38 exit
39 </code></pre>
41 <h2>3. Install and configure LiquidFeedback-Core</h2>
43 <p>We recommend to create the database with the same user as your webserver
44 (usually <code>www-data</code>) to avoid having to setup database privileges.</p>
46 <p>The example below installs the database as <code>www-data</code> and stores the three
47 executables <code>lf_update</code>, <code>lf_update_issue_order</code> and
48 <code>lf_update_suggestion_order</code> in the directory <code>/opt/liquid_feedback_core/</code>:</p>
50 <pre><code># Download and unpack LiquidFeedback-Core
51 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
52 make
53 mkdir /opt/liquid_feedback_core
54 cp core.sql lf_update lf_update_issue_order lf_update_suggestion_order /opt/liquid_feedback_core
55 su www-data -s $SHELL
56 cd /opt/liquid_feedback_core
57 createdb liquid_feedback
58 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
59 </code></pre>
61 <p>A simple configuration may look as follows:</p>
63 <pre><code>psql liquid_feedback
65 INSERT INTO system_setting (member_ttl) VALUES ('1 year');
66 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6);
67 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
68 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
69 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
70 </code></pre>
72 <p>Create an invite code for an admin user:</p>
74 <pre><code>INSERT INTO member (invite_code, admin) VALUES ('sesam', true);
75 </code></pre>
77 <p>Exit the <code>psql</code> interface by typing:</p>
79 <pre><code>\q
80 </code></pre>
82 <p>And don't forget to quit the <code>www-data</code> shell:</p>
84 <pre><code>exit
85 </code></pre>
87 <h2>4. Install Moonbridge</h2>
89 <pre><code># Download and unpack Moonbridge
90 # from http://www.public-software-group.org/pub/projects/moonbridge/
91 pmake MOONBR_LUA_PATH=/opt/moonbridge/?.lua
92 mkdir /opt/moonbridge
93 cp moonbridge /opt/moonbridge/
94 cp moonbridge_http.lua /opt/moonbridge/
95 </code></pre>
97 <h2>5. Install WebMCP</h2>
99 <pre><code># Download and unpack WebMCP
100 # from http://www.public-software-group.org/pub/projects/webmcp/
101 make
102 mkdir /opt/webmcp
103 cp -RL framework/* /opt/webmcp/
104 </code></pre>
106 <h2>6. Install the LiquidFeedback-Frontend</h2>
108 <p>Unpack source tree into appropriate directory, e.g. <code>/opt/liquid_feedback_frontend</code>:</p>
110 <pre><code># Download LiquidFeedback-Frontend
111 # from http://www.public-software-group.org/pub/projects/liquid_feedback/frontend/
112 mv liquid_feedback_frontend-vX.X.X /opt/liquid_feedback_frontend
113 </code></pre>
115 <p>Make <code>tmp/</code> directory of LiquidFeedback-Frontend writable for webserver:</p>
117 <pre><code>chown www-data /opt/liquid_feedback_frontend/tmp
118 </code></pre>
120 <h2>7. Configure mail system</h2>
122 <p>It may be necessary to configure your server's mail system.</p>
124 <h2>8. Configure the LiquidFeedback-Frontend</h2>
126 <pre><code>cd /opt/liquid_feedback_frontend/config
127 cp example.lua myconfig.lua
128 # edit myconfig.lua according to your needs
129 </code></pre>
131 <h2>9. Setup regular execution of <code>lf_update</code> and related commands </h2>
133 <p>The executables <code>lf_update</code>, <code>lf_update_issue_order</code>, and
134 <code>lf_update_suggestion_order</code> must be executed regularly. This may be achieved
135 by creating a file named <code>/opt/liquid_feedback_core/lf_update.sh</code> with the
136 following contents:</p>
138 <pre><code>#!/bin/sh
140 while true; do
141 nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2&gt;&amp;1 | logger -t "lf_core"
142 nice /opt/liquid_feedback_core/lf_update_issue_order dbname=liquid_feedback 2&gt;&amp;1 | logger -t "lf_core"
143 nice /opt/liquid_feedback_core/lf_update_suggestion_order dbname=liquid_feedback 2&gt;&amp;1 | logger -t "lf_core"
144 sleep 5
145 done
146 </code></pre>
148 <p>This file must be marked as executable:</p>
150 <pre><code>chmod +x /opt/liquid_feedback_core/lf_update.sh
151 </code></pre>
153 <p>And this file should be started automatically at system boot. On systems with
154 systemd, create a file named <code>/etc/systemd/system/liquid_feedback_core.service</code>:</p>
156 <pre><code>[Unit]
157 Description=LiquidFeedback Core update
159 [Service]
160 User=www-data
161 ExecStart=/opt/liquid_feedback_core/lf_update.sh
163 [Install]
164 WantedBy=multi-user.target
165 </code></pre>
167 <p>Enable and start the service:</p>
169 <pre><code>systemctl start liquid_feedback_core
170 systemctl enable liquid_feedback_core
171 </code></pre>
173 <h2>10. Start the frontend</h2>
175 <p>After <code>lf_update</code> has been executed at least once, you should be able to use
176 your LiquidFeedback system.</p>
178 <p>Create a file named <code>/opt/liquid_feedback_frontend/run.sh</code>:</p>
180 <pre><code>#/bin/bash
182 /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 2&gt;&amp;1 | logger -t "lf_frontend"
183 </code></pre>
185 <p>Make it executable:</p>
187 <pre><code>chmod +x /opt/liquid_feedback_frontend/run.sh
188 </code></pre>
190 <p>On systemd based systems, create a file named
191 <code>/etc/systemd/system/liquid_feedback_frontend.service</code>:</p>
193 <pre><code>[Unit]
194 Description=LiquidFeedback Frontend
196 [Service]
197 User=www-data
198 ExecStart=/opt/liquid_feedback_frontend/run.sh
200 [Install]
201 WantedBy=multi-user.target
202 </code></pre>
204 <p>Enable and start the service:</p>
206 <pre><code>systemctl start liquid_feedback_frontend
207 systemctl enable liquid_feedback_frontend
208 </code></pre>
210 <p>In the latter case, the Moonbridge server will open a TCP port according to
211 your configuration. Directly accessing this TCP port through your webbrowser
212 is helpful for development purposes. For real-life deployment, however, it is
213 recommended to further proxy the application (e.g. using nginx). The proxy can
214 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
215 itself).</p>
216 </body></html>

Impressum / About Us