From fda8f43786d08a937b1417684ff18e793c1439da Mon Sep 17 00:00:00 2001 From: john-ea <9639570+john-ea@users.noreply.github.com> Date: Sat, 30 Mar 2024 17:43:23 +0500 Subject: [PATCH] Fixing docs --- .tests/tests/intranet-vhost.sh | 2 - .tests/tests/rproxy-javascript.sh | 2 - .tests/tests/vhost-directory_index.sh | 1 - .tests/tests/vhost-vhostgen_customize.sh | 2 - .../tests/vhost-vhostgen_default_template.sh | 1 - .../advanced/customize-webserver-globally.rst | 2 +- docs/configuration-files/apache-conf.rst | 41 +-------------- docs/configuration-files/env-file.rst | 37 +++++--------- docs/examples/setup-reverse-proxy-nodejs.rst | 51 ++----------------- .../setup-reverse-proxy-python-flask.rst | 51 ++----------------- .../setup-reverse-proxy-sphinx-docs.rst | 49 ++---------------- .../change-container-versions.rst | 3 +- .../reverse-proxy-for-custom-docker.rst | 44 +--------------- .../reverse-proxy-with-https.rst | 45 +--------------- .../customize-all-virtual-hosts-globally.rst | 10 ---- .../customize-specific-virtual-host.rst | 17 ++----- docs/vhost-gen/example-add-subdomains.rst | 29 ++++------- docs/vhost-gen/virtual-host-templates.rst | 29 ++--------- 18 files changed, 53 insertions(+), 363 deletions(-) diff --git a/.tests/tests/intranet-vhost.sh b/.tests/tests/intranet-vhost.sh index 66c520547..0bedc95f3 100755 --- a/.tests/tests/intranet-vhost.sh +++ b/.tests/tests/intranet-vhost.sh @@ -155,7 +155,6 @@ fi ### vhost-gen config link should appear ### #run "docker-compose exec --user devilbox -T php mkdir -p /shared/httpd/${VHOST}/${HTTPD_TEMPLATE_DIR}" "${RETRIES}" "${DVLBOX_PATH}" -#run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache22.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml" "${RETRIES}" #run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache24.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml" "${RETRIES}" #run "cp ${DVLBOX_PATH}/cfg/vhost-gen/nginx.yml-example-vhost ${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml" "${RETRIES}" # @@ -185,7 +184,6 @@ fi ### ### vhost-gen config changes are shown in intranet ### -#replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml" #replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml" #replace "__INDEX__" "__MY_GREP_VALUE__" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml" # diff --git a/.tests/tests/rproxy-javascript.sh b/.tests/tests/rproxy-javascript.sh index d2a6c9934..ac36a7220 100755 --- a/.tests/tests/rproxy-javascript.sh +++ b/.tests/tests/rproxy-javascript.sh @@ -70,7 +70,6 @@ run "docker-compose exec --user devilbox -T php mkdir -p /shared/httpd/${RPROXY_ ### ### Apply default vhost-gen reverse proxy configurations ### -run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache22.yml-example-rproxy ${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/apache22.yml" "${RETRIES}" run "cp ${DVLBOX_PATH}/cfg/vhost-gen/apache24.yml-example-rproxy ${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/apache24.yml" "${RETRIES}" run "cp ${DVLBOX_PATH}/cfg/vhost-gen/nginx.yml-example-rproxy ${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/nginx.yml" "${RETRIES}" @@ -78,7 +77,6 @@ run "cp ${DVLBOX_PATH}/cfg/vhost-gen/nginx.yml-example-rproxy ${SCRIPT_PATH}/ ### ### Apply custom configuration to reverse proxy files ### -replace ":${VHOSTGEN_TPL_DEFAULT_PORT}" ":${RPROXY_PORT}" "${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/apache22.yml" replace ":${VHOSTGEN_TPL_DEFAULT_PORT}" ":${RPROXY_PORT}" "${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/apache24.yml" replace ":${VHOSTGEN_TPL_DEFAULT_PORT}" ":${RPROXY_PORT}" "${SCRIPT_PATH}/../www/${RPROXY_NAME}/${HTTPD_TEMPLATE_DIR}/nginx.yml" diff --git a/.tests/tests/vhost-directory_index.sh b/.tests/tests/vhost-directory_index.sh index a2a176d1f..2c3de608d 100755 --- a/.tests/tests/vhost-directory_index.sh +++ b/.tests/tests/vhost-directory_index.sh @@ -53,7 +53,6 @@ fi ### TLD_SUFFIX="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "TLD_SUFFIX" )" HTTPD_DOCROOT_DIR="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HTTPD_DOCROOT_DIR" )" -HTTPD_VERSION="$( "${SCRIPT_PATH}/../scripts/env-getvar.sh" "HTTPD_SERVER" )" ### diff --git a/.tests/tests/vhost-vhostgen_customize.sh b/.tests/tests/vhost-vhostgen_customize.sh index aa55f1a9c..1e06742e1 100755 --- a/.tests/tests/vhost-vhostgen_customize.sh +++ b/.tests/tests/vhost-vhostgen_customize.sh @@ -88,7 +88,6 @@ run "docker-compose exec --user devilbox -T php bash -c 'echo \" 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/ Customization is achieved by placing a file into ``cfg/apache-X.X/`` (where ``X.X`` stands for @@ -54,44 +53,6 @@ In order for the changes to be applied, you will have to restart the Devilbox. Examples ======== -Adjust KeepAlive settings for Apache 2.2 ----------------------------------------- - -The following examples shows you how to change the -`KeepAlive `_, the -`MaxKeepAliveRequests `_ -as well as the -`KeepAliveTimeout `_ values of -Apache 2.2. - -.. code-block:: bash - - # Navigate to the Devilbox directory - host> cd path/to/devilbox - - # Navigate to Apache 2.2 config directory - host> cd cfg/apache-2.2 - - # Create new conf file - host> touch keep_alive.conf - -Now add the following content to the file: - -.. code-block:: ini - :caption: keep_alive.conf - - 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. - - Limit HTTP headers and GET size for Apache 2.4 ---------------------------------------------- diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index df3dba78f..27c5e69e1 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -557,24 +557,17 @@ PHP_SERVER This variable choses your desired PHP-FPM version to be started. -+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+ -| Name | Allowed values | Default value | -+=========================+==================================================================================================================================================================================================================================================================================================+=================+ -| ``PHP_SERVER`` | ``php-fpm-5.2`` |br| ``php-fpm-5.3`` |br| ``php-fpm-5.4`` |br| ``php-fpm-5.5`` |br| ``php-fpm-5.6`` |br| ``php-fpm-7.0`` |br| ``php-fpm-7.1`` |br| ``php-fpm-7.2`` |br| ``php-fpm-7.3`` |br| ``php-fpm-7.4`` |br| ``php-fpm-8.0`` |br| ``php-fpm-8.1`` |br| ``php-fpm-8.2`` |br| ``php-fpm-8.2`` | ``php-fpm-8.1`` | -+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+ - -.. important:: - **PHP 5.2** is available to use, but it is not officially supported. The Devilbox intranet does - not work with this version as PHP 5.2 does not support namespaces. Furthermore PHP 5.2 does only - work with Apache 2.4, Nginx stable and Nginx mainline. It does not work with Apache 2.2. - **Use at your own risk.** - ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+ +| Name | Allowed values | Default value | ++=========================+==============================================================================================================================================================================================================+=================+ +| ``PHP_SERVER`` | ``php-fpm-5.6`` |br| ``php-fpm-7.0`` |br| ``php-fpm-7.1`` |br| ``php-fpm-7.2`` |br| ``php-fpm-7.3`` |br| ``php-fpm-7.4`` |br| ``php-fpm-8.0`` |br| ``php-fpm-8.1`` |br| ``php-fpm-8.2`` |br| ``php-fpm-8.3`` | ``php-fpm-8.1`` | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+ All values are already available in the ``.env`` file and just need to be commented or uncommented. If multiple values are uncommented, the last uncommented variable one takes precedences: .. code-block:: bash :caption: .env - :emphasize-lines: 14 + :emphasize-lines: 10 host> grep PHP_SERVER .env @@ -597,21 +590,20 @@ HTTPD_SERVER This variable choses your desired web server version to be started. -+-------------------------+----------------------------------------------------------------------------------+------------------+ -| Name | Allowed values | Default value | -+=========================+==================================================================================+==================+ -| ``HTTPD_SERVER`` | ``apache-2.2`` |br| ``apache-2.4`` |br| ``nginx-stable`` |br| ``nginx-mainline`` | ``nginx-stable`` | -+-------------------------+----------------------------------------------------------------------------------+------------------+ ++-------------------------+--------------------------------------------------------------+------------------+ +| Name | Allowed values | Default value | ++=========================+==============================================================+==================+ +| ``HTTPD_SERVER`` | ``apache-2.4`` |br| ``nginx-stable`` |br| ``nginx-mainline`` | ``nginx-stable`` | ++-------------------------+--------------------------------------------------------------+------------------+ All values are already available in the ``.env`` file and just need to be commented or uncommented. If multiple values are uncommented, the last uncommented variable one takes precedences: .. code-block:: bash :caption: .env - :emphasize-lines: 5 + :emphasize-lines: 4 host> grep HTTPD_SERVER .env - #HTTPD_SERVER=apache-2.2 #HTTPD_SERVER=apache-2.4 HTTPD_SERVER=nginx-stable #HTTPD_SERVER=nginx-mainline @@ -1477,17 +1469,16 @@ Let's have a look how the directory is actually built up: # 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 +The three files ``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 |ext_lnk_project_vhost_gen|. - A virtual host generator for Apache 2.2, Apache 2.4 and any Nginx version. + A virtual host generator for Apache 2.4 and any Nginx version. .. seealso:: **Customize your virtual host** diff --git a/docs/examples/setup-reverse-proxy-nodejs.rst b/docs/examples/setup-reverse-proxy-nodejs.rst index 6c327fc59..512e6c8ea 100644 --- a/docs/examples/setup-reverse-proxy-nodejs.rst +++ b/docs/examples/setup-reverse-proxy-nodejs.rst @@ -159,26 +159,24 @@ inside the project directory. 5.2 Copy vhost-gen templates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.2, Apache 2.4 and Nginx. +Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.4 and Nginx. The reverse vhost-gen templates are available in ``cfg/vhost-gen``: .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files For this example we will copy all ``*-example-rproxy`` files into ``/shared/httpd/my-node/.devilbox`` to ensure this will work with all web servers. @@ -186,7 +184,6 @@ to ensure this will work with all web servers. .. code-block:: bash host> cd /path/to/devilbox - host> cp cfg/vhost-gen/apache22.yml-example-rproxy data/www/my-node/.devilbox/apache22.yml host> cp cfg/vhost-gen/apache24.yml-example-rproxy data/www/my-node/.devilbox/apache24.yml host> cp cfg/vhost-gen/nginx.yml-example-rproxy data/www/my-node/.devilbox/nginx.yml @@ -198,45 +195,7 @@ By default, all vhost-gen templates will forward requests to port ``8000`` into Our current example however uses port ``4000``, so we must change that accordingly for all three templates. -5.3.1 Adjust Apache 2.2 template -"""""""""""""""""""""""""""""""" - -Open the ``apache22.yml`` vhost-gen template in your project: - -.. code-block:: bash - - host> cd /path/to/devilbox - host> vi data/www/my-node/.devilbox/apache22.yml - - -Find the two lines with ``ProxyPass`` and ``ProxyPassReverse`` and change the port from ``8000`` -to ``4000`` - -.. code-block:: yaml - :caption: data/www/my-node/.devilbox/apache22.yml - :emphasize-lines: 16,17 - - # ... more lines above ... # - - ### - ### Basic vHost skeleton - ### - vhost: | - - ServerName __VHOST_NAME__ - - CustomLog "__ACCESS_LOG__" combined - ErrorLog "__ERROR_LOG__" - - # Reverse Proxy definition (Ensure to adjust the port, currently '8000') - ProxyRequests On - ProxyPreserveHost On - ProxyPass / http://php:4000/ - ProxyPassReverse / http://php:4000/ - - # ... more lines below ... # - -5.3.2 Adjust Apache 2.4 template +5.3.1 Adjust Apache 2.4 template """""""""""""""""""""""""""""""" Open the ``apache24.yml`` vhost-gen template in your project: @@ -274,7 +233,7 @@ to ``4000`` # ... more lines below ... # -5.3.3 Adjust Nginx template +5.3.2 Adjust Nginx template """"""""""""""""""""""""""" Open the ``nginx.yml`` vhost-gen template in your project: diff --git a/docs/examples/setup-reverse-proxy-python-flask.rst b/docs/examples/setup-reverse-proxy-python-flask.rst index 9a5b93ffd..9090c110a 100644 --- a/docs/examples/setup-reverse-proxy-python-flask.rst +++ b/docs/examples/setup-reverse-proxy-python-flask.rst @@ -225,26 +225,24 @@ inside the project directory. 6.2 Copy vhost-gen templates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.2, Apache 2.4 and Nginx. +Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.4 and Nginx. The reverse vhost-gen templates are available in ``cfg/vhost-gen``: .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files For this example we will copy all ``*-example-rproxy`` files into ``data/www/my-flask/.devilbox/`` (Inside container: ``/shared/httpd/my-flask/.devilbox``) to ensure this will work with all web servers. @@ -252,7 +250,6 @@ For this example we will copy all ``*-example-rproxy`` files into ``data/www/my- .. code-block:: bash host> cd /path/to/devilbox - host> cp cfg/vhost-gen/apache22.yml-example-rproxy data/www/my-flask/.devilbox/apache22.yml host> cp cfg/vhost-gen/apache24.yml-example-rproxy data/www/my-flask/.devilbox/apache24.yml host> cp cfg/vhost-gen/nginx.yml-example-rproxy data/www/my-flask/.devilbox/nginx.yml @@ -265,45 +262,7 @@ Our current example however uses port ``3000`` and backend IP ``172.16.238.250`` in the Flask docker compose override file), so we must change that accordingly for all three templates. -6.3.1 Adjust Apache 2.2 template -"""""""""""""""""""""""""""""""" - -Open the ``apache22.yml`` vhost-gen template in your project: - -.. code-block:: bash - - host> cd /path/to/devilbox - host> vi data/www/my-flask/.devilbox/apache22.yml - - -Find the two lines with ``ProxyPass`` and ``ProxyPassReverse`` and change the port from ``8000`` -to ``3000`` as well as the backend server from ``php`` to ``172.16.238.250``. - -.. code-block:: yaml - :caption: data/www/my-flask/.devilbox/apache22.yml - :emphasize-lines: 16,17 - - # ... more lines above ... # - - ### - ### Basic vHost skeleton - ### - vhost: | - - ServerName __VHOST_NAME__ - - CustomLog "__ACCESS_LOG__" combined - ErrorLog "__ERROR_LOG__" - - # Reverse Proxy definition (Ensure to adjust the port, currently '8000') - ProxyRequests On - ProxyPreserveHost On - ProxyPass / http://172.16.238.250:3000/ - ProxyPassReverse / http://172.16.238.250:3000/ - - # ... more lines below ... # - -6.3.2 Adjust Apache 2.4 template +6.3.1 Adjust Apache 2.4 template """""""""""""""""""""""""""""""" Open the ``apache24.yml`` vhost-gen template in your project: @@ -341,7 +300,7 @@ to ``3000`` # ... more lines below ... # -6.3.3 Adjust Nginx template +6.3.2 Adjust Nginx template """"""""""""""""""""""""""" Open the ``nginx.yml`` vhost-gen template in your project: diff --git a/docs/examples/setup-reverse-proxy-sphinx-docs.rst b/docs/examples/setup-reverse-proxy-sphinx-docs.rst index ddf38dfa9..5e4069e88 100644 --- a/docs/examples/setup-reverse-proxy-sphinx-docs.rst +++ b/docs/examples/setup-reverse-proxy-sphinx-docs.rst @@ -184,26 +184,24 @@ inside the project directory. 5.2 Copy vhost-gen templates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.2, Apache 2.4 and Nginx. +Now we can copy and adjust the vhost-gen reverse proxy files for Apache 2.4 and Nginx. The reverse vhost-gen templates are available in ``cfg/vhost-gen``: .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files For this example we will copy all ``*-example-rproxy`` files into ``/shared/httpd/my-sphinx/.devilbox`` to ensure this will work with all web servers. @@ -211,7 +209,6 @@ to ensure this will work with all web servers. .. code-block:: bash host> cd /path/to/devilbox - host> cp cfg/vhost-gen/apache22.yml-example-rproxy data/www/my-sphinx/.devilbox/apache22.yml host> cp cfg/vhost-gen/apache24.yml-example-rproxy data/www/my-sphinx/.devilbox/apache24.yml host> cp cfg/vhost-gen/nginx.yml-example-rproxy data/www/my-sphinx/.devilbox/nginx.yml @@ -223,45 +220,7 @@ By default, all vhost-gen templates will forward requests to port ``8000`` into Our current example however uses port ``4000``, so we must change that accordingly for all three templates. -5.3.1 Adjust Apache 2.2 template -"""""""""""""""""""""""""""""""" - -Open the ``apache22.yml`` vhost-gen template in your project: - -.. code-block:: bash - - host> cd /path/to/devilbox - host> vi data/www/my-sphinx/.devilbox/apache22.yml - - -Find the two lines with ``ProxyPass`` and ``ProxyPassReverse`` and change the port from ``8000`` -to ``4000`` - -.. code-block:: yaml - :caption: data/www/my-sphinx/.devilbox/apache22.yml - :emphasize-lines: 16,17 - - # ... more lines above ... # - - ### - ### Basic vHost skeleton - ### - vhost: | - - ServerName __VHOST_NAME__ - - CustomLog "__ACCESS_LOG__" combined - ErrorLog "__ERROR_LOG__" - - # Reverse Proxy definition (Ensure to adjust the port, currently '8000') - ProxyRequests On - ProxyPreserveHost On - ProxyPass / http://php:4000/ - ProxyPassReverse / http://php:4000/ - - # ... more lines below ... # - -5.3.2 Adjust Apache 2.4 template +5.3.1 Adjust Apache 2.4 template """""""""""""""""""""""""""""""" Open the ``apache24.yml`` vhost-gen template in your project: diff --git a/docs/getting-started/change-container-versions.rst b/docs/getting-started/change-container-versions.rst index dee4c4aae..c5557b5da 100644 --- a/docs/getting-started/change-container-versions.rst +++ b/docs/getting-started/change-container-versions.rst @@ -170,13 +170,12 @@ once the Devilbox starts. To change this, simply uncomment your version of choice and save this file. Do not forget to comment (disable) any other version. -In order to enable Apache 2.2, you would change the ``.env`` file like this: +In order to enable Apache 2.4, you would change the ``.env`` file like this: .. code-block:: bash :caption: .env :emphasize-lines: 1 - HTTPD_SERVER=apache-2.2 #HTTPD_SERVER=apache-2.4 #HTTPD_SERVER=nginx-stable #HTTPD_SERVER=nginx-mainline diff --git a/docs/reverse-proxy/reverse-proxy-for-custom-docker.rst b/docs/reverse-proxy/reverse-proxy-for-custom-docker.rst index 0117f3163..cfc0ca324 100644 --- a/docs/reverse-proxy/reverse-proxy-for-custom-docker.rst +++ b/docs/reverse-proxy/reverse-proxy-for-custom-docker.rst @@ -78,20 +78,18 @@ Copy vhost-gen templates The reverse vhost-gen templates are available in ``cfg/vhost-gen``: .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files For this example we will copy all ``*-example-rproxy`` files into ``/shared/httpd/my-python/.devilbox`` to ensure this will work with all web servers. @@ -99,7 +97,6 @@ to ensure this will work with all web servers. .. code-block:: bash host> cd /path/to/devilbox - host> cp cfg/vhost-gen/apache22.yml-example-rproxy data/www/my-python/.devilbox/apache22.yml host> cp cfg/vhost-gen/apache24.yml-example-rproxy data/www/my-python/.devilbox/apache24.yml host> cp cfg/vhost-gen/nginx.yml-example-rproxy data/www/my-python/.devilbox/nginx.yml @@ -111,43 +108,6 @@ By default, all vhost-gen templates will forward requests to port ``8000`` into Our current example however uses port ``3000`` and host ``python``, so we must change that accordingly for all three templates. -Adjust Apache 2.2 template -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Open the ``apache22.yml`` vhost-gen template in your project: - -.. code-block:: bash - - host> cd /path/to/devilbox - host> vi data/www/my-python/.devilbox/apache22.yml - -Find the two lines with ``ProxyPass`` and ``ProxyPassReverse`` and change the port from ``8000`` -to ``3000`` and host ``php`` to ``python``: - -.. code-block:: yaml - :caption: data/www/my-python/.devilbox/apache22.yml - :emphasize-lines: 16,17 - - # ... more lines above ... # - - ### - ### Basic vHost skeleton - ### - vhost: | - - ServerName __VHOST_NAME__ - - CustomLog "__ACCESS_LOG__" combined - ErrorLog "__ERROR_LOG__" - - # Reverse Proxy definition (Ensure to adjust the port, currently '8000') - ProxyRequests On - ProxyPreserveHost On - ProxyPass / http://python:3000/ - ProxyPassReverse / http://python:3000/ - - # ... more lines below ... # - Adjust Apache 2.4 template ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reverse-proxy/reverse-proxy-with-https.rst b/docs/reverse-proxy/reverse-proxy-with-https.rst index e719f2cd4..1074f7b7b 100644 --- a/docs/reverse-proxy/reverse-proxy-with-https.rst +++ b/docs/reverse-proxy/reverse-proxy-with-https.rst @@ -49,20 +49,18 @@ Copy vhost-gen templates The reverse vhost-gen templates are available in ``cfg/vhost-gen``: .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files For this example we will copy all ``*-example-rproxy`` files into ``/shared/httpd/my-app/.devilbox`` to ensure this will work with all web servers. @@ -70,7 +68,6 @@ to ensure this will work with all web servers. .. code-block:: bash host> cd /path/to/devilbox - host> cp cfg/vhost-gen/apache22.yml-example-rproxy data/www/my-app/.devilbox/apache22.yml host> cp cfg/vhost-gen/apache24.yml-example-rproxy data/www/my-app/.devilbox/apache24.yml host> cp cfg/vhost-gen/nginx.yml-example-rproxy data/www/my-app/.devilbox/nginx.yml @@ -82,44 +79,6 @@ By default, all vhost-gen templates will forward requests to port ``8000`` into Our current example however uses port ``8081``, so we must change that accordingly for all three templates. -Adjust Apache 2.2 template -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Open the ``apache22.yml`` vhost-gen template in your project: - -.. code-block:: bash - - host> cd /path/to/devilbox - host> vi data/www/my-app/.devilbox/apache22.yml - - -Find the two lines with ``ProxyPass`` and ``ProxyPassReverse`` and change the port from ``8000`` -to ``8081`` - -.. code-block:: yaml - :caption: data/www/my-app/.devilbox/apache22.yml - :emphasize-lines: 16,17 - - # ... more lines above ... # - - ### - ### Basic vHost skeleton - ### - vhost: | - - ServerName __VHOST_NAME__ - - CustomLog "__ACCESS_LOG__" combined - ErrorLog "__ERROR_LOG__" - - # Reverse Proxy definition (Ensure to adjust the port, currently '8000') - ProxyRequests On - ProxyPreserveHost On - ProxyPass / http://php:8081/ - ProxyPassReverse / http://php:8081/ - - # ... more lines below ... # - Adjust Apache 2.4 template ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/vhost-gen/customize-all-virtual-hosts-globally.rst b/docs/vhost-gen/customize-all-virtual-hosts-globally.rst index d378852ff..8a612d46d 100644 --- a/docs/vhost-gen/customize-all-virtual-hosts-globally.rst +++ b/docs/vhost-gen/customize-all-virtual-hosts-globally.rst @@ -36,8 +36,6 @@ filename. +----------------+--------------------------------+------------------+ | Web server | Example template | Template name | +================+================================+==================+ -| Apache 2.2 | ``apache22.yml-example-vhost`` | ``apache22.yml`` | -+----------------+--------------------------------+------------------+ | Apache 2.4 | ``apache24.yml-example-vhost`` | ``apache24.yml`` | +----------------+--------------------------------+------------------+ | Nginx stable | ``nginx.yml-example-vhost`` | ``nginx.yml`` | @@ -54,14 +52,6 @@ filename. as those templates reflect the same values the web servers are using. -Apache 2.2 ----------- - -1. Navigate to ``cfg/vhost-gen/`` inside the Devilbox directory -2. Copy ``apache22.yml-example-vhost`` to ``apache22.yml`` and restart the Devilbox -3. Whenever you adjust ``apache22.yml``, you need to restart the Devilbox - - Apache 2.4 ---------- diff --git a/docs/vhost-gen/customize-specific-virtual-host.rst b/docs/vhost-gen/customize-specific-virtual-host.rst index 3e89ae5c3..f58903524 100644 --- a/docs/vhost-gen/customize-specific-virtual-host.rst +++ b/docs/vhost-gen/customize-specific-virtual-host.rst @@ -18,7 +18,7 @@ vhost-gen What is vhost-gen ----------------- -``vhost-gen`` is a python script which is able to dynamically generate Apache 2.2, Apache 2.4 and +``vhost-gen`` is a python script which is able to dynamically generate Apache 2.4 and Nginx virtual host or reverse proxy configuration files. It is intended to be used by other means of automation such as change of directories or change of @@ -123,8 +123,7 @@ Then you can copy the templates. host> cp cfg/vhost-gen/*.yml-example-* ./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 + You actually only need to copy the template of your chosen webserver (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. @@ -133,7 +132,6 @@ Then you can copy the templates. At this stage you can start adjusting the template. Either do that for the webserver version you have enabled via :ref:`env_httpd_server`: -``/home/user/devilbox/data/www/project-1/.devilbox/apache22.yml``. ``/home/user/devilbox/data/www/project-1/.devilbox/apache24.yml``, ``/home/user/devilbox/data/www/project-1/.devilbox/nginx.yml`` or do it for all of them synchronously. @@ -158,8 +156,6 @@ needs to be in place for what webserver version. +----------------+------------------+ | Webserver | Template | +================+==================+ -| Apache 2.2 | ``apache22.yml`` | -+----------------+------------------+ | Apache 2.4 | ``apache24.yml`` | +----------------+------------------+ | Nginx stable | ``nginx.yml`` | @@ -169,7 +165,7 @@ 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 + differences, whereas Apache 2.4 have slight differences in syntax and therefore require two different templates. @@ -186,7 +182,7 @@ Ensure yaml files are valid .. code-block:: bash - :emphasize-lines: 13-16 + :emphasize-lines: 10-13 # Navigate to the Devilbox directory host> cd /home/user/devilbox @@ -197,9 +193,6 @@ Ensure yaml files are valid # 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 - 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) @@ -276,7 +269,7 @@ By default the ``vhost:`` section has variables from global scope, from the ``vh section and from the ``features:`` section. You can also fully hard-code your webserver configuration without any variables. This way you -can specify a fully self-brewed webserver configuration. An example for Apache 2.2 could +can specify a fully self-brewed webserver configuration. An example for Apache 2.4 could look like this: .. code-block:: yaml diff --git a/docs/vhost-gen/example-add-subdomains.rst b/docs/vhost-gen/example-add-subdomains.rst index 05a89148e..e27e67fdf 100644 --- a/docs/vhost-gen/example-add-subdomains.rst +++ b/docs/vhost-gen/example-add-subdomains.rst @@ -190,9 +190,7 @@ By having done all prerequisite, your project should be available under http://m Now you are all set and we can dive into the actual configuration. -.. _tutorial_adding_sub_domains_apache_22: - -Apache 2.2 +Apache 2.4 ---------- Adding ``www`` sub domain @@ -210,15 +208,15 @@ See here how to do that for Linux, MacOS or Windows: DNS is in place, however when you visit http://www.my-project-1.loc, you will end up seeing the Devilbox intranet, because this is the default host when no match has been found. -Step 2: Adjust apache22.yml +Step 2: Adjust apache24.yml """"""""""""""""""""""""""" -Next you will have to adjust the Apache 2.2 vhost configuration template. The current default +Next you will have to adjust the Apache 2.4 vhost configuration template. The current default template looks similar to the one shown below (**Note:** Only the ``vhost:`` sub section is shown here). .. code-block:: yaml - :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml + :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache24.yml :emphasize-lines: 3 vhost: | @@ -241,7 +239,7 @@ here). All you will have to do, is to add a``ServerAlias`` directive: .. code-block:: yaml - :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml + :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache24.yml :emphasize-lines: 3,4 vhost: | @@ -287,15 +285,15 @@ See here how to do that for Linux, MacOS or Windows: This however is not really convenient. If you have basically infinite sub domains (via catch-all), you should consider using Auto-DNS instead: :ref:`setup_auto_dns`. -Step 2: Adjust apache22.yml +Step 2: Adjust apache24.yml """"""""""""""""""""""""""" -Next you will have to adjust the Apache 2.2 vhost configuration template. The current default +Next you will have to adjust the Apache 2.4 vhost configuration template. The current default template looks similar to the one shown below (**Note:** Only the ``vhost:`` sub section is shown here). .. code-block:: yaml - :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml + :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache24.yml :emphasize-lines: 3 vhost: | @@ -318,7 +316,7 @@ here). All you will have to do, is to add a ``ServerAlias`` directive which does catch-all: .. code-block:: yaml - :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache22.yml + :caption: /home/user/devilbox/data/www/project-1/.devilbox/apache24.yml :emphasize-lines: 3,4 vhost: | @@ -346,15 +344,6 @@ The **last step** is to actually to apply those changes. This is equal for all w Go to :ref:`tutorial_adding_sub_domains_apply_changes` and follow the steps. -Apache 2.4 ----------- - -The procedure for Apache 2.4 is exactly the same as for Apache 2.2, even the syntax is identical. -The only difference is that you need to adjust ``apache24.yml`` instead of ``apache22.yml``. - -Just go up one section: :ref:`tutorial_adding_sub_domains_apache_22` - - Nginx ----- diff --git a/docs/vhost-gen/virtual-host-templates.rst b/docs/vhost-gen/virtual-host-templates.rst index a56e2b95a..de205080e 100644 --- a/docs/vhost-gen/virtual-host-templates.rst +++ b/docs/vhost-gen/virtual-host-templates.rst @@ -45,20 +45,18 @@ All template files ending by ``-example-vhost`` can be used to customize a norma virtual host. .. code-block:: bash - :emphasize-lines: 5,7,9 + :emphasize-lines: 5,7 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files Reverse proxy ^^^^^^^^^^^^^ @@ -67,20 +65,18 @@ All template files ending by ``-example-rproxy`` can be used to create a reverse project. .. code-block:: bash - :emphasize-lines: 4,6,8 + :emphasize-lines: 4,6 host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example-rproxy - ├── apache22.yml-example-vhost ├── apache24.yml-example-rproxy ├── apache24.yml-example-vhost ├── nginx.yml-example-rproxy ├── nginx.yml-example-vhost └── README.md - 0 directories, 7 files + 0 directories, 5 files Template sections ----------------- @@ -107,14 +103,6 @@ Virtual host Templates These templates can be used to alter the behaviour of the vhost on a per project base or globally. -Apache 2.2 template -------------------- - -.. literalinclude:: ../../cfg/vhost-gen/apache22.yml-example-vhost - :caption: apache22.yml-example-vhost - :language: yaml - - Apache 2.4 template ------------------- @@ -145,15 +133,6 @@ useful if you use NodeJs applications for example. your project directory. Lines that need to be changed are marked below. The currently set default listening port is ``8000``. -Apache 2.2 template -------------------- - -.. literalinclude:: ../../cfg/vhost-gen/apache22.yml-example-rproxy - :caption: apache22.yml-example-rproxy - :language: yaml - :emphasize-lines: 51,52 - - Apache 2.4 template -------------------