· Tutorial ·

How to make settings of: PHP, APACHE, MARIADB, POSTFIX, DOVECOT, on my server with SWPanel

In this manual we are going to teach you how to make PHP, Apache, Nginx, MariaDB, Postfix and Dovecot settings for your cloud with SWPanel.

  1. Access to your SWPanel, entering your username and password.

  2. Once inside, you will see, by default, your SWPanel Dashboard. You must click on "Tree of active services", which you will find in the left side menu:

enter image description here

  1. Select your cloud to access its Dashboard:

enter image description here

  1. Open the menu "Actions for this Cloud -> Settings and Logs -> Basic parameter settings", you can also click on the wrench and screwdriver icon.

enter image description here

This section is divided into six tabs:

  • PHP
  • Apache
  • Nginx
  • MariaDB
  • Postfix
  • Mail (Dovecot)
  • Advanced Settings

info Remember that changes to the following settings will affect all the services of your Cloud. If you have any questions you can consult us through the free support wall.

enter image description here

PHP

From here you can configure different basic PHP parameters.

At the top you can select the PHP version to configure. You can make a different configuration for each of the versions:

enter image description here

This section is divided into two sections that are on the same page:

  • Security and performance settings
  • Common configuration

Security and performance settings

From this section you can configure the following parameters:

  • disable_functions: This directive allows you to disable certain functions for security reasons. It requires a list with the names of the functions delimited by commas. The default value is: exec, passthru, shell_exec, system, proc_open, popen, parse_ini_file, show_source, posix_getpwuid, symlink, escapeshellcmd, mail.

  • max_execution_time: This value sets the maximum time in seconds that it is allowed to run before the scanner ends. This helps prevent badly written scripts from blocking the server. The default value is 30.

  • max_input_time: Sets the maximum time in seconds that a script is allowed to parse input data, such as POST and GET. Measurement begins the moment PHP is invoked on the server and ends when execution begins. The default value is 60.

  • max_input_vars: How many input variables can be accepted (limit applies to $_GET, $_POST y $_COOKIE superglobal arrays separately). Using this directive mitigates the possibility of denial of service attacks using hash collisions. If there are more input variables than specified by this directive, a E_WARNING is issued, and other input variables are truncated from the request. The default value is 1000.

  • memory_limit: Sets the maximum memory in bytes that a script can consume. It helps prevent badly programmed scripts from consuming all the memory available on the server. To have no memory limit, you must set this directive to -1. The default value is 128.

  • post_max_size: Defines the maximum size of POST data allowed. This option also affects the upload of files. To upload large files, this value must be greater than upload_max_filesize. As a general rule, memory_limit must be greater than post_max_size. The default value is 20.

  • upload_max_filesize: The maximum size of a file uploaded. The default value is 20.

Common configuration

From this section you can configure the following parameters:

  • allow_url_fopen: This option enables URL type fopen wrappers that allow access to URL objects such as files. The default wrappers are provided for remote file access using the ftp or http protocols.

  • display_errors: Determines whether errors should be printed on screen as part of the output or whether they should be hidden from the user. The default value is Off.

  • error_reporting: Sets which PHP errors are reported. The default value is E_ALL & ~E_DEPRECATED & ~E_STRICT.

  • file_uploads: Whether or not to allow file upload via HTTP.

  • max_file_uploads: The maximum number of files to upload allowed simultaneously. The default value is 20.

  • session.save_path: Set the storage path of the current session

  • short_open_tag: Tells PHP if the short form of PHP opening tags should be allowed (<? ?>).

Once the changes have been made, select the button "Save Settings" to apply the changes made to your Cloud

Apache

From here you can configure different basic Apache parameters.

At the top you can select the Apache version to configure if you have more than one. You can make a different configuration for each of the versions:

enter image description here

Security and performance settings

  • KeepAlive: The Keep-Alive extension for HTTP / 1.0 and the persistent connection function of HTTP / 1.1 provide long-lasting HTTP sessions that allow multiple requests to be sent over the same TCP connection

  • KeepAliveTimeout: The number of seconds Apache http will wait for a subsequent request before closing the connection. The default value is 5.

  • MaxKeepAliveRequests: The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is activated. If set to 0, unlimited requests will be allowed. The default value is 100.

  • ServerSignature: The ServerSignature directive allows the configuration of a footer line at the end of the documents generated by the server (error messages, mod_proxy ftp directory listings, mod_info output, ...). The default value is Off.

  • ServerTokens: This directive controls whether the server response header field, which is sent back to clients, includes a description of the server's generic operating system type, as well as information about compiled modules. The default value is Prod.

  • MaxConnectionsPerChild: Limit on the number of connections an individual secondary server will handle over its lifetime. The default value is 0.

  • MaxRequestWorkers: Maximum number of connections to be processed simultaneously. The default value is 150.

  • MaxSpareThreads: Maximum number of idle threads. The default value is 75.

  • MinSpareThreads: Minimum number of idle threads available to handle request peaks. The default value is 25.

  • StartServers: Number of threads created at startup. The default value is 2.

  • ThreadLimit: Maximum number of threads per thread. The default value is 64.

  • ThreadsPerChild: Number of threads created by each thread. The default value is 25.

Once the changes have been made, select the "Save Settings" button to apply the changes made to your Cloud

Nginx

From here you can configure different basic Nginx parameters.

At the top you can select the version of Nginx to configure, in case you have more than one. You can make a different configuration for each of the versions:

enter image description here

Security and performance settings

  • client_max_body_size: Sets the maximum size allowed for the body of the client request, specified in the request header field "Content-Length". Setting the size to 0 disables checking the body size of the client request. The default value is 20.

  • keepalive_timeout: Sets a timeout during which a Keep-Live client connection will remain open on the server side. The value zero disables client connections to keep alive. The default value is 65.

  • server_tokens: Enables or disables the issuance of the nginx version in the error pages and in the response header field "Server".

  • ssl_ciphers: Specifies the enabled ciphers. Ciphers are specified in the format understood by the OpenSSL library.

  • ssl_protocols: Enables the specified protocols.

Common configuration

  • server_names_hash_bucket_size: Sets the bucket size for server name hash tables. The default value is 64.

  • worker_connections: Sets the maximum number of simultaneous connections that a worker process can open. It should be noted that this number includes all connections (for example, connections to proxy servers, among others), not just connections to clients. The default value is 768.

MariaDB

From here you can configure different basic parameters of MariaDB.

At the top you can select the version of MariaDB to configure if you have more than one. You can make a different configuration for each of the versions:

enter image description here

Common configuration

  • character-set-server: Default character set used by the server. See character_set_database to see the character sets used by the default database. The default value is utf8.

  • collation-server: Default rating used by the server. This is set to the default classification, for a given character set automatically, when character_set_server is changed, but can also be set manually. The default value utf8_unicode_ci.

  • key_buffer_size: Buffer size for index blocks used by MyISAM tables and shared for all threads. The default value is 0.

  • max_allowed_packet: Maximum size of a packet or generated / intermediate string. If this value is changed, it must also be changed on the client side. The default value is 0.

  • query_cache_limit: Size for which results greater than this are not cached in the query cache. The default value is 0.

  • query_cache_size: Size available for the query cache. About 40 KB is required for cache structures, so setting a size smaller than this will be a warning. 0 effectively disables the query cache. The default value is 16.

Once the changes have been made, select the "Save Settings" button to apply the changes made to your Cloud

Postfix

From here you can configure different basic Postfix parameters.

At the top you can select the Postfix version to configure if you have more than one. You can make a different configuration for each of the versions:

enter image description here

This section is divided into two sections that are on the same page:

  • Security and performance settings
  • Common configuration

Security and performance settings

  • anvil_rate_time_unit: The unit of time on which the client connection fees and other fees are calculated. Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). The default value is 60s.

  • default_destination_recipient_limit: The unit of time on which the client connection fees and other fees are calculated. Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). The default value is 50s.

  • message_size_limit: The maximum size in bytes of a message, including the envelope information. The default value is 51200000.

  • smtpd_client_message_rate_limit: The maximum number of message delivery requests that any client can make to this service per unit of time. The unit of time is specified with the anvil_rate_time_unit configuration parameter. The default value is 1000.

  • smtpd_client_recipient_rate_limit: The maximum number of recipient addresses that any client can send to this service per unit of time. The unit of time is specified with the anvil_rate_time_unit configuration parameter. The default value is 0.

Common configuration

  • bounce_queue_lifetime: Considers that a return message cannot be delivered, when the delivery fails with a temporary error and the time in the queue has reached the bounce_queue_lifetime limit. Specifies 0 when mail delivery is to be tested only once. The default value is 5.

  • maximal_queue_lifetime: Considers that a message cannot be delivered, when the delivery fails with a temporary error and the time in the queue has reached the maximal_queue_lifetime limi. Specifies 0 when mail delivery is to be tested only once. The default value ist. 5.

Once the changes have been made, select the "Save Settings" button to apply the changes made to your Cloud

Mail (Dovecot)

From here you can configure different basic Dovecot parameters.

At the top you can select the version of Dovecot to configure if you have more than one. You can make a different configuration for each of the versions: enter image description here

Security and performance settings

  • default_client_limit: Maximum number of connections per process. If the limit is reached, a new process starts. The default value is 1000.

  • default_process_limit: Maximum number of processes. The default value is 100.

  • mail_max_userip_connections: Maximum number of IMAP connections per IP. The default value is 10.

  • mail_max_userip_connections: Maximum number of POP3 connections per IP. The default value is 10.

Once the changes have been made, select the "Save Settings" button to apply the changes made to your Cloud

Advanced settings

The Advanced settings allow you to directly edit the generic configuration files of the services and their different versions. You will find all the possible files to modify, grouped by types of service to which they correspond, in the boxes below. It should be noted that once these configuration files have been modified and saved, a reload of the service will be carried out enter image description here

Very important information

Modifying these files without knowing exactly what you are doing can cause the services to stop working properly. If you do not know or know perfectly the configuration files of the services and all its sections, we strongly recommend that this section is not used.

What files can I modify?

In the deployment of a SWHosting server, the following files will be found to modify:

  • /etc/postfix/main.cf: Postfix mail service configuration file.

  • /etc/postfix/master.cf: Master process configuration file, where it is defined how a program connects to the service.

  • /etc/mysql/mariadb.conf.d/50-server.cnf: MariaDB configuration file for the server where the parameters are defined at the server level.

  • /etc/php/5.6/fpm/php.ini: Generic configuration file of the FastCGI Process Manager for the version of php 5.6

  • /etc/php/5.6/cli/php.ini: Generic configuration file for the command interface or Command Line Interface for the version of php 5.6

  • /etc/php/7.0/fpm/php.ini: Generic FastCGI Process Manager configuration file for php 7.0 version

  • /etc/php/7.0/cli/php.ini: Generic configuration file for the command interface or Command Line Interface for the version of php 7.0

  • /etc/php/7.2/fpm/php.ini: Generic FastCGI Process Manager configuration file for php 7.2 version

  • /etc/php/7.2/cli/php.ini: Generic configuration file for the command interface or Command Line Interface for the version of php 7.2

  • /etc/php/7.3/fpm/php.ini: Generic FastCGI Process Manager configuration file for php 7.3 version

  • /etc/php/7.3/cli/php.ini: Generic configuration file of the command interface or Command Line Interface for the version of php 7.3

  • /etc/php/7.4/fpm/php.ini: Generic configuration file of the FastCGI Process Manager for the version of php 7.4

  • /etc/php/7.4/cli/php.ini: Generic configuration file for the command interface or Command Line Interface for the version of php 7.4

  • /etc/php/8.0/fpm/php.ini: Generic configuration file of the FastCGI Process Manager for the version of php 8.0

  • /etc/php/8.0/cli/php.ini: Generic configuration file for the command interface or Command Line Interface for the version of php 8.0

  • /etc/apache2/apache2.conf: Generic configuration file of apache2 at the server level

  • /etc/nginx/nginx.conf: Server-level Nginx configuration file

  • /etc/nginx/swhosting/general.conf: Generic server-level Nginx configuration file

  • /etc/nginx/swhosting/all_vhosts.conf: Generic configuration file of the vhosts present in all the server services

History of modifications

enter image description here

Once the configuration files have been changed, their modification is saved within your SWPanel specifying date and time in a modification history with different available actions, these actions are the following:

  • See configuration file: With this option, you will be able to view the configuration file before its modification.

  • Restore this configuration: This option allows you to restore the configuration prior to the modification, viewable with the option "View configuration file".

  • Comments on the configuration: You can add comments or notes regarding each modification.

enter image description here

i