Skip to content

Installation

Gijsbert edited this page Dec 26, 2022 · 4 revisions

Ubuntu install

This guide will show you how to install Argus on a Ubuntu 22.04 VM. This guide will assume basic knowledge of Linux.

Requirements

Dependency Installation

# Update repositories list
apt update

# Install Dependencies
apt -y install software-properties-common curl certbot apt-transport-https ca-certificates gnupg php8.1 php8.1-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb-server nginx tar unzip git redis-server

Install Composer

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Clone Argus

git clone https://github.com/DutchIS/Argus.git /var/www/argus
cd /var/www/argus

Database Configuration

Change yourPassword with a secure password.

mysql -u root -p

CREATE USER 'argus'@'127.0.0.1' IDENTIFIED BY 'yourPassword';
CREATE DATABASE argus;
GRANT ALL PRIVILEGES ON argus.* TO 'argus'@'127.0.0.1';
exit;

Set enviroment variables

cp .env.example .env
nano .env

Set Encryption key

Only do this on your first install.

php artisan key:generate --force

Install Packages and build

composer install --no-dev --optimize-autoloader
npm i --production
npm run build

Set permissions

chmod -R 755 storage/* bootstrap/cache/
chown -R www-data:www-data /var/www/argus/*

Migrate database

php artisan migrate --force

Cron configuration

Edit your cron configuration with sudo crontab -e and paste the following

* * * * * php /var/www/argus/artisan schedule:run >> /dev/null 2>&1

Create SSL certificate

sudo certbot certonly

NGINX configuration

rm /etc/nginx/sites-enabled/default

Add configuration file

Use sudo nano /etc/nginx/sites-available/argus.conf to edit your config. Change <domain> to your domain name.

server {
    listen 80;
    server_name <domain>;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name <domain>;

    root /var/www/argus/public;
    index index.php;

    access_log /var/log/nginx/argus.app-access.log;
    error_log  /var/log/nginx/argus.app-error.log error;

    ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
    ssl_session_cache shared:SSL:10m;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
    ssl_prefer_server_ciphers on;

    # See https://hstspreload.org/ before uncommenting the line below.
    # add_header Strict-Transport-Security "max-age=15768000; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header Content-Security-Policy "frame-ancestors 'self'";
    add_header X-Frame-Options DENY;
    add_header Referrer-Policy same-origin;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_PROXY "";
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        include /etc/nginx/fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

Load new NGINX configuration

sudo ln -s /etc/nginx/sites-available/argus.conf /etc/nginx/sites-enabled/argus.conf

sudo systemctl restart nginx

Finished!

You can now access Argus from your domain name. Visit /dashboard to start configuring Argus.

Clone this wiki locally