5

How To Install OpenRefine on a web server with Ubuntu 18.04

 2 years ago
source link: https://gist.github.com/felixlohmeier/0ec8b2e8241356ed52af072d9102b391
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How To Install OpenRefine on a web server with Ubuntu 20.04

OpenRefine is intended to be installed locally as a desktop application. Due to the client-server architecture it is also possible to install OpenRefine on a web server to share it with multiple users. This can be useful despite the missing user administration, e.g. temporarily for a workshop or permanently in a protected network.

Security warning

Can I somehow host OpenRefine for others to access ?

OpenRefine has no built-in security for multi-user or multi-tenant scenarios. OpenRefine has a single data model that is not shared, so there is a risk of columnar data operations being overwritten by other users, so care must be taken by users. Having said that, if you are inclined to proceed at your own risk, you can get some security by using a proxy.

https://github.com/OpenRefine/OpenRefine/wiki/FAQ

Installation (without Authentication)

Tested on Ubuntu 20.04 LTS

  1. Install Java 11 and Unzip
apt install openjdk-11-jre-headless unzip
  1. Configure Java to be behave better on cloud infrastructure
sed -i 's/securerandom.source=file:\/dev\/random/securerandom.source=file:\/dev\/urandom/' /etc/java-11-openjdk/security/java.security
  1. Install OpenRefine 3.5.0
mkdir /opt/openrefine
wget https://github.com/OpenRefine/OpenRefine/releases/download/3.5.0/openrefine-linux-3.5.0.tar.gz
tar -xzf openrefine-linux-3.5.0.tar.gz -C /opt/openrefine --strip 1
  1. Create a systemd service for OpenRefine (adjust memory if needed with parameter -m 3g)
adduser --system openrefine
echo "[Unit]
Description=OpenRefine
[Service]
User=openrefine
ExecStart=/opt/openrefine/refine -i 0.0.0.0 -m 3G
TimeoutStopSec=3600s
Restart=always
RestartSec=10
[Install]
WantedBy=default.target
" > /etc/systemd/system/openrefine.service
systemctl enable openrefine.service
systemctl start openrefine.service
  1. Redirect port 3333 to 80
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3333
apt install iptables-persistent

See also


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK