Skip to content

Latest commit

 

History

History
109 lines (75 loc) · 2.95 KB

File metadata and controls

109 lines (75 loc) · 2.95 KB

Prerequisites

The MOT is built on Drupal. You need to have PHP and composer installed. PHP 8.4 is not supported, make sure to install stable PHP 8.3.

Clone the repository

git clone <repo-url> mot
cd mot

Install dependencies

composer install

If you encounter installation errors, please be sure the following PHP extensions are enabled in your php.ini file: gd, zip, pdo_sqlite.

Local development environment

The production environment uses an external database which requires special settings but for development purposes you can simply use the built-in default Drupal sql.lite setup which is enough to test code changes locally.

Here are some simple steps to get you started:

Create an empty .env file:

touch .env

Start MOT:

php web/core/scripts/drupal quick-start

A browser window should open with the MOT website, you can find the login credentials in the output for the above command. The database is empty though.

IMPORTANT NOTE: When submitting PRs from this setup be careful not to include the web/sites/default/settings.php file.

Populate database with Models

Once MOT is up & running, run this command to populate the database with models.

vendor/bin/drush scr scripts/sync_models.php

Advanced/Production Settings

Create .env file

Define these environment variables in the .env file:

DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
DB_PORT=
HASH_SALT=
TRUSTED_HOST=

Environment variables:

  • DB_HOST: The hostname or IP address of your database server.
  • DB_USER: The username for your database.
  • DB_PASS: The password for your database user.
  • DB_NAME: The name of your database.
  • DB_PORT: The port number your database server is listening on (default is usually 3306 for MySQL).
  • HASH_SALT: A unique, random string used for securing passwords and other sensitive data in Drupal. This should be a long and complex string.
  • TRUSTED_HOST: The host used to access the MOT; e.g. mot\.isitopen\.ai

Configure settings

Copy the default settings file:

cp ./web/sites/default/mot.settings.php ./web/sites/default/settings.php

Update settings.php to reflect your environment if needed.

Configure webserver

Ensure the document root is pointed to the mot/web directory.

Below is an example of what an Apache virtual host configuration may look like:

<VirtualHost *:80>
    ServerName mot.local
    DocumentRoot /path/to/your/repo/mot/web
    <Directory /path/to/your/repo/mot/web>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/mot-error.log
    CustomLog ${APACHE_LOG_DIR}/mot-access.log combined
</VirtualHost>

Install Drupal/ MOT

Visit the site in your browser (e.g., http://mot.local) to complete the MOT installation process.

Follow the on-screen instructions.