How to Install Hauk on Debian Latest

This tutorial will guide you step-by-step on how to install Hauk on Debian Latest. Hauk is a free and open-source location sharing web application that you can use to share your GPS location in real-time with others.

Prerequisites

Before we begin, you will need the following:

Step 1: Install Required Packages

First, update your system by running the following command:

apt-get update && apt-get upgrade

Now, install the required packages:

apt-get install git curl wget nginx php-fpm php-curl php-xml php-mysql php-zip php-mbstring

Step 2: Install MariaDB

Hauk requires a database to store location data. We will use MariaDB for this purpose. Install MariaDB by running the following command:

apt-get install mariadb-server

After the installation is complete, start the MariaDB service:

systemctl start mariadb

And enable it to start at boot time:

systemctl enable mariadb

Now, run the MariaDB secure installation script to secure your database:

mysql_secure_installation

Follow the prompts and set a strong root password, remove anonymous users, disallow remote root login, and remove test databases.

Step 3: Create a Database and User

Next, create a database and user for Hauk. Log in to the MariaDB server as the root user:

mysql -u root -p

Create a database named "hauk" by running the following SQL command:

CREATE DATABASE hauk;

Create a user named "haukuser" with a strong password by running the following command:

CREATE USER 'haukuser'@'localhost' IDENTIFIED BY 'password';

Grant all privileges on the "hauk" database to the "haukuser" user by running the following command:

GRANT ALL PRIVILEGES ON hauk.* TO 'haukuser'@'localhost';

Flush the privileges to apply the changes:

FLUSH PRIVILEGES;

Exit the MariaDB shell:

exit

Step 4: Install Hauk

Now, it's time to install Hauk. Clone the Hauk repository from GitHub:

git clone https://github.com/bilde2910/Hauk.git /var/www/hauk

Change the ownership of the "hauk" directory to the Nginx user and group:

chown -R www-data:www-data /var/www/hauk

Step 5: Configure Nginx

Create a new Nginx server block for Hauk:

nano /etc/nginx/sites-available/hauk.conf

Add the following configuration:

server {
    listen 80;
    server_name yourdomain.com;

    # Redirect all HTTP traffic to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate /etc/ssl/certs/yourdomain.com.crt;
    ssl_certificate_key /etc/ssl/private/yourdomain.com.key;

    root /var/www/hauk/web;

    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}

Replace "yourdomain.com" with your domain or subdomain name, and change "/etc/ssl/certs/yourdomain.com.crt" and "/etc/ssl/private/yourdomain.com.key" to the paths of your SSL certificate and key files.

Save and close the file.

Enable the Hauk server block by creating a symbolic link:

ln -s /etc/nginx/sites-available/hauk.conf /etc/nginx/sites-enabled/

Test the Nginx configuration:

nginx -t

If the configuration is valid, restart the Nginx service:

systemctl restart nginx

Step 6: Configure Hauk

Copy the "config.sample.inc.php" file to "config.inc.php":

cp /var/www/hauk/config.sample.inc.php /var/www/hauk/config.inc.php

Edit the "config.inc.php" file:

nano /var/www/hauk/config.inc.php

Change the following parameters:

$db["type"] = "mysql";
$db["user"] = "haukuser";
$db["pass"] = "password";
$db["name"] = "hauk";

Replace "haukuser" and "password" with the database user and password you created earlier.

Set your domain or subdomain name as the "domain" parameter:

$config["domain"] = "yourdomain.com";

Save and close the file.

Step 7: Test Hauk

Finally, open a web browser and navigate to your domain or subdomain name. You should see the Hauk login screen. Log in with the default username "admin" and password "admin".

That's it! You have successfully installed Hauk on Debian Latest. You can now start sharing your GPS location with others in real-time.

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!