From 8f71c56a51ef991d9f23ffb9bec6bd8c24c21fd3 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 3 Jun 2018 20:45:01 +0200 Subject: [PATCH] Check documentation via travis --- .travis.yml | 30 +- docs/about/read-first.rst | 4 +- docs/configuration-files/apache-conf.rst | 70 ++-- docs/configuration-files/bashrc-sh.rst | 41 +- .../docker-compose-override-yml.rst | 35 +- .../docker-compose-yml.rst | 2 +- docs/configuration-files/env-file.rst | 363 +++++++++--------- docs/configuration-files/my-cnf.rst | 70 ++-- docs/configuration-files/nginx-conf.rst | 66 ++-- docs/configuration-files/php-fpm-conf.rst | 99 +++-- docs/configuration-files/php-ini.rst | 58 ++- docs/configuration-global/auto-dns.rst | 71 ++-- docs/configuration-global/https-ssl.rst | 14 +- docs/configuration-project/custom-vhost.rst | 150 ++++---- docs/configuration-project/dns-records.rst | 48 +-- docs/examples/setup-cakephp.rst | 64 ++- docs/examples/setup-codeigniter.rst | 76 ++-- docs/examples/setup-drupal.rst | 19 +- docs/examples/setup-joomla.rst | 21 +- docs/examples/setup-laravel.rst | 17 +- docs/examples/setup-phalcon.rst | 17 +- docs/examples/setup-photon-cms.rst | 23 +- docs/examples/setup-symfony.rst | 21 +- docs/examples/setup-wordpress.rst | 17 +- docs/examples/setup-yii.rst | 17 +- docs/examples/setup-zend.rst | 17 +- docs/getting-started/best-practice.rst | 98 +++-- .../create-your-first-project.rst | 39 +- .../enter-the-php-container.rst | 28 +- docs/getting-started/install-the-devilbox.rst | 17 +- docs/getting-started/read-log-files.rst | 56 +-- docs/getting-started/the-intranet.rst | 10 +- docs/getting-started/update-the-devilbox.rst | 16 +- docs/index.rst | 2 - docs/installation/docker-toolbox.rst | 1 + docs/maintenance/backup-and-restore-mongo.rst | 24 +- docs/maintenance/backup-and-restore-pgsql.rst | 48 +-- docs/readings/available-tools.rst | 12 +- .../syncronize-container-permissions.rst | 2 +- docs/support/faq.rst | 2 +- docs/support/troubleshooting.rst | 26 +- docs/tutorials/add-your-own-docker-image.rst | 157 ++++---- docs/tutorials/adding-subdomains.rst | 89 ++--- docs/tutorials/change-container-versions.rst | 69 ++-- .../communicating-with-external-hosts.rst | 29 +- .../custom-environment-variables.rst | 6 +- docs/tutorials/enable-xdebug.rst | 4 +- .../overwrite-existing-docker-image.rst | 81 ++-- docs/tutorials/static-code-analysis.rst | 76 ++-- docs/tutorials/work-inside-the-container.rst | 84 ++-- 50 files changed, 1178 insertions(+), 1228 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54a32770..451bca03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ +### +### Enable Python support +### +language: python + ### ### Enable sudo (required for docker service) ### @@ -15,6 +20,11 @@ services: ### Specify combinations ### env: + ### + ### Check Documentation + ### + - S1=DOCUMENTATION + ### ### The matrix specifies 2 versions to compare against each other. ### As PHP (any version) needs to be able to run with everything, @@ -111,6 +121,19 @@ before_install: - docker-compose version +### +### Installation +### +install: + # Install dependencies for documentation + - if [ "${S1}" = "DOCUMENTATION" ]; then + pip install sphinx; + pip install sphinx-autobuild; + pip install recommonmark; + pip install sphinx_rtd_theme; + fi + + ### ### Before Script ### @@ -135,4 +158,9 @@ before_script: ### Test ### script: - - .tests/test_single.sh . "${S1}" "${V1}" "${S2}" "${V2}" + - if [ "${S1}" = "DOCUMENTATION" ]; then + cd docs/; + sphinx-build -a -W -E -j auto -n -v . _build/html/; + else + .tests/test_single.sh . "${S1}" "${V1}" "${S2}" "${V2}"; + fi diff --git a/docs/about/read-first.rst b/docs/about/read-first.rst index 94939dd7..117d4619 100644 --- a/docs/about/read-first.rst +++ b/docs/about/read-first.rst @@ -17,13 +17,13 @@ Shell commands .. code-block:: bash - host> command + host> command 2. This one indicates that the command should be executed inside the currently selected PHP container. (When copying commands, do not copy the ``php>`` part). .. code-block:: bash - php> command + php> command Checklists diff --git a/docs/configuration-files/apache-conf.rst b/docs/configuration-files/apache-conf.rst index 6028ebd1..f509d5c2 100644 --- a/docs/configuration-files/apache-conf.rst +++ b/docs/configuration-files/apache-conf.rst @@ -11,9 +11,9 @@ custom configurations. .. seealso:: If you are rather using Nginx, have a look at: :ref:`nginx_conf` .. important:: - You could actually also create virtual hosts here, but it is recommended to use the - Devilbox Auto-vhost generation feature. If you want to custimize your current virtual hosts - have a look at :ref:`custom_vhost`. + You could actually also create virtual hosts here, but it is recommended to use the + Devilbox Auto-vhost generation feature. If you want to custimize your current virtual hosts + have a look at :ref:`custom_vhost`. **Table of Contents** @@ -29,10 +29,10 @@ See the directory structure for Apache configuration directories inside ``./cfg/ .. code-block:: bash - host> ls -l path/to/devilbox/cfg/ | grep 'apache' + host> ls -l path/to/devilbox/cfg/ | grep 'apache' - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 apache-2.2/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 apache-2.4/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 apache-2.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 apache-2.4/ Customization is achieved by placing a file into ``cfg/apache-X.X/`` (where ``X.X`` stands for your Apache version). The file must end by ``.conf`` in order to be sourced by the web server. @@ -59,31 +59,30 @@ Apache 2.2. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to Apache 2.2 config directory - host> cd cfg/apache-2.2 + # Navigate to Apache 2.2 config directory + host> cd cfg/apache-2.2 - # Create new conf file - host> touch keep_alive.conf + # Create new conf file + host> touch keep_alive.conf Now add the following content to the file: .. code-block:: ini - :name: keep_alive.conf - :caption: keep_alive.conf + :caption: keep_alive.conf - KeepAlive On - KeepAliveTimeout 10 - MaxKeepAliveRequests 100 + KeepAlive On + KeepAliveTimeout 10 + MaxKeepAliveRequests 100 In order to apply the changes you need to restart the Devilbox. .. note:: - The above is just an example demonstration, you probably need other values for your setup. - So make sure to understand how to configure Apache, if you are going to change any of those - settings. + The above is just an example demonstration, you probably need other values for your setup. + So make sure to understand how to configure Apache, if you are going to change any of those + settings. Limit HTTP headers and GET size for Apache 2.4 @@ -99,31 +98,30 @@ for Apache 2.4. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to Apache 2.4 config directory - host> cd cfg/apache-2.4 + # Navigate to Apache 2.4 config directory + host> cd cfg/apache-2.4 - # Create new conf file - host> touch limits.conf + # Create new conf file + host> touch limits.conf Now add the following content to the file: .. code-block:: ini - :name: limits.conf - :caption: limits.conf + :caption: limits.conf - # Limit amount of HTTP headers a client can send to the server - LimitRequestFields 20 - LimitRequestFieldSize 4094 + # Limit amount of HTTP headers a client can send to the server + LimitRequestFields 20 + LimitRequestFieldSize 4094 - # URL GET size - LimitRequestLine 2048 + # URL GET size + LimitRequestLine 2048 In order to apply the changes you need to restart the Devilbox. .. note:: - The above is just an example demonstration, you probably need other values for your setup. - So make sure to understand how to configure Apache, if you are going to change any of those - settings. + The above is just an example demonstration, you probably need other values for your setup. + So make sure to understand how to configure Apache, if you are going to change any of those + settings. diff --git a/docs/configuration-files/bashrc-sh.rst b/docs/configuration-files/bashrc-sh.rst index fd19fa5d..f16b7b9b 100644 --- a/docs/configuration-files/bashrc-sh.rst +++ b/docs/configuration-files/bashrc-sh.rst @@ -43,22 +43,21 @@ by ``.sh`` and place it into the ``./bash/`` directory: .. code-block:: bash - # Navigate to the Devilbox git directory - host> cd path/to/devilbox + # Navigate to the Devilbox git directory + host> cd path/to/devilbox - # Create a new file - host> touch ./bash/aliases.sh + # Create a new file + host> touch ./bash/aliases.sh - # Add some content to the file - host> vi ./bash/aliases.sh + # Add some content to the file + host> vi ./bash/aliases.sh .. code-block:: bash - :name: ./bash/aliases.sh - :caption: ./bash/aliases.sh + :caption: ./bash/aliases.sh - alias l='ls -a' - alias ll='ls -al' - alias www='cd /shared/httpd' + alias l='ls -a' + alias ll='ls -al' + alias www='cd /shared/httpd' Custom vim configuration @@ -72,11 +71,11 @@ First of all, place your favorite ``.vimrc`` into the ``./bash/`` directory .. code-block:: bash - # Navigate to the Devilbox git directory - host> cd path/to/devilbox + # Navigate to the Devilbox git directory + host> cd path/to/devilbox - # Copy your vim config to the ./bash directory - host> cp ~/.vimrc bash/.vimrc + # Copy your vim config to the ./bash directory + host> cp ~/.vimrc bash/.vimrc Right now, this is not going to do anything and as ``.vimrc`` is not ending by ``.sh`` it is also ignored by the shell itself. What is now left to do, is make vim itself always use this config file. @@ -87,14 +86,14 @@ that will always use this file: .. code-block:: bash - # Navigate to the Devilbox git directory - host> cd path/to/devilbox + # Navigate to the Devilbox git directory + host> cd path/to/devilbox - # Create a new file - host> touch ./bash/vim.sh + # Create a new file + host> touch ./bash/vim.sh - # Add your vim alias - host> vi ./bash/vim.sh + # Add your vim alias + host> vi ./bash/vim.sh .. code-block:: bash :caption: ./bash/vim.sh diff --git a/docs/configuration-files/docker-compose-override-yml.rst b/docs/configuration-files/docker-compose-override-yml.rst index 630e3933..dd961b8a 100644 --- a/docs/configuration-files/docker-compose-override-yml.rst +++ b/docs/configuration-files/docker-compose-override-yml.rst @@ -25,8 +25,8 @@ Copy example file .. code-block:: bash - host> cd path/to/devilbox - host> cp docker-compose.override.yml-example docker-compose.override.yml + host> cd path/to/devilbox + host> cp docker-compose.override.yml-example docker-compose.override.yml Create new file from scratch @@ -38,30 +38,27 @@ Create new file from scratch .. code-block:: bash - # Create an empty file - host> cd path/to/devilbox - host> touch docker-compose.override.yml + # Create an empty file + host> cd path/to/devilbox + host> touch docker-compose.override.yml - # Retrieve the current version - host> grep ^version docker-compose.yml - version: '2.1' + # Retrieve the current version + host> grep ^version docker-compose.yml + version: '2.1' - # Add this version line to docker-compose.override.yml - host> echo "version: '2.1'" > docker-compose.override.yml + # Add this version line to docker-compose.override.yml + host> echo "version: '2.1'" > docker-compose.override.yml Let's see again how this file should look like now: .. code-block:: yaml - :name: docker-compose.override.yml - :caption: docker-compose.override.yml - - version: '2.1' - + :caption: docker-compose.override.yml + version: '2.1' .. note:: - The documentation might be outdated and the version number might already be higher. - Rely on the output of the ``grep`` command. + The documentation might be outdated and the version number might already be higher. + Rely on the output of the ``grep`` command. Further reading @@ -71,5 +68,5 @@ To dive deeper into this topic and see how to actually add new services or overw services follow the below listed links: .. seealso:: - * :ref:`add_your_own_docker_image` - * :ref:`overwrite_existing_docker_image` + * :ref:`add_your_own_docker_image` + * :ref:`overwrite_existing_docker_image` diff --git a/docs/configuration-files/docker-compose-yml.rst b/docs/configuration-files/docker-compose-yml.rst index 9acce8fa..a6718245 100644 --- a/docs/configuration-files/docker-compose-yml.rst +++ b/docs/configuration-files/docker-compose-yml.rst @@ -10,4 +10,4 @@ It is very tempting to just change this file in order to add new services to the However your git directory will become dirty and you will always have to stash your changes before pulling new features from remote. To overcome this Docker Compose offers a default override file (``docker-compose.override.yml``) that let's you specify custom changes as well as completely new services without having to touch the default ``docker-compose.yml``. .. seealso:: - To find out more read :ref:`docker_compose_override_yml` + To find out more read :ref:`docker_compose_override_yml` diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index 88e49eaf..63d98f7a 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -62,61 +62,61 @@ The ``./log/`` directory itself will contain subdirectories in the form `` cd path/to/devilbox - host> tree log + host> cd path/to/devilbox + host> tree log - log/ - ├── nginx-stable/ - │   ├── nginx-stable/ - │   ├── defaultlocalhost-access.log - │   ├── defaultlocalhost-error.log - │   ├── -access.log # Each project has its own access log - │   ├── -error.log # Each project has its own error log - ├── mariadb-10.1/ - │   ├── error.log - │   ├── query.log - │   ├── slow.log - ├── php-fpm-7.1/ - │   ├── php-fpm.access - │   ├── php-fpm.error + log/ + ├── nginx-stable/ + │   ├── nginx-stable/ + │   ├── defaultlocalhost-access.log + │   ├── defaultlocalhost-error.log + │   ├── -access.log # Each project has its own access log + │   ├── -error.log # Each project has its own error log + ├── mariadb-10.1/ + │   ├── error.log + │   ├── query.log + │   ├── slow.log + ├── php-fpm-7.1/ + │   ├── php-fpm.access + │   ├── php-fpm.error When you want to read logs sent to Docker logs, you can do so via the following command: .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs + host> cd path/to/devilbox + host> docker-compose logs When you want to continuously watch the log output (such as ``tail -f``), you need to append ``-f`` to the command. .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs -f + host> cd path/to/devilbox + host> docker-compose logs -f When you only want to have logs displayed for a single service, you can also append the service name (works with or without ``-f`` as well): .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs php -f + host> cd path/to/devilbox + host> docker-compose logs php -f .. important:: - Currently this is only implemented for PHP-FPM and HTTPD Docker container. - MySQL will always output its logs to file and all other official Docker container - always output to Docker logs. + Currently this is only implemented for PHP-FPM and HTTPD Docker container. + MySQL will always output its logs to file and all other official Docker container + always output to Docker logs. DEVILBOX_PATH @@ -226,24 +226,23 @@ this project visible to everyone in your corporate LAN. +-------------+----------------+---------------------------+ .. warning:: - Do not use ``dev`` as a domain suffix (I know, it's tempting). - It has been registered by - `Google `_ and they advertise the - `HSTS header `_ - which makes your browser redirect every http request to https. + Do not use ``dev`` as a domain suffix (I know, it's tempting). + It has been registered by + `Google `_ and they advertise the + `HSTS header `_ + which makes your browser redirect every http request to https. - **See also:** `This blog post `_ + **See also:** `This blog post `_ .. warning:: - Do not use ``localhost`` as a domain suffix. - There is an RFC draft to make sure all localhost requests, including their sub domains - should be redirected to the systems loopback interface. - Docker has already released a commit preventing the use of ``localhost`` on MacOS. + Do not use ``localhost`` as a domain suffix. + There is an RFC draft to make sure all localhost requests, including their sub domains + should be redirected to the systems loopback interface. + Docker has already released a commit preventing the use of ``localhost`` on MacOS. - - **See also:** `RFC Draft `_ - and - `Docker Release notes `_ + **See also:** `RFC Draft `_ + and + `Docker Release notes `_ .. _env_extra_hosts: @@ -269,13 +268,13 @@ The general structure to add extra hosts looks like this .. code-block:: bash - # Single host - EXTRA_HOSTS='hostname=1.1.1.1' - EXTRA_HOSTS='hostname=CNAME' + # Single host + EXTRA_HOSTS='hostname=1.1.1.1' + EXTRA_HOSTS='hostname=CNAME' - # Multiple hosts - EXTRA_HOSTS='hostname1=1.1.1.1,hostname2=2.2.2.2' - EXTRA_HOSTS='hostname1=CNAME1,hostname2=CNAME2' + # Multiple hosts + EXTRA_HOSTS='hostname1=1.1.1.1,hostname2=2.2.2.2' + EXTRA_HOSTS='hostname1=CNAME1,hostname2=CNAME2' * The left side represents the name by which the host will be available by * The right side represents the IP address by which the new name will resolve to @@ -285,32 +284,32 @@ A few examples for adding extra hosts: .. code-block:: bash - # 1. One entry: - # The following extra host 'loc' is added and will always point to 192.168.0.7. - # When reverse resolving '192.168.0.7' it will answer with 'tld'. - EXTRA_HOSTS='loc=192.168.0.7' + # 1. One entry: + # The following extra host 'loc' is added and will always point to 192.168.0.7. + # When reverse resolving '192.168.0.7' it will answer with 'tld'. + EXTRA_HOSTS='loc=192.168.0.7' - # 2. One entry: - # The following extra host 'my.host.loc' is added and will always point to 192.168.0.9. - # When reverse resolving '192.168.0.9' it will answer with 'my.host'. - EXTRA_HOSTS='my.host.loc=192.168.0.9' + # 2. One entry: + # The following extra host 'my.host.loc' is added and will always point to 192.168.0.9. + # When reverse resolving '192.168.0.9' it will answer with 'my.host'. + EXTRA_HOSTS='my.host.loc=192.168.0.9' - # 3. Two entries: - # The following extra host 'tld' is added and will always point to 192.168.0.1. - # When reverse resolving '192.168.0.1' it will answer with 'tld'. - # A second extra host 'example.org' is added and always redirects to 192.168.0.2 - # When reverse resolving '192.168.0.2' it will answer with 'example.org'. - EXTRA_HOSTS='tld=192.168.0.1,example.org=192.168.0.2' + # 3. Two entries: + # The following extra host 'tld' is added and will always point to 192.168.0.1. + # When reverse resolving '192.168.0.1' it will answer with 'tld'. + # A second extra host 'example.org' is added and always redirects to 192.168.0.2 + # When reverse resolving '192.168.0.2' it will answer with 'example.org'. + EXTRA_HOSTS='tld=192.168.0.1,example.org=192.168.0.2' - # 4. Using CNAME's for resolving: - # The following extra host 'my.host' is added and will always point to whatever - # IP example.org resolves to. - # When reverse resolving '192.168.0.1' it will answer with 'my.host'. - EXTRA_HOSTS='my.host=example.org' + # 4. Using CNAME's for resolving: + # The following extra host 'my.host' is added and will always point to whatever + # IP example.org resolves to. + # When reverse resolving '192.168.0.1' it will answer with 'my.host'. + EXTRA_HOSTS='my.host=example.org' .. seealso:: - This resembles the feature of `Docker Compose: extra_hosts `_ to add external links. + This resembles the feature of `Docker Compose: extra_hosts `_ to add external links. .. seealso:: :ref:`communicating_with_external_hosts` @@ -329,8 +328,8 @@ How do you find out your user id? .. code-block:: bash - host> id -u - 1000 + host> id -u + 1000 In most cases (on Linux and MacOS), this will be ``1000`` if you are the first and only user on your system, however it could also be a different value. @@ -363,8 +362,8 @@ How do you find out your group id? .. code-block:: bash - host> id -g - 1000 + host> id -g + 1000 In most cases (on Linux and MacOS), this will be ``1000`` if you are the first and only user on your system, however it could also be a different value. @@ -534,7 +533,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 7 host> grep PHP_SERVER .env @@ -566,7 +564,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 5 host> grep HTTPD_SERVER .env @@ -594,7 +591,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 9 host> grep MYSQL_SERVER .env @@ -630,7 +626,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 8 host> grep PGSQL_SERVER .env @@ -666,7 +661,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 6 host> grep REDIS_SERVER .env @@ -699,7 +693,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 24 host> grep MEMCD_SERVER .env @@ -751,7 +744,6 @@ All values are already available in the ``.env`` file and just need to be commen .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 6 host> grep MONGO_SERVER .env @@ -814,9 +806,8 @@ like this: .. code-block:: bash :caption: .env - :name: .env - HOST_PATH_HTTPD_DATADIR=/home/myuser/workspace/web + HOST_PATH_HTTPD_DATADIR=/home/myuser/workspace/web Mapping ^^^^^^^ @@ -862,18 +853,18 @@ The directory structure will look something like this: .. code-block:: bash - host> 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.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.3/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.5/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.6/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.7/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-8.0/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.5/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.6/ - drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.7/ + host> 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.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.3/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.5/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.6/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-5.7/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 mysql-8.0/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.5/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.6/ + drwxrwxr-x 6 48 48 4096 Jun 21 08:47 percona-5.7/ .. warning:: :ref:`remove_stopped_container` @@ -908,13 +899,13 @@ The directory structure will look something like this: .. code-block:: bash - host> 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/ + host> 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/ .. warning:: :ref:`remove_stopped_container` @@ -949,12 +940,12 @@ The directory structure will look something like this: .. code-block:: bash - host> 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/ + host> 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/ .. warning:: :ref:`remove_stopped_container` @@ -976,13 +967,13 @@ Open a terminal and type the following: .. code-block:: bash - host> netstat -an | grep 'LISTEN\s' - tcp 0 0 127.0.0.1:53585 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:37715 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:58555 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:48573 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:34591 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN + host> netstat -an | grep 'LISTEN\s' + tcp 0 0 127.0.0.1:53585 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:37715 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:58555 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:48573 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:34591 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN **How to list used ports on Windows** @@ -990,12 +981,12 @@ Open the command prompt and type the following: .. code-block:: bash - C:\WINDOWS\system32> netstat -an - Proto Local Address Foreign Address State - TCP 0.0.0.0:80 0.0.0.0:0 LISTENING - TCP 0.0.0.0:145 0.0.0.0:0 LISTENING - TCP 0.0.0.0:445 0.0.0.0:0 LISTENING - TCP 0.0.0.0:1875 0.0.0.0:0 LISTENING + C:\WINDOWS\system32> netstat -an + Proto Local Address Foreign Address State + TCP 0.0.0.0:80 0.0.0.0:0 LISTENING + TCP 0.0.0.0:145 0.0.0.0:0 LISTENING + TCP 0.0.0.0:445 0.0.0.0:0 LISTENING + TCP 0.0.0.0:1875 0.0.0.0:0 LISTENING .. warning:: :ref:`docker_toolbox` @@ -1139,13 +1130,12 @@ Enable any non-standard PHP modules in a comma separated list. +------------------------+--------------------------------------+------------------+ .. note:: - Currently only ``ioncube`` is available to enable. + Currently only ``ioncube`` is available to enable. Example: .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 2 # Enable ionCube @@ -1166,7 +1156,6 @@ Example: .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 2 # Disable Xdebug, Imagick and Swoole @@ -1184,7 +1173,6 @@ production, for example: ``APPLICATION_ENV``, you can just add this to the ``.en .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 3 host> grep APPLICATION_ENV .env @@ -1195,7 +1183,6 @@ Within your php application/file you can then access this variable via the ``get .. code-block:: php :caption: index.php - :name: index.php :emphasize-lines: 3 ls -l data/www/my-first-project/ - total 4 - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ + # Project directory + host> ls -l data/www/my-first-project/ + total 4 + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ - # htdocs directory inside your project directory - host> ls -l data/www/my-first-project/htdocs - total 4 - -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 index.php + # htdocs directory inside your project directory + host> ls -l data/www/my-first-project/htdocs + total 4 + -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 index.php By calling your proect url, the ``index.php`` file will be served. @@ -1280,16 +1267,16 @@ Let's have a look how the directory is actually built up: .. code-block:: bash :emphasize-lines: 5 - # Project directory - host> ls -l data/www/my-first-project/ - total 4 - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 cakephp/ - lrwxrwxrwx 1 cytopia cytopia 15 Mar 17 09:36 htdocs -> cakephp/webroot/ + # Project directory + host> ls -l data/www/my-first-project/ + total 4 + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 cakephp/ + lrwxrwxrwx 1 cytopia cytopia 15 Mar 17 09:36 htdocs -> cakephp/webroot/ - # htdocs directory inside your project directory - host> ls -l data/www/my-first-project/htdocs - total 4 - -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 index.php + # htdocs directory inside your project directory + host> ls -l data/www/my-first-project/htdocs + total 4 + -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 index.php As you can see, the web server is still able to server the files from the ``htdocs`` location, this time however, ``htdocs`` itself is a symlink pointing to a much deeper and nested location @@ -1320,10 +1307,10 @@ Let's have a look at an imaginary project directory called ``my-first-project``: .. code-block:: bash - # Project directory - host> ls -l data/www/my-first-project/ - total 4 - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ + # Project directory + host> ls -l data/www/my-first-project/ + total 4 + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ Inside this your project directory you will need to create another directory which is called ``.devilbox`` by default. If you change the ``HTTPD_TEMPLATE_DIR`` variable to something else, @@ -1332,13 +1319,13 @@ you will have to create a directory by whatever name you chose for that variable .. code-block:: bash :emphasize-lines: 3,6 - # Project directory - host> cd data/www/my-first-project/ - host> mkdir .devilbox - host> ls -l - total 4 - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 .devilbox/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ + # Project directory + host> cd data/www/my-first-project/ + host> mkdir .devilbox + host> ls -l + total 4 + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 .devilbox/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ Now you need to copy the ``vhost-gen`` templates into the ``.devilbox`` directory. The templates are available in the Devilbox git directory under ``templates/vhost-gen/``. @@ -1350,11 +1337,11 @@ present. .. code-block:: bash :emphasize-lines: 5 - # Navigate into the devilbox directory - host> cd path/to/devilbox + # Navigate into the devilbox directory + host> cd path/to/devilbox - # Copy templates to your project directory - host> cp templates/vhost-gen/* data/www/my-first-project/.devilbox/ + # Copy templates to your project directory + host> cp templates/vhost-gen/* data/www/my-first-project/.devilbox/ Let's have a look how the directory is actually built up: @@ -1362,35 +1349,35 @@ Let's have a look how the directory is actually built up: .. code-block:: bash :emphasize-lines: 4,8 - # Project directory - host> ls -l data/www/my-first-project/ - total 4 - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 .devilbox/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ + # Project directory + host> ls -l data/www/my-first-project/ + total 4 + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 .devilbox/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 12 23:05 htdocs/ - # template directory inside your project directory - host> ls -l data/www/my-first-project/htdocs/.devilbox - total 4 - -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 apache22.yml - -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 apache24.yml - -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 nginx.yml + # template directory inside your project directory + host> ls -l data/www/my-first-project/htdocs/.devilbox + total 4 + -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 apache22.yml + -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 apache24.yml + -rw-r--r-- 1 cytopia cytopia 87 Mar 12 23:05 nginx.yml The three files ``apache22.yml``, ``apache24.yml`` and ``nginx.yml`` let you customize your web servers virtual host to anything from adding rewrite rules, overwriting directory index to even changing the server name or adding locations to other assets. .. seealso:: - The whole process is based on a project called `vhost-gen `_. - A virtual host generator for Apache 2.2, Apache 2.4 and any Nginx version. + The whole process is based on a project called `vhost-gen `_. + A virtual host generator for Apache 2.2, Apache 2.4 and any Nginx version. .. seealso:: - **Customize your virtual host** - When you want to find out more how to actually customize each virtual host to its own need, - read up more on :ref:`custom_vhost`. - **Tutorials** - Also have a look at this tutorial which is a walk-through showing you how to modify - a virtual host and make it serve all files for multiple sub domains (server names): - :ref:`tutorial_adding_sub_domains` + **Customize your virtual host** + When you want to find out more how to actually customize each virtual host to its own need, + read up more on :ref:`custom_vhost`. + **Tutorials** + Also have a look at this tutorial which is a walk-through showing you how to modify + a virtual host and make it serve all files for multiple sub domains (server names): + :ref:`tutorial_adding_sub_domains` MySQL @@ -1413,7 +1400,7 @@ be able to display information inside the bundled intranet. +-------------------------+-------------------+---------------------+ .. warning:: - Keep this variable in sync with the actual MySQL root password. + Keep this variable in sync with the actual MySQL root password. MYSQL_GENERAL_LOG @@ -1452,7 +1439,7 @@ connect to PostgreSQL and will not be able to display information inside the bun +-------------------------+---------------------+---------------------+ .. warning:: - Keep this variable in sync with the actual PostgreSQL username. + Keep this variable in sync with the actual PostgreSQL username. PGSQL_ROOT_PASSWORD @@ -1470,7 +1457,7 @@ connect to PostgreSQL and will not be able to display information inside the bun +-------------------------+---------------------+---------------------+ .. warning:: - Keep this variable in sync with the actual PostgreSQL password. + Keep this variable in sync with the actual PostgreSQL password. Bind @@ -1497,14 +1484,14 @@ Some examples: .. code-block:: bash - BIND_DNS_RESOLVER='8.8.8.8' - BIND_DNS_RESOLVER='8.8.8.8,192.168.0.10' + BIND_DNS_RESOLVER='8.8.8.8' + BIND_DNS_RESOLVER='8.8.8.8,192.168.0.10' .. note:: - If you don't trust the Google DNS server, then set it to something else. - If you already have a DNS server inside your LAN and also want your custom DNS (if any) - to be available inside the containers, set the value to its IP address. + If you don't trust the Google DNS server, then set it to something else. + If you already have a DNS server inside your LAN and also want your custom DNS (if any) + to be available inside the containers, set the value to its IP address. BIND_DNSSEC_VALIDATE @@ -1550,8 +1537,8 @@ This variable controls the DNS TTL in seconds. If empty or removed it will fallb .. seealso:: - * `BIND TTL `_ - * `BIND SOA `_ + * `BIND TTL `_ + * `BIND SOA `_ BIND_REFRESH_TIME ^^^^^^^^^^^^^^^^^ diff --git a/docs/configuration-files/my-cnf.rst b/docs/configuration-files/my-cnf.rst index 9eb0eec6..43664e98 100644 --- a/docs/configuration-files/my-cnf.rst +++ b/docs/configuration-files/my-cnf.rst @@ -10,10 +10,10 @@ MySQL version. .. important:: - When using :ref:`docker_toolbox` on Windows, ``*.cnf`` files must have read-only file - permissions, otherwise they are not sourced by the MySQL server. + When using :ref:`docker_toolbox` on Windows, ``*.cnf`` files must have read-only file + permissions, otherwise they are not sourced by the MySQL server. - Make sure to ``chmod 0444 *.cnf`` after adding your values. + Make sure to ``chmod 0444 *.cnf`` after adding your values. **Table of Contents** @@ -29,19 +29,19 @@ See the directory structure for MySQL configuration directories inside ``./cfg/` .. code-block:: bash - host> ls -l path/to/devilbox/cfg/ | grep -E 'mysql|mariadb|percona' + host> ls -l path/to/devilbox/cfg/ | grep -E 'mysql|mariadb|percona' - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.0/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.1/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.2/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.3/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.5/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.6/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.7/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-8.0/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.5/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.6/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.7/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.0/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.1/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mariadb-10.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.5/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.6/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-5.7/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 mysql-8.0/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.5/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.6/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 percona-5.7/ Customization is achieved by placing a file into ``cfg/mysql-X.X/``, ``cfg/mariadb-X.X/`` or ``cfg/percona-X-X`` (where ``X.X`` stands for your MySQL version). @@ -66,23 +66,22 @@ of MySQL 5.5 to 16 MB. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to MySQL 5.5 config directory - host> cd cfg/mysql-5.5 + # Navigate to MySQL 5.5 config directory + host> cd cfg/mysql-5.5 - # Create new cnf file - host> touch key_buffer_size.cnf + # Create new cnf file + host> touch key_buffer_size.cnf Now add the following content to the file: .. code-block:: ini - :name: memory_limit.cnf - :caption: memory_limit.cnf + :caption: memory_limit.cnf - [mysqld] - key_buffer_size=16M + [mysqld] + key_buffer_size=16M In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet MySQL info page. @@ -99,24 +98,23 @@ of PerconaDB 5.7 .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PerconaDB 5.7 config directory - host> cd cfg/percona-5.7 + # Navigate to PerconaDB 5.7 config directory + host> cd cfg/percona-5.7 - # Create new ini file - host> touch timeouts.cnf + # Create new ini file + host> touch timeouts.cnf Now add the following content to the file: .. code-block:: ini - :name: timeouts.cnf - :caption: timeouts.cnf + :caption: timeouts.cnf - [mysqld] - max_allowed_packet=256M - wait_timeout = 86400 + [mysqld] + max_allowed_packet=256M + wait_timeout = 86400 In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet MySQL info page. diff --git a/docs/configuration-files/nginx-conf.rst b/docs/configuration-files/nginx-conf.rst index eef4af13..4708f853 100644 --- a/docs/configuration-files/nginx-conf.rst +++ b/docs/configuration-files/nginx-conf.rst @@ -11,9 +11,9 @@ supplying custom configurations. .. seealso:: If you are rather using Apache, have a look at: :ref:`apache_conf` .. important:: - You could actually also create virtual hosts here, but it is recommended to use the - Devilbox Auto-vhost generation feature. If you want to custimize your current virtual hosts - have a look at :ref:`custom_vhost`. + You could actually also create virtual hosts here, but it is recommended to use the + Devilbox Auto-vhost generation feature. If you want to custimize your current virtual hosts + have a look at :ref:`custom_vhost`. **Table of Contents** @@ -29,10 +29,10 @@ See the directory structure for Nginx configuration directories inside ``./cfg/` .. code-block:: bash - host> ls -l path/to/devilbox/cfg/ | grep 'nginx' + host> ls -l path/to/devilbox/cfg/ | grep 'nginx' - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 nginx-mainline/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 nginx-stable/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 nginx-mainline/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 nginx-stable/ Customization is achieved by placing a file into ``cfg/nginx-X/`` (where ``X`` stands for your Nginx flavoour). The file must end by ``.conf`` in order to be sourced by the web server. @@ -59,31 +59,30 @@ values of Nginx stable. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to Nginx stable config directory - host> cd cfg/nginx-stable + # Navigate to Nginx stable config directory + host> cd cfg/nginx-stable - # Create new conf file - host> touch keep_alive.conf + # Create new conf file + host> touch keep_alive.conf Now add the following content to the file: .. code-block:: ini - :name: keep_alive.conf - :caption: keep_alive.conf + :caption: keep_alive.conf - keepalive 10; - keepalive_timeout 10s; - keepalive_requests 100; + keepalive 10; + keepalive_timeout 10s; + keepalive_requests 100; In order to apply the changes you need to restart the Devilbox. .. note:: - The above is just an example demonstration, you probably need other values for your setup. - So make sure to understand how to configure Nginx, if you are going to change any of those - settings. + The above is just an example demonstration, you probably need other values for your setup. + So make sure to understand how to configure Nginx, if you are going to change any of those + settings. Adjust timeout settings for Nginx mainline @@ -98,28 +97,27 @@ and .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to Nginx mainline config directory - host> cd cfg/nginx-mainline + # Navigate to Nginx mainline config directory + host> cd cfg/nginx-mainline - # Create new conf file - host> touch timeouts.conf + # Create new conf file + host> touch timeouts.conf Now add the following content to the file: .. code-block:: ini - :name: timeouts.conf - :caption: timeouts.conf + :caption: timeouts.conf - client_body_timeout 60s; - client_header_timeout 60s; - send_timeout 60s; + client_body_timeout 60s; + client_header_timeout 60s; + send_timeout 60s; In order to apply the changes you need to restart the Devilbox. .. note:: - The above is just an example demonstration, you probably need other values for your setup. - So make sure to understand how to configure Nginx, if you are going to change any of those - settings. + The above is just an example demonstration, you probably need other values for your setup. + So make sure to understand how to configure Nginx, if you are going to change any of those + settings. diff --git a/docs/configuration-files/php-fpm-conf.rst b/docs/configuration-files/php-fpm-conf.rst index b74bcc44..b4cf7e47 100644 --- a/docs/configuration-files/php-fpm-conf.rst +++ b/docs/configuration-files/php-fpm-conf.rst @@ -22,23 +22,23 @@ These changes affect the PHP-FPM process itself, global as well as pool specific be set. .. note:: - The default PHP-FPM pool is called ``www`` in case you want to make changes to it. + The default PHP-FPM pool is called ``www`` in case you want to make changes to it. See the directory structure for PHP-FPM configuration directories inside ``./cfg/`` directory: .. code-block:: bash - host> ls -l path/to/devilbox/cfg/ | grep 'php-fpm' + host> ls -l path/to/devilbox/cfg/ | grep 'php-fpm' - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.3/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.4/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.5/ - drwxr-xr-x 2 cytopia cytopia 4096 Apr 3 22:04 php-fpm-5.6/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.0/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.1/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.2/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.4/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-5.5/ + drwxr-xr-x 2 cytopia cytopia 4096 Apr 3 22:04 php-fpm-5.6/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.0/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.1/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-fpm-7.3/ Customization is achieved by placing a file into ``cfg/php-fpm-X.X/`` (where ``X.X`` stands for your PHP version). The file must end by ``.conf`` in order to be sourced by the PHP-FPM server. @@ -50,8 +50,8 @@ This file holds some example values that can be adjusted or commented out. In order for the changes to be applied, you will have to restart the Devilbox. .. seealso:: - To find out about all available PHP-FPM directives, global or pool specific have a look - at its documentation: https://secure.php.net/manual/en/install.fpm.configuration.php + To find out about all available PHP-FPM directives, global or pool specific have a look + at its documentation: https://secure.php.net/manual/en/install.fpm.configuration.php Examples @@ -66,23 +66,22 @@ of PHP-FPM 7.1 master process to 100. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PHP 7.1 config directory - host> cd cfg/php-fpm-7.1 + # Navigate to PHP 7.1 config directory + host> cd cfg/php-fpm-7.1 - # Create new conf file - host> touch rlimit.conf + # Create new conf file + host> touch rlimit.conf Now add the following content to the file: .. code-block:: ini - :name: rlimit.conf - :caption: rlimit.conf + :caption: rlimit.conf - [global] - rlimit_core = 100 + [global] + rlimit_core = 100 .. important:: Note the ``[global]`` section. @@ -103,28 +102,27 @@ of PHP-FPM 5.6 on pool ``www``. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PHP 5.6 config directory - host> cd cfg/php-fpm-5.6 + # Navigate to PHP 5.6 config directory + host> cd cfg/php-fpm-5.6 - # Create new conf file - host> touch www_server.conf + # Create new conf file + host> touch www_server.conf Now add the following content to the file: .. code-block:: ini - :name: www_server.conf - :caption: www_server.conf + :caption: www_server.conf - [www] - ; Pool config - pm = dynamic - pm.max_children = 10 - pm.start_servers = 3 - pm.min_spare_servers = 2 - pm.max_spare_servers = 5 + [www] + ; Pool config + pm = dynamic + pm.max_children = 10 + pm.start_servers = 3 + pm.min_spare_servers = 2 + pm.max_spare_servers = 5 .. important:: Note the ``[www]`` section. @@ -146,33 +144,32 @@ The following example will disable built-in PHP functions globally and non-overw .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PHP 7.0 config directory - host> cd cfg/php-fpm-7.0 + # Navigate to PHP 7.0 config directory + host> cd cfg/php-fpm-7.0 - # Create new conf file - host> touch admin.conf + # Create new conf file + host> touch admin.conf Now add the following content to the file: .. code-block:: ini - :name: admin.conf - :caption: admin.conf + :caption: admin.conf - [www] - php_admin_value[disable_functions] = link,symlink,popen,exec,system,shell_exec + [www] + php_admin_value[disable_functions] = link,symlink,popen,exec,system,shell_exec .. important:: Note the ``[www]`` section. .. important:: - This kind of setting only has affects PHP files served through PHP-FPM, when you run php - on the command line, this setting will be ignored. + This kind of setting only has affects PHP files served through PHP-FPM, when you run php + on the command line, this setting will be ignored. .. important:: - Be aware that none of your projects can use the above disabled functions anymore. - They will simply not exist for PHP 7.0 after that configuration took affect. + Be aware that none of your projects can use the above disabled functions anymore. + They will simply not exist for PHP 7.0 after that configuration took affect. In order to apply the changes you need to restart the Devilbox. diff --git a/docs/configuration-files/php-ini.rst b/docs/configuration-files/php-ini.rst index fecd3712..8ce78610 100644 --- a/docs/configuration-files/php-ini.rst +++ b/docs/configuration-files/php-ini.rst @@ -22,16 +22,16 @@ See the directory structure for PHP configuration directories inside ``./cfg/`` .. code-block:: bash - host> ls -l path/to/devilbox/cfg/ | grep 'php-ini' + host> ls -l path/to/devilbox/cfg/ | grep 'php-ini' - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.3/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.4/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.5/ - drwxr-xr-x 2 cytopia cytopia 4096 Apr 3 22:04 php-ini-5.6/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.0/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.1/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.2/ - drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.3/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.4/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-5.5/ + drwxr-xr-x 2 cytopia cytopia 4096 Apr 3 22:04 php-ini-5.6/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.0/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.1/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.2/ + drwxr-xr-x 2 cytopia cytopia 4096 Mar 5 21:53 php-ini-7.3/ Customization is achieved by placing a file into ``cfg/php-ini-X.X/`` (where ``X.X`` stands for your PHP version). The file must end by ``.ini`` in order to be sourced by the PHP-FPM server. @@ -55,23 +55,22 @@ The following examples shows you how to change the .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PHP 7.1 config directory - host> cd cfg/php-ini-7.1 + # Navigate to PHP 7.1 config directory + host> cd cfg/php-ini-7.1 - # Create new ini file - host> touch memory_limit.ini + # Create new ini file + host> touch memory_limit.ini Now add the following content to the file: .. code-block:: ini - :name: memory_limit.ini - :caption: memory_limit.ini + :caption: memory_limit.ini - [PHP] - memory_limit = 4096M + [PHP] + memory_limit = 4096M In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet phpinfo page. @@ -87,24 +86,23 @@ of PHP 5.6. .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Navigate to PHP 5.6 config directory - host> cd cfg/php-ini-5.6 + # Navigate to PHP 5.6 config directory + host> cd cfg/php-ini-5.6 - # Create new ini file - host> touch timeouts.ini + # Create new ini file + host> touch timeouts.ini Now add the following content to the file: .. code-block:: ini - :name: timeouts.ini - :caption: timeouts.ini + :caption: timeouts.ini - [PHP] - max_execution_time = 180 - max_input_time = 180 + [PHP] + max_execution_time = 180 + max_input_time = 180 In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet phpinfo page. diff --git a/docs/configuration-global/auto-dns.rst b/docs/configuration-global/auto-dns.rst index abe92d2f..d1ceb048 100644 --- a/docs/configuration-global/auto-dns.rst +++ b/docs/configuration-global/auto-dns.rst @@ -8,8 +8,8 @@ If you don't want to add DNS records manually for every project, you can also us DNS server and use it's DNS catch-all feature to have all DNS records automatically available. .. important:: - By default, the DNS server is set to listen on ``1053`` to avoid port collisions during startup. - You need to change it to ``53`` in ``.env`` via :ref:`env_host_port_bind`. + By default, the DNS server is set to listen on ``1053`` to avoid port collisions during startup. + You need to change it to ``53`` in ``.env`` via :ref:`env_host_port_bind`. **Table of Contents** @@ -34,34 +34,32 @@ Prerequisites First ensure that :ref:`env_local_listen_addr` is either empty or listening on ``127.0.0.1``. .. code-block:: bash - :caption: .env - :name: .env - :emphasize-lines: 3 + :caption: .env + :emphasize-lines: 3 - host> cd path/to/devilbox - host> vi .env - LOCAL_LISTEN_ADDR= + host> cd path/to/devilbox + host> vi .env + LOCAL_LISTEN_ADDR= Then you need to ensure that :ref:`env_host_port_bind` is set to ``53``. .. code-block:: bash - :caption: .env - :name: .env - :emphasize-lines: 3 + :caption: .env + :emphasize-lines: 3 - host> cd path/to/devilbox - host> vi .env - HOST_PORT_BIND=53 + host> cd path/to/devilbox + host> vi .env + HOST_PORT_BIND=53 Before starting up the Devilbox, ensure that port ``53`` is not already used on ``127.0.0.1``. .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> netstat -an | grep -E 'LISTEN\s*$' - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:43477 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:50267 0.0.0.0:* LISTEN + host> netstat -an | grep -E 'LISTEN\s*$' + tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:43477 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:50267 0.0.0.0:* LISTEN If you see port ``53`` already being used as in the above example, ensure to stop any DNS resolver, otherwise it does not work. @@ -70,9 +68,9 @@ The output should look like this (It is only important that there is no ``:53``. .. code-block:: bash - host> netstat -an | grep -E 'LISTEN\s*$' - tcp 0 0 127.0.0.1:43477 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:50267 0.0.0.0:* LISTEN + host> netstat -an | grep -E 'LISTEN\s*$' + tcp 0 0 127.0.0.1:43477 0.0.0.0:* LISTEN + tcp 0 0 127.0.0.1:50267 0.0.0.0:* LISTEN Linux @@ -91,20 +89,19 @@ are changed, you always want to have an additional entry, which is the one from Add the following line to to the very beginning to ``/etc/dhcp/dhclient.conf``: .. code-block:: bash - :caption: /etc/dhcp/dhclient.conf - :name: /etc/dhcp/dhclient.conf + :caption: /etc/dhcp/dhclient.conf - prepend domain-name-servers 127.0.0.1; + prepend domain-name-servers 127.0.0.1; When you do that for the first time, you need to restart the ``network-manager`` service. .. code-block:: bash - # Via service command - host> sudo service network-manager restart + # Via service command + host> sudo service network-manager restart - # Or the systemd way - host> sudo systemctl restart network-manager + # Or the systemd way + host> sudo systemctl restart network-manager This will make sure that whenever your /etc/resolv.conf is deployed, you will have ``127.0.0.1`` as the first entry and also make use of any other DNS server which are deployed via the LAN's DHCP server. @@ -120,33 +117,31 @@ In case you are using systemd-resolved instead of NetworkManager, add the follow the very beginning to ``/etc/resolv.conf.head``: .. code-block:: bash - :caption: /etc/resolv.conf.head - :name: /etc/resolv.conf.head + :caption: /etc/resolv.conf.head - nameserver 127.0.0.1 + nameserver 127.0.0.1 Prevent NetworkManager from modifying ``/etc/resolv.conf`` and leave everything to systemd-resolved by adding the following line under the ``[main]`` section of ``/etc/NetworkManager/NetworkManager.conf`` .. code-block:: bash - :caption: /etc/NetworkManager/NetworkManager.conf - :name: /etc/NetworkManager/NetworkManager.conf + :caption: /etc/NetworkManager/NetworkManager.conf - dns=none + dns=none As a last step you will have to restart ``systemd-resolved``. .. code-block:: bash - host> sudo systemctl stop systemd-resolved - host> sudo systemctl start systemd-resolved + host> sudo systemctl stop systemd-resolved + host> sudo systemctl start systemd-resolved Once done, you can verify if the new DNS settings are effective: .. code-block:: bash - host> systemd-resolve --status + host> systemd-resolve --status .. seealso:: `Archlinux Wiki: resolv.conf `_ diff --git a/docs/configuration-global/https-ssl.rst b/docs/configuration-global/https-ssl.rst index eb0a2e0d..bbb2dd2c 100644 --- a/docs/configuration-global/https-ssl.rst +++ b/docs/configuration-global/https-ssl.rst @@ -38,11 +38,11 @@ manually, i.e. they are not overwritten. .. code-block:: bash - host> cd path/to/devilbox - host> ls -l ca/ - -rw-r--r-- 1 cytopia cytopia 1558 May 2 11:12 devilbox-ca.crt - -rw------- 1 cytopia cytopia 1675 May 2 11:12 devilbox-ca.key - -rw-r--r-- 1 cytopia cytopia 17 May 4 08:35 devilbox-ca.srl + host> cd path/to/devilbox + host> ls -l ca/ + -rw-r--r-- 1 cytopia cytopia 1558 May 2 11:12 devilbox-ca.crt + -rw------- 1 cytopia cytopia 1675 May 2 11:12 devilbox-ca.key + -rw-r--r-- 1 cytopia cytopia 17 May 4 08:35 devilbox-ca.srl SSL Certificates @@ -60,8 +60,8 @@ into your browser ones and all current projects and future projects will automat valid and trusted SSL certificates without any further work. .. important:: - Importing the CA into the browser is also recommended and required for the Devilbox - intranet page to work properly. + Importing the CA into the browser is also recommended and required for the Devilbox + intranet page to work properly. Import the CA into your browser diff --git a/docs/configuration-project/custom-vhost.rst b/docs/configuration-project/custom-vhost.rst index 75ff7f9a..7fcd80fb 100644 --- a/docs/configuration-project/custom-vhost.rst +++ b/docs/configuration-project/custom-vhost.rst @@ -23,12 +23,12 @@ listening ports. .. seealso:: - If you intend to use ``vhost-gen`` for your own projects, have a look at its projcet page and - its sister projects: + If you intend to use ``vhost-gen`` for your own projects, have a look at its projcet page and + its sister projects: - * `vhost-gen `_ - * `watcherd `_ - * `watcherp `_ + * `vhost-gen `_ + * `watcherd `_ + * `watcherp `_ Where do I find templates @@ -99,7 +99,7 @@ it will change the `Project template path` which you need to create yourself. For this example we will keep the default value for the sake of simplicity: ``.devilxbox``. .. note:: - The :ref:`env_httpd_template_dir` value is a global setting and will affect all projects. + The :ref:`env_httpd_template_dir` value is a global setting and will affect all projects. 2. Copy webserver template to project template directory @@ -109,23 +109,23 @@ First you need to ensure that the :ref:`env_httpd_template_dir` exists wihin you .. code-block:: bash - # Navigate to the Devilbox directory - host> cd /home/user/devilbox + # Navigate to the Devilbox directory + host> cd /home/user/devilbox - # Create template directory in your project - host> mkdir ./data/www/project-1/.devilbox + # Create template directory in your project + host> mkdir ./data/www/project-1/.devilbox Then you can copy the templates. .. code-block:: bash - host> cp templates/vhost-gen/* ./data/www/project-1/.devilbox + host> cp templates/vhost-gen/* ./data/www/project-1/.devilbox .. note:: - You actually only need to copy the template of your chosen webserver (either Apache 2.2, - Apache 2.4 or Nginx), however it is good practice to copy all templates and also adjust - all templates synchronously. This allows you to change web server versions and still - keep your virtual host settings. + You actually only need to copy the template of your chosen webserver (either Apache 2.2, + Apache 2.4 or Nginx), however it is good practice to copy all templates and also adjust + all templates synchronously. This allows you to change web server versions and still + keep your virtual host settings. 3. Adjust template ^^^^^^^^^^^^^^^^^^ @@ -167,42 +167,42 @@ needs to be in place for what webserver version. +----------------+------------------+ .. note:: - Nginx stable and mainline share the same template as their syntax has no special - differences, whereas Apache 2.2 and Apache 2.4 have slight differences in syntax and therefore - require two different templates. + Nginx stable and mainline share the same template as their syntax has no special + differences, whereas Apache 2.2 and Apache 2.4 have slight differences in syntax and therefore + require two different templates. Ensure yaml files are valid --------------------------- .. warning:: - Pay close attention that you do not use TAB (``\t``) characters for indenting the vhost-gen - yaml files. Some editors might automatically indent using TABs, so ensure they are replaced - with spaces. If TAB characters are present, those files become invalid and won't work. - https://github.com/cytopia/devilbox/issues/142 + Pay close attention that you do not use TAB (``\t``) characters for indenting the vhost-gen + yaml files. Some editors might automatically indent using TABs, so ensure they are replaced + with spaces. If TAB characters are present, those files become invalid and won't work. + https://github.com/cytopia/devilbox/issues/142 - You can use the bundled ``yamllint`` binary inside the container to validate your config. + You can use the bundled ``yamllint`` binary inside the container to validate your config. .. code-block:: bash :emphasize-lines: 13-16 - # Navigate to the Devilbox directory - host> cd /home/user/devilbox + # Navigate to the Devilbox directory + host> cd /home/user/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Go to your project's template directory - devilbox@php-7.0.19 in /shared/httpd $ cd project-1/.devilbox + # Go to your project's template directory + devilbox@php-7.0.19 in /shared/httpd $ cd project-1/.devilbox - # Check the syntax of apache22.yml - devilbox@php-7.0.19 in /shared/httpd/project-1/.devilbox $ yamllint apache22.yml + # Check the syntax of apache22.yml + devilbox@php-7.0.19 in /shared/httpd/project-1/.devilbox $ yamllint apache22.yml - 108:81 error line too long (90 > 80 characters) (line-length) - 139:81 error line too long (100 > 80 characters) (line-length) - 140:81 error line too long (84 > 80 characters) (line-length) - 142:81 error line too long (137 > 80 characters) (line-length) + 108:81 error line too long (90 > 80 characters) (line-length) + 139:81 error line too long (100 > 80 characters) (line-length) + 140:81 error line too long (84 > 80 characters) (line-length) + 142:81 error line too long (137 > 80 characters) (line-length) Long line errors can safely be ignored. @@ -280,29 +280,29 @@ look like this: .. code-block:: yaml - vhost: | - - ServerName example.com + vhost: | + + ServerName example.com - CustomLog "/var/log/apache/access.log" combined - ErrorLog "/var/log/apache/error.log" + CustomLog "/var/log/apache/access.log" combined + ErrorLog "/var/log/apache/error.log" - DocumentRoot "/shared/httpd/project-1/htdocs" - - DirectoryIndex index.php + DocumentRoot "/shared/httpd/project-1/htdocs" + + DirectoryIndex index.php - AllowOverride All - Options All + AllowOverride All + Options All - RewriteEngine on - RewriteBase / + RewriteEngine on + RewriteBase / - Order allow,deny - Allow from all - + Order allow,deny + Allow from all + - ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/shared/httpd/project-1/htdocs/$1 - + ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/shared/httpd/project-1/htdocs/$1 + 2. ``vhost_type:`` ^^^^^^^^^^^^^^^^^^ @@ -360,34 +360,34 @@ Rename project directory .. code-block:: bash - # Navigate to the data directory - host> /home/user/devilbox/data/www + # Navigate to the data directory + host> /home/user/devilbox/data/www - # Rename your project to something else - host> mv project-1 project-1.tmp + # Rename your project to something else + host> mv project-1 project-1.tmp - # Rename your project to its original name - host> mv project-1.tmp project-1 + # Rename your project to its original name + host> mv project-1.tmp project-1 If you want to understand what is going on right now, check the docker logs for the web server. .. code-block:: bash - # Navigate to the devilbox directory - host> /home/user/devilbox + # Navigate to the devilbox directory + host> /home/user/devilbox - # Check docker logs - host> docker-compose logs httpd + # Check docker logs + host> docker-compose logs httpd - httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1.tmp.loc - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1.tmp - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1 - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart + httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1.tmp.loc + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1.tmp + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1 + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart - httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1loc - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1 - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1.tmp - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart + httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1loc + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1 + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1.tmp + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart **What happened?** @@ -395,9 +395,9 @@ The directory changes have been noticed and a new virtual host has been created. your new vhost-gen template has been read and the changes have applied. .. note:: - Renaming a project directory will only affect a single project. In case your change the - value of :ref:`env_httpd_template_dir` it will affect all projects and you would have to - rename all project directories. In this case it is much faster to just restart the Devilbox. + Renaming a project directory will only affect a single project. In case your change the + value of :ref:`env_httpd_template_dir` it will affect all projects and you would have to + rename all project directories. In this case it is much faster to just restart the Devilbox. Restart the Devilbox @@ -410,6 +410,6 @@ Further readings ================ .. seealso:: - Have a look at the following examples which involve customizing vhost-gen templates: + Have a look at the following examples which involve customizing vhost-gen templates: - * :ref:`tutorial_adding_sub_domains` + * :ref:`tutorial_adding_sub_domains` diff --git a/docs/configuration-project/dns-records.rst b/docs/configuration-project/dns-records.rst index 6056ad88..a315d422 100644 --- a/docs/configuration-project/dns-records.rst +++ b/docs/configuration-project/dns-records.rst @@ -11,9 +11,9 @@ The server name is constructed by a ```` and the :ref:`env_tl requires the same DNS record to be present in order to access it. .. seealso:: - This section gives you an overview about how to create separate DNS records for each project. - It has to be done for each project, however if you want to automate the process, refer - to :ref:`global_configuration_auto_dns`. + This section gives you an overview about how to create separate DNS records for each project. + It has to be done for each project, however if you want to automate the process, refer + to :ref:`global_configuration_auto_dns`. **Table of Contents** @@ -36,8 +36,8 @@ See the following table for project directories and TLD_SUFFIX. +-------------------+------------+--------------------------+-----------------------+ .. note:: - When you have created the above two projects, you can check the vhost page on the - Devilbox intranet. It will tell you exactly what DNS record to add. + When you have created the above two projects, you can check the vhost page on the + Devilbox intranet. It will tell you exactly what DNS record to add. .. image:: /_static/img/devilbox-vhosts-dns.png @@ -66,10 +66,10 @@ uses vim to add the two example DNS records. .. code-block:: bash - host> sudo vim /etc/hosts + host> sudo vim /etc/hosts - 127.0.0.1 project-1.loc - 127.0.0.1 www.project-1.loc + 127.0.0.1 project-1.loc + 127.0.0.1 www.project-1.loc MacOS @@ -80,10 +80,10 @@ uses vim to add the two example DNS records. .. code-block:: bash - host> sudo vim /etc/hosts + host> sudo vim /etc/hosts - 127.0.0.1 project-1.loc - 127.0.0.1 www.project-1.loc + 127.0.0.1 project-1.loc + 127.0.0.1 www.project-1.loc Windows @@ -94,8 +94,8 @@ and add the following two lines: .. code-block:: bash - 127.0.0.1 project-1.loc - 127.0.0.1 www.project-1.loc + 127.0.0.1 project-1.loc + 127.0.0.1 www.project-1.loc Docker Toolbox @@ -119,10 +119,10 @@ uses vim to add the two example DNS records. .. code-block:: bash - host> sudo vim /etc/hosts + host> sudo vim /etc/hosts - 192.16.0.1 project-1.loc - 192.16.0.1 www.project-1.loc + 192.16.0.1 project-1.loc + 192.16.0.1 www.project-1.loc Windows @@ -133,8 +133,8 @@ and add the following two lines: .. code-block:: bash - 192.16.0.1 project-1.loc - 192.16.0.1 www.project-1.loc + 192.16.0.1 project-1.loc + 192.16.0.1 www.project-1.loc @@ -145,14 +145,14 @@ After settings the DNS records, you can use the ``ping`` command to verify if ev .. code-block:: bash - host> ping -c1 project-1.loc + host> ping -c1 project-1.loc - PING project-1.loc (127.0.0.1) 56(84) bytes of data. - 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.066 ms + PING project-1.loc (127.0.0.1) 56(84) bytes of data. + 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.066 ms .. code-block:: bash - host> ping -c1 www.project-1.loc + host> ping -c1 www.project-1.loc - PING www.project-1.loc (127.0.0.1) 56(84) bytes of data. - 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.066 ms + PING www.project-1.loc (127.0.0.1) 56(84) bytes of data. + 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.066 ms diff --git a/docs/examples/setup-cakephp.rst b/docs/examples/setup-cakephp.rst index 76e62686..b0116068 100644 --- a/docs/examples/setup-cakephp.rst +++ b/docs/examples/setup-cakephp.rst @@ -49,7 +49,7 @@ It will be ready in eight simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -59,7 +59,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake 3. Install CakePHP @@ -67,8 +67,8 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-cake - devilbox@php-7.0.20 in /shared/httpd/my-cake $ composer create-project --prefer-dist cakephp/app cakephp + devilbox@php-7.0.20 in /shared/httpd $ cd my-cake + devilbox@php-7.0.20 in /shared/httpd/my-cake $ composer create-project --prefer-dist cakephp/app cakephp 4. Symlink webroot @@ -76,7 +76,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-cake $ ln -s cakephp/webroot/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-cake $ ln -s cakephp/webroot/ htdocs 5. Add MySQL Database @@ -84,7 +84,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-cake $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_cake;' + devilbox@php-7.0.20 in /shared/httpd/my-cake $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_cake;' 6. Configure database connection @@ -92,34 +92,33 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-cake $ vi cakephp/config/app.php + devilbox@php-7.0.20 in /shared/httpd/my-cake $ vi cakephp/config/app.php .. code-block:: php :caption: cakephp/config/app.php - :name: cakephp/config/app.php :emphasize-lines: 7,14,15,16 - [ - 'default' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => '127.0.0.1', - /** - * CakePHP will use the default DB port based on the driver selected - * MySQL on MAMP uses port 8889, MAMP users will want to uncomment - * the following line and set the port accordingly - */ - //'port' => 'non_standard_port_number', - 'username' => 'root', - 'password' => 'secret', - 'database' => 'my_cake', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'flags' => [], - 'cacheMetadata' => true, - ?> + [ + 'default' => [ + 'className' => 'Cake\Database\Connection', + 'driver' => 'Cake\Database\Driver\Mysql', + 'persistent' => false, + 'host' => '127.0.0.1', + /** + * CakePHP will use the default DB port based on the driver selected + * MySQL on MAMP uses port 8889, MAMP users will want to uncomment + * the following line and set the port accordingly + */ + //'port' => 'non_standard_port_number', + 'username' => 'root', + 'password' => 'secret', + 'database' => 'my_cake', + 'encoding' => 'utf8', + 'timezone' => 'UTC', + 'flags' => [], + 'cacheMetadata' => true, + ?> 7. DNS record @@ -131,13 +130,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-cake.loc + 127.0.0.1 my-cake.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 8. Open your browser diff --git a/docs/examples/setup-codeigniter.rst b/docs/examples/setup-codeigniter.rst index e9fbec4a..ff2fd800 100644 --- a/docs/examples/setup-codeigniter.rst +++ b/docs/examples/setup-codeigniter.rst @@ -48,7 +48,7 @@ It will be ready in eight simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -58,7 +58,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-ci + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-ci 3. Download CodeIgniter @@ -66,13 +66,13 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-ci - devilbox@php-7.0.20 in /shared/httpd/my-ci $ wget https://github.com/bcit-ci/CodeIgniter/archive/3.1.8.tar.gz - devilbox@php-7.0.20 in /shared/httpd/my-ci $ tar xfvz 3.1.8.tar.gz - devilbox@php-7.0.20 in /shared/httpd/my-ci $ ls -l - total 7488 - drwxr-xr-x 5 devilbox devilbox 4096 Mar 22 15:48 CodeIgniter-3.1.8/ - -rw-r--r-- 1 devilbox devilbox 2205672 May 21 10:42 3.1.8.tar.gz + devilbox@php-7.0.20 in /shared/httpd $ cd my-ci + devilbox@php-7.0.20 in /shared/httpd/my-ci $ wget https://github.com/bcit-ci/CodeIgniter/archive/3.1.8.tar.gz + devilbox@php-7.0.20 in /shared/httpd/my-ci $ tar xfvz 3.1.8.tar.gz + devilbox@php-7.0.20 in /shared/httpd/my-ci $ ls -l + total 7488 + drwxr-xr-x 5 devilbox devilbox 4096 Mar 22 15:48 CodeIgniter-3.1.8/ + -rw-r--r-- 1 devilbox devilbox 2205672 May 21 10:42 3.1.8.tar.gz 4. Symlink webroot @@ -80,7 +80,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-ci $ ln -s CodeIgniter-3.1.8/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-ci $ ln -s CodeIgniter-3.1.8/ htdocs 5. Add MySQL Database @@ -88,7 +88,7 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-ci $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_ci;' + devilbox@php-7.0.20 in /shared/httpd/my-ci $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_ci;' 6. Configure database connection @@ -96,35 +96,34 @@ It will be ready in eight simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-ci $ vi htdocs/application/config/database.php + devilbox@php-7.0.20 in /shared/httpd/my-ci $ vi htdocs/application/config/database.php .. code-block:: php :caption: htdocs/application/config/database.php - :name: htdocs/application/config/database.php :emphasize-lines: 4-7 - '', - 'hostname' => '127.0.0.1', - 'username' => 'root', - 'password' => '', - 'database' => 'my_ci', - 'dbdriver' => 'mysqli', - 'dbprefix' => '', - 'pconnect' => FALSE, - 'db_debug' => (ENVIRONMENT !== 'production'), - 'cache_on' => FALSE, - 'cachedir' => '', - 'char_set' => 'utf8', - 'dbcollat' => 'utf8_general_ci', - 'swap_pre' => '', - 'encrypt' => FALSE, - 'compress' => FALSE, - 'stricton' => FALSE, - 'failover' => array(), - 'save_queries' => TRUE - ); + '', + 'hostname' => '127.0.0.1', + 'username' => 'root', + 'password' => '', + 'database' => 'my_ci', + 'dbdriver' => 'mysqli', + 'dbprefix' => '', + 'pconnect' => FALSE, + 'db_debug' => (ENVIRONMENT !== 'production'), + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'encrypt' => FALSE, + 'compress' => FALSE, + 'stricton' => FALSE, + 'failover' => array(), + 'save_queries' => TRUE + ); 7. DNS record @@ -136,13 +135,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-ci.loc + 127.0.0.1 my-ci.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 8. Open your browser diff --git a/docs/examples/setup-drupal.rst b/docs/examples/setup-drupal.rst index 9367eb23..52e191a0 100644 --- a/docs/examples/setup-drupal.rst +++ b/docs/examples/setup-drupal.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal 3. Install Drupal @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-drupal - devilbox@php-7.0.20 in /shared/httpd/my-drupal $ drush dl drupal + devilbox@php-7.0.20 in /shared/httpd $ cd my-drupal + devilbox@php-7.0.20 in /shared/httpd/my-drupal $ drush dl drupal 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-drupal $ ln -s drupal-8.3.3/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-drupal $ ln -s drupal-8.3.3/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-drupal.loc + 127.0.0.1 my-drupal.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser @@ -101,4 +100,4 @@ following line to your host operating systems ``/etc/hosts`` file Open your browser at http://my-drupal.loc and follow the Drupal installation steps. .. note:: - When asked about MySQL hostname, choose ``127.0.0.1``. + When asked about MySQL hostname, choose ``127.0.0.1``. diff --git a/docs/examples/setup-joomla.rst b/docs/examples/setup-joomla.rst index d9b59382..cf111fe6 100644 --- a/docs/examples/setup-joomla.rst +++ b/docs/examples/setup-joomla.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-joomla + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-joomla 3. Download and extract Joomla @@ -65,10 +65,10 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-joomla - devilbox@php-7.0.20 in /shared/httpd/my-joomla $ wget -O joomla.tar.gz https://downloads.joomla.org/cms/joomla3/3-8-0/joomla_3-8-0-stable-full_package-tar-gz?format=gz - devilbox@php-7.0.20 in /shared/httpd $ mkdir joomla - devilbox@php-7.0.20 in /shared/httpd $ tar xvfz joomla.tar.gz -C joomla/ + devilbox@php-7.0.20 in /shared/httpd $ cd my-joomla + devilbox@php-7.0.20 in /shared/httpd/my-joomla $ wget -O joomla.tar.gz https://downloads.joomla.org/cms/joomla3/3-8-0/joomla_3-8-0-stable-full_package-tar-gz?format=gz + devilbox@php-7.0.20 in /shared/httpd $ mkdir joomla + devilbox@php-7.0.20 in /shared/httpd $ tar xvfz joomla.tar.gz -C joomla/ 4. Symlink webroot @@ -76,7 +76,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-joomla $ ln -s joomla/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-joomla $ ln -s joomla/ htdocs 5. DNS record @@ -88,13 +88,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-joomla.loc + 127.0.0.1 my-joomla.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-laravel.rst b/docs/examples/setup-laravel.rst index 2bad2232..a8d97658 100644 --- a/docs/examples/setup-laravel.rst +++ b/docs/examples/setup-laravel.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel 3. Install Laravel @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-laravel - devilbox@php-7.0.20 in /shared/httpd/my-laravel $ laravel new laravel-project + devilbox@php-7.0.20 in /shared/httpd $ cd my-laravel + devilbox@php-7.0.20 in /shared/httpd/my-laravel $ laravel new laravel-project 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-laravel $ ln -s laravel-project/public/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-laravel $ ln -s laravel-project/public/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-laravel.loc + 127.0.0.1 my-laravel.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-phalcon.rst b/docs/examples/setup-phalcon.rst index 4d7511fd..e86c999b 100644 --- a/docs/examples/setup-phalcon.rst +++ b/docs/examples/setup-phalcon.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon 3. Install Phalcon @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-phalcon - devilbox@php-7.0.20 in /shared/httpd/my-phalcon $ phalcon project phalconphp + devilbox@php-7.0.20 in /shared/httpd $ cd my-phalcon + devilbox@php-7.0.20 in /shared/httpd/my-phalcon $ phalcon project phalconphp 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-phalcon $ ln -s phalconphp/public/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-phalcon $ ln -s phalconphp/public/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-phalcon.loc + 127.0.0.1 my-phalcon.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-photon-cms.rst b/docs/examples/setup-photon-cms.rst index 21c38eef..350098a0 100644 --- a/docs/examples/setup-photon-cms.rst +++ b/docs/examples/setup-photon-cms.rst @@ -49,7 +49,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -59,7 +59,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-photon + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-photon 3. Install Photon @@ -72,11 +72,11 @@ itself beforehand. .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-photon - devilbox@php-7.0.20 in /shared/httpd/my-photon $ photon new blog - ...What is your mysql hostname? [localhost] 127.0.0.1 - ...What is your mysql username? [root]root - ...What is your mysql password? [] + devilbox@php-7.0.20 in /shared/httpd $ cd my-photon + devilbox@php-7.0.20 in /shared/httpd/my-photon $ photon new blog + ...What is your mysql hostname? [localhost] 127.0.0.1 + ...What is your mysql username? [root]root + ...What is your mysql password? [] 4. Symlink webroot @@ -84,7 +84,7 @@ itself beforehand. .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-photon $ ln -s blog/public/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-photon $ ln -s blog/public/ htdocs 5. DNS record @@ -96,13 +96,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-photon.loc + 127.0.0.1 my-photon.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-symfony.rst b/docs/examples/setup-symfony.rst index 44ce54f6..231f2f9d 100644 --- a/docs/examples/setup-symfony.rst +++ b/docs/examples/setup-symfony.rst @@ -48,7 +48,7 @@ It will be ready in seven simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -58,7 +58,7 @@ It will be ready in seven simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony 3. Install Symfony @@ -66,8 +66,8 @@ It will be ready in seven simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-symfony - devilbox@php-7.0.20 in /shared/httpd/my-symfony $ symfony new symfony + devilbox@php-7.0.20 in /shared/httpd $ cd my-symfony + devilbox@php-7.0.20 in /shared/httpd/my-symfony $ symfony new symfony 4. Symlink webroot @@ -75,7 +75,7 @@ It will be ready in seven simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-symfony $ ln -s symfony/web/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-symfony $ ln -s symfony/web/ htdocs 5. Enable Symfony prod (``app.php``) @@ -83,8 +83,8 @@ It will be ready in seven simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-symfony $ cd symfony/web - devilbox@php-7.0.20 in /shared/httpd/my-symfony/symfony/web $ ln -s app.php index.php + devilbox@php-7.0.20 in /shared/httpd/my-symfony $ cd symfony/web + devilbox@php-7.0.20 in /shared/httpd/my-symfony/symfony/web $ ln -s app.php index.php 6. DNS record @@ -96,13 +96,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-symfony.loc + 127.0.0.1 my-symfony.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 7. Open your browser diff --git a/docs/examples/setup-wordpress.rst b/docs/examples/setup-wordpress.rst index e4d5516b..d2ed9a39 100644 --- a/docs/examples/setup-wordpress.rst +++ b/docs/examples/setup-wordpress.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp 3. Download Wordpress via ``git`` @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-wp - devilbox@php-7.0.20 in /shared/httpd/my-wp $ git clone https://github.com/WordPress/WordPress wordpress.git + devilbox@php-7.0.20 in /shared/httpd $ cd my-wp + devilbox@php-7.0.20 in /shared/httpd/my-wp $ git clone https://github.com/WordPress/WordPress wordpress.git 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-wp $ ln -s wordpress.git/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-wp $ ln -s wordpress.git/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-wp.loc + 127.0.0.1 my-wp.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-yii.rst b/docs/examples/setup-yii.rst index 55e68000..13267ee7 100644 --- a/docs/examples/setup-yii.rst +++ b/docs/examples/setup-yii.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii 3. Install Yii2 via ``composer`` @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-yii - devilbox@php-7.0.20 in /shared/httpd/my-yii $ composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic yii2-dev + devilbox@php-7.0.20 in /shared/httpd $ cd my-yii + devilbox@php-7.0.20 in /shared/httpd/my-yii $ composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic yii2-dev 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-yii $ ln -s yii2-dev/web/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-yii $ ln -s yii2-dev/web/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-yii.loc + 127.0.0.1 my-yii.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/examples/setup-zend.rst b/docs/examples/setup-zend.rst index b7a1fc7c..90d40fcb 100644 --- a/docs/examples/setup-zend.rst +++ b/docs/examples/setup-zend.rst @@ -47,7 +47,7 @@ It will be ready in six simple steps: .. code-block:: bash - host> ./shell.sh + host> ./shell.sh .. seealso:: :ref:`tutorial_work_inside_the_php_container` @@ -57,7 +57,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend 3. Install Zend via ``composer`` @@ -65,8 +65,8 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd $ cd my-zend - devilbox@php-7.0.20 in /shared/httpd/my-zend $ composer create-project --prefer-dist zendframework/skeleton-application zend + devilbox@php-7.0.20 in /shared/httpd $ cd my-zend + devilbox@php-7.0.20 in /shared/httpd/my-zend $ composer create-project --prefer-dist zendframework/skeleton-application zend 4. Symlink webroot @@ -74,7 +74,7 @@ It will be ready in six simple steps: .. code-block:: bash - devilbox@php-7.0.20 in /shared/httpd/my-zend $ ln -s zend/public/ htdocs + devilbox@php-7.0.20 in /shared/httpd/my-zend $ ln -s zend/public/ htdocs 5. DNS record @@ -86,13 +86,12 @@ following line to your host operating systems ``/etc/hosts`` file .. code-block:: bash :caption: /etc/hosts - :name: /etc/hosts - 127.0.0.1 my-zend.loc + 127.0.0.1 my-zend.loc .. seealso:: - For in-depth info about adding DNS records on Linux, Windows or MacOS see: - :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. + For in-depth info about adding DNS records on Linux, Windows or MacOS see: + :ref:`project_configuration_dns_records` or :ref:`global_configuration_auto_dns`. 6. Open your browser diff --git a/docs/getting-started/best-practice.rst b/docs/getting-started/best-practice.rst index eefbac5e..e9a20185 100644 --- a/docs/getting-started/best-practice.rst +++ b/docs/getting-started/best-practice.rst @@ -36,20 +36,19 @@ All you have to to is to adjust the path of :ref:`env_httpd_datadir` in the ``.e .. code-block:: bash - # Navigate to Devilbox git directory - host> cd path/to/devilbox + # Navigate to Devilbox git directory + host> cd path/to/devilbox - # Open the .env file with your favourite editor - host> vim .env + # Open the .env file with your favourite editor + host> vim .env Now Adjust the value of :ref:`env_httpd_datadir` .. code-block:: bash - :name: .env - :caption: .env - :emphasize-lines: 1 + :caption: .env + :emphasize-lines: 1 - HOST_PATH_HTTPD_DATADIR=/home/user/workspace/web + HOST_PATH_HTTPD_DATADIR=/home/user/workspace/web That's it, whenever you start up the Devilbox ``/home/user/workspace/web/`` will be mounted into the PHP and the web server container into ``/shared/httpd/``. @@ -70,20 +69,19 @@ All you have to to is to adjust the path of :ref:`env_mysql_datadir` in the ``.e .. code-block:: bash - # Navigate to Devilbox git directory - host> cd path/to/devilbox + # Navigate to Devilbox git directory + host> cd path/to/devilbox - # Open the .env file with your favourite editor - host> vim .env + # Open the .env file with your favourite editor + host> vim .env Now Adjust the value of :ref:`env_mysql_datadir` .. code-block:: bash - :name: .env - :caption: .env - :emphasize-lines: 1 + :caption: .env + :emphasize-lines: 1 - HOST_PATH_MYSQL_DATADIR=/home/user/workspace/db/mysql + HOST_PATH_MYSQL_DATADIR=/home/user/workspace/db/mysql That's it, whenever you start up the Devilbox ``/home/user/workspace/db/mysql/`` will be mounted into the MySQL container. @@ -95,20 +93,19 @@ All you have to to is to adjust the path of :ref:`env_pgsql_datadir` in the ``.e .. code-block:: bash - # Navigate to Devilbox git directory - host> cd path/to/devilbox + # Navigate to Devilbox git directory + host> cd path/to/devilbox - # Open the .env file with your favourite editor - host> vim .env + # Open the .env file with your favourite editor + host> vim .env Now Adjust the value of :ref:`env_pgsql_datadir` .. code-block:: bash - :name: .env - :caption: .env - :emphasize-lines: 1 + :caption: .env + :emphasize-lines: 1 - HOST_PATH_PGSQL_DATADIR=/home/user/workspace/db/pgsql + HOST_PATH_PGSQL_DATADIR=/home/user/workspace/db/pgsql That's it, whenever you start up the Devilbox ``/home/user/workspace/db/pqsql/`` will be mounted into the PostgreSQL container. @@ -120,20 +117,19 @@ All you have to to is to adjust the path of :ref:`env_mongo_datadir` in the ``.e .. code-block:: bash - # Navigate to Devilbox git directory - host> cd path/to/devilbox + # Navigate to Devilbox git directory + host> cd path/to/devilbox - # Open the .env file with your favourite editor - host> vim .env + # Open the .env file with your favourite editor + host> vim .env Now Adjust the value of :ref:`env_mongo_datadir` .. code-block:: bash - :name: .env - :caption: .env - :emphasize-lines: 1 + :caption: .env + :emphasize-lines: 1 - HOST_PATH_MONGO_DATADIR=/home/user/workspace/db/mongo + HOST_PATH_MONGO_DATADIR=/home/user/workspace/db/mongo That's it, whenever you start up the Devilbox ``/home/user/workspace/db/mongo/`` will be mounted into the MongoDB container. @@ -189,8 +185,8 @@ This allows you to keep your project configuration unchanged and have the same b PHP container and on your host operating system. .. important:: - Do not mix up ``localhost`` with ``127.0.0.1``. They behave differently! - Use ``127.0.0.1`` and do not use ``localhost``. + Do not mix up ``localhost`` with ``127.0.0.1``. They behave differently! + Use ``127.0.0.1`` and do not use ``localhost``. As an example, if you want to access the MySQL database from within the PHP container, you do the following: @@ -198,24 +194,24 @@ following: .. code-block:: bash :emphasize-lines: 8 - # Navigate to Devilbox git directory - host> cd path/to/devilbox + # Navigate to Devilbox git directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Enter the MySQL console - php> mysql -u root -h 127.0.0.1 -p - mysql> + # Enter the MySQL console + php> mysql -u root -h 127.0.0.1 -p + mysql> The very same command applies to access the MySQL database from your host operating system: .. code-block:: bash :emphasize-lines: 2 - # Enter the MySQL console - host> mysql -u root -h 127.0.0.1 -p - mysql> + # Enter the MySQL console + host> mysql -u root -h 127.0.0.1 -p + mysql> So no matter if you use the Devilbox or have another LAMP stack installed locally on your host operating system, you do not have to change your configuration files if you stick to this tip. @@ -225,13 +221,13 @@ or IP address of the MySQL server to ``127.0.0.1``: .. code-block:: php - + .. seealso:: :ref:`tutorial_work_inside_the_php_container` diff --git a/docs/getting-started/create-your-first-project.rst b/docs/getting-started/create-your-first-project.rst index 75c96088..ae81f363 100644 --- a/docs/getting-started/create-your-first-project.rst +++ b/docs/getting-started/create-your-first-project.rst @@ -5,13 +5,12 @@ Create your first project ************************* .. important:: - Ensure you have read :ref:`getting_started_directory_overview` to understand what is - going on under the hood. + Ensure you have read :ref:`getting_started_directory_overview` to understand what is + going on under the hood. .. note:: - - This section not only applies for one project, it applied for as many projects as you need. - **There is no limit in the number of projects.** + This section not only applies for one project, it applied for as many projects as you need. + **There is no limit in the number of projects.** **Table of Contents** @@ -35,8 +34,8 @@ Step 2: create a project directory In your Devilbox git directory, navigate to ``./data/www`` and create a new directory. .. note:: - Choose the directory name wisely, as it will be part of the domain for that project. - For this example we will use ``project-1`` as our project name. + Choose the directory name wisely, as it will be part of the domain for that project. + For this example we will use ``project-1`` as our project name. .. code-block:: bash @@ -62,7 +61,7 @@ Step 3: create a docroot directory ================================== .. note:: - As desribed in :ref:`getting_started_directory_overview_docroot` the docroot directory name must be ``htdocs`` for now. + As desribed in :ref:`getting_started_directory_overview_docroot` the docroot directory name must be ``htdocs`` for now. Navigate to your newly created project directory and create a directory named `htdocs` inside it. @@ -88,7 +87,7 @@ By having created the docroot directory, the web server is now able to serve you The intranet already gives you the exact string that you can simply copy into your ``/etc/hosts`` file on your host operating system to solve this issue. .. important:: - This will only work on **native Docker** for Linux or MacOS. Read up on the next section to also find out how to do that on **Docker Toolbox** and Windows. + This will only work on **native Docker** for Linux or MacOS. Read up on the next section to also find out how to do that on **Docker Toolbox** and Windows. .. _getting_started_create_your_first_project_dns_entry: @@ -97,9 +96,9 @@ Step 4: create a DNS entry ========================== .. note:: - This step can also be automated via the bundled DNS server to automatically provide catch-all - DNS entries to your host computer, but is outside the scope of this - *getting started tutorial*. + This step can also be automated via the bundled DNS server to automatically provide catch-all + DNS entries to your host computer, but is outside the scope of this + *getting started tutorial*. Add DNS for Linux and MacOS (native Docker) ------------------------------------------- @@ -109,11 +108,11 @@ you the exact string you need to paste into your ``/etc/hosts`` file on your hos .. code-block:: bash - # Open your /etc/hosts file with sudo or root privileges - # and add the following DNS entry - host> sudo vi /etc/hosts + # Open your /etc/hosts file with sudo or root privileges + # and add the following DNS entry + host> sudo vi /etc/hosts - 127.0.0.1 project-1.loc + 127.0.0.1 project-1.loc Add DNS for Windows (native Docker) ----------------------------------- @@ -125,7 +124,7 @@ Open ``C:\Windows\System32\drivers\etc`` with admistrative privileges and add th .. code-block:: bash - 127.0.0.1 project-1.loc + 127.0.0.1 project-1.loc Add DNS for Docker Toolbox -------------------------- @@ -144,9 +143,9 @@ have to add instead on your host operating system is: .. code-block:: bash - host> sudo vi /etc/hosts + host> sudo vi /etc/hosts - 192.16.0.1 project-1.loc + 192.16.0.1 project-1.loc **Docker Toolbox on Windows** @@ -154,7 +153,7 @@ Open ``C:\Windows\System32\drivers\etc`` with admistrative privileges and add th .. code-block:: bash - 192.16.0.1 project-1.loc + 192.16.0.1 project-1.loc Back to intranet ---------------- diff --git a/docs/getting-started/enter-the-php-container.rst b/docs/getting-started/enter-the-php-container.rst index 24f8da9a..f822ddb7 100644 --- a/docs/getting-started/enter-the-php-container.rst +++ b/docs/getting-started/enter-the-php-container.rst @@ -12,8 +12,8 @@ The only thing you might need to install on your host operating system is your f editor to actually start coding. .. seealso:: - If you want to find out what tools are available inside the PHP container, visit the - following section: :ref:`available_tools`. + If you want to find out what tools are available inside the PHP container, visit the + following section: :ref:`available_tools`. **Table of Contents** @@ -25,7 +25,7 @@ How to enter ============ .. note:: - You can only enter the PHP container if it is running. + You can only enter the PHP container if it is running. Linux and MacOS @@ -51,11 +51,11 @@ Just run it and it will enter you into the PHP container and bring you to ``/sha .. code-block:: bash - # Execute on the host operating system - C:/Users/user1/devilbox> shell.bat + # Execute on the host operating system + C:/Users/user1/devilbox> shell.bat - # Now you are inside the PHP Linux container - devilbox@php-7.0.19 in /shared/httpd $ + # Now you are inside the PHP Linux container + devilbox@php-7.0.19 in /shared/httpd $ How to become root @@ -67,16 +67,16 @@ the password-less ``sudo``. .. code-block:: bash - # Inside the PHP Linux container as user devilbox - devilbox@php-7.0.19 in /shared/httpd $ sudo su - + # Inside the PHP Linux container as user devilbox + devilbox@php-7.0.19 in /shared/httpd $ sudo su - - # Now you are root and can do anything you want - root@php-7.0.19 in /shared/httpd $ + # Now you are root and can do anything you want + root@php-7.0.19 in /shared/httpd $ .. note:: - As this action is inside a Docker container, there is no difference between Linux, MacOS or - Windows. Every host operating system is using the same Docker container - equal accross all - platforms. + As this action is inside a Docker container, there is no difference between Linux, MacOS or + Windows. Every host operating system is using the same Docker container - equal accross all + platforms. Tools diff --git a/docs/getting-started/install-the-devilbox.rst b/docs/getting-started/install-the-devilbox.rst index c0c1371b..5aeac207 100644 --- a/docs/getting-started/install-the-devilbox.rst +++ b/docs/getting-started/install-the-devilbox.rst @@ -45,9 +45,9 @@ Additionally you will require ``git`` in order to clone the devilbox project. Docker Toolbox (e.g. for Windows 7 or older Macs) read up on this section. .. warning:: - Docker itself requires super user privileges which is granted to a system wide group - called ``docker``. After having installed Docker on your system, ensure that your local - user is assigned to the ``docker`` group. Check this via ``groups`` or ``id`` command. + Docker itself requires super user privileges which is granted to a system wide group + called ``docker``. After having installed Docker on your system, ensure that your local + user is assigned to the ``docker`` group. Check this via ``groups`` or ``id`` command. .. seealso:: :ref:`install_docker` @@ -84,10 +84,10 @@ this specific git tag. .. warning:: - Whenever you check out a different version, make sure that your ``.env`` file is up-to-date - with the bundled ``env-example`` file. Different Devilbox releases might require different - settings to be available inside the ``.env`` file. Refer to the next section for how to - create the ``.env`` file. + Whenever you check out a different version, make sure that your ``.env`` file is up-to-date + with the bundled ``env-example`` file. Different Devilbox releases might require different + settings to be available inside the ``.env`` file. Refer to the next section for how to + create the ``.env`` file. Create ``.env`` file @@ -145,7 +145,6 @@ Open the ``.env`` file with your favorite text editor and adjust those values: .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 3,4 host> vi .env @@ -154,7 +153,7 @@ Open the ``.env`` file with your favorite text editor and adjust those values: NEW_GID=1002 .. warning:: - Make sure that you use the values provided by ``id -u`` and ``id -g``. + Make sure that you use the values provided by ``id -u`` and ``id -g``. .. seealso:: :ref:`syncronize_container_permissions` diff --git a/docs/getting-started/read-log-files.rst b/docs/getting-started/read-log-files.rst index 0de60549..f5f31d59 100644 --- a/docs/getting-started/read-log-files.rst +++ b/docs/getting-started/read-log-files.rst @@ -24,29 +24,29 @@ The log directory structure would look something like this: .. code-block:: bash - host> cd path/to/devilbox - host> tree log + host> cd path/to/devilbox + host> tree log - log/ - ├── nginx-stable/ - │   ├── nginx-stable/ - │   ├── defaultlocalhost-access.log - │   ├── defaultlocalhost-error.log - │   ├── -access.log # Each project has its own access log - │   ├── -error.log # Each project has its own error log - ├── mariadb-10.1/ - │   ├── error.log - │   ├── query.log - │   ├── slow.log - ├── php-fpm-7.1/ - │   ├── php-fpm.access - │   ├── php-fpm.error + log/ + ├── nginx-stable/ + │   ├── nginx-stable/ + │   ├── defaultlocalhost-access.log + │   ├── defaultlocalhost-error.log + │   ├── -access.log # Each project has its own access log + │   ├── -error.log # Each project has its own error log + ├── mariadb-10.1/ + │   ├── error.log + │   ├── query.log + │   ├── slow.log + ├── php-fpm-7.1/ + │   ├── php-fpm.access + │   ├── php-fpm.error Use your favorite tools to view log files such as ``tail``, ``less``, ``more``, ``cat`` or others. .. important:: - Currently logs are only mounted for PHP, HTTPD and MYSQL container. - All other services will log to Docker logs. + Currently logs are only mounted for PHP, HTTPD and MYSQL container. + All other services will log to Docker logs. Docker logs @@ -59,31 +59,31 @@ When using this approach, you need to use the ``docker-compose logs`` command to files from within the Devilbox git directory. .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs + host> cd path/to/devilbox + host> docker-compose logs When you want to continuously watch the log output (such as ``tail -f``), you need to append ``-f`` to the command. .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs -f + host> cd path/to/devilbox + host> docker-compose logs -f When you only want to have logs displayed for a single service, you can also append the service name (works with or without ``-f`` as well): .. code-block:: bash - :emphasize-lines: 2 + :emphasize-lines: 2 - host> cd path/to/devilbox - host> docker-compose logs php -f + host> cd path/to/devilbox + host> docker-compose logs php -f .. important:: - This currently does not work for the MySQL container, which will always log to file. + This currently does not work for the MySQL container, which will always log to file. Checklist diff --git a/docs/getting-started/the-intranet.rst b/docs/getting-started/the-intranet.rst index 4dc45cd3..ed236c29 100644 --- a/docs/getting-started/the-intranet.rst +++ b/docs/getting-started/the-intranet.rst @@ -109,10 +109,10 @@ If you share your projects over a LAN, but do not want anybody to view the Devil you can also password protect it. .. seealso:: - In order to do so, have a look at the following ``.env`` variables: + In order to do so, have a look at the following ``.env`` variables: - * :ref:`env_devilbox_ui_protect` - * :ref:`env_devilbox_ui_password` + * :ref:`env_devilbox_ui_protect` + * :ref:`env_devilbox_ui_password` Disable the intranet @@ -123,9 +123,9 @@ This is achieved internally by removing the default virtual host which serves th When the intranet is disabled, there is no way to access it. .. seealso:: - In order to do so, have a look at the following ``.env`` variable: + In order to do so, have a look at the following ``.env`` variable: - * :ref:`env_devilbox_ui_enable` + * :ref:`env_devilbox_ui_enable` Checklist diff --git a/docs/getting-started/update-the-devilbox.rst b/docs/getting-started/update-the-devilbox.rst index 112a8c1e..92aa8daa 100644 --- a/docs/getting-started/update-the-devilbox.rst +++ b/docs/getting-started/update-the-devilbox.rst @@ -128,14 +128,14 @@ You first need to find out the image name and then also the currently used image host> grep 'image:' docker-compose.yml - image: cytopia/bind:0.11 - image: devilbox/php-fpm:${PHP_SERVER:-7.0}-work - image: devilbox/${HTTPD_SERVER:-nginx-stable}:0.13 - image: cytopia/${MYSQL_SERVER:-mariadb-10.1}:latest - image: postgres:${PGSQL_SERVER:-9.6} - image: redis:${REDIS_SERVER:-3.2} - image: memcached:${MEMCD_SERVER:-latest} - image: mongo:${MONGO_SERVER:-latest} + image: cytopia/bind:0.11 + image: devilbox/php-fpm:${PHP_SERVER:-7.0}-work + image: devilbox/${HTTPD_SERVER:-nginx-stable}:0.13 + image: cytopia/${MYSQL_SERVER:-mariadb-10.1}:latest + image: postgres:${PGSQL_SERVER:-9.6} + image: redis:${REDIS_SERVER:-3.2} + image: memcached:${MEMCD_SERVER:-latest} + image: mongo:${MONGO_SERVER:-latest} After having found the possible candidates, you will still have to find the corresponding value inside the ``..env`` file. Let's do it for the PHP image: diff --git a/docs/index.rst b/docs/index.rst index d8d5f2ad..4d6d2481 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -66,7 +66,6 @@ host is ready to be served with your custom domain. tutorials/change-container-versions tutorials/work-inside-the-container tutorials/enable-xdebug - tutorials/custom-apache-modules tutorials/custom-environment-variables tutorials/static-code-analysis @@ -94,7 +93,6 @@ host is ready to be served with your custom domain. :maxdepth: 2 configuration-project/dns-records - configuration-project/domain configuration-project/custom-vhost diff --git a/docs/installation/docker-toolbox.rst b/docs/installation/docker-toolbox.rst index 87f7e02d..059c42ee 100644 --- a/docs/installation/docker-toolbox.rst +++ b/docs/installation/docker-toolbox.rst @@ -74,6 +74,7 @@ If you do not port-forward it to your host machines localhost, you will have to DNS entries that are described in this documentation to go to ``127.0.0.1`` to the IP address of your virtual machine. +.. _docker_toolbox_auto_dns: Auto-DNS -------- diff --git a/docs/maintenance/backup-and-restore-mongo.rst b/docs/maintenance/backup-and-restore-mongo.rst index 0bab0dde..0060fa5b 100644 --- a/docs/maintenance/backup-and-restore-mongo.rst +++ b/docs/maintenance/backup-and-restore-mongo.rst @@ -29,14 +29,14 @@ each PHP container and reay to use. To backup all databases follow the below lis .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Run mongodump - devilbox@php-7.1.6 in /shared/httpd $ mongodump --out /shared/backups/mongo + # Run mongodump + devilbox@php-7.1.6 in /shared/httpd $ mongodump --out /shared/backups/mongo To find out more about the configuration and options of mongodump, visit its project page under: https://docs.mongodb.com/manual/reference/program/mongodump. @@ -53,14 +53,14 @@ each PHP container and ready to use. To restore all MongoDB databases follow the .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Start the restore/import from /shared/backups/mongo - devilbox@php-7.1.6 in /shared/httpd $ mongorestore /shared/backups/mongo + # Start the restore/import from /shared/backups/mongo + devilbox@php-7.1.6 in /shared/httpd $ mongorestore /shared/backups/mongo To find out more about the configuration and options of mongorestore, visit its project page under: https://docs.mongodb.com/manual/reference/program/mongorestore/. diff --git a/docs/maintenance/backup-and-restore-pgsql.rst b/docs/maintenance/backup-and-restore-pgsql.rst index 307bea89..56a8a3df 100644 --- a/docs/maintenance/backup-and-restore-pgsql.rst +++ b/docs/maintenance/backup-and-restore-pgsql.rst @@ -30,14 +30,14 @@ listed example: .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Run pg_dump - devilbox@php-7.1.6 in /shared/httpd $ pg_dump -h pgsql -U postgres -W my_db_name > /shared/backups/pgsql/my_db_name.sql + # Run pg_dump + devilbox@php-7.1.6 in /shared/httpd $ pg_dump -h pgsql -U postgres -W my_db_name > /shared/backups/pgsql/my_db_name.sql To find out more about the configuration and options of pg_dump, visit its project page under: https://www.postgresql.org/docs/current/static/backup-dump.html. @@ -67,42 +67,42 @@ Here are a few examples for different file types: .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Start the import - devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < /shared/backups/pgsql/my_db_name.sql + # Start the import + devilbox@php-7.1.6 in /shared/httpd $ psql -h pgsql -U postgres -W my_db_name < /shared/backups/pgsql/my_db_name.sql ``*.sql.gz`` file ^^^^^^^^^^^^^^^^^^ .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Start the import - devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.gz | psql -h pgsql -U postgres -W my_db_name + # Start the import + devilbox@php-7.1.6 in /shared/httpd $ zcat /shared/backups/pgsql/my_db_name.sql.gz | psql -h pgsql -U postgres -W my_db_name ``*.sql.tar.gz`` file ^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash - # Navigate to the Devilbox directory - host> cd path/to/devilbox + # Navigate to the Devilbox directory + host> cd path/to/devilbox - # Enter the PHP container - host> ./shell.sh + # Enter the PHP container + host> ./shell.sh - # Start the import - devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.sql.tar.gz | psql -h pgsql -U postgres -W my_db_name + # Start the import + devilbox@php-7.1.6 in /shared/httpd $ tar xzOf /shared/backups/pgsql/my_db_name.sql.tar.gz | psql -h pgsql -U postgres -W my_db_name Adminer diff --git a/docs/readings/available-tools.rst b/docs/readings/available-tools.rst index 218cda85..5aaee36b 100644 --- a/docs/readings/available-tools.rst +++ b/docs/readings/available-tools.rst @@ -84,11 +84,11 @@ The PHP container is your workhorse and these are your tools: +----------------------+-----------------------------------------------------------------------------------+ .. note:: - If you are in need of other tools, open up an issue at - `Github `_ and ask for it, - this can usually be implemented very quickly. + If you are in need of other tools, open up an issue at + `Github `_ and ask for it, + this can usually be implemented very quickly. .. seealso:: - If you ever feel those tools are out-dated, simply update your Docker images. - Docker images are built every night to ensure latest tools and security patches: - :ref:`getting_started_update_the_docker_images` + If you ever feel those tools are out-dated, simply update your Docker images. + Docker images are built every night to ensure latest tools and security patches: + :ref:`getting_started_update_the_docker_images` diff --git a/docs/readings/syncronize-container-permissions.rst b/docs/readings/syncronize-container-permissions.rst index 9cafd129..7bad875c 100644 --- a/docs/readings/syncronize-container-permissions.rst +++ b/docs/readings/syncronize-container-permissions.rst @@ -86,5 +86,5 @@ When the PHP-FPM process finally starts up it actually runs with your local syst sure permissions will be in sync from now on. .. note:: - To tackle this on the PHP-FPM side is only half a solution to the problem. The same applies to a web server Docker container when you offer **file uploads**. They will be uploaded and created by the web servers uid/gid. Therefore the web server itself must also provide the same kind of solution. + To tackle this on the PHP-FPM side is only half a solution to the problem. The same applies to a web server Docker container when you offer **file uploads**. They will be uploaded and created by the web servers uid/gid. Therefore the web server itself must also provide the same kind of solution. diff --git a/docs/support/faq.rst b/docs/support/faq.rst index d8cdd0f6..ed33c308 100644 --- a/docs/support/faq.rst +++ b/docs/support/faq.rst @@ -122,7 +122,7 @@ Yes, the ``.env`` variable :ref:`env_tld_suffix` can be changed to whatever doma you want. See :ref:`env_tld_suffix`. .. warning:: - Be aware not to use ``dev`` or ``localhost``. See :ref:`env_tld_suffix` for more details. + Be aware not to use ``dev`` or ``localhost``. See :ref:`env_tld_suffix` for more details. Can I just start PHP and MySQL instead of all container? diff --git a/docs/support/troubleshooting.rst b/docs/support/troubleshooting.rst index d8a7ede3..b8a08ea1 100644 --- a/docs/support/troubleshooting.rst +++ b/docs/support/troubleshooting.rst @@ -29,12 +29,12 @@ In order to remove the container do the following: .. code-block:: bash - host> cd path/to/devilbox - host> docker-compose stop + host> cd path/to/devilbox + host> docker-compose stop - # Remove the stopped container (IMPORTANT!) - # After the removal it will be re-created during next run - host> docker-compose rm -f + # Remove the stopped container (IMPORTANT!) + # After the removal it will be re-created during next run + host> docker-compose rm -f .. seealso:: :ref:`remove_stopped_container` @@ -51,15 +51,15 @@ to read-only by applying the following ``chmod`` command. .. code-block:: bash - # Nagivate to devilbox git directory - host> cd path/to/devilbox + # Nagivate to devilbox git directory + host> cd path/to/devilbox - # Navigate to the MySQL config directory (e.g.: MySQL 5.5) - host> cd cfg/mysql-5.5 + # Navigate to the MySQL config directory (e.g.: MySQL 5.5) + host> cd cfg/mysql-5.5 - # Make cnf files read only - host> chmod 0444 *.cnf + # Make cnf files read only + host> chmod 0444 *.cnf .. seealso:: - * :ref:`my_cnf` - * https://github.com/cytopia/devilbox/issues/212 + * :ref:`my_cnf` + * https://github.com/cytopia/devilbox/issues/212 diff --git a/docs/tutorials/add-your-own-docker-image.rst b/docs/tutorials/add-your-own-docker-image.rst index 472f6a83..be60aeea 100644 --- a/docs/tutorials/add-your-own-docker-image.rst +++ b/docs/tutorials/add-your-own-docker-image.rst @@ -44,77 +44,75 @@ Open ``docker-compose.override.yml`` with your favourite editor and paste the fo into it. .. code-block:: yaml - :caption: docker-compose.override.yml - :name: docker-compose.override.yml - :emphasize-lines: 4,5,8 + :caption: docker-compose.override.yml + :emphasize-lines: 4,5,8 - version: '2.1' - services: - # Your custom Docker image here: - : - image: : - networks: - app_net: - ipv4_address: - # For ease of use always automatically start these: - depends_on: - - bind - - php - - httpd - # End of custom Docker image + version: '2.1' + services: + # Your custom Docker image here: + : + image: : + networks: + app_net: + ipv4_address: + # For ease of use always automatically start these: + depends_on: + - bind + - php + - httpd + # End of custom Docker image .. note:: - * ```` has to be replaced with any name of your choice - * ```` has to be replaced with the name of the Docker image - * ```` has to be replaced with the tag of the Docker image - * ```` has to be replaced with an unused IP address + * ```` has to be replaced with any name of your choice + * ```` has to be replaced with the name of the Docker image + * ```` has to be replaced with the tag of the Docker image + * ```` has to be replaced with an unused IP address Two new services ^^^^^^^^^^^^^^^^ .. code-block:: yaml - :caption: docker-compose.override.yml - :name: docker-compose.override.yml - :emphasize-lines: 4,5,8,16,17,20 + :caption: docker-compose.override.yml + :emphasize-lines: 4,5,8,16,17,20 - version: '2.1' - services: - # Your first custom Docker image here: - : - image: : - networks: - app_net: - ipv4_address: - # For ease of use always automatically start these: - depends_on: - - bind - - php - - httpd - # End of first custom Docker image - # Your second custom Docker image here: - : - image: : - networks: - app_net: - ipv4_address: - # For ease of use always automatically start these: - depends_on: - - bind - - php - - httpd - # End of second custom Docker image + version: '2.1' + services: + # Your first custom Docker image here: + : + image: : + networks: + app_net: + ipv4_address: + # For ease of use always automatically start these: + depends_on: + - bind + - php + - httpd + # End of first custom Docker image + # Your second custom Docker image here: + : + image: : + networks: + app_net: + ipv4_address: + # For ease of use always automatically start these: + depends_on: + - bind + - php + - httpd + # End of second custom Docker image .. note:: - * ```` has to be replaced with any name of your choice - * ```` has to be replaced with the name of the Docker image - * ```` has to be replaced with the tag of the Docker image - * ```` has to be replaced with an unused IP address + * ```` has to be replaced with any name of your choice + * ```` has to be replaced with the name of the Docker image + * ```` has to be replaced with the tag of the Docker image + * ```` has to be replaced with an unused IP address .. note:: - * ```` has to be replaced with any name of your choice - * ```` has to be replaced with the name of the Docker image - * ```` has to be replaced with the tag of the Docker image - * ```` has to be replaced with an unused IP address + * ```` has to be replaced with any name of your choice + * ```` has to be replaced with the name of the Docker image + * ```` has to be replaced with the tag of the Docker image + * ```` has to be replaced with an unused IP address CockroachDB example @@ -131,25 +129,24 @@ Docker image: Now add the information to ``docker-compose.override.yml``: .. code-block:: yaml - :caption: docker-compose.override.yml - :name: docker-compose.override.yml - :emphasize-lines: 4-5,9 + :caption: docker-compose.override.yml + :emphasize-lines: 4-5,9 - version: '2.1' - services: - # Your custom Docker image here: - cockroach: - image: cockroachdb/cockroach:latest - command: start --insecure - networks: - app_net: - ipv4_address: 172.16.238.200 - # For ease of use always automatically start these: - depends_on: - - bind - - php - - httpd - # End of custom Docker image + version: '2.1' + services: + # Your custom Docker image here: + cockroach: + image: cockroachdb/cockroach:latest + command: start --insecure + networks: + app_net: + ipv4_address: 172.16.238.200 + # For ease of use always automatically start these: + depends_on: + - bind + - php + - httpd + # End of custom Docker image @@ -162,18 +159,18 @@ name you have chosen. .. code-block:: bash - host> docker-compose up + host> docker-compose up In the example of Cockroach DB the command would look like this .. code-block:: bash - host> docker-compose up cockroach + host> docker-compose up cockroach Further reading =============== .. seealso:: - * :ref:`docker_compose_override_yml` - * :ref:`overwrite_existing_docker_image` + * :ref:`docker_compose_override_yml` + * :ref:`overwrite_existing_docker_image` diff --git a/docs/tutorials/adding-subdomains.rst b/docs/tutorials/adding-subdomains.rst index 4225ccc6..0788d786 100644 --- a/docs/tutorials/adding-subdomains.rst +++ b/docs/tutorials/adding-subdomains.rst @@ -59,32 +59,31 @@ default generation process via templates. Those templates can be added to each p you the option to customize the virtual host of this specific project. .. note:: - :ref:`custom_vhost` - Ensure you have read and understand how to customize your virtual host with ``vhost-gen``. - :ref:`env_httpd_template_dir` - Ensure you know what this variable does inside your ``.env`` file. + :ref:`custom_vhost` + Ensure you have read and understand how to customize your virtual host with ``vhost-gen``. + :ref:`env_httpd_template_dir` + Ensure you know what this variable does inside your ``.env`` file. .. important:: - When adjusting vhost-gen templates for a project you have to do **one** of the following: + When adjusting vhost-gen templates for a project you have to do **one** of the following: - * Restart the devilbox - * Or rename your project directory to some other name and then rename it back to its original - name. + * Restart the devilbox + * Or rename your project directory to some other name and then rename it back to its original name. - More information here: :ref:`custom_vhost_apply_vhost_gen_changes` + More information here: :ref:`custom_vhost_apply_vhost_gen_changes` .. warning:: - Pay close attention that you do not use TAB (``\t``) characters for indenting the vhost-gen - yaml files. Some editors might automatically indent using TABs, so ensure they are replaced - with spaces. If TAB characters are present, those files become invalid and won't work. - https://github.com/cytopia/devilbox/issues/142 + Pay close attention that you do not use TAB (``\t``) characters for indenting the vhost-gen + yaml files. Some editors might automatically indent using TABs, so ensure they are replaced + with spaces. If TAB characters are present, those files become invalid and won't work. + https://github.com/cytopia/devilbox/issues/142 - You can use the bundled ``yamllint`` binary inside the container to validate your config. + You can use the bundled ``yamllint`` binary inside the container to validate your config. - **See also:** + **See also:** - * :ref:`tutorial_work_inside_the_php_container` - * :ref:`available_tools` + * :ref:`tutorial_work_inside_the_php_container` + * :ref:`available_tools` Prerequisite @@ -110,14 +109,14 @@ Ensure that the default ``vhost-gen`` templates have been copied to your project .. code-block:: bash - # Navigate to the Devilbox directory - host> cd ./home/user/devilbox + # Navigate to the Devilbox directory + host> cd ./home/user/devilbox - # Create template directory in your project - host> mkdir ./data/www/project-1/.devilbox + # Create template directory in your project + host> mkdir ./data/www/project-1/.devilbox - # Copy vhost-gen templates - host> cp templates/vhost-gen/* ./data/www/project-1/.devilbox + # Copy vhost-gen templates + host> cp templates/vhost-gen/* ./data/www/project-1/.devilbox By having done all prerequisite, your project should be available under http://my-project-1.loc @@ -153,7 +152,6 @@ here). .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml - :name: apache22.yml :emphasize-lines: 3 vhost: | @@ -177,7 +175,6 @@ All you will have to do, is to add another ``ServerName`` directive: .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml - :name: apache22.yml :emphasize-lines: 3,4 vhost: | @@ -232,7 +229,6 @@ here). .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml - :name: apache22.yml :emphasize-lines: 3 vhost: | @@ -256,7 +252,6 @@ All you will have to do, is to add another ``ServerName`` directive which does c .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml - :name: apache22.yml :emphasize-lines: 3,4 vhost: | @@ -325,7 +320,6 @@ here). .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/nginx.yml - :name: nginx.yml :emphasize-lines: 4 vhost: | @@ -350,7 +344,6 @@ All you will have to do, is to extend the ``server_name`` directive: .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/nginx.yml - :name: nginx.yml :emphasize-lines: 4 vhost: | @@ -407,7 +400,6 @@ here). .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/nginx.yml - :name: nginx.yml :emphasize-lines: 4 vhost: | @@ -432,7 +424,6 @@ All you will have to do, is to extend the ``server_name`` directive with a catch .. code-block:: yaml :caption: /home/user/devilbox/data/www/project-1/.devilbox/nginx.yml - :name: nginx.yml :emphasize-lines: 4 vhost: | @@ -475,34 +466,34 @@ Let's cover the second step .. code-block:: bash - # Navigate to the data directory - host> /home/user/devilbox/data/www + # Navigate to the data directory + host> /home/user/devilbox/data/www - # Rename your project to something else - host> mv project-1 project-1.tmp + # Rename your project to something else + host> mv project-1 project-1.tmp - # Rename your project to its original name - host> mv project-1.tmp project-1 + # Rename your project to its original name + host> mv project-1.tmp project-1 If you want to understand what is going on right now, check the docker logs for the web server. .. code-block:: bash - # Navigate to the devilbox directory - host> /home/user/devilbox + # Navigate to the devilbox directory + host> /home/user/devilbox - # Check docker logs - host> docker-compose logs httpd + # Check docker logs + host> docker-compose logs httpd - httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1.tmp.loc - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1.tmp - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1 - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart + httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1.tmp.loc + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1.tmp + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1 + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart - httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1loc - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1 - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1.tmp - httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart + httpd_1 | vhostgen: [2018-03-18 11:46:52] Adding: project-1loc + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] ADD: succeeded: /shared/httpd/project-1 + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] DEL: succeeded: /shared/httpd/project-1.tmp + httpd_1 | watcherd: [2018-03-18 11:46:52] [OK] TRIGGER succeeded: /usr/local/apache2/bin/httpd -k restart **What happened?** diff --git a/docs/tutorials/change-container-versions.rst b/docs/tutorials/change-container-versions.rst index 56116a77..b2934501 100644 --- a/docs/tutorials/change-container-versions.rst +++ b/docs/tutorials/change-container-versions.rst @@ -21,11 +21,11 @@ Shut down the Devilbox in case it is still running: .. code-block:: bash - # Navigate to the Devilbox directory - host> /home/user/devilbox + # Navigate to the Devilbox directory + host> /home/user/devilbox - # Stop all container - host> docker-compose stop + # Stop all container + host> docker-compose stop Edit the ``.env`` file @@ -36,18 +36,17 @@ It will look something like this: .. code-block:: bash - :name: .env :caption: .env :emphasize-lines: 5 - #PHP_SERVER=5.3 - #PHP_SERVER=5.4 - #PHP_SERVER=5.5 - #PHP_SERVER=5.6 - #PHP_SERVER=7.0 - PHP_SERVER=7.1 - #PHP_SERVER=7.2 - #PHP_SERVER=7.3 + #PHP_SERVER=5.3 + #PHP_SERVER=5.4 + #PHP_SERVER=5.5 + #PHP_SERVER=5.6 + #PHP_SERVER=7.0 + PHP_SERVER=7.1 + #PHP_SERVER=7.2 + #PHP_SERVER=7.3 As you can see, all available values are already there, but commented. Only one is uncommented. In this example it is ``7.1``, which is the PHP version that will be started, once the Devilbox @@ -59,18 +58,17 @@ To change this, simply uncomment your version of choice and save this file. Do n In order to enable PHP 5.5, you would change the ``.env`` file like this: .. code-block:: bash - :name: .env :caption: .env :emphasize-lines: 2 - #PHP_SERVER=5.3 - #PHP_SERVER=5.4 - PHP_SERVER=5.5 - #PHP_SERVER=5.6 - #PHP_SERVER=7.0 - #PHP_SERVER=7.1 - #PHP_SERVER=7.2 - #PHP_SERVER=7.3 + #PHP_SERVER=5.3 + #PHP_SERVER=5.4 + PHP_SERVER=5.5 + #PHP_SERVER=5.6 + #PHP_SERVER=7.0 + #PHP_SERVER=7.1 + #PHP_SERVER=7.2 + #PHP_SERVER=7.3 Start the Devilbox @@ -80,11 +78,11 @@ Now save the file and you can start the Devilbox again. .. code-block:: bash - # Navigate to the Devilbox directory - host> /home/user/devilbox + # Navigate to the Devilbox directory + host> /home/user/devilbox - # Stop all container - host> docker-compose up php httpd bind + # Stop all container + host> docker-compose up php httpd bind .. seealso:: :ref:`start_the_devilbox` @@ -97,18 +95,17 @@ If two versions are uncommented, always the last one takes precedence. Consider this ``.env`` file: .. code-block:: bash - :name: .env :caption: .env :emphasize-lines: 2,4 - #PHP_SERVER=5.3 - #PHP_SERVER=5.4 - PHP_SERVER=5.5 - #PHP_SERVER=5.6 - PHP_SERVER=7.0 - #PHP_SERVER=7.1 - #PHP_SERVER=7.2 - #PHP_SERVER=7.3 + #PHP_SERVER=5.3 + #PHP_SERVER=5.4 + PHP_SERVER=5.5 + #PHP_SERVER=5.6 + PHP_SERVER=7.0 + #PHP_SERVER=7.1 + #PHP_SERVER=7.2 + #PHP_SERVER=7.3 Both, PHP 5.4 and PHP 7.0 are uncommented, however, when you start the Devilbox, it will use PHP 7.0 as this value overwrites any previous ones. @@ -124,7 +121,7 @@ The variable names of all available services with changable versions are in the ``_SERVER``. Just look through the :ref:`env_file`. .. seealso:: - The following variables control service versions: + The following variables control service versions: :ref:`env_php_server`, :ref:`env_httpd_server`, :ref:`env_mysql_server`, :ref:`env_pgsql_server`, :ref:`env_redis_server`, :ref:`env_memcd_server`, :ref:`env_mongo_server` diff --git a/docs/tutorials/communicating-with-external-hosts.rst b/docs/tutorials/communicating-with-external-hosts.rst index 2b8c504e..95db0ee9 100644 --- a/docs/tutorials/communicating-with-external-hosts.rst +++ b/docs/tutorials/communicating-with-external-hosts.rst @@ -106,26 +106,23 @@ If you are running Linux as your host operating system you would use the IP addr computer which was identified as ``172.16.238.1``. .. code-block:: bash - :name: .env - :caption: .env + :caption: .env - EXTRA_HOSTS=mywebserver.loc=172.16.238.1 + EXTRA_HOSTS=mywebserver.loc=172.16.238.1 or .. code-block:: bash - :name: .env - :caption: .env + :caption: .env - EXTRA_HOSTS=mywebserver.loc=docker.for.lin.host.internal + EXTRA_HOSTS=mywebserver.loc=docker.for.lin.host.internal or .. code-block:: bash - :name: .env - :caption: .env + :caption: .env - EXTRA_HOSTS=mywebserver.loc=docker.for.lin.localhost + EXTRA_HOSTS=mywebserver.loc=docker.for.lin.localhost Mapping on MacOS @@ -135,10 +132,9 @@ If you are running MacOS as your host operating system you would use one of the (depending on your Docker version). .. code-block:: bash - :name: .env - :caption: .env + :caption: .env - EXTRA_HOSTS=mywebserver.loc=host.docker.internal + EXTRA_HOSTS=mywebserver.loc=host.docker.internal The CNAME ``host.docker.internal`` will be resolved to an IP address during startup and ``mywebserver.loc`` 's DNS record will point to that IP address. @@ -151,10 +147,9 @@ If you are running Windows as your host operating system you would use one of th (depending on your Docker version). .. code-block:: bash - :name: .env - :caption: .env + :caption: .env - EXTRA_HOSTS=mywebserver.loc=docker.for.win.host.internal + EXTRA_HOSTS=mywebserver.loc=docker.for.win.host.internal The CNAME ``docker.for.win.host.internal`` will be resolved to an IP address during startup and ``mywebserver.loc`` 's DNS record will point to that IP address. @@ -171,5 +166,5 @@ Further reading =============== .. seealso:: - * :ref:`env_extra_hosts` - * :ref:`global_configuration_auto_dns` + * :ref:`env_extra_hosts` + * :ref:`global_configuration_auto_dns` diff --git a/docs/tutorials/custom-environment-variables.rst b/docs/tutorials/custom-environment-variables.rst index fe2e5343..4e8e1d9d 100644 --- a/docs/tutorials/custom-environment-variables.rst +++ b/docs/tutorials/custom-environment-variables.rst @@ -24,7 +24,6 @@ would add the following to the ``.env`` file: .. code-block:: bash :caption: .env - :name: .env :emphasize-lines: 1 APPLICATION_ENV=production @@ -32,8 +31,8 @@ would add the following to the ``.env`` file: You need to restart the Devilbox for the changes to take effect. .. note:: - There is already a proposed section inside the ``.env`` file at the very bottom - to add you custom variables to differentiate them from the Devilbox required variables. + There is already a proposed section inside the ``.env`` file at the very bottom + to add you custom variables to differentiate them from the Devilbox required variables. Use custom environment variables @@ -44,7 +43,6 @@ You can use the PHP's built-in function ``getenv`` to obtain the value: .. code-block:: php :caption: index.php - :name: index.php :emphasize-lines: 3 ./bash + # 1. Enter your PHP container + host> ./bash - # 2. Go to your project folder - devilbox@php-7.0.20 $ cd /shared/httpd/my-project + # 2. Go to your project folder + devilbox@php-7.0.20 $ cd /shared/httpd/my-project - # 3. Run the tools - devilbox@php-7.0.20 $ git-conflicts --path=. - devilbox@php-7.0.20 $ git-ignored --path=. - devilbox@php-7.0.20 $ file-cr --path=. - devilbox@php-7.0.20 $ file-crlf --path=. - devilbox@php-7.0.20 $ file-empty --path=. + # 3. Run the tools + devilbox@php-7.0.20 $ git-conflicts --path=. + devilbox@php-7.0.20 $ git-ignored --path=. + devilbox@php-7.0.20 $ file-cr --path=. + devilbox@php-7.0.20 $ file-crlf --path=. + devilbox@php-7.0.20 $ file-empty --path=. - # 4. Run tools with more options - devilbox@php-7.0.20 $ syntax-php --path=. --extension=php - devilbox@php-7.0.20 $ syntax-php --path=. --shebang=php + # 4. Run tools with more options + devilbox@php-7.0.20 $ syntax-php --path=. --extension=php + devilbox@php-7.0.20 $ syntax-php --path=. --shebang=php - # 5. Various syntax checks - devilbox@php-7.0.20 $ syntax-bash --path=. --text --extension=sh - devilbox@php-7.0.20 $ syntax-css --path=. --text --extension=css - devilbox@php-7.0.20 $ syntax-js --path=. --text --extension=js - devilbox@php-7.0.20 $ syntax-json --path=. --text --extension=json - devilbox@php-7.0.20 $ syntax-markdown --path=. --text --extension=md - devilbox@php-7.0.20 $ syntax-perl --path=. --text --extension=pl - devilbox@php-7.0.20 $ syntax-php --path=. --text --extension=php - devilbox@php-7.0.20 $ syntax-python --path=. --text --extension=python - devilbox@php-7.0.20 $ syntax-ruby --path=. --text --extension=rb - devilbox@php-7.0.20 $ syntax-scss --path=. --text --extension=scss + # 5. Various syntax checks + devilbox@php-7.0.20 $ syntax-bash --path=. --text --extension=sh + devilbox@php-7.0.20 $ syntax-css --path=. --text --extension=css + devilbox@php-7.0.20 $ syntax-js --path=. --text --extension=js + devilbox@php-7.0.20 $ syntax-json --path=. --text --extension=json + devilbox@php-7.0.20 $ syntax-markdown --path=. --text --extension=md + devilbox@php-7.0.20 $ syntax-perl --path=. --text --extension=pl + devilbox@php-7.0.20 $ syntax-php --path=. --text --extension=php + devilbox@php-7.0.20 $ syntax-python --path=. --text --extension=python + devilbox@php-7.0.20 $ syntax-ruby --path=. --text --extension=rb + devilbox@php-7.0.20 $ syntax-scss --path=. --text --extension=scss PHPCS @@ -79,14 +79,14 @@ PHPCS is a code style analyser for PHP. .. code-block:: bash - # 1. Enter your PHP container - host> ./bash + # 1. Enter your PHP container + host> ./bash - # 2. Go to your project folder - devilbox@php-7.0.20 $ cd /shared/httpd/my-project + # 2. Go to your project folder + devilbox@php-7.0.20 $ cd /shared/httpd/my-project - # 3. Run it - devilbox@php-7.0.20 $ phpcs . + # 3. Run it + devilbox@php-7.0.20 $ phpcs . ESLint @@ -98,11 +98,11 @@ ESLint is a Javascript static source code analyzer. .. code-block:: bash - # 1. Enter your PHP container - host> ./bash + # 1. Enter your PHP container + host> ./bash - # 2. Go to your project folder - devilbox@php-7.0.20 $ cd /shared/httpd/my-project + # 2. Go to your project folder + devilbox@php-7.0.20 $ cd /shared/httpd/my-project - # 3. Run it - devilbox@php-7.0.20 $ eslint . + # 3. Run it + devilbox@php-7.0.20 $ eslint . diff --git a/docs/tutorials/work-inside-the-container.rst b/docs/tutorials/work-inside-the-container.rst index cc894e24..9ac5d89d 100644 --- a/docs/tutorials/work-inside-the-container.rst +++ b/docs/tutorials/work-inside-the-container.rst @@ -34,14 +34,14 @@ Entering from Linux or MacOS: ``shell.sh`` .. code-block:: bash - # Navigate to the Devilbox directory - host> cd /path/to/devilbox + # Navigate to the Devilbox directory + host> cd /path/to/devilbox - # Run provided script - host> ./shell.sh + # Run provided script + host> ./shell.sh - # Now you are inside the PHP Linux container - devilbox@php-7.0.19 in /shared/httpd $ + # Now you are inside the PHP Linux container + devilbox@php-7.0.19 in /shared/httpd $ Entering from Windows: ``shell.bat`` @@ -49,14 +49,14 @@ Entering from Windows: ``shell.bat`` .. code-block:: bash - # Navigate to the Devilbox directory - C:/> cd C:/Users/user1/devilbox + # Navigate to the Devilbox directory + C:/> cd C:/Users/user1/devilbox - # Run provided script - C:/Users/user1/devilbox> shell.bat + # Run provided script + C:/Users/user1/devilbox> shell.bat - # Now you are inside the PHP Linux container - devilbox@php-7.0.19 in /shared/httpd $ + # Now you are inside the PHP Linux container + devilbox@php-7.0.19 in /shared/httpd $ Inside the container @@ -77,8 +77,8 @@ The uid and gid mappings are controlled via two ``.env`` variables called :ref:` .. seealso:: - If you want to find out more about synronized container permissions read up here: - :ref:`syncronize_container_permissions` + If you want to find out more about synronized container permissions read up here: + :ref:`syncronize_container_permissions` ``root`` user @@ -92,19 +92,19 @@ By default ``sudo`` is configured to be used without passwords, so you can simpl .. code-block:: bash - # As user devilbox inside the container - devilbox@php-7.0.19 in /shared/httpd $ sudo su - + # As user devilbox inside the container + devilbox@php-7.0.19 in /shared/httpd $ sudo su - - # You are now the root user - root@php-7.0.19 in /shared/httpd $ + # You are now the root user + root@php-7.0.19 in /shared/httpd $ You can also use ``sudo`` to run commands with root privileges without having to become root first. .. code-block:: bash - # As user devilbox inside the container - devilbox@php-7.0.19 in /shared/httpd $ sudo apt update - devilbox@php-7.0.19 in /shared/httpd $ sudo apt install nmap + # As user devilbox inside the container + devilbox@php-7.0.19 in /shared/httpd $ sudo apt update + devilbox@php-7.0.19 in /shared/httpd $ sudo apt install nmap Leave the container @@ -115,11 +115,11 @@ and you are out. .. code-block:: bash - # As user devilbox inside the container - devilbox@php-7.0.19 in /shared/httpd $ exit + # As user devilbox inside the container + devilbox@php-7.0.19 in /shared/httpd $ exit - # You are now back on your host operating system - host> + # You are now back on your host operating system + host> Host to Container mappings @@ -199,28 +199,28 @@ An example to access the MySQL database from either host or within the PHP conta .. code-block:: bash - # Access MySQL from your host operating system - host> mysql -h 127.0.0.1 + # Access MySQL from your host operating system + host> mysql -h 127.0.0.1 - # Access MySQL from within the PHP container - devilbox@php-7.0.19 in /shared/httpd $ mysql -h 127.0.0.1 + # Access MySQL from within the PHP container + devilbox@php-7.0.19 in /shared/httpd $ mysql -h 127.0.0.1 .. important:: - Do not use ``localhost`` to access the services, it does not map to ``127.0.0.1`` on - all cases. + Do not use ``localhost`` to access the services, it does not map to ``127.0.0.1`` on + all cases. So when setting up a configuration file from your PHP project you would for example use ``127.0.0.`` as the host for your MySQL database connection: .. code-block:: php - + Imagine your PHP framework ships a command line tool to run database migration. You could run it from your host operating system or from within the PHP container. It would work from both @@ -230,8 +230,8 @@ You could also even switch between the Devilbox and a locally installed LAMP sta and still use the same configuration. .. warning:: - The mapping of ``127.0.0.1`` to your host operating system does not work with - :ref:`docker_toolbox`. + The mapping of ``127.0.0.1`` to your host operating system does not work with + :ref:`docker_toolbox`. Port mappings @@ -269,8 +269,8 @@ The PHP container is hooked up by default to the bundled DNS server and makes us :ref:`global_configuration_auto_dns`. .. seealso:: - You can achieve the same on your host operating system by explicitly enabling auto-dns. - See also: :ref:`global_configuration_auto_dns`. + You can achieve the same on your host operating system by explicitly enabling auto-dns. + See also: :ref:`global_configuration_auto_dns`. Checklist