Skip to content

Installation

Rick van der Zwet edited this page May 18, 2023 · 40 revisions

Classic Setup

There are two ways to get the source of Hashtopolis:

  • Clone the full repository to the location on the web server where it should run, protect the directories which are outside of src and keep the git repository intact.
  • Download the bundled version (https://archive.hashtopolis.org/server) which only contains the files which are required to run Hashtopolis (without CI and doc folder), extract it at the desired location.

NOTE: If you don't use one of these ways, updates will not be possible to applied directly. If you're hesitating to download the bundled version, you can bundle it yourself from the repository by navigating into the ci/ directory and run ./bundle.sh. With the created zip you then can proceed the same as with the bundle download.

Please check that you have the proper permissions set on files and folders within Hashtopolis' webroot.

After the above is complete navigate to your Hashtopolis URL with your favorite browser and you should automatically be forwarded to the installation procedure.

Docker Setup

IMPORTANT Instructions not ready yet

With the release of version 0.14.0 the default installation method for Hashtopolis has been changed from using the bundled version to using Docker images. Currently, the Docker images are not hosted yet at the docker-hub, so you have to built them yourself.

Requirements:

  1. Clone the web-ui repo: git clone https://github.com/hashtopolis/web-ui.git
  2. cd web-ui
  3. Build the web-ui repo and tag it docker build . -t hashtopolis-web-ui:latest
  4. Move one directory back cd ..
  5. Clone the server repo: git clone https://github.com/hashtopolis/server.git
  6. cd server
  7. Switch to docker branch git checkout feature/docker-install
  8. Check output of file docker-entrypoint.sh if it mentions 'with CRLF line terminators' your git checkout is converting line-ending on checkout, which is causing issues for files within the docker container. This is common behaviour for example within Windows (WSL) instances, to fix:
    1. git config core.eol lf
    2. git config core.autocrlf input
    3. git rm -rf --cached .
    4. git reset --hard HEAD
    5. Check output of file docker-entrypoint.sh is should output: 'docker-entrypoint.sh: Bourne-Again shell script, ASCII text executable'
  9. Copy the env.example and edit the values to your likings cp env.example .env
  10. Build the server docker image docker compose build
  11. Start everything docker compose up
  12. Access the new Hashtopolis UI through: http://127.0.0.1:8080 and the new Hashtopolis UI through http://127.0.0.1:4200 using the credentials (user=admin, password=hashtopolis)

Without Docker

This method is not supported and only here to give some guidance. It recommended way to deploy Hashtopolis from version 0.14.0 is to use Docker.

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
sudo a2enmod rewrite

Secure the mysql installation by running mysql_secure_installation

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

Unzip the release zip to and change the ownership

sudo unzip server-x.x.x.zip -d /var/www/
sudo mv /var/www/server-x.x.x /var/www/hashtopolis-server
sudo chown -R www-data:www-data /var/www/hashtopolis-server

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

New Angular web-ui

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-web-ui/
sudo cp -r dist/* /var/www/hashtopolis-web-ui/
sudo chown -R www-data:www-data /var/www/hashtopolis-web-ui/

sudo vi /etc/apache2/site-enabled/000-default.conf
# Replace the file with roughly the following contents
<VirtualHost *:8080>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/hashtopolis-server/src

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

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

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

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

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