How to Install Lila on OpenSUSE Latest
Lichess is a free and open-source online chess server that allows users to play chess games, participate in tournaments or solve puzzles. Lila is its chess variant engine that implements variants of chess like Crazyhouse or Antichess. In this tutorial, you will learn how to install Lila on OpenSUSE Latest.
Prerequisites
Before we begin, ensure that you have the following requirements:
A user account on the OpenSUSE Latest operating system with sudo privileges.
A stable internet connection.
Java Development Kit (JDK) installed on your server. To install, run:
sudo zypper install java-devel
Installation
We'll start by installing some dependencies:
sudo zypper install git-core gcc make sbtNext, we'll clone Lila's git repository:
git clone git://github.com/ornicar/lila.gitMove into the lila directory and create a new file
lila.conf:cd lila/ cp conf/lila.prod.conf conf/lila.conf nano conf/lila.confThe conf file is important. We'll edit it to reflect your domain and other settings.
In the conf file, change the following as needed:
domain = "your-domain.com" mongodb-uri = "mongodb://localhost:27017/lila"Make sure to replace
your-domain.comwith your actual domain name.Configure Lila. You can use the provided
conf/lila.prod.conffile as a reference but some adjustments will have to be made to suit your needs. Open the file in your preferred text editor:nano conf/lila.prod.confIn the file, modify the following lines:
play.crypto.secret = "abcdefghijk9908409285" lila.host = "your_domain_name:8080" # Replace "your_domain_name" with the actual domain name lila.port = play.http.port = 8080Build Lila with:
sbt buildThis may take some time.
Once the build is complete, start Lila with:
target/universal/stage/bin/lilaThis will web-serve Lila at
127.0.0.1:8080. We'll set Lila up to be accessible via its domain/UI web interface instead of the local IP. To do so, use a reverse proxy likenginx.Install
nginxand configure it to point to Lila:sudo zypper install nginx sudo nano /etc/nginx/nginx.confAdd the following inside the
serverblock:location / { proxy_pass http://127.0.0.1:8080; proxy_set_header X-Real-IP $remote_addr; add_header P3P 'CP="IDC CSS ADM DEVi TAIi PSAi \ IVAi IVDi CONi HISi TELi OUR \ SAMi IND ONL PUR COM NAV \ INT DEM CNT STA PRE LOC"'; add_header Access-Control-Allow-Origin *; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 300; }Save changes and restart
nginx:sudo systemctl enable nginx sudo systemctl start nginxYou should now be able to access Lila via
http://your-domain.comin your web browser.
Conclusion
In this tutorial, we installed and configured Lila on OpenSUSE Latest. You can now play chess, participate in tournaments and solve puzzles from your server.