How to Install Collective Access - Providence on NixOS Latest

Collective Access - Providence is an open-source software for managing and publishing cultural heritage data developed by CollectiveAccess. In this tutorial, we will guide you through the process of installing Collective Access - Providence on NixOS Latest using the Nix package manager.

Prerequisites

Before proceeding, ensure that you have the following prerequisites:

Step 1: Update Your System

Ensure that your system is up to date by running the following command:

sudo nixos-rebuild switch --upgrade

Step 2: Create a NixOS Configuration

We will create a NixOS configuration file that includes all the necessary dependencies for Collective Access - Providence.

Create a new file named configuration.nix in the /etc/nixos/ directory by running the following command:

sudo nano /etc/nixos/configuration.nix

Add the following code to the configuration file:

# /etc/nixos/configuration.nix

{ config, pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    apacheHttpd
    mariadb
    php
    phpComposer
    imagemagick
    exiftool
    gawk
    sed
    wget
    tar
    gzip
  ];
  httpd.enable = true;
  services.httpd.documentRoot = "/var/www";
  services.httpd.directoryIndex = [ "index.php" ];
}

Once you have added the above code, save the file and exit.

Step 3: Install Collective Access - Providence

We will now download and install Collective Access - Providence using Composer.

Run the following command to download and install the software:

sudo composer create-project collectiveaccess/providence /var/www/providence

This command will download and install the latest version of Collective Access - Providence in the /var/www/providence directory.

Step 4: Configure Collective Access - Providence

We will now configure Collective Access - Providence to work with our server.

Create a new file named providence.conf in the /etc/httpd/vhosts.d/ directory using the following command:

sudo nano /etc/httpd/vhosts.d/providence.conf

Add the following code to the file:

# /etc/httpd/vhosts.d/providence.conf

<VirtualHost *:80>
  ServerName your_domain.com
  DocumentRoot /var/www/providence
  <Directory /var/www/providence>
    AllowOverride All
    Require all granted
  </Directory>
  ErrorLog /var/log/httpd/providence-error.log
  CustomLog /var/log/httpd/providence-access.log combined
</VirtualHost>

Replace your_domain.com with your server's domain name or IP address.

Once you have added the above code, save the file and exit.

Step 5: Start the Apache Server

We will now start the Apache server to run Collective Access - Providence.

Run the following command to start the Apache server:

sudo systemctl start httpd.service

To ensure that the server starts automatically at boot, run the following command:

sudo systemctl enable httpd.service

Step 6: Access Collective Access - Providence

You can now access Collective Access - Providence by entering your server's domain name or IP address in your web browser. The installation Wizard will start, which will guide you through the setup process.

Congratulations! You have successfully installed Collective Access - Providence on NixOS Latest using the Nix package manager.