REL-0.11 Configure documentation

This commit is contained in:
cytopia 2017-06-22 11:32:43 +02:00
parent 89524f5341
commit 66b58e5960
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
12 changed files with 372 additions and 154 deletions

View File

@ -68,6 +68,7 @@ So before you change to a new database version you will have to make a backup an
If you use the devilbox bundled tools, you will find all backups in the main directory under `./backups/`. If you use the devilbox bundled tools, you will find all backups in the main directory under `./backups/`.
## 2. MySQL ## 2. MySQL
#### 2.1 MySQL Database Backup #### 2.1 MySQL Database Backup
@ -202,7 +203,6 @@ $ docker-compose exec --user devilbox php mysqldump-secure
To find out more about the configuration and options of mysqldump-secure, visit its project page under: [https://mysqldump-secure.org](https://mysqldump-secure.org). To find out more about the configuration and options of mysqldump-secure, visit its project page under: [https://mysqldump-secure.org](https://mysqldump-secure.org).
##### 2.1.2 mysqldump ##### 2.1.2 mysqldump
**[mysqldump](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html)** is bundled with each PHP/HHVM container and ready to use. To backup a database named `my_db_name` follow the below listed example: **[mysqldump](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html)** is bundled with each PHP/HHVM container and ready to use. To backup a database named `my_db_name` follow the below listed example:
@ -229,7 +229,6 @@ If you do not like to use the command line for backups, you can use **[Adminer](
To find out more about the usage of Adminer, visit its project page under: [https://www.adminer.org](https://www.adminer.org). To find out more about the usage of Adminer, visit its project page under: [https://www.adminer.org](https://www.adminer.org).
#### 2.2 MySQL Database Restore #### 2.2 MySQL Database Restore
##### 2.2.1 mysql ##### 2.2.1 mysql
@ -279,7 +278,6 @@ devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/mysql/my_db_name.
#### 3.1 PostgreSQL Database Backup #### 3.1 PostgreSQL Database Backup
##### 3.1.1 pg_dump ##### 3.1.1 pg_dump
**[pg_dump](https://www.postgresql.org/docs/current/static/backup-dump.html)** is bundled with each PHP/HHVM container and ready to use. To backup a database named `my_db_name` follow the below listed example: **[pg_dump](https://www.postgresql.org/docs/current/static/backup-dump.html)** is bundled with each PHP/HHVM container and ready to use. To backup a database named `my_db_name` follow the below listed example:

View File

@ -18,56 +18,139 @@ Configure |
## Configure ## Configure
1. [Overview]() 1. [Overview](#1-overview)
2. [Devilbox general settings](#1-devilbox-general-settings) 1. [The devilbox `.env` file](#1-1-the-devilbox-env-file)
1. [Verbosity]() 2. [The devilbox `cfg/` directory](#1-2-the-devilbox-cfg-directory)
2. [Devilbox base path]() 3. [The operating system `hosts` file](#1-3-the-operating-system-hosts-file)
3. [Host computer listening address]() 4. [The operating system `resolv.conf` file](#1-4-the-operating-system-resolv-conf-file)
3. [Project settings]() 2. [Devilbox general settings](#2-devilbox-general-settings)
1. [Project domain]() 1. [Verbosity](#2-1-verbosity)
2. [Project path]() 2. [Devilbox base path](#2-2-devilbox-base-path)
4. [Container settings]() 3. [Host computer listening address](#2-3-host-computer-listening-address)
1. [General]() 3. [Project settings](#3-project-settings)
1. [Timezone]() 1. [Project domain](#3-1-project-domain)
2. [User id]() 2. [Project path](#3-2-project-path)
3. [Group id]() 4. [Container settings](#4-container-settings)
2. [PHP / HHVM]() 1. [General](#4-1-general)
1. [Xdebug]() 1. [Timezone](#4-1-1-timezone)
2. [php.ini]() 2. [User id](#4-1-1-user-id)
3. [HHVM]() 3. [Group id](#4-1-2-group-id)
3. [Webserver]() 2. [PHP / HHVM](#4-2-php-hhvm)
1. [Host port]() 1. [Select PHP version](#4-2-1-select-php-version)
4. [MySQL]() 2. [Xdebug](#4-2-2-xdebug)
1. [Root password]() 3. [php.ini](#4-2-3-php-ini)
2. [General Log]() 4. [HHVM](#4-2-4-hhvm)
3. [Host port]() 3. [Apache / Nginx](#4-3-apache-nginx)
4. [Data path]() 1. [Select Httpd version](#4-3-1-select-httpd-version)
5. [my.cnf]() 2. [Host port](#4-3-2-host-port)
5. [PostgreSQL]() 4. [MySQL](#4-4-mysql)
1. [Root user]() 1. [Select MySQL version](#4-4-1-select-mysql-version)
2. [Root password]() 2. [Root password](#4-4-2-root-password)
3. [Host port]() 3. [General Log](#4-4-3-general-log)
4. [Data path]() 4. [Host port](#4-4-4-host-port)
6. [Redis]() 5. [Data path](#4-4-5-data-path)
1. [Host port]() 6. [my.cnf](#4-4-6-my-cnf)
7. [Memcached]() 5. [PostgreSQL](#4-5-postgresql)
1. [Host port]() 1. [Select PostgreSQL version](#4-5-1-select-postgresql-version)
8. [MongoDB]() 2. [Root user](#4-5-2-root-user)
1. [Host port]() 3. [Root password](#4-5-3-root-password)
2. [Data path]() 4. [Host port](#4-5-4-host-port)
9. [Bind]() 5. [Data path](#4-5-5-data-path)
1. [Upstream resolver]() 6. [Redis](#4-6-redis)
2. [Host port]() 1. [Select Redis version](#4-6-1-select-redis-version)
5. [Intranet settings]() 2. [Host port](#4-6-2-host-port)
1. [DNS check timeout]() 7. [Memcached](#4-7-memcached)
6. [Host computer]() 1. [Select Memcached version](#4-7-1-select-memcached-version)
1. [Auto-DNS]() 2. [Host port](#4-7-2-host-port)
2. [/etc/hosts/]() 8. [MongoDB](#4-8-mongodb)
1. [Select MongoDB version](#4-8-1-select-mongodb-version)
2. [Host port](#4-8-2-host-port)
3. [Data path](#4-8-3-data-path)
9. [Bind](#4-9-bind)
1. [Upstream resolver](#4-9-1-upstream-resolver)
2. [Host port](#4-9-2-host-port)
5. [Intranet settings](#5-intranet-settings)
1. [DNS check timeout](#5-1-dns-check-timeout)
6. [Host computer](#6-host-computer)
1. [/etc/hosts](#6-1-etc-hosts)
2. [Auto-DNS](#6-2-auto-dns)
--- ---
## 1. Overview ## 1. Overview
There are only four things you can configure on your host computer.
#### 1.1 The devilbox `.env` file
All docker-compose configuration is done inside the `.env` file which simply defines key-value variables parsed to `docker-compose.yml`.
First thing to do after cloning this repository is creating this file from the `env-example`:
```shell
$ cp env-example .env
```
When you update the devilbox git directory, you should always check if `env-example` introduces new configuration options. You can do that by comparing the `env-example` file with your current `.env` file.
```shell
$ vimdiff env-example .env
```
You can get more information here:
> [What is the `.env` file?](https://docs.docker.com/compose/env-file/)
#### 1.2 The devilbox `cfg/` directory
Inside the devilbox root directory you will find a foder called `cfg/`. This will contain subdirectories in the form of `<SERVICE>-<VERSION>`. Those folders will be mounted into the appropriate location into the respective docker container in order to overwrite service configuration.
Currently only MySQL/MariaDB and PHP/HHVM overrides are supported.
The folder structure looks like this:
```
cfg/
hhvm-latest/
mariadb-10.0/
mariadb-10.1/
mariadb-10.2/
mariadb-10.3/
mariadb-5.5/
mysql-5.5/
mysql-5.6/
mysql-5.7/
mysql-8.0/
php-fpm-5.4/
php-fpm-5.5/
php-fpm-5.6/
php-fpm-7.0/
php-fpm-7.1/
php-fpm-7.2/
```
Each of the folders will contain an example file in the following format:
```
devilbox-custom.<ext>-example
```
Only files which have the correct file extensions will be read, all others such as `*.<ext>-example` will be ignored.
* Valid PHP config extension: `.ini`
* Valid MySQL config extension: `.cnf`
#### 1.3 The operating system `hosts` file
On Linux and OSX your hosts file is located at `/etc/hosts` on Windows it will be at `C:\Windows\System32\drivers\etc`. Use this file to setup custom DNS entries if you are not using Auto-DNS.
Read up on it below at `/etc/hosts` or `Auto-DNS` section.
#### 1.4 The operating system `resolv.conf` file
This file is used to add the devilbox DNS server for Auto-DNS.
Read up on it below at `/etc/hosts` or `Auto-DNS` section.
## 2. Devilbox general settings ## 2. Devilbox general settings
#### 2.1 Verbosity #### 2.1 Verbosity
@ -189,7 +272,20 @@ $ id
#### 4.2 PHP / HHVM #### 4.2 PHP / HHVM
##### 4.2.1 Xdebug ##### 4.2.1 Select PHP version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| PHP_SERVER | `php-fpm-7.0`| Change the PHP Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `PHP_SERVER=` block
You can choose between different PHP versions and HHVM.
**Important:** Keep in mind that if you have a custom php.ini config at `./cfg/php-*/`, it is only effective for one version. Custom php configurations are separted per version.
##### 4.2.2 Xdebug
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -199,7 +295,7 @@ $ id
Xdebug is turned on by default and also using the official Xdebug default port. The only thing you will have to adjust is the Xdebug remote host address so that your editor/IDE can actually receive Xdebug data. Xdebug is turned on by default and also using the official Xdebug default port. The only thing you will have to adjust is the Xdebug remote host address so that your editor/IDE can actually receive Xdebug data.
##### 4.2.2 php.ini ##### 4.2.3 php.ini
`php.ini` settings can be configured for each PHP/HHVM version separately. Container-based configuration is done inside the `./cfg/` directory. `php.ini` settings can be configured for each PHP/HHVM version separately. Container-based configuration is done inside the `./cfg/` directory.
@ -229,7 +325,7 @@ $ vi devilbox-custom.ini
Change will take effect after restarting the devilbox. Change will take effect after restarting the devilbox.
##### 4.2.3 HHVM ##### 4.2.4 HHVM
HHVM can just be configured as all other PHP versions. However it has a special option to change between **PHP-5.6** mode and **PHP-7** mode. This example is addressed in `cfg/hhvm-latest/devilbox.ini-example`. HHVM can just be configured as all other PHP versions. However it has a special option to change between **PHP-5.6** mode and **PHP-7** mode. This example is addressed in `cfg/hhvm-latest/devilbox.ini-example`.
@ -248,9 +344,20 @@ By default, HHVM is using **PHP-7** mode, you can change this setting to **PHP-5
**Note:** You must then also copy the file to something that ends by `*.ini`. **Note:** You must then also copy the file to something that ends by `*.ini`.
#### 4.3 Webserver #### 4.3 Apache / Nginx
##### 4.3.1 Host port ##### 4.3.1 Select Httpd version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| HTTPD_SERVER | `nginx-stable`| Change the Httpd Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `HTTPD_SERVER=` block
You can choose between Apache and Nginx in different version. All of them are configured to work the same, there is nothing to worry about when changing them.
##### 4.3.2 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -262,7 +369,18 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
#### 4.4 MySQL #### 4.4 MySQL
##### 4.4.1 Root password ##### 4.4.1 Select MySQL version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| MYSQL_SERVER | `mariadb-10.1`| Change the MySQL Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `MYSQL_SERVER=` block
**Important:** Each version has a different data directory. This is a security precautions. Imagine you startup MySQL 5.5 for the first time. New databases will be created. Now you startup MySQL 8. All existing databases would be upgraded to work flawlessly with MySQL 8, however this is not downwards compatible. So by startup up MySQL 5.5 again, it would say the database is corrupt.
##### 4.4.2 Root password
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -270,7 +388,7 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
If you start a MySQL container for the first time, it will setup MySQL itself with the specified password. If you do change the root password to something else, make sure to also set it accordingly in `.env`, otherwise the devilbox will not be able to connect to MySQL and will not be able to display information inside the bundled intranet. If you start a MySQL container for the first time, it will setup MySQL itself with the specified password. If you do change the root password to something else, make sure to also set it accordingly in `.env`, otherwise the devilbox will not be able to connect to MySQL and will not be able to display information inside the bundled intranet.
##### 4.4.2 General Log ##### 4.4.3 General Log
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -281,7 +399,7 @@ https://dev.mysql.com/doc/refman/5.7/en/query-log.html:
This logging behavior is turned on by default in order to provide all information during development. Set it to `0` to turn it off. This logging behavior is turned on by default in order to provide all information during development. Set it to `0` to turn it off.
##### 4.4.3 Host port ##### 4.4.4 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -291,7 +409,7 @@ By default the MySQL server will listen on port 3306 (on your Host computer). Yo
If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`. If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`.
##### 4.4.4 Data path ##### 4.4.5 Data path
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -302,19 +420,20 @@ This is the file system path on your host computer which will hold the MySQL dat
**Note:** A sub directory will be created inside this path for each MySQL version. This separation is there to make sure that higher versions do not upgrade the database irrevocably. (e.g.: MySQL 8.0 can read data from MySQL 5.5, but not the other way round). **Note:** A sub directory will be created inside this path for each MySQL version. This separation is there to make sure that higher versions do not upgrade the database irrevocably. (e.g.: MySQL 8.0 can read data from MySQL 5.5, but not the other way round).
The automatic folder structure will look something like this: The automatic folder structure will look something like this:
```shell ```shell
$ ls -l ./data/mysql/ $ ls -l ./data/mysql/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.0/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.0/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.1/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.1/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.2/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.2/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.3/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mariadb-10.3/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysqp-5.5/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.5/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysqp-5.6/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.6/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysqp-5.7/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.7/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysqp-8.0/ drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-8.0/
``` ```
##### 4.4.5 my.cnf ##### 4.4.6 my.cnf
`my.cnf` settings can be configured for each MySQL/MariaDB version separately. Container-based configuration is done inside the `./cfg/` directory. `my.cnf` settings can be configured for each MySQL/MariaDB version separately. Container-based configuration is done inside the `./cfg/` directory.
@ -347,7 +466,18 @@ Change will take effect after restarting the devilbox.
#### 4.5 PostgreSQL #### 4.5 PostgreSQL
##### 4.5.1 Root user ##### 4.5.1 Select PostgreSQL version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| PGSQL_SERVER | `9.6` | Change the PostgreSQL Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `PGSQL_SERVER=` block
**Important:** Each version has a different data directory. This is a security precautions. Imagine you startup PostgreSQL 9.1 for the first time. New databases will be created. Now you startup PostgreSQL 9.6. All existing databases would be upgraded to work flawlessly with PostgreSQL 9.6, however this is not downwards compatible. So by startup up PostgreSQL 9.1 again, it would say the database is corrupt.
##### 4.5.2 Root user
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -357,7 +487,7 @@ If you start a PostgreSQL container for the first time, it will setup PostgreSQ
See also: Root password See also: Root password
S##### 4.5.2 Root password ##### 4.5.3 Root password
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -367,7 +497,7 @@ If you start a PostgreSQL container for the first time, it will setup PostgreSQ
See also: Root user See also: Root user
##### 4.5.3 Host port ##### 4.5.4 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -377,15 +507,42 @@ By default the PostgreSQL server will listen on port 5432 (on your Host computer
If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`. If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`.
##### 4.5.4 Data path ##### 4.5.5 Data path
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
| HOST_PATH_PGSQL_DATADIR | `./data/pgsql` | Can be absolute or relative path. A relative path starts inside the devilbox git directory. | | HOST_PATH_PGSQL_DATADIR | `./data/pgsql` | Can be absolute or relative path. A relative path starts inside the devilbox git directory. |
This is the file system path on your host computer which will hold the PostgreSQL data.
**Note:** A sub directory will be created inside this path for each PostgreSQL version. This separation is there to make sure that higher versions do not upgrade the database irrevocably. (e.g.: PostgreSQL 9.6 can read data from PostgreSQL 9.1, but maybe not the other way round).
The automatic folder structure will look something like this:
```shell
$ ls -l ./data/pgsql/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.1/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.2/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.3/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.4/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.5/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 9.6/
```
#### 4.6 Redis #### 4.6 Redis
##### 4.6.1 Host port ##### 4.6.1 Select Redis version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| REDIS_SERVER | `3.2` | Change the Redis Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `REDIS_SERVER=` block
There is nothing to pay attention to here.
##### 4.6.2 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -397,7 +554,18 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
#### 4.7 Memcached #### 4.7 Memcached
##### 4.7.1 Host port ##### 4.7.1 Select Memcached version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| MEMCD_SERVER | `1.4.21` | Change the Memcached Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `MEMCD_SERVER=` block
There is nothing to pay attention to here.
##### 4.7.2 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -409,7 +577,18 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
#### 4.8 MongoDB #### 4.8 MongoDB
##### 4.8.1 Host port ##### 4.8.1 Select MongoDB version
| `.env` file variable name | Default | Note |
|---------------------------|---------|------|
| MONGO_SERVER | `3.4` | Change the MongoDB Docker container |
1. Open the `.env` file in your favorite editor
2. Find the `MONGO_SERVER=` block
**Important:** Each version has a different data directory. This is a security precautions. Imagine you startup MongoDB 2.8 for the first time. New databases will be created. Now you startup MongoDB 3.5. All existing databases would be upgraded to work flawlessly with MongoDB 3.5, however this is not downwards compatible. So by startup up MongoDB 2.8 again, it would say the database is corrupt.
##### 4.8.2 Host port
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
@ -419,12 +598,27 @@ By default the Memcached server will listen on port 27017 (on your Host computer
If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`. If you also want to change the listening address (default: 127.0.0.1) to something else, see above or search this document for `LOCAL_LISTEN_ADDRESS`.
##### 4.8.2 Data path ##### 4.8.3 Data path
| `.env` file variable name | Default | Note | | `.env` file variable name | Default | Note |
|---------------------------|---------|------| |---------------------------|---------|------|
| HOST_PATH_MONGO_DATADIR | `./data/mongo` | Can be absolute or relative path. A relative path starts inside the devilbox git directory. | | HOST_PATH_MONGO_DATADIR | `./data/mongo` | Can be absolute or relative path. A relative path starts inside the devilbox git directory. |
This is the file system path on your host computer which will hold the MongoDB data.
**Note:** A sub directory will be created inside this path for each MongoDB version. This separation is there to make sure that higher versions do not upgrade the database irrevocably. (e.g.: MongoDB 3.5 can read data from MongoDB 2.8, but maybe not the other way round).
The automatic folder structure will look something like this:
```shell
$ ls -l ./data/mongo/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 2.8/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 3.0/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 3.2/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 3.4/
drwxrwxr-x 6 48 48 4096 Jun 21 08:47 3.5/
```
#### 4.9 Bind #### 4.9 Bind
##### 4.9.1 Upstream resolver ##### 4.9.1 Upstream resolver
@ -460,7 +654,11 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
`DNS_CHECK_TIMEOUT` value is how many seconds to time out. `DNS_CHECK_TIMEOUT` value is how many seconds to time out.
## 6. Host computer
#### 6.1 Auto-DNS ## 6. Host computer
#### 6.2 /etc/hosts/
#### 6.1 /etc/hosts
#### 6.2 Auto-DNS

View File

@ -39,6 +39,7 @@ The devilbox provides popular tools for setting up and managing major frameworks
| `drush` | [drush](http://www.drush.org/) | Drupal | | `drush` | [drush](http://www.drush.org/) | Drupal |
| `drupal` | [drupal-consol](https://drupalconsole.com) | Drupal | | `drupal` | [drupal-consol](https://drupalconsole.com) | Drupal |
| `git` | [git](https://git-scm.com) | Everything available on github and other git servers | | `git` | [git](https://git-scm.com) | Everything available on github and other git servers |
| `laravel` | [laravel installer](https://github.com/laravel/installer) | Laravel |
| `phalcon` | [phalcon devtools](https://github.com/phalcon/phalcon-devtools) | Phalcon | | `phalcon` | [phalcon devtools](https://github.com/phalcon/phalcon-devtools) | Phalcon |
| `symfony` | [symfony installer](https://github.com/symfony/symfony-installer) | Symfony | | `symfony` | [symfony installer](https://github.com/symfony/symfony-installer) | Symfony |
| `wp` | [wp-cli](https://wp-cli.org/) | Wordpress | | `wp` | [wp-cli](https://wp-cli.org/) | Wordpress |
@ -118,6 +119,7 @@ All set now, you can visit http://my-cake.local in your browser.
If you want to dig deeper into installing CakePHP, visit their documentation [https://book.cakephp.org/3.0/en/installation.html](https://book.cakephp.org/3.0/en/installation.html). If you want to dig deeper into installing CakePHP, visit their documentation [https://book.cakephp.org/3.0/en/installation.html](https://book.cakephp.org/3.0/en/installation.html).
## 3. Setup Drupal ## 3. Setup Drupal
The following configuration will be used: The following configuration will be used:
@ -163,6 +165,7 @@ Open your browser at http://my-drupal.local and follow the Drupal installation s
**Note:** For MySQL host choose `127.0.0.1`. **Note:** For MySQL host choose `127.0.0.1`.
## 4. Setup Phalcon ## 4. Setup Phalcon
The following configuration will be used: The following configuration will be used:

View File

@ -66,7 +66,6 @@ There will however be slight differences between the versions and especially wit
[PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) | [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
[HHVM](https://github.com/cytopia/docker-hhvm-latest) [HHVM](https://github.com/cytopia/docker-hhvm-latest)
**Can I add other PHP Modules?** **Can I add other PHP Modules?**
Yes, if there are any PHP modules you require that are not yet available in the PHP Docker container, you can install it during run-time, or create your own container. See [Hacking](Hacking.md) for more informatino. Yes, if there are any PHP modules you require that are not yet available in the PHP Docker container, you can install it during run-time, or create your own container. See [Hacking](Hacking.md) for more informatino.

View File

@ -70,7 +70,6 @@ Your newly rebuild `latest` docker container will not yet be available for the n
If your devilbox git repository is checkout out on the `master` branch, then all docker container are always bound to the `latest` docker tag inside `docker-compose.yml` and you do not need to change anything. Just rebuilding the container is enough to be picked up for the next start. If your devilbox git repository is checkout out on the `master` branch, then all docker container are always bound to the `latest` docker tag inside `docker-compose.yml` and you do not need to change anything. Just rebuilding the container is enough to be picked up for the next start.
## 2. Customizing the bundled Docker container ## 2. Customizing the bundled Docker container
Customizing a Docker container is almost as simple as rebuilding it. Customizing a Docker container is almost as simple as rebuilding it.
@ -86,7 +85,6 @@ Customizing a Docker container is almost as simple as rebuilding it.
You can add your custom docker container including its configuration to `docker-compose.yml`. You can add your custom docker container including its configuration to `docker-compose.yml`.
#### 3.1 What information will you need? #### 3.1 What information will you need?
1. A name that you can use to refer to in the docker-compose command 1. A name that you can use to refer to in the docker-compose command
@ -149,7 +147,6 @@ services:
``` ```
#### 3.3 How to start your service? #### 3.3 How to start your service?
```shell ```shell

View File

@ -48,6 +48,7 @@ Refer to the official [Docker for Mac documentation](https://docs.docker.com/doc
**Note:** You should install the [Native Mac Docker](https://docs.docker.com/docker-for-mac/install/) and not the [Docker Toolbox](https://docs.docker.com/toolbox/overview/). **Note:** You should install the [Native Mac Docker](https://docs.docker.com/docker-for-mac/install/) and not the [Docker Toolbox](https://docs.docker.com/toolbox/overview/).
## 2. Install Devilbox ## 2. Install Devilbox
Just clone the devilbox repository and copy the configuration file. Just clone the devilbox repository and copy the configuration file.
@ -60,7 +61,6 @@ $ cp env-example .env
You are all set now and can continue with [configuring the devilbox](Configure.md). You are all set now and can continue with [configuring the devilbox](Configure.md).
#### 2.1 Latest git tag #### 2.1 Latest git tag
If you always want a stable development environment, you should stay on the latest git tag. However devilbox git tags are tied to specific Docker container tags. That means you will only get new Docker versions once you switch to the next devilbox git tag. If you always want a stable development environment, you should stay on the latest git tag. However devilbox git tags are tied to specific Docker container tags. That means you will only get new Docker versions once you switch to the next devilbox git tag.

View File

@ -64,6 +64,7 @@ $ git pull origin master
$ ./update-docker.sh $ ./update-docker.sh
``` ```
## 3. Configuration ## 3. Configuration
#### 3.1 .env #### 3.1 .env
@ -87,6 +88,7 @@ $ cd cfg/
$ echo "[mysqld]\nslow_query_log = 1" > mysql-5.5/config.cnf $ echo "[mysqld]\nslow_query_log = 1" > mysql-5.5/config.cnf
``` ```
## 4. Run ## 4. Run
#### 4.1 Run all #### 4.1 Run all
@ -101,6 +103,7 @@ $ docker-compose up -d
$ docker-compose up -d httpd php mysql redis $ docker-compose up -d httpd php mysql redis
``` ```
## 5. Project setup ## 5. Project setup
#### 5.1 General setup #### 5.1 General setup

View File

@ -58,6 +58,7 @@ By having the above folders, the devilbox will automatically be able to serve th
New folders can be created, deleted and removed during run-time and corresponding virtual hosts will be available instantly without having to restart anything. New folders can be created, deleted and removed during run-time and corresponding virtual hosts will be available instantly without having to restart anything.
## 2. Features ## 2. Features
| Feature | Description | | Feature | Description |
@ -109,11 +110,11 @@ The devilbox runs on all major operating systems. Below you can quickly check th
[lin-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Alinux%22 [lin-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Alinux%22
[osx-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Aosx%22 [osx-issues]: https://github.com/cytopia/devilbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22host%3Aosx%22
**How about FreeBSD?** **How about FreeBSD?**
The devilbox has not been tested on FreeBSD yet. Current milestones include to make it rock-solid on the above listed operating systems. However, if you want it to run on FreeBSD open up an issue on Github and you will receive support making it work on FreeBSD. The devilbox has not been tested on FreeBSD yet. Current milestones include to make it rock-solid on the above listed operating systems. However, if you want it to run on FreeBSD open up an issue on Github and you will receive support making it work on FreeBSD.
## 4. Requirements ## 4. Requirements
* **Internet connection** - only required during initial setup for cloning the devilbox repository and pulling the required docker container. Afterwards you can always work offline. * **Internet connection** - only required during initial setup for cloning the devilbox repository and pulling the required docker container. Afterwards you can always work offline.
@ -169,6 +170,7 @@ There will however be slight differences between the versions and especially wit
[PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) | [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
[HHVM](https://github.com/cytopia/docker-hhvm-latest) [HHVM](https://github.com/cytopia/docker-hhvm-latest)
## 9. Supported Frameworks and CMS ## 9. Supported Frameworks and CMS
As far as tested there are no limitations and you can use any Framework or CMS just as you would on your live environment. Below are a few examples of extensively tested Frameworks and CMS: As far as tested there are no limitations and you can use any Framework or CMS just as you would on your live environment. Below are a few examples of extensively tested Frameworks and CMS:

View File

@ -128,6 +128,7 @@ $ docker-compose kill
Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them. Best pracice would be to start the container in the background (with `-d`) and use `docker compose down` to gracefully stop all of them.
## 3. Attach/Detach during run-time ## 3. Attach/Detach during run-time
#### 3.1 Attach during run-time #### 3.1 Attach during run-time
@ -144,7 +145,6 @@ $ docker-compose up -d redis
It is recommended to always use background starts, this way you can intially start your desired stack and re-use the current terminal window to start or stop other services. It is recommended to always use background starts, this way you can intially start your desired stack and re-use the current terminal window to start or stop other services.
#### 3.2 Detach during run-time #### 3.2 Detach during run-time
You can also stop specific containers during runtime if they are not needed anymore. You might have started httpd, php, bind, mysql and redis and decided that redis was not needed. So go ahead and remove redis from the running container stack. You can also stop specific containers during runtime if they are not needed anymore. You might have started httpd, php, bind, mysql and redis and decided that redis was not needed. So go ahead and remove redis from the running container stack.
@ -153,6 +153,7 @@ You can also stop specific containers during runtime if they are not needed anym
$ docker-compose stop redis $ docker-compose stop redis
``` ```
## 4. Docker Logs ## 4. Docker Logs
Services started in background mode (`-d`) or those that were started as dependencies (`http` and `php`) will always only log to docker logs and not to stdout/stderr. Services started in background mode (`-d`) or those that were started as dependencies (`http` and `php`) will always only log to docker logs and not to stdout/stderr.
@ -180,4 +181,3 @@ There is also a version similar to `tail -f` to keep logs updated all the time.
```shell ```shell
$ docker-compose logs -f $ docker-compose logs -f
``` ```

View File

@ -43,6 +43,7 @@ It is best to use the hostnames and not to rely on the ip addresses as they migh
| Memcached | memcd | memcd | 172.16.238.15 | | Memcached | memcd | memcd | 172.16.238.15 |
| MongoDB | mongo | mongo | 172.16.238.16 | | MongoDB | mongo | mongo | 172.16.238.16 |
## 2. Ports and forwarding ## 2. Ports and forwarding
#### 2.1 PHP Container #### 2.1 PHP Container
@ -73,7 +74,6 @@ The following container can be reached from within the PHP container via the fol
| Memcached | memcd | 172.16.238.15 | 127.0.0.1 | 11211 | | Memcached | memcd | 172.16.238.15 | 127.0.0.1 | 11211 |
| MongoDB | mongo | 172.16.238.16 | 127.0.0.1 | 27017 | | MongoDB | mongo | 172.16.238.16 | 127.0.0.1 | 27017 |
#### 2.2 Docker Host #### 2.2 Docker Host
The docker host (your computer) does exactly the same as the `php` container. The docker host (your computer) does exactly the same as the `php` container.
@ -97,6 +97,7 @@ The following container can be reached from the Docker host via the following me
| Memcached | 127.0.0.1 | 11211 | | Memcached | 127.0.0.1 | 11211 |
| MongoDB | 127.0.0.1 | 27017 | | MongoDB | 127.0.0.1 | 27017 |
## 3. Works the same on Host and PHP Container ## 3. Works the same on Host and PHP Container
As you might have noticed, the ports and addresses will be exactly the same inside the PHP container and on the docker host (when using `127.0.0.1`) for most container. That way it is possible to write your php application like this: As you might have noticed, the ports and addresses will be exactly the same inside the PHP container and on the docker host (when using `127.0.0.1`) for most container. That way it is possible to write your php application like this:

View File

@ -53,6 +53,7 @@ $ docker-compose up
Do not forget to read: [Pull new Docker container (Important!)](#4-pull-new-docker-container-important-) Do not forget to read: [Pull new Docker container (Important!)](#4-pull-new-docker-container-important-)
## 2. Git tag vs master branch ## 2. Git tag vs master branch
#### 2.1 Git tag #### 2.1 Git tag
@ -79,7 +80,6 @@ $ git fetch --all
$ git checkout "$(git describe --abbrev=0 --tags)" $ git checkout "$(git describe --abbrev=0 --tags)"
``` ```
**Note:** If you want to pre-download all available versions for later offline-usage, run the `update-docker.sh` script. **Note:** If you want to pre-download all available versions for later offline-usage, run the `update-docker.sh` script.
```shell ```shell
@ -115,6 +115,7 @@ $ docker-compose pull
$ ./update-docker.sh $ ./update-docker.sh
``` ```
## 3. Compare .env file ## 3. Compare .env file
New devilbox releases will most likeley receive new or improved functionality and features and therefore will have an altered `env-example` file. (This is an example configuration file which holds all current configuration options). New devilbox releases will most likeley receive new or improved functionality and features and therefore will have an altered `env-example` file. (This is an example configuration file which holds all current configuration options).
@ -128,6 +129,7 @@ $ vimdiff .env env-example
Make sure to transfer all new options from `env-example` to your current `.env` file. Make sure to transfer all new options from `env-example` to your current `.env` file.
## 4. Pull new Docker container (Important!) ## 4. Pull new Docker container (Important!)
As described above, for git master branch updates you will always have to pull new Docker container. **However, there is something very important to keep in mind:** As described above, for git master branch updates you will always have to pull new Docker container. **However, there is something very important to keep in mind:**
@ -154,6 +156,7 @@ So instead of pulling everything manually, use the bundled update script to do t
$ ./update-docker.sh $ ./update-docker.sh
``` ```
## 5. Remove anonymous volumes ## 5. Remove anonymous volumes
The devilbox is not yet at a feature-ready stable release and volumes mounts might change from release to release until version 1.0 will be released. This can cause errors during startup. To solve those issues after updating, you should remove all anonymouse volumes with the following command: The devilbox is not yet at a feature-ready stable release and volumes mounts might change from release to release until version 1.0 will be released. This can cause errors during startup. To solve those issues after updating, you should remove all anonymouse volumes with the following command:

View File

@ -19,42 +19,47 @@ Usage |
## Usage ## Usage
1. [Mounted directories](#1-mounted-directories) 1. [Mounted directories](#1-mounted-directories)
2. [Work on the Docker host](#2-work-on-the-docker-host)
Mounted directories are the bridge between the container and your host computer. 3. [Work inside the PHP container](#3-work-inside-the-php-container)
1. [As devilbox user](#3-1-as-devilbox-user)
1. [Work on the Docker host](#1-work-on-the-docker-host) 2. [As root user](#3-2-as-root-user)
2. [Work inside the PHP container](#2-work-inside-the-php-container) 3. [Available tools](#3-3-available-tools)
1. [As devilbox user](#2-1-as-devilbox-user) 4. [Available URLs](#3-4-available-urls)
2. [As root user](#2-2-as-root-user) 4. [Managing Projects explained](#4-managing-projects-explained)
3. [Available tools](#2-3-available-tools) 1. [How does it work?](#4-1-how-does-it-work-)
4. [Available URLs](#2-4-available-urls) 2. [Directory structure explained](#4-2-directory-structure-explained)
3. [Managing Projects explained](#3-managing-projects-explained) 5. [Creating new Projects](#5-creating-new-projetcs)
1. [How does it work?](#3-1-how-does-it-work-) 1. [From Docker Host](#5-1-from-docker-host)
2. [Directory structure explained](#3-2-directory-structure-explained) 2. [From inside the PHP container](#5-2-from-inside-the-php-container)
4. [Creating new Projects](#4-creating-new-projetcs) 3. [Using symlinks](#5-3-using-symlinks)
1. [From Docker Host](#4-1-from-docker-host) 4. [Adding DNS records](#5-4-adding-dns-record)
2. [From inside the PHP container](#4-2-from-inside-the-php-container) 1. [/etc/hosts](#5-4-1-etc-hosts)
3. [Using symlinks](#4-3-using-symlinks) 2. [Auto-DNS](#5-4-2-auto-dns)
4. [Adding DNS records](#4-4-adding-dns-record) 6. [Switching container versions](#6-switching-container-versions)
1. [/etc/hosts](#4-4-1-etc-hosts) 1. [Httpd versions](#6-1-httpd-versions)
2. [Auto-DNS](#4-4-2-auto-dns) 2. [PHP versions](#6-2-php-versions)
5. [Switching container versions](#5-switching-container-versions) 2. [SQL versions](#6-3-sql-versions)
1. [Httpd versions](#5-1-httpd-versions) 3. [NoSQL versions](#6-4-nosql-versions)
2. [PHP versions](#5-2-php-versions) 7. [Emails](#7-emails)
2. [SQL versions](#5-3-sql-versions) 8. [Log files](#8-log-files)
3. [NoSQL versions](#5-4-nosql-versions) 1. [Mounted logs](#8-1-mounted-logs)
6. [Emails](#6-emails) 2. [Docker logs](#8-2-docker-logs)
7. [Log files](#7-log-files) 9. [Intranet](#9-intranet)
1. [Mounted logs](#7-1-mounted-logs) 1. [Overview](#9-1-overview)
2. [Docker logs](#7-2-docker-logs) 2. [vHosts](#9-2-vhosts)
8. [Intranet](#8-intranet) 3. [Tools](#9-3-tools)
1. [Overview](#8-1-overview)
2. [vHosts](#8-2-vhosts)
3. [Tools](#8-3-tools)
--- ---
## 1. Work on the Docker host ## 1. Mounted directories
Mounted directories are the bridge between the container and your host computer.
All your projects will be available on your host computer as well as inside the Docker container.
That makes it possible to work from the Docker host, by for example editing your files with your favorite editor/IDE and to run any commands, such as `npm`, `composer` or others inside the PHP container with the correct PHP version.
## 2. Work on the Docker host
If you do not need to run any command line tools manually (composer, node, etc), it is sufficient to stay on the host. All you need is a browser and an editor/IDE. If you do not need to run any command line tools manually (composer, node, etc), it is sufficient to stay on the host. All you need is a browser and an editor/IDE.
@ -84,7 +89,8 @@ Here is an example to list the PHP inside the container from the Docker host.
$ docker-compose exec --user devilbox php php -v $ docker-compose exec --user devilbox php php -v
``` ```
## 2. Work inside the PHP container
## 3. Work inside the PHP container
If you need to run some command line tasks manually such as `drush`, `composer` or anything similar which is not available on your host computer, you can do that inside the PHP container, which comes with lots of useful pre-install tools. If you need to run some command line tasks manually such as `drush`, `composer` or anything similar which is not available on your host computer, you can do that inside the PHP container, which comes with lots of useful pre-install tools.
@ -92,7 +98,7 @@ The situation inside the container is not different from on the Docker host. All
**FYI:** You will always find your projects inside the PHP container at `/shared/httpd/`. **FYI:** You will always find your projects inside the PHP container at `/shared/httpd/`.
#### 2.1 As devilbox user #### 3.1 As devilbox user
In the devilbox git directory you will find a bash script called `bash.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory. In the devilbox git directory you will find a bash script called `bash.sh`. Just execute this script and it will take you directly into the PHP docker container at the project root directory.
@ -103,7 +109,7 @@ devilbox@php-7.0.19 in /shared/httpd $
As you can see, the PS1 prompt will also show you the current configured PHP version. As you can see, the PS1 prompt will also show you the current configured PHP version.
#### 2.2 As root user #### 3.2 As root user
In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can also use the `root_bash.sh` script. In case you need to perform some tasks that are only possible with root rights (such as installing or updating software), you can also use the `root_bash.sh` script.
@ -114,18 +120,23 @@ root@php-7.0.19 in /shared/httpd $
**Note:** Performing installations and updates are only temporary for the current session. Any change will be lost at the next start/restart of the devilbox. If you permanently require additional software refer to [Hacking](Hacking.md). **Note:** Performing installations and updates are only temporary for the current session. Any change will be lost at the next start/restart of the devilbox. If you permanently require additional software refer to [Hacking](Hacking.md).
#### 2.3 Available tools #### 3.3 Available tools
For your convenience a few selected tools have been pre-installed in their current version that you can use for your daily development tasks. Some of them are: For your convenience a few selected tools have been pre-installed in their current version that you can use for your daily development tasks. Some of them are:
*[composer](https://getcomposer.org)*, | Binary | Tool name |
*[drush](http://www.drush.org)*, |------------|-------------------|
*[drupal-console](https://drupalconsole.com)*, | `composer` | [composer](https://getcomposer.org) |
*[git](https://git-scm.com)*, | `drush` | [drush](http://www.drush.org/) |
*[mysqldump-secure](https://mysqldump-secure.org)*, | `drupal` | [drupal-consol](https://drupalconsole.com) |
*[node](https://nodejs.org)*, | `git` | [git](https://git-scm.com) |
*[npm](https://www.npmjs.com)*, | `laravel` | [laravel installer](https://github.com/laravel/installer) |
*[wp-cli](https://wp-cli.org)* | `mysqldump-secure` | [mysqldump-secure](https://mysqldump-secure.org) |
| `node` | [node](https://nodejs.org) |
| `npm` | [npm](https://www.npmjs.com) |
| `phalcon` | [phalcon devtools](https://github.com/phalcon/phalcon-devtools) |
| `symfony` | [symfony installer](https://github.com/symfony/symfony-installer) |
| `wp` | [wp-cli](https://wp-cli.org/) |
The complete list of tools including their version can be found at the PHP docker containers git repository Readme: The complete list of tools including their version can be found at the PHP docker containers git repository Readme:
@ -140,16 +151,18 @@ If you permanently require additional software refer to [Hacking](Hacking.md).
If you think additional tools should always be bundled, [create an issue](https://github.com/cytopia/devilbox/issues). If you think additional tools should always be bundled, [create an issue](https://github.com/cytopia/devilbox/issues).
#### 2.4 Available URLs #### 3.4 Available URLs
Your projects will be available by the same URL as they are available from your docker host computer. There is no need to edit the PHP container's `/etc/hosts` file, as it is automatically provide via the DNS container `bind`. Your projects will be available by the same URL as they are available from your docker host computer. There is no need to edit the PHP container's `/etc/hosts` file, as it is automatically provide via the DNS container `bind`.
For example, by doing `curl http://project1.dev` from either your host computer or from inside the PHP container will return the same URL. For example, by doing `curl http://project1.dev` from either your host computer or from inside the PHP container will return the same URL.
## 3. Managing Projects explained
## 4. Managing Projects explained
[![Devilbox setup and workflow](img/devilbox_01-setup-and-workflow.png "devilbox - setup and workflow")](https://www.youtube.com/watch?v=reyZMyt2Zzo) [![Devilbox setup and workflow](img/devilbox_01-setup-and-workflow.png "devilbox - setup and workflow")](https://www.youtube.com/watch?v=reyZMyt2Zzo)
#### 3.1 How does it work? #### 4.1 How does it work?
Creating new projects is really simple and just involves a few steps. Creating new projects is really simple and just involves a few steps.
@ -159,7 +172,7 @@ Creating new projects is really simple and just involves a few steps.
The **project folder** will be the name of your VirtualHost. The **htdocs/** folder holds all files that will be server by the VirtualHost (called DocumentRoot). The **DNS record** will be the domain name that points to the webserver's IP address (127.0.0.1). The **project folder** will be the name of your VirtualHost. The **htdocs/** folder holds all files that will be server by the VirtualHost (called DocumentRoot). The **DNS record** will be the domain name that points to the webserver's IP address (127.0.0.1).
#### 3.2 Directory structure explained #### 4.2 Directory structure explained
Your project folder is determined by the value of `HOST_PATH_TO_HTTPD_DATADIR` which can be set in `.env`. The default is `./data/www`. Your project folder is determined by the value of `HOST_PATH_TO_HTTPD_DATADIR` which can be set in `.env`. The default is `./data/www`.
@ -189,11 +202,11 @@ In order to make the following examples easier let's work with some assumed defa
The VirtualHost directory make a new VirtualHost available under the specified URL. However the actual files that will be served are always expected to be in a subfolder called `htdocs/`. By having an additional sub-directory for the Document root you are able to store non-www files inside the project folder and even **symlink** you www dir to htdocs. The VirtualHost directory make a new VirtualHost available under the specified URL. However the actual files that will be served are always expected to be in a subfolder called `htdocs/`. By having an additional sub-directory for the Document root you are able to store non-www files inside the project folder and even **symlink** you www dir to htdocs.
## 4. Creating new Projetcs ## 5. Creating new Projetcs
This is a general overview about creating projects. If you want to see some real examples how to setup **Wordpress**, **Drupal**, **CakePHP**, **Yii**, **Symfony** and others, visit the [Example Section](Examples.md). This is a general overview about creating projects. If you want to see some real examples how to setup **Wordpress**, **Drupal**, **CakePHP**, **Yii**, **Symfony** and others, visit the [Example Section](Examples.md).
#### 4.1 From Docker host #### 5.1 From Docker host
The following will create a VirtualHost for `http://project1.local`. The following will create a VirtualHost for `http://project1.local`.
@ -206,7 +219,7 @@ $ mkdir project1/htdocs
<sub>If you want to know how to change the TLD_SUFFIX `local` to something else, refer to [Configure](Configure.md).</sub> <sub>If you want to know how to change the TLD_SUFFIX `local` to something else, refer to [Configure](Configure.md).</sub>
#### 4.2 From inside the PHP container #### 5.2 From inside the PHP container
If you prefer to work directly inside the PHP Docker container, you can do the same. The following will create a VirtualHost for `http://project1.local`. If you prefer to work directly inside the PHP Docker container, you can do the same. The following will create a VirtualHost for `http://project1.local`.
@ -218,7 +231,7 @@ $ mkdir project1/htdocs
<sub>If you want to know how to go into the PHP container, check the section above **2. Work inside the PHP container**.</sub> <sub>If you want to know how to go into the PHP container, check the section above **2. Work inside the PHP container**.</sub>
#### 4.3 Using symlinks #### 5.3 Using symlinks
Instead of creating a **htdocs/** folder explicitly, you can also make a symlink by the same name. This is required as some frameworks have nested www folders. Instead of creating a **htdocs/** folder explicitly, you can also make a symlink by the same name. This is required as some frameworks have nested www folders.
@ -236,11 +249,11 @@ drwxrwxr-x 2 cytopia 4096 Jun 14 08:29 cakephp
lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/ lrwxrwxrwx 1 cytopia 11 Jun 14 08:29 htdocs -> cakephp/app/webroot/
``` ```
#### 4.4 Adding DNS record #### 5.4 Adding DNS record
In order to actually visit the newly created project in your browser, there must be a DNS entry pointing to the webserver's listening IP address. This can either be done automatically by a DNS server or you can do it manually for each project by editing your `/etc/hosts` file every time you create a new project. In order to actually visit the newly created project in your browser, there must be a DNS entry pointing to the webserver's listening IP address. This can either be done automatically by a DNS server or you can do it manually for each project by editing your `/etc/hosts` file every time you create a new project.
##### 4.4.1 /etc/hosts ##### 5.4.1 /etc/hosts
If you have not setup Auto-DNS, you will need to create your own DNS records for every project. Let's assume your `TLD_SUFFIX` is set to `local`. If you have not setup Auto-DNS, you will need to create your own DNS records for every project. Let's assume your `TLD_SUFFIX` is set to `local`.
@ -250,13 +263,12 @@ If you have not setup Auto-DNS, you will need to create your own DNS records for
| drupal-test | `127.0.0.1 drupal-test.local` | | drupal-test | `127.0.0.1 drupal-test.local` |
| playground | `127.0.0.1 playground.local` | | playground | `127.0.0.1 playground.local` |
##### 5.4.2 Auto-DNS
##### 4.4.2 Auto-DNS
When using the devilbox built-in DNS server, there is nothing to do. DNS catch-all records for your `TLD_SUFFIX` exist and will always point to `127.0.0.1`. See [Configure](Configure.md) for how to setup Auto-DNS. When using the devilbox built-in DNS server, there is nothing to do. DNS catch-all records for your `TLD_SUFFIX` exist and will always point to `127.0.0.1`. See [Configure](Configure.md) for how to setup Auto-DNS.
## 5. Switching container versions ## 6. Switching container versions
Being able to combine all kinds of different container version is one of the main goals of the devilbox. Changing the versions is kept simple and consistent for all container. Being able to combine all kinds of different container version is one of the main goals of the devilbox. Changing the versions is kept simple and consistent for all container.
@ -270,15 +282,14 @@ Being able to combine all kinds of different container version is one of the mai
For an in-depth explanation about how to configure each service, you should have a look at [Configure](Configure.md). For an in-depth explanation about how to configure each service, you should have a look at [Configure](Configure.md).
#### 5.1 Httpd versions #### 6.1 Httpd versions
1. Open the `.env` file in your favorite editor 1. Open the `.env` file in your favorite editor
2. Find the `HTTPD_SERVER=` block 2. Find the `HTTPD_SERVER=` block
You can choose between Apache and Nginx in different version. All of them are configured to work the same, there is nothing to worry about when changing them. You can choose between Apache and Nginx in different version. All of them are configured to work the same, there is nothing to worry about when changing them.
#### 6.2 PHP versions
#### 5.2 PHP versions
1. Open the `.env` file in your favorite editor 1. Open the `.env` file in your favorite editor
2. Find the `PHP_SERVER=` block 2. Find the `PHP_SERVER=` block
@ -287,29 +298,31 @@ You can choose between different PHP versions and HHVM.
**Important:** Keep in mind that if you have a custom php.ini config at `./cfg/php-*/`, it is only effective for one version. Custom php configurations are separted per version. **Important:** Keep in mind that if you have a custom php.ini config at `./cfg/php-*/`, it is only effective for one version. Custom php configurations are separted per version.
#### 5.3 SQL versions #### 6.3 SQL versions
1. Open the `.env` file in your favorite editor 1. Open the `.env` file in your favorite editor
2. Find the `MYSQL_SERVER=` or `PGSQL_SERVER=` block 2. Find the `MYSQL_SERVER=` or `PGSQL_SERVER=` block
**Important:** Each version has a different data directory. This is a security precautions. Imagine you startup MySQL 5.5 for the first time. New databases will be created. Now you startup MySQL 8. All existing databases would be upgraded to work flawlessly with MySQL 8, however this is not downwards compatible. So by startup up MySQL 5.5 again, it would say the database is corrupt. **Important:** Each version has a different data directory. This is a security precautions. Imagine you startup MySQL 5.5 for the first time. New databases will be created. Now you startup MySQL 8. All existing databases would be upgraded to work flawlessly with MySQL 8, however this is not downwards compatible. So by startup up MySQL 5.5 again, it would say the database is corrupt.
#### 5.4 NoSQL versions #### 6.4 NoSQL versions
1. Open the `.env` file in your favorite editor 1. Open the `.env` file in your favorite editor
2. Find the `MONGO_SERVER=`, 'MEMCD_SERVER=` or `REDIS_SERVER=` block 2. Find the `MONGO_SERVER=`, 'MEMCD_SERVER=` or `REDIS_SERVER=` block
There is nothing to pay attention to here. There is nothing to pay attention to here.
## 6. Emails
## 7. Emails
All your projects can send emails to whatever recipient. You do not have to worry that they will actually being sent. Each PHP container runs a local postfix mailserver that intercepts all outgoing mails and puts them all in the local devilbox user mail account. All your projects can send emails to whatever recipient. You do not have to worry that they will actually being sent. Each PHP container runs a local postfix mailserver that intercepts all outgoing mails and puts them all in the local devilbox user mail account.
In order to view sent emails open up the devilbox intranet http://localhost/mail.php. There you can also test email sending and verify that they really stay locally. In order to view sent emails open up the devilbox intranet http://localhost/mail.php. There you can also test email sending and verify that they really stay locally.
## 7. Log files
#### 7.1 Mounted logs ## 8. Log files
#### 8.1 Mounted logs
Log files are available on the Host system and separated per service version. See `./log/` (inside devilbox git directory). The `./log/` folder itself will contain subdirectories in the form `<service>-<version>` which will then hold all available log files. Log files are available on the Host system and separated per service version. See `./log/` (inside devilbox git directory). The `./log/` folder itself will contain subdirectories in the form `<service>-<version>` which will then hold all available log files.
@ -339,7 +352,7 @@ log/
www-error.log www-error.log
``` ```
#### 7.2 Docker logs #### 8.2 Docker logs
All output printed to stdout or stderr by the started services will be available in `docker logs`. In order to view them constantly in a terminal session use: All output printed to stdout or stderr by the started services will be available in `docker logs`. In order to view them constantly in a terminal session use:
@ -349,23 +362,24 @@ docker-compose logs -f
Docker logs are currently only being used to display the initial startup including the chosen settings. All other logging is written to file and mounted to the docker host. Docker logs are currently only being used to display the initial startup including the chosen settings. All other logging is written to file and mounted to the docker host.
## 8. Intranet
## 9. Intranet
The devilbox bundled intranet is not required for project management or creation, however it offers a few useful tools. The devilbox bundled intranet is not required for project management or creation, however it offers a few useful tools.
#### 8.1 Overview #### 9.1 Overview
The overview page presents you the current state of the running stack and any errors it might have encountered. The overview page presents you the current state of the running stack and any errors it might have encountered.
http://localhost http://localhost
#### 8.2 vHosts #### 9.2 vHosts
The vHost page shows you all available projects and any configuation errors that need to be resolved. Errors could be: missing `htdocs/` folder and incorrect DNS settings. So make sure to first visit this page if any of your vHost does not work. The vHost page shows you all available projects and any configuation errors that need to be resolved. Errors could be: missing `htdocs/` folder and incorrect DNS settings. So make sure to first visit this page if any of your vHost does not work.
http://localhost/vhosts.php http://localhost/vhosts.php
#### 8.3 Tools #### 9.3 Tools
The intranet also offers a few common as well as self-made tools. These include: The intranet also offers a few common as well as self-made tools. These include: