summaryrefslogtreecommitdiff
path: root/stories/projects/etherpad.rst
diff options
context:
space:
mode:
Diffstat (limited to 'stories/projects/etherpad.rst')
-rw-r--r--stories/projects/etherpad.rst237
1 files changed, 237 insertions, 0 deletions
diff --git a/stories/projects/etherpad.rst b/stories/projects/etherpad.rst
new file mode 100644
index 0000000..cc75def
--- /dev/null
+++ b/stories/projects/etherpad.rst
@@ -0,0 +1,237 @@
1.. link:
2.. description: is a documentation project on how to setup the classic etherpad software in a FreeBSD jail.
3.. tags: project
4.. date: 2015/02/01 19:10:08
5.. title: etherpad
6.. slug: ../arts/software/etherpad/index
7
8.. contents::
9 :depth: 1
10 :class: ezjail-toc
11
12----
13
14Overview
15========
16
17This is how to install the etherpad from http://etherpad.org/ in a FreeBSD-8.2 jail. (N.B: Things are reported not to work with newer versions.)
18
19This guide assumes, you have sudo, bash and an editor of your choice installed. Reserve around 2GB space for the jail. If you're using a different shell, use ``setenv`` to configure the environment variables set by ``export`` in this guide. Send feedback to `erdgeist <mailto:erdgeist-etherpad@erdgeist.org>`_. Many regards to `this guide <http://pauleira.com/13/installing-etherpad/>`_, it helped me a lot.
20
21----
22
23Install Scala + Java
24====================
25
26Since etherpad does not build under the version of scala that is shipped with FreeBSD-8.2 (i.e. scala-2.8.0), we have to manually install scala-2.7.7. However, scala brings nice dependencies that help with the manual installation of the jdk. So we install scala-2.8.0 to get the dependencies, then deinstall it and install java and scala.
27
28* Fetch jdk here: `<jdk-1.6.0.3p4_15.tbz>`_
29* Fetch scala-2.7.7 here: `<scala-2.7.7.tbz>`_
30
31Then type::
32
33 pkg_add -r scala
34 pkg_delete -f scala\*
35 pkg_add jdk-1.6.0.3p4_15.tbz scala-2.7.7.tbz
36
37----
38
39Install mysql, fastjar and java connector
40=========================================
41
42Type::
43
44 pkg_add -r mysql55-server mysql-connector-java fastjar
45 echo mysql_enable=YES >> /etc/rc.conf
46 /usr/local/etc/rc.d/mysql-server start
47
48----
49
50Prepare mysql
51=============
52
53Connection in a jail comes from the jail IP, not from 127.0.0.1, so enter IPADDRESS accordingly
54
55``mysql -u root``
56
57and in the mysql shell::
58
59 create database etherpad;
60 grant all privileges on etherpad.* to 'etherpad'@'IPADDRESS' identified by 'MYSQLPASS_CHANGEME';
61
62----
63
64Checkout etherpad
65=================
66
67Type::
68
69 pkg_add -r git
70 cd /usr/local
71 git clone git://github.com/ether/pad.git
72
73known good commit 94d5b2dfd65abbee5a06d80d94cdb00a7947d9b1, otoh: you might want to check `my issue about this commit <https://github.com/ether/pad/issues/293>`_, overlay windows are broken atm.
74
75----
76
77Configure etherpad
78==================
79
80Type::
81
82 cd /usr/local/pad/etherpad
83 cp etc/etherpad.localdev-default.properties etc/etherpad.local.properties
84
85and in your ``etc/etherpad.local.properties`` do:
86
87* Change: devMode = false
88* Change: etherpad.isProduction = true
89* Change: etherpad.proAccounts = true
90* Change: etherpad.adminPass = ADMINPASS_CHANGEME
91* Change: etherpad.isProduction = true
92* Change: etherpad.SQL_PASSWORD = MYSQLPASS_CHANGEME
93* Change: listen = 0.0.0.0:9000
94* Change: topdomains = pads.domain.tld,localhost
95* Change: customEmailAddress = admin@pads.domain.tld
96* Change: transportUseWildcardSubdomains = false
97* Change: useHttpsUrls = true
98
99Remember the passwords well, take special care about trailing spaces! Now setup your domain in the following files:
100
101* src/main.js
102* src/static/crossdomain.xml
103* src/etherpad/pro/pro_utils.js
104* src/etherpad/control/pad/pad_control.js
105* src/etherpad/control/global_pro_account_control.js
106
107To disable a per-pad quota, comment out the call to _checkPadQuota in src/etherpad/control/pad/pad_control.js
108
109----
110
111Rebuild the JAR
112===============
113
114Type::
115
116 export JAVA_HOME="/usr/local/jdk1.6.0/"
117 export JAVA="/usr/local/jdk1.6.0/bin/java"
118 export SCALA="/usr/local/share/scala-2.7.7/bin/scala"
119 export SCALA_HOME="/usr/local/share/scala-2.7.7/"
120 export SCALA_LIBRARY_JAR="/usr/local/share/scala-2.7.7/lib/scala-library.jar"
121 export PATH=/usr/local/share/scala-2.7.7/bin/:$PATH
122 export MYSQL_CONNECTOR_JAR="/usr/local/share/java/classes/mysql-connector-java.jar"
123 export mysql=mysql
124
125Rebuild the ace dependency
126--------------------------
127
128This is especially important if you see this (google hint): ``net.appjet.bodylock.JSRuntimeException: Error: Neither module exists: etherpad.collab.ace.easysync2, etherpad.collab.ace.easysync2.``::
129
130 cd /usr/local/pad/infrastructure/ace
131 bin/make normal etherpad
132
133Rebuild the JAR with correct settings
134-------------------------------------
135
136Type::
137
138 cd /usr/local/pad/etherpad
139 bin/rebuildjar.sh
140
141----
142
143Install nginx
144=============
145
146Type::
147
148 cd /usr/ports/www/nginx
149 make install clean
150
151and be sure to select HTTPS.
152
153----
154
155Create Self Signed Certificates
156===============================
157
158For whatever your domain is, substitute it in the following commands::
159
160 openssl genrsa -out pads.domain.tld.key 1024
161 openssl req -new -key pads.domain.tld.key -out pads.domain.tld.csr
162 echo "subjectAltName=DNS:pads.domain.tld,DNS:*.pads.domain.tld" >pads.domain.tld.conf
163 openssl x509 -req -days 365 -in pads.domain.tld.csr -signkey pads.domain.tld.key -text -extfile pads.domain.tld.conf -out pads.domain.tld.crt
164 cat pads.domain.tld.crt pads.domain.tld.key >/usr/local/etc/nginx/pads.domain.tld.pem
165
166----
167
168Configure nginx
169===============
170
171Nginx configs were provided by cryx. Thank you. Fetch ``nginx.conf`` here: `<nginx.conf>`_ and put it to ``/usr/local/etc/nginx/``. Then in your local ``nginx.conf`` do:
172
173* Change: server_name pads.domain.tld \*.pads.domain.tld; take special care to include the wildcard subdomains
174* Change: ssl_certificate pads.domain.tld.pem; as created above
175
176Fetch ``nginx-etherpad.conf`` here: `<nginx-etherpad.conf>`_ and put it to ``/usr/local/etc/nginx/``. Then in your local ``nginx-etherpad.conf`` do:
177
178* Change: server_name pads.domain.tld \*.pads.domain.tld; take special care to include the wildcard subdomains
179* Change: proxy_pass http://pads.domain.tld:9000/;
180
181Type::
182
183 mkdir /var/log/www/; chown www:www /var/log/www
184 echo nginx_enable=YES >> /etc/rc.conf
185
186----
187
188Install start script
189====================
190
191Fetch rc script here: `<etherpad>`_ and put it to ``/usr/local/etc/rc.d/``.
192
193Type::
194
195 chmod +x /usr/local/etc/rc.d/etherpad
196 echo etherpad_enable=YES >> /etc/rc.conf
197 mkdir /var/run/etherpad; chown etherpad /var/run/etherpad
198 chown -R etherpad:etherpad /usr/local/pad
199
200----
201
202Install openoffice
203==================
204
205If you want to export word and pdf documents, you need to install openoffice and run it as a headless service.
206
207Fetch the libreoffice package here: http://wiki.bsdforen.de/anwendungen/libreoffice_aus_inoffiziellen_paketen#freebsd_amd64i386_87-stable_kamikaze or, a know working mirror for `<libreoffice-3.3.3.tbz>`_, MD5 (libreoffice-3.3.3.tbz) = 028d259735b361e46af8a9e253f168a8.
208
209Install dependencies, ignore warnings about already installed older versions::
210
211 pkg_add -r xineramaproto xf86vidmodeproto xextproto videoproto renderproto randrproto printproto kbproto inputproto fixesproto dri2proto damageproto compositeproto font-util encodings libtextcat expat gnome_subr ca_root_nss hicolor-icon-theme gnomehier lp_solve python27 xcb-proto perl hu-hunspell poppler-data png lcms jpeg jbigkit tiff openjpeg jasper curl pkg-config xproto pixman libtasn1 libfontenc libXdmcp libXau libICE libSM freetype2 mkfontscale mkfontdir fontconfig font-misc-meltho font-misc-ethiopic font-bh-ttf bitstream-vera xorg-fonts-truetype pcre orc m4 libpthread-stubs libxcb xcb-util libdrm libX11 libXt libXrender libXft libXfixes libXext libXxf86vm libXv libXrandr libXpm libXp libXmu libXinerama libXi libXdamage libXcursor libXcomposite libXaw libGL libGLU libltdl libffi libcheck icu db41 libiconv libxml2 raptor rasqal redland gettext libgpg-error libgcrypt glib gamin gio-fam-backend shared-mime-info libIDL gdk-pixbuf desktop-file-utils dbus libgee dbus-glib eggdbus cairo poppler bison gobject-introspection gstreamer gstreamer-plugins polkit pango ORBit2 lzo2 gnutls cups-client atk gtk dconf gconf2 libgsf libwpd libwps libwpg libxslt
212
213Install the local package::
214
215 pkg_add -f libreoffice-3.3.3.tbz
216
217Fetch rc script here: `<soffice>`_ and put it to ``/usr/local/etc/rc.d/``. Then type::
218
219 chmod +x /usr/local/etc/rc.d/soffice
220 echo soffice_enable=YES >> /etc/rc.conf
221
222----
223
224Configure name server
225=====================
226
227Add records for the pads and wildcard subdomains, for tinydns this is::
228
229 +pads.domain.tld:192.168.0.23:43200
230 +*.pads.domain.tld:192.168.0.23:43200
231
232----
233
234Filter local services
235=====================
236
237Add rules to filter ports 9000 and 3306 to pf.