|
|
|
|---|
| ⇦ | Installation | |||
|---|---|---|---|---|
Prerequisites for InstallationIn this chapter we describe the necessary prerequisites for installing Focus™. Client-sideOne of the modern operating systems in reasonably-recent versions (Windows, MacOS, Linux, iOS, Android). HostingFocus™ requires a physical, virtual or containerized server to install on. ArchitectureAny modern CPU architecture, on which a Go™ compiler is available, can be used. Operating SystemFocus™ has been developed on a declarative Linux operating system (NixOS) and is officially supported only on Linux in general. Go™ CompilerYou will need an installed version of the Go™ compiler (1.17 or above). SQL DatabaseFocus™ needs to access an installed version of MySQL or MariaDB with enabled local access by TCP/IP (127.0.0.1) and the associated database server “root” account & password. E-Mail ServerYou require an installed SMTP-capable e-mail server (eg. Exim4), which is configured to receive SMTP-based e-mail via port 25 from “localhost” and capable of sending e-mail to other SMTP servers on the Internet (needed for registration of new players or recovering a lost certificate). Memory and Disk SpaceWe recommend to have at least 4 GB of main memory available and about 32 GB of disk space. User AccessFocus™ can be installed with user privileges on an operating system. NetworkIt is possible to install Focus™ locally without being connected to the Internet or a private network, but this defies (at least partially) its purpose as a collaborative web application. Examples: http://localhost:8080 (test installation without network connection) http://192.168.1.100:8080 http://www.mysite.org:8080 SSL and Proxying(needs more detailed Linux engineering knowledge) <VirtualHost *:443> ServerName www.mysite.org DocumentRoot /var/www/html/mysite.org SSLEngine on SSLCertificateFile /etc/letsencrypt/live/www.mysite.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.mysite.org/privkey.pem RewriteEngine On ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost> You can install the "Let’s Encrypt" tooling and obtain a valid SSL certificate with the following commands (example for a Debian Linux installation; you will need a registered functioning domain name before this will work; in this example "www.mysite.org"): apt-get install certbot python3-certbot-apache certbot certonly --apache -d www.mysite.org certbot renew --dry-run systemctl list-timers Further installation details are not part of this getting started guide, as they may vary wildly between the installations. # web server. webaddress = 192.168.0.5 webport = 8443 websslactive = true websslcert = fullchain.pem websslkey = privkey.pem Please note that if you want use “443” as SSL port, you need to start Focus™ with "root" privileges, which is NOT recommended. Some Examples based on Debian 11First make sure that "bullseye-backports" is uncommented in /etc/apt/sources.list. apt-get install joe mariadb-server exim4 golang-1.17 Afterwards edit /etc/profiles and add the following line at the end: export PATH=/lib/go-1.17/bin:${PATH}
Reconfigure Exim4 for Internet delivery: dpkg-reconfigure exim4-config Add the autostart file for the compiled executable (joe /etc/rc.local): ##!/bin/sh -e ## ## rc.local ## ## This script is executed at the end of each multiuser runlevel. ## Make sure that the script will "exit 0" on success or any other ## value on error. ## ## In order to enable or disable this script just change the execution ## bits. ## ## By default this script does nothing. ## Focus™ (start the interactive fiction engine) /root/focus/start.sh exit 0 Make the file executable and start the associated system service: chmod +x /etc/rc.local systemctl start rc-local Configure an optional MariaDB for UTF8 (joe /etc/mysql/conf.d/utf8.cnf): [mysqld] character-set-server=UTF8 [client] default-character-set=UTF8 MariaDB Tunings for very large installations (optimized for speed): joe /etc/mysql/mariadb.conf.d/50-server.cnf: max_allowed_packet = 64M query_cache_size = 64M innodb_buffer_pool_size = 4GB innodb_log_file_size = 1GB joe /etc/mysql/conf.d/mysqldump.cnf: max_allowed_packet = 64M Allow for MariaDB connections by all IP addresses. mysql -u root -p drop user 'root'@'localhost'; create user 'root'@'%' identified by 'password'; grant all privileges on *.* to 'root'@'%'; flush privileges; Now create a new database for Focus™. create database focus; use focus; create user 'melaniebush'@'localhost' identified by 'Test123!'; grant all privileges on focus.* to 'melaniebush'@'localhost'; flush privileges; Verify if you can successfully connect to your database "focus" as user "melaniebush" with password "Test123!": mysql -u melaniebush -p focus Installation and SetupDownload the latest installation bundle from the official Focus™ website: Installation bundles are named “focus_YYYY_MM_DD.tar” (with YYYY, MM and DD replaced by year, month and day of the release date). cd The directory will now contain another directory called "focus". Enter this directory by typing: cd focus If you want to better understand what directories and files you find here: Now open the Focus™ main configuration file with a text editor: nano focus.ini Go through all the configuration items line-by-line and take a closer look at the entries which need to be changed based on your installation environment. ./start.sh When starting for the first time, verify the startup output by typing: tail -f start.out Watch for any error messages. You can stop the Focus™ service again by typing: ps ax | grep focus (mark and copy the process id of the running process) kill [process id] But if startup of the service was successful, just keep it running. http://localhost:8080/ascabera The browser will ask you for confirmation to create the tables in your configured database instance. If you encounter other error messages (for example "create table"), check your configuration in "focus.ini" and make necessary corrections.
This will make the above initialization URL inaccessible. Congratulations! You are ready to use your own installation of Focus™. | ||||
1ms