Skip to content

PIC2BIM#

Hosting and Installing the Web Console#

Prepare Ubuntu Server#

sudo apt update && sudo apt upgrade -y

Install Docker and Docker Compose#

Install Docker#

sudo apt install docker.io -y

Install Docker Compose#

sudo apt install docker-compose -y

Start and enable Docker#

sudo systemctl enable docker
sudo systemctl start docker

Check Docker installation#

docker --version
docker-compose --version

Clone the project#

git clone git@github.com:buildvoc/PIC2BIM.git
cd <your-project-directory>

SSL#

Create a self-signed certificate for the nginx-server (only for development, for production use a real certificate):

mkdir ./ssl/certs
mkdir ./ssl/private
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./ssl/private/localhost.key -out ./ssl/certs/localhost.crt -config ./ssl/localhost.conf

Set Up Environment Variables for Docker and Laravel#

Docker#

cp .env.example .env
Note:
- For local development: NPM_COMMAND="npm install && npm run dev -- --host 0.0.0.0"
- For production: NPM_COMMAND="npm install && npm run build"

Laravel#

cp src/.env.example src/.env

Update File Permissions#

sudo chown -R laravel:laravel storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache

Build and Start the Docker Containers#

docker-compose up -d --build

Create Database#

Login to Adminer (https://yoursite:8091) with the credentials provided in the .env file for Docker.

  1. Create a database named PIC2BIM
  2. Select the public schema and execute:
    CREATE EXTENSION POSTGIS;
    

Run Laravel Setup#

Install Composer dependencies#

docker-compose run --rm composer install

Run Migration#

docker-compose run --rm artisan migrate

Run Seeders#

docker-compose run --rm artisan db:seed

Manual Hosting and Installation (Alternative)#

Hosting requirements#

  • PHP 7 engine
  • Composer v2
  • Postgres
  • Apache2 webserver
  • Node v20.17.0

Server resources requirements#

  • Minimum 8GB RAM
  • Minimum 2 core CPU
  • Minimum 10GB disk space

Installation Database#

  1. Install PostgreSQL database.
  2. Create a database named egnss4all.
  3. Import the provided Postgres dump file to initialize the database.

Installation steps for the Web Console and Web Services#

  1. Copy the Web Console files into the selected webroot directory.
  2. Create a VirtualHost section in the Apache2 configuration and point it to the selected directory.
  3. Ensure that the directive DirectoryIndex index.php is set.

Then, execute the following commands in the selected directory:

Create environment file#

cp .env.example .env

Generate application key#

php artisan key:generate

Edit database configuration in .env file#

DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=egnss4all
DB_USERNAME=username
DB_PASSWORD=password

Migrate database#

php artisan migrate

Install Laravel dependencies#

composer install

Install front end packages#

npm install

For development#

npm run dev

For production build#

npm run build

Finally, open the Web Console in your browser:
👉 http://your-domain.tld