Installing SeedDMS 6.x on FreeBSD 12

This guide will walk through the installation and basic config of SeedDMS 6.x, at time of writing 6.0.17.

It is being done on an already existing system, comprising:

  • FreeBSD 12.2
  • Nginx 1.20
  • PHP 7.4
  • MariaDB 10.5

SeedDMS' Sourceforge page can be found here

Installation steps

Pre-requisites

  1. Download the zip file containing SeedDMS to somewhere suitable on the system

  2. On FreeBSD systems the web root is usually

    /usr/local/www

    Please create a suitable directory to host SeedDMS at this (or an appropriate other path). For us do:

    mkdir /usr/local/www/seeddms
  3. There are a series of package dependencies that are required, on FreeBSD install these using the package manager pkg or from Ports. If you are using Poudriere you will need to make sure they have been built ahead of time, but Poudriere is out of scope of this guide. MariaDB, Nginx and PHP 7.4 have been included here for clarity.

    • mariadb105-client
    • mariadb105-server
    • nginx
    • php74
    • php74-bcmath
    • php74-mbstring
    • php74-mysqli
    • php74-gd
    • php74-pdo
    • php74-pdo_mysql

Setup MariaDB

  1. Log on to your MariaDB instance with an account that has sufficient rights to create a database & user account
  2. Create a table for SeedDMS. In this instance we shall create one called 'seeddms'
    MariaDB [(none)]> CREATE DATABASE seeddms;
  3. Create a user account. It will be used for the connection and to create the initial tables
    MariaDB [(none)]> CREATE USER 'seeddms'@'localhost' IDENTIFIED BY '<password>';

    If your MariaDB instance is not local, change the value of 'localhost' to the appropriate value for the web server running Nginx. Specify a good strong secure password and replace '<password>' with that value in the command above.

  4. Grant this account privileges to this new database and everything in it
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON seeddms.* TO 'seeddms'@'localhost' WITH GRANT OPTION;
  5. Reload the user privileges table
    MariaDB [(none)] FLUSH PRIVILEGES;

Configure Nginx site

Next we need to update the Nginx configuration. The plan here is to serve SeedDMS from it's own domain name 'seeddms.domain.com'. These steps assume:

  • There is already an existing working copy of Nginx
  • Multiple sites / vhosts are configured already, or Nginx is setup to use them
  • SSL will not be covered here, please adjust your config appropriately, these steps are simply to get it working
  • PHP-FPM is already installed and running, and is listening on a local socket
  1. On FreeBSD Nginx configuration files are kept here:
    /usr/local/etc/nginx

    with site specific ones frequently at

    /usr/local/etc/nginx/sites-available

    change to this location by entering this at the command line

    cd /usr/local/etc/nginx/sites-available
  2. Create a config file using vi by entering:
    vi seeddms.def
  3. In that file insert this as the contents

    # --
    # nginx SeedDMS site config
    # v1 - 2022-03-14 - Site for SeedDMS 6.x
    # --
    server {
       # basic parameters
       listen 80;
       server_name seeddms.domain.com;
       root /usr/local/www/seeddms/www;
       index index.php;
    
       # logging
       access_log /var/log/nginx/seeddms-access.log main;
       error_log /var/log/nginx/seeddms-error.log info;
       rewrite_log on;
    
       # DAV - disable any built in DAV methods in Nginx
       dav_methods off;
    
       # location specific
       # for webdav
       location ^~ /webdav/ {
          include /usr/local/etc/nginx/fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $document_root/webdav/index.php;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php-fpm.sock;
       }
    
       # all php files
       location ~ \.php$ {
          try_files $uri =404;
          include /usr/local/etc/nginx/fastcgi_params;
          fastcgi_index index.php;
          fastcgi_pass unix:/var/run/php-fpm.sock;
       }
    }
  4. Next we need to make the site available to Nginx. This is normally done by placing a link to this config in another location, namely:
    /usr/local/etc/nginx/sites-enabled

    To do this first change to this location:

    cd /usr/local/etc/nginx/sites-enabled

    and then create the link

    ln -s /usr/local/etc/nginx/sites-available/seeddms.def seeddms.conf
  5. Nginx can now be reloaded to pick up the new site
    service nginx reload

SeedDMS installation

  1. Change to the path for the webroot of where you wish to install SeedDMS. For us this is:
    cd /usr/local/www/seeddms
  2. Run the command
    tar xf </path/to/downloaded/seeddms/archive>

    This will extract the contents of the archive to the current location

  3. List the contents of the current path to see the extracted files:
    ls -AlF

    You will probably see a single directory:

    drwxr-xr-x   7 root  wheel   8 Mar 14 12:34 seeddms60x/
  4. This doesn't quite fit with how we want it laid out, so we'll start by relocating the contents of that directory to the current one. This can be done by using this command:
    mv seeddms60x/* .

    (Optional) Just in case there's any special files that start with a '.', this command will help move those as well:

    mv seeddms60x/.* .
  5. And now if we do a listing, it should look more like we're expecting:
    total 7
    drwxr-xr-x   2 root  wheel   4 Mar 14 12:34 conf/
    drwxr-xr-x   8 root  wheel   9 Mar 14 12:34 data/
    drwxr-xr-x   5 root  wheel   7 Mar 14 12:34 pear/
    lrwxr-xr-x   1 root  wheel  16 Mar 14 12:34 seeddms@ -> seeddms-6.0.17.1
    drwxr-xr-x  15 root  wheel  19 Mar 14 12:34 seeddms-6.0.17.1/
    drwxr-xr-x  14 root  wheel  17 Mar 14 12:34 www/
  6. The permissions are a problem however, Nginx does not have permission to do anything with any of these files. To fix that we need to use chown to change the owner for everything here and further down the tree to be the www account & group:
    chown -R www:www .
  7. Doing another listing and everything should look better
    total 7
    drwxr-xr-x   2 www  www   4 Mar 14 12:34 conf/
    drwxr-xr-x   8 www  www   9 Mar 14 12:34 data/
    drwxr-xr-x   5 www  www   7 Mar 14 12:34 pear/
    lrwxr-xr-x   1 www  www  16 Mar 14 12:34 seeddms@ -> seeddms-6.0.17.1
    drwxr-xr-x  15 www  www  19 Mar 14 12:34 seeddms-6.0.17.1/
    drwxr-xr-x  14 www  www  17 Mar 14 12:34 www/

SeedDMS Configuration

SeedDMS is capable of configuring itself through some guided installation steps

  1. Prior to being able to run through the installation, a final command on the command line is needed to allow us to configure SeedDMS using it's own configuration page. This involves the creation of a file to enable installation:
    touch conf/ENABLE_INSTALL_TOOL
  2. In a browser, navigate to the following page:
    http://seeddms.domain.com/install

    You should be presented with a simple welcome page similar to: SeedDMS-Install-1

Should it not load, double check the previous two sections on Nginx config and SeedDMS installation It may not look right, but this is just due to paths that need to be changed from their defaults, this will be covered in subsequent steps

  1. Once ready, click on 'Start installation' at the bottom and you should be presented with SeedDMS-Install-2

As per the message at the top, the Root directory has been updated to fit the installation path. This is also why the page looks much more like it should. Most of the following paths are now set with good defaults, and shouldn't need changing. The Database settings however, do.

  1. First, change the 'Database Type' field to 'mysql'

  2. Next, in the 'Server Name' field, enter 'localhost'. If your MariaDB server is on a remote host, enter that value instead

  3. For 'Database' enter 'seeddms', the name we gave the database when we set it up earlier

  4. For 'Username' and 'Password' again enter the details supplied when the database was set up earlier

  5. Finally, tick the box at the bottom that reads 'Create database tables'

  6. The values should now look similar to this (password left blank here, make sure the relevant password has been entered) SeedDMS-Install-3

  7. When ready, and all the details are correct, click on 'Apply'

  8. All being well, you should now be taken to the next screen, where it reports installation successfully completed SeedDMS-Install-4

  9. A final tidy up step, remove the file we created in step one to disable the installer and permit normal usage

    rm conf/ENABLE_INSTALL_TOOL
  10. Click on the link 'Configure more settings' and it should take you to the main logon screen SeedDMS-MainLogon

  11. Logging in with the default credentials should now show you the main set of additional settings SeedDMS-MainSettings

There are too many to describe them all, however the ones shown here will allow you to change the name of the site & the foot note which appears at the bottom of each page

  1. At the very bottom of this page is a 'Save' button you will need to use to save any changes
  2. Clicking on 'SeedDMS' at the top left (or alternative text if you've renamed the site) acts like a Home button and takes you back to the main screen. By default it looks similar to this SeedDMS-Homepage

You should now have a working version of SeedDMS installed. There is plenty of advanced configuration that can be done to make it work better for you, look out for further guides on these.

Previous Post Next Post

Add a comment

Comments

fTQiaWRouC
Written on Fri, 05 Jan 2024 19:46:57 by xbCIjEkMvPTNpB
amzCvZIsUBgFVRO
Written on Fri, 05 Jan 2024 19:46:56 by gmfsREtHz
dEZmXyYbM
Written on Wed, 13 Dec 2023 07:46:55 by aoKLjitmCDsI
sOnoeSPlhCb
Written on Wed, 13 Dec 2023 07:46:53 by QEuOZNPk