Installation

In this guide we will be installing Vegvisir on a Debian-based system with NGINX as the web server. The process should be similar for other configurations as well.

Please contact me if you need help

Prerequisites

  • PHP 8.0 or newer (PHP 8.3 is recommended)
  • A web server (NGINX is used in this guide)

Step 1: Clone the repo

Let's start by cloning Vegvisir to a folder. The code for Vegvisir will be separate from the code for your project.

I have cloned this into the folder /var/www/vegvisir but you can put it wherever you want.

Step 2: Install dependencies

Vegvisir only has one dependency, let's cd into our folder and install it with Composer.

Step 3: Configure virtual host

We will be pointing a virtual host to the /public/index.php file from the Vegvisir root directory.

Since your project files will live in a different directory, this can be set-and-forget.

Step 4: Create project folder

We're almost done here. We want to create a separate folder which will hold our project files.

Let's create a folder /var/www/my-website as an example - you can put this wherever you want!

Step 5: Point Vegvisir to project folder

Now let's finish up by pointing Vegvisir to the folder we just created.

Make a copy of the .env.example.ini file from Vegvisir's root directory and place it in the same spot as .env.ini

There is only one line we need to change inside the .env.ini file we just created. It should be the top most variable called root_path.

Change the value of this variable to an absolute path to your project root folder. In our case it will be /var/www/my-website.

Done!

That's all there is to it. Restart your webserver if you haven't and navigate to your published website.

If everything worked correctly, you should see a default landing page with a summary.


Static assets

Vegvisir will automatically serve anything that isn't a .php file under /public in your project directory as a static asset. You can for example put your robots.txt file under /public/robots.txt and it will be returned as a text/plain document.

While this works fine for smaller assets, they still have to be passed through the PHP CGI. This process is a bit slower than serving assets with your web server directly - and might be a lot slower for larger files.

To fix this, let's add an optional location block to our NGINX configuration which will handle assets. The process should be similar for other web servers - contact me if you need help.

Let's add the following location block to our NGINX virtual host that we set up in Step X.