Directus is a free and open source content management framework that provides a feature-rich environment for rapid development and management of custom MySQL database solutions.
View the Directus documentation here:
- Apache HTTP Server
- MySQL Server
- PHP >5.2
- Git
- Composer
You will need to setup a local *AMP enviroment (Apache, MySQL and PHP) in order to test Directus. *AMP packages can be found for different platforms:
You will need Git to keep your test version of Directus up to date. Unless you already have Git installed, you can download it from here.
Create a directory named "directus" in the www root. Next, open the directory in the terminal and type:
$ git init
$ git clone https://github.com/RNGR/directus6
Directus uses composer to handle its php dependencies. Go to the directus/api/
folder and install composer:
$ curl -s https://getcomposer.org/installer | php
Then install the dependencies by executing:
$ php composer.phar install
The AMP-packages listed above all include Phpmyadmin. The following three steps need to be completed in order to setup the database
- Create the database
- Databases -> Create Database
- Type directus as name and select utf8_general_ci as Collation.
- Create a user
- Once you've created the database it will be visible in the left column – open it by clicking it.
- Privileges -> Add user
- Fill in username and password. Leave the other fields as defaults.
- Import the database schema
- Import->File to Import->Choose file
- Open directus/directus.sql
- Press Go
Open directus/api/config_sample.php
Add the database username and password from Step 5 to DB_USER and DB_PASSWORD. Save the file as directus/api/config.php
define('DB_USER', 'myusername');
define('DB_PASSWORD', 'mypassword');
This requires configuring your Storage Adapters. Currently the best way to do this is to manually edit the directus_storage_adapters
table using a SQL client.
By default, directus.sql
should contain two storage adapters out of the box, with the DEFAULT
and THUMBNAIL
roles, both using the FileSystemAdapter
(meaning these will map to your local hard drive).
Simply define the destination
(absolute path) and url
(equivalent URL to the same directory) parameters of each of these records. For example, using a MAMP setup, you might define them this way:
UPDATE `directus_storage_adapters` SET `destination` = '/Applications/MAMP/htdocs/directus-media/', `url` = 'http://localhost:8888/directus-media/' WHERE `directus_storage_adapters`.`id` = 1;
UPDATE `directus_storage_adapters` SET `destination` = '/Applications/MAMP/htdocs/directus-media-thumbnails/', `url` = 'http://localhost:8888/directus-media-thumbnails/' WHERE `directus_storage_adapters`.`id` = 2;
Open directus by navigating to the path directus in your local host. Log in using the default user admin@getdirectus.com and password admin