Apache and Nginx

The default web server is Apache, but starting from release 202405 it is also possible to install Nginx. In this case, Apache will still be enabled, but you will have the option to choose which of the two web servers you prefer to use for each domain you add to the control panel.

To allow the coexistence of both servers, HaProxy is installed as well, and is configured to listen on ports 80 and 443 of the server’s public IP and redirects traffic to the following local IPs:

  • 127.0.0.2 for Apache

  • 127.0.0.3 para Nginx

Nginx and Apache with Haproxy

HaProxy.

Nginx has been added to support applications such as CryptPad, Mastodon or PeerTube, being the recommended web server for them. However, we have kept Apache, as many people prefer to use .htaccess files, which can be edited using webmaster accounts and without the need for console access.

For domains added from the control panel, the corresponding Vhosts are created in the following locations:

  • /etc/apache2/ldap-enabled for Apache

  • /etc/nginx/ldap-enabled for Nginx

When you need to apply changes to the Vhosts, do not overwrite the files created by the system, as your changes may be lost in any updates or changes you may make from the control panel. Instead, copy the file to the corresponding sites-enabled folder, ie:

  • /etc/apache2/sites-enabled for Apache

  • /etc/nginx/sites-enabled for Nginx

Keep in mind that the domain files you have manually copied to the sites-enabled folder will not be deleted if you delete the domain from the control panel.

Puedes consutar esta pagina si quieres saber más sobre Haproxy