Skip to content

Commit

Permalink
Fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
john-ea committed Mar 30, 2024
1 parent f76a465 commit fda8f43
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 363 deletions.
2 changes: 0 additions & 2 deletions .tests/tests/intranet-vhost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
#
Expand Down Expand Up @@ -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"
#
Expand Down
2 changes: 0 additions & 2 deletions .tests/tests/rproxy-javascript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ 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}"


###
### 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"

Expand Down
1 change: 0 additions & 1 deletion .tests/tests/vhost-directory_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" )"


###
Expand Down
2 changes: 0 additions & 2 deletions .tests/tests/vhost-vhostgen_customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ run "docker-compose exec --user devilbox -T php bash -c 'echo \"<?php echo \\\"i
### Copy default configuration
###
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}"


###
### Customize DirectoryIndex to use 'index.html' only
###
replace "__INDEX__" "index.html" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache22.yml"
replace "__INDEX__" "index.html" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/apache24.yml"
replace "__INDEX__" "index.html" "${SCRIPT_PATH}/../www/${VHOST}/${HTTPD_TEMPLATE_DIR}/nginx.yml"

Expand Down
1 change: 0 additions & 1 deletion .tests/tests/vhost-vhostgen_default_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ TEMPLATE1="$( run "curl -sS --fail 'http://localhost:${HOST_PORT_HTTPD}/vhost.d/
### Copy default configuration
###
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}"

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/customize-webserver-globally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Configure Apache
================

All settings that usually go into the main ``httpd.conf`` or ``apache2.conf`` configuration file
can be overwritten or customized separately for Apache 2.2 and Apache 2.4.
can be overwritten or customized separately for Apache 2.4.

.. seealso:: :ref:`apache_conf`

Expand Down
41 changes: 1 addition & 40 deletions docs/configuration-files/apache-conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
apache.conf
***********

Apache 2.2 and Apache 2.4 both come with their default vendor configuration. This might not be the
Apache 2.4 both come with their default vendor configuration. This might not be the
ideal setup for some people, so you have the chance to change any of those settings, by supplying
custom configurations.

Expand Down Expand Up @@ -38,7 +38,6 @@ See the directory structure for Apache configuration directories inside ``./cfg/
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/
Customization is achieved by placing a file into ``cfg/apache-X.X/`` (where ``X.X`` stands for
Expand All @@ -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 <https://httpd.apache.org/docs/2.2/mod/core.html#keepalive>`_, the
`MaxKeepAliveRequests <https://httpd.apache.org/docs/2.2/mod/core.html#maxkeepaliverequests>`_
as well as the
`KeepAliveTimeout <https://httpd.apache.org/docs/2.2/mod/core.html#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
----------------------------------------------

Expand Down
37 changes: 14 additions & 23 deletions docs/configuration-files/env-file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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**
Expand Down
51 changes: 5 additions & 46 deletions docs/examples/setup-reverse-proxy-nodejs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,34 +159,31 @@ 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.

.. 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
Expand All @@ -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: |
<VirtualHost __DEFAULT_VHOST__:__PORT__>
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:
Expand Down Expand Up @@ -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:
Expand Down
Loading

0 comments on commit fda8f43

Please sign in to comment.