How to Install Hauk on Ubuntu Server Latest

In this tutorial, we will guide you through the installation process of Hauk, a lightweight location-sharing app, on Ubuntu Server Latest. Hauk uses end-to-end encryption and allows you to share your location with others in real-time.

Prerequisites

Before installing Hauk, make sure you have the following:

Step 1: Install Required Dependancies

First of all, update your server with the latest packages:

sudo apt-get update 
sudo apt-get upgrade

After that, install the required dependencies using the following command:

sudo apt install apache2 libapache2-mod-php php-sqlite3 composer

Step 2: Download and Configure Hauk

  1. Start by moving to the /var/www directory:

    cd /var/www
    
  2. Clone the Hauk GitHub repository:

    git clone https://github.com/bilde2910/Hauk.git
    
  3. Change the directory to the newly created Hauk directory:

    cd Hauk
    
  4. Install all the required dependencies:

    composer install --no-dev
    
  5. Rename the config.example.php file to config.php:

    mv config.example.php config.php
    
  6. Edit the config.php file and update the following variables based on your domain name:

    $base_uri = "https://example.com/Hauk";
    $secret_key = "q3DSyX9fj2muzPghcv5BRZpxt78M6KLW";
    

Replace example.com with your domain name and secret_key with a unique key. Save the file and exit.

  1. Next, we need to create the store directory:

    sudo mkdir -p /var/www/Hauk/store
    sudo chown -R www-data: /var/www/Hauk/store
    

Step 3: Configure Apache Web Server

  1. Create a new Apache virtual host configuration file for Hauk:

    sudo nano /etc/apache2/sites-available/hauk.conf
    
  2. Add the following configuration to the file:

    <VirtualHost *:80>
          ServerName example.com
          Redirect permanent / https://example.com/
    </VirtualHost>
    
    <VirtualHost *:443>
          ServerName example.com
          DocumentRoot /var/www/Hauk
          ErrorLog /var/log/apache2/error.log
          CustomLog /var/log/apache2/access.log combined
          SSLEngine on
          SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
          SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
    </VirtualHost>
    

    Make sure to replace example.com with your domain name.

  3. Enable the virtual host configuration:

    sudo a2ensite hauk.conf
    
  4. Restart the Apache web server:

    sudo systemctl restart apache2
    

Step 4: Install Certbot SSL Certificate

  1. Install Certbot:

    sudo apt install certbot python3-certbot-apache
    
  2. Obtain SSL certificate:

    sudo certbot --apache -d example.com
    

    This command will obtain an SSL certificate for your domain name using Apache.

  3. Verify that SSL certificate is enabled:

    sudo nano /etc/apache2/mods-enabled/ssl.conf
    

    The file should contain the following lines:

    <IfModule mod_ssl.c>
            SSLRandomSeed startup builtin
            SSLRandomSeed connect builtin
            SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
            SSLCipherSuite TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
            SSLHonorCipherOrder off
    </IfModule>
    

    Save the file and exit.

Step 5: Verify Installation

Open your web browser and navigate to your domain (https://example.com/Hauk). You should see the Hauk login page. Enter the secret key and click on 'Continue'. You should now see the Hauk dashboard.

Congratulations! You have successfully installed Hauk on Ubuntu Server Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!