Web Application Server built around the relational data model described in [1]. Text based content, e.g. HTML, Javascript, CSS, GraphViz, JSON is created with the template language described in [2]. Other type of content is created with dedicated Java servlets. Jetty is the default servlet engine. Command line scripts are written in Bash, Python, Make and Ant.
Start the installation with a clone of this repo.
git clone https://github.com/TheOtherMarcus/Biotope.git
Download Jetty [3], extract the archive in the Biotope directory and create a symlink with the name jetty
to it.
cd Biotope
wget http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.6.v20170531/jetty-distribution-9.4.6.v20170531.tar.gz
tar xvf jetty*
rm jetty*.tar.gz
ln -s jetty* jetty
Enable basic HTTP authentication in Jetty [4]. Edit jetty/etc/jetty.xml and add the following at the bottom.
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">Biotope Realm</Set>
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/passwd.properties</Set>
<Call name="start"></Call>
</New>
</Arg>
</Call>
Add users to the file jetty/etc/passwd.properties
. The security roles used by Biotope are reader
and writer
.
guest: yourewelcome,reader
admin: CRYPT:adgc01se8haby9,reader,writer
Encrypted passwords can be generated by a Jetty utility.
java -cp jetty/lib/jetty-http-9.2.10.v20150310.jar:jetty/lib/jetty-util-9.2.10.v20150310.jar org.eclipse.jetty.util.security.Password USERNAME PASSWORD
Install Java and Ant. Make sure you have java 8 selected among the alternatives.
sudo apt-get install openjdk-8-jdk ant
sudo update-alternatives --config java
Install the Biotope servlets in Jetty.
cd servlets
ant deploy
cd ..
Install PostgreSQL.
sudo apt-get install postgresql
Create the database. This is typically performed by the postgres user.
sudo su - posgtgres
createuser -P -S -R -D biotope
Enter password for new role: biotope
createdb -O biotope -E UTF8 biotope
exit
Create the collations you need for correct text handling (e.g. sorting) in PostgreSQL. This also tests that postgres server accepts socket connections from localhost, which is necessary for Biotope to work. You may need to add the locale at the OS level first.
# sudo dpkg-reconfigure locales
psql -h localhost --user biotope biotope
Password for user biotope: biotope
CREATE COLLATION sv_se (LOCALE = 'sv_SE.utf8');
\q
Install Python libraries.
sudo apt-get install python-psycopg2
Install the default content.
make
Install GraphViz.
sudo apt-get install graphviz
Visualize the databse schema.
./schema.sh
make
Start Jetty.
cd jetty
java -jar start.jar