Skip to content

Install without Docker

festanie edited this page Apr 8, 2024 · 1 revision

This method is not supported and only here to give some guidance. The recommended way to deploy Hashtopolis, from version 0.14.0 and up, is to use Docker. Consult the Installation page.

OS Ubuntu 22.04

Install the requirements

sudo apt update && sudo apt upgrade
sudo apt install mysql-server
sudo apt install apache2
sudo apt install libapache2-mod-php php-mysql php php-gd php-pear php-curl
sudo apt install git unzip curl
sudo a2enmod rewrite

Secure the mysql installation by running mysql_secure_installation

Setup database

sudo mysql 
CREATE DATABASE hashtopolis;
CREATE USER 'hashtopolis'@'localhost' IDENTIFIED BY '<PASSWORD HERE>';
GRANT ALL PRIVILEGES ON hashtopolis.* TO 'hashtopolis'@'localhost' WITH GRANT OPTION;
exit

Configuration

You may want to increase these PHP parameters to accommodate your intended usage.

sudo nano /etc/php/8.1/apache2/php.ini
...
memory_limit = ...
upload_max_filesize = ...
post_max_size = ...
...

In order to leverage the usage of TCP sessions in the python client, the timeout of the server needs to be set to something higher than your status update time (5s by default) (in Apache2 the timeout is 5s by default). For Apache2 you need to add/modify following setting:

sudo nano /etc/apache2/apache2.conf
...
KeepAliveTimeout 10
...

Install Hashtopolis

Download the release bundle from: https://github.com/hashtopolis/server/releases

wget https://github.com/hashtopolis/server/archive/refs/tags/vx.x.x.zip -O server-x.x.x.zip

Unzip the release zip

unzip server-x.x.x.zip
sudo mv server-x.x.x/ /var/www/hashtopolis-backend

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo composer install --working-dir=/var/www/hashtopolis-backend

Point your Apache config towards your Hashtopolis instance

sudo nano /etc/apache2/sites-enabled/000-default.conf
...
    DocumentRoot /var/www/hashtopolis-backend/src
...

Set the database password in a config file

sudo nano /var/www/hashtopolis-backend/src/inc/conf.php
<?php
//START CONFIG
$CONN['user'] = 'hashtopolis';
$CONN['pass'] = '<PASSWORD HERE>';
$CONN['server'] = 'localhost';
$CONN['db'] = 'hashtopolis';
$CONN['port'] = '3306';

$DIRECTORIES = [
  "files" => "/var/www/hashtopolis-backend/files/",
  "import" => "/var/www/hashtopolis-backend/import/",
  "log" => "/var/www/hashtopolis-backend/log/",
  "config" => "/var/www/hashtopolis-backend/config/",
];
//END CONFIG

Create the Hashtopolis user, setup database and fix permissions

sudo php -f /var/www/hashtopolis-backend/src/inc/load.php
sudo chown -R www-data:www-data /var/www/hashtopolis-backend
sudo systemctl restart apache2

All done! Access Hashtopolis via port 80: http://localhost/

New Angular web-ui

The new web-ui is currently in preview! When enabling this, everyone using the new web-ui will become full admin user!!!

Download the web-ui release via https://github.com/hashtopolis/web-ui/releases Unzip the release and open a terminal inside the web-ui folder

unzip web-ui-x.x.x.zip
cd web-ui
# Install nodejs, see https://github.com/nodesource/distributions#debinstall
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Angular and the dependencies
npm install

# Edit the application file to point it to the hashtopolis server:
sed -i 's/localhost:8080/<ip of hashtopolis backend server>:8080/g' src/config/default/app/main.ts

# Build a package to be used with apache
npm run build
sudo mkdir -p /var/www/hashtopolis-frontend/
sudo cp -r dist/* /var/www/hashtopolis-frontend/
sudo chown -R www-data:www-data /var/www/hashtopolis-frontend/

sudo nano /etc/apache2/sites-enabled/000-default.conf
# Replace the file with roughly the following contents
# IMPORTANT, if you don't set the HASHTOPOLIS_APIV2_ENABLE environment variable in the config. The APIv2 will not be enabled!
<VirtualHost *:8080>
        
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/hashtopolis-backend/src/

        SetEnv HASHTOPOLIS_APIV2_ENABLE 1

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <Directory "/var/www/hashtopolis-backend/">
            AllowOverride All
        </Directory>
</VirtualHost>

<VirtualHost *:4200>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/hashtopolis-frontend

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
sudo nano /etc/apache2/ports.conf
# Replace the file with roughly the following contents:
Listen 8080
Listen 4200
sudo systemctl restart apache2

Video Tutorial (Thanks to winxp5421)

This is for Ubuntu 16.10 and for Hashtopolis release 0.13.1

Hashtopolis Install video