From 71899930aa42a52b8fe89299b25fb8b4bcba5f77 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 25 Mar 2018 14:35:05 +0200 Subject: [PATCH] Documentation: Examples --- docs/configuration-global/auto-dns.rst | 5 + docs/configuration-project/auto-dns.rst | 5 - docs/configuration-project/dns-records.rst | 5 + docs/examples/setup-cakephp.rst | 146 +++++++++++++++++++ docs/examples/setup-drupal.rst | 104 +++++++++++++ docs/examples/setup-joomla.rst | 103 +++++++++++++ docs/examples/setup-laravel.rst | 101 +++++++++++++ docs/examples/setup-phalcon.rst | 101 +++++++++++++ docs/examples/setup-symfony.rst | 111 ++++++++++++++ docs/examples/setup-wordpress.rst | 101 +++++++++++++ docs/examples/setup-yii.rst | 101 +++++++++++++ docs/examples/setup-zend.rst | 101 +++++++++++++ docs/index.rst | 21 +-- docs/tutorials/work-inside-the-container.rst | 5 +- 14 files changed, 994 insertions(+), 16 deletions(-) create mode 100644 docs/configuration-global/auto-dns.rst delete mode 100644 docs/configuration-project/auto-dns.rst create mode 100644 docs/configuration-project/dns-records.rst create mode 100644 docs/examples/setup-cakephp.rst create mode 100644 docs/examples/setup-drupal.rst create mode 100644 docs/examples/setup-joomla.rst create mode 100644 docs/examples/setup-laravel.rst create mode 100644 docs/examples/setup-phalcon.rst create mode 100644 docs/examples/setup-symfony.rst create mode 100644 docs/examples/setup-wordpress.rst create mode 100644 docs/examples/setup-yii.rst create mode 100644 docs/examples/setup-zend.rst diff --git a/docs/configuration-global/auto-dns.rst b/docs/configuration-global/auto-dns.rst new file mode 100644 index 00000000..2e5619b9 --- /dev/null +++ b/docs/configuration-global/auto-dns.rst @@ -0,0 +1,5 @@ +.. _global_configuration_auto_dns: + +******** +Auto-DNS +******** diff --git a/docs/configuration-project/auto-dns.rst b/docs/configuration-project/auto-dns.rst deleted file mode 100644 index f6815df7..00000000 --- a/docs/configuration-project/auto-dns.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. _auto_dns: - -******** -Auto-DNS -******** diff --git a/docs/configuration-project/dns-records.rst b/docs/configuration-project/dns-records.rst new file mode 100644 index 00000000..e18bd72c --- /dev/null +++ b/docs/configuration-project/dns-records.rst @@ -0,0 +1,5 @@ +.. _project_configuration_dns_records: + +*********** +DNS records +*********** diff --git a/docs/examples/setup-cakephp.rst b/docs/examples/setup-cakephp.rst new file mode 100644 index 00000000..76e62686 --- /dev/null +++ b/docs/examples/setup-cakephp.rst @@ -0,0 +1,146 @@ +.. _example_setup_cakephp: + +************* +Setup CakePHP +************* + +This example will use ``composer`` to install CakePHP from within the PHP container. + +.. seealso:: `Official CakePHP Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-cake | /shared/httpd/my-cake | my_cake | loc | http://my-cake.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in eight simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install CakePHP via ``composer`` +4. Symlink webroot directory +5. Add MySQL database +6. Configure datbase connection +7. Setup DNS record +8. Visit http://my-cake.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-cake + + +3. Install CakePHP +------------------ + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-cake $ ln -s cakephp/webroot/ htdocs + + +5. Add MySQL Database +--------------------- + +.. 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;' + + +6. Configure database connection +-------------------------------- + +.. code-block:: bash + + 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, + ?> + + +7. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +8. Open your browser +-------------------- + +All set now, you can visit http://my-cake.loc in your browser. diff --git a/docs/examples/setup-drupal.rst b/docs/examples/setup-drupal.rst new file mode 100644 index 00000000..9367eb23 --- /dev/null +++ b/docs/examples/setup-drupal.rst @@ -0,0 +1,104 @@ +.. _example_setup_drupal: + +************ +Setup Drupal +************ + +This example will use ``drush`` to install Drupal from within the PHP container. + +.. seealso:: `Official Drupal Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-drupal | /shared/httpd/my-drupal | my_drupal | loc | http://my-drupal.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Drupal via ``drush`` +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-drupal.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-drupal + + +3. Install Drupal +----------------- + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-drupal $ ln -s drupal-8.3.3/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +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``. diff --git a/docs/examples/setup-joomla.rst b/docs/examples/setup-joomla.rst new file mode 100644 index 00000000..d9b59382 --- /dev/null +++ b/docs/examples/setup-joomla.rst @@ -0,0 +1,103 @@ +.. _example_setup_joomla: + +************ +Setup Joomla +************ + +This example will install Joomla from within the PHP container. + +.. seealso:: `Official Joomla Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-joomla | /shared/httpd/my-joomla | n.a. | loc | http://my-joomla.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Download and extract Joomla +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-joomla.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-joomla + + +3. Download and extract Joomla +------------------------------ + +.. 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/ + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-joomla $ ln -s joomla/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-joomla.loc diff --git a/docs/examples/setup-laravel.rst b/docs/examples/setup-laravel.rst new file mode 100644 index 00000000..2bad2232 --- /dev/null +++ b/docs/examples/setup-laravel.rst @@ -0,0 +1,101 @@ +.. _example_setup_laravel: + +************* +Setup Laravel +************* + +This example will use ``laravel`` to install Laravel from within the PHP container. + +.. seealso:: `Official Laravel Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-laravel | /shared/httpd/my-laravel | n.a. | loc | http://my-laravel.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Laravel +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-laravel.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-laravel + + +3. Install Laravel +------------------ + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-laravel $ ln -s laravel-project/public/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-laravel.loc diff --git a/docs/examples/setup-phalcon.rst b/docs/examples/setup-phalcon.rst new file mode 100644 index 00000000..eb8df11e --- /dev/null +++ b/docs/examples/setup-phalcon.rst @@ -0,0 +1,101 @@ +.. _example_setup_phalcon: + +************* +Setup Phalcon +************* + +This example will use ``phalcon`` to install Phalcon from within the PHP container. + +.. seealso:: `Official Phalcon Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-phalcon | /shared/httpd/my-phalcon | n.a. | loc | http://my-phalcon.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Phalcon +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-phalcon.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-phalcon + + +3. Install Phalcon +------------------ + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-pahlcon $ ln -s phalconphp/public/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-phalcon.loc diff --git a/docs/examples/setup-symfony.rst b/docs/examples/setup-symfony.rst new file mode 100644 index 00000000..44ce54f6 --- /dev/null +++ b/docs/examples/setup-symfony.rst @@ -0,0 +1,111 @@ +.. _example_setup_symfony: + +************* +Setup Symfony +************* + +This example will use ``symfony`` to install Symfony from within the PHP container. + +.. seealso:: `Official Symfony Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-symfony | /shared/httpd/my-symfony | n.a. | loc | http://my-symfony.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in seven simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Symfony +4. Symlink webroot directory +5. Enable Symfony prod (``app.php``) +6. Setup DNS record +7. Visit http://my-symfony.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-symfony + + +3. Install Symfony +------------------ + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-symfony $ ln -s symfony/web/ htdocs + + +5. Enable Symfony prod (``app.php``) +------------------------------------ + +.. 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 + + +6. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +7. Open your browser +-------------------- + +Open your browser at http://my-symfony.loc diff --git a/docs/examples/setup-wordpress.rst b/docs/examples/setup-wordpress.rst new file mode 100644 index 00000000..e4d5516b --- /dev/null +++ b/docs/examples/setup-wordpress.rst @@ -0,0 +1,101 @@ +.. _example_setup_wordpress: + +*************** +Setup Wordpress +*************** + +This example will use ``git`` to install Wordpress from within the PHP container. + +.. seealso:: `Official Wordpress Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-wp | /shared/httpd/my-wp | my_wp | loc | http://my-wp.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Download Wordpress via ``git`` +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-wp.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-wp + + +3. Download Wordpress via ``git`` +--------------------------------- + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-wp $ ln -s wordpress.git/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-wp.loc diff --git a/docs/examples/setup-yii.rst b/docs/examples/setup-yii.rst new file mode 100644 index 00000000..55e68000 --- /dev/null +++ b/docs/examples/setup-yii.rst @@ -0,0 +1,101 @@ +.. _example_setup_yii: + +********* +Setup Yii +********* + +This example will use ``composer`` to install Yii from within the PHP container. + +.. seealso:: `Official Yii Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-yii | /shared/httpd/my-yii | n.a. | loc | http://my-yii.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Yii2 via ``composer`` +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-wp.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-yii + + +3. Install Yii2 via ``composer`` +-------------------------------- + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-yii $ ln -s yii2-dev/web/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-yii.loc diff --git a/docs/examples/setup-zend.rst b/docs/examples/setup-zend.rst new file mode 100644 index 00000000..b7a1fc7c --- /dev/null +++ b/docs/examples/setup-zend.rst @@ -0,0 +1,101 @@ +.. _example_setup_zend: + +********** +Setup Zend +********** + +This example will use ``composer`` to install Zend from within the PHP container. + +.. seealso:: `Official Zend Documentation `_ + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +The following configuration will be used: + ++--------------+--------------------------+-------------+------------+-----------------------+ +| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL | ++==============+==========================+=============+============+=======================+ +| my-zend | /shared/httpd/my-zend | n.a. | loc | http://my-zend.loc | ++--------------+--------------------------+-------------+------------+-----------------------+ + + +Walk through +============ + +It will be ready in six simple steps: + +1. Enter the PHP container +2. Create a new VirtualHost directory +3. Install Zend via ``composer`` +4. Symlink webroot directory +5. Setup DNS record +6. Visit http://my-wp.loc in your browser + + +.. seealso:: :ref:`available_tools` + + +1. Enter the PHP container +-------------------------- + +.. code-block:: bash + + host> ./shell.sh + +.. seealso:: :ref:`tutorial_work_inside_the_php_container` + + +2. Create new vhost directory +----------------------------- + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd $ mkdir my-zend + + +3. Install Zend via ``composer`` +-------------------------------- + +.. 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 + + +4. Symlink webroot +------------------ + +.. code-block:: bash + + devilbox@php-7.0.20 in /shared/httpd/my-zend $ ln -s zend/public/ htdocs + + +5. DNS record +------------- + +If you do not have :ref:`global_configuration_auto_dns` configured, you will need to add the +following line to your host operating systems ``/etc/hosts`` file +(or ``C:\Windows\System32\drivers\etc`` on Windows): + +.. code-block:: bash + :caption: /etc/hosts + :name: /etc/hosts + + 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`. + + +6. Open your browser +-------------------- + +Open your browser at http://my-zend.loc diff --git a/docs/index.rst b/docs/index.rst index 9613548e..87132340 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -56,6 +56,7 @@ devilbox documentation tutorials/custom-environment-variables tutorials/password-protect-intranet tutorials/disable-intranet + tutorials/static-code-analysis .. toctree:: @@ -73,6 +74,15 @@ devilbox documentation examples/setup-zend +.. toctree:: + :caption: Project configuration + :maxdepth: 2 + + configuration-project/dns-records + configuration-project/domain + configuration-project/custom-vhost + + .. toctree:: :caption: Global configuration :maxdepth: 2 @@ -85,15 +95,8 @@ devilbox documentation configuration-global/memcached configuration-global/bind configuration-global/devilbox-intranet - -.. toctree:: - :caption: Project configuration - :maxdepth: 2 - - configuration-project/dns - configuration-project/auto-dns - configuration-project/domain - configuration-project/custom-vhost + configuration-global/auto-dns + configuration-global/logging .. toctree:: diff --git a/docs/tutorials/work-inside-the-container.rst b/docs/tutorials/work-inside-the-container.rst index 03a706e8..70715993 100644 --- a/docs/tutorials/work-inside-the-container.rst +++ b/docs/tutorials/work-inside-the-container.rst @@ -265,11 +265,12 @@ DNS mappings All project DNS records are also available from inside the PHP container independent of the value of :ref:`env_tld_suffix`. -The PHP container is hooked up by default to the bundled DNS server and makes use :ref:`auto_dns`. +The PHP container is hooked up by default to the bundled DNS server and makes use +:ref:`global_configuration_auto_dns`. .. seealso:: You can achieve the same on your host operating system by explicitly enabling auto-dns. - See also: :ref:`auto_dns` and :ref:`tutorial_enable_auto_dns`. + See also: :ref:`global_configuration_auto_dns` and :ref:`tutorial_enable_auto_dns`. Checklist