CMS - OrdinBeta/IT-Landscape GitHub Wiki

CMS

Table of Contents

What is CMS?

A Content Management System (CMS) is a software application that allows users to create, manage, and modify content on a website without the need for specialized technical knowledge. It provides a user-friendly interface for managing digital content, including text, images, videos, and other multimedia elements. Popular CMS platforms include WordPress, Drupal, and Joomla. I have chosen to use Drupal because it's Belgian 🤠.

How to install a CMS?

Installing Drupal using Docker is (almost) straightforward. I'm going to presume you already have Docker and know how to use it.

Step 1: Create a docker-compose.yml file

First of, add the services below to your docker-compose.yml file.

services:

  drupal:
    image: drupal
    ports:
    - "8080:80"
    volumes:
    # - ./drupal/modules:/var/www/html/modules
    # - ./drupal/profiles:/var/www/html/profiles
    # - ./drupal/themes:/var/www/html/themes
    # - ./drupal/sites:/var/www/html/sites
    - /var/www/html/modules
    - /var/www/html/profiles
    - /var/www/html/themes
    - /var/www/html/sites
    depends_on:
      - db
    restart: always

  db:
    image: mariadb:latest
    environment:
      MARIADB_DATABASE: drupal
      MARIADB_USER: drupal
      MARIADB_PASSWORD: drupal
      MARIADB_ROOT_PASSWORD: test
    volumes:
      - ./mariadb/data:/var/lib/mysql
    restart: always

  adminer:
    image: adminer
    restart: always
    ports:
      - 8081:8080
    depends_on:
      - db

Step 2: Get default.settings.php & settings.php files

You need a default.settings.php & settings.php file for Drupal to work properly. This is normally included, but when you use a bind mount, it will become obscured. So we need to copy it from the container to our local machine. Run the following commands below. Take note of the / & \! These commands are for a windows pc.:

# Make folder first
mkdir drupal\sites\default

# Start the containers
docker compose up -d

# Get the container ID of the drupal container
docker ps

# Copy the default.settings.php file from the container to your local machine
docker cp <container_id>:/opt/drupal/web/sites/default/default.settings.php ./drupal/sites/default/default.settings.php

# Make a copy of the default.settings.php file
copy .\drupal\sites\default\default.settings.php .\drupal\sites\default\settings.php

# Shutdown the containers
docker compose down

Switch over the commented section in the docker-compose.yml file in the drupal service. (And save it!)

    volumes:
    - ./drupal/modules:/var/www/html/modules
    - ./drupal/profiles:/var/www/html/profiles
    - ./drupal/themes:/var/www/html/themes
    - ./drupal/sites:/var/www/html/sites
    # - /var/www/html/modules
    # - /var/www/html/profiles
    # - /var/www/html/themes
    # - /var/www/html/sites

Then docker compose up -d.

Step 3: Configure Drupal

Go to http://localhost:8080 in your web browser. You should see the Drupal installation page. Follow the instructions to set up your site.

  • language: Choose your preferred language.
  • profile: standard
  • Set up database:
    • Database name: drupal
    • Database username: drupal
    • Database password: drupal
    • Advanced options:
      • Host: db
      • Leave the rest as they are.

Drupal Database settings

If everything goes well, you should arrive at the Site Configuration page. Here you can set the site name, email address, and other settings. When you're done, click on the Save and continue button.

Configure your site

Finally, you have a working Drupal installation

Placeholder Drupal Site

How to use a CMS?

Als ik nog tijd heb doe ik dees nog, anders is het voor het herexamen. 🤣🤣🤣🤣🤣🤣

Sources