Web Server Guide

The InterWorx Control Panel provides an easy-to-use interface for managing Web Server settings.

From the Web Server page in NodeWorx, server administrators can manage auto-restart and start-on-boot settings for the Web Server, and set configuration options such as max connections and timeout settings.

Server administrators can also mange Multiple PHP settings and versions from the Webserver page. More information on managing Multiple PHP in InterWorx can be found here.

Web Server Options

Server administrators are able to manage a selection of Web Server configuration options from the Web Server page in NodeWorx.

The Web Server Options box

Configurable options are:

  • HTTP Port: The TCP port that the server will bind to on startup for HTTP connections. By default, this is set to port 80

  • HTTPS Port: The HTTPS port that the Web Server will listen on for HTTPS requests. By default this is set to 443

  • ServerLimit: The maximum configured value for the MaxRequestWorkers directive for the lifetime of the Apache Process. By default, this is set to 20. Possible values range from 1 to 20000. More detailed information can be found in the Apache documentation on the ServerLimit directive.

  • ThreadsPerChild: Controls the number of threads created per child process. The child creates these threads at startup and never creates more. The total number of threads should be high enough to handle the common load on the server. By default, this is set to 25. More detailed information can be found in the Apache documentation on the ThreadsPerChild directive.

  • MaxRequestWorkers: Referred to as MaxClients prior to Apache version 2.3.13. Sets the limit on the number of simultaneous requests that will be served. For threaded and hybrid servers (e.g. event or worker) MaxRequestWorkers restricts the total number of threads that will be available to serve clients. InterWorx sets this value to be the ServerLimit multiplied by ThreadsPerChild.

    While MaxRequestWorkers is not directly configurable, altering the value of ServerLimit will change the value of MaxRequestWorkers. More detailed information can be found in the Apache documentation on the MaxRequestWorkers directive.

  • StartServers: The number of child server process created on server startup. As the number of processes is dynamically controlled depending on the load, there is usually little reason to adjust this parameter. The default setting is 3, however, possible values range from 1 to 20000. More detailed information can be found in the Apache docs on StartServers directive.

  • MinSpareThreads: The minimum number of idle threads. An idle thread is one which is not handling a request. The default setting is 75, however, possible values range from 1 to 20000. If the number of idle threads drops below the set number, Apache will spawn new child processes at the rate of 1 per second, until the the number of idle threads is above the set value.

    It is generally not recommended that this setting be increased too high, as the group of Apache processes will eventually begin consuming a large portion of memory and CPU. More detailed information can be found in the Apache docs on the MinSpareTheads directive.

  • MaxSpareThreads: The maximum number of idle threads. An idle thread is one which is not handling a request. The default setting is 250. Possible values range from 1 to 20000. The MaxSpareThreads directive is used to mitigate spikes in web traffic. If the number of idle threads goes higher than the set value, Apache will begin killing child processes until the set value is reached.

    The set value for MaxSpareThreads should always be higher than that of MinSpareThreads. As with MinSpareThreads, it is generally not recommended to adjust this setting, or set it too high, as doing so may consume a large amount of memory and CPU usage. More detailed information can be found in the Apache docs on the MaxSpareThreads directive.

  • MaxRequestsPerChild: The limit on the number of connections that an individual child server process will handle. The default setting is 8192. Possible values range from 0 to 1000000. Setting MaxRequestsPerChild to 0 will allow an unlimited number of requests. More detailed information can be found in the Apache docs on the MaxConnectionsPerChild directive

  • Timeout: The length of time that the Apache will wait before killing the thread handling the connection. More detailed information can be found in the Apache docs on the Timeout directive

  • Keepalive: The Keepalive directive provides long-lived HTTP sessions, which allow multiple requests to be sent over the same TCP connection. In some instances, turning keepalive on has resulted in a reduction in latency for HTML documents that contain images. More detailed information can be found in the Apache docs on the Keepalive directive

  • Keepalive Requests (max): The maximum number of HTTP requests that can be issued per TCP connection while Keepalive is enabled. Once an HTTP client on a single TCP connection hits the max keepalive requests, it must establish new connection before continuing to issue new requests. It is set to 100 by default. 0 is unlimited.

  • Keepalive Timeout: The number of seconds Apache will wait for a request before closing the connection. This value can only be changed if Keepalive is enabled. More detailed information can be found in the Apache docs on Keepalive Timeout directive

  • Default Charset: Default value for the media type charset parameter (the name of a character encoding) to be added to a response if, and only if, the response’s content-type is either text/plain or text/html

  • Force Graceful Restart: Controls how InterWorx issues restarts to the web server

    By default, InterWorx does a full restart by bringing down the entire Apache process tree, and then starting it back up. On servers with a lot of virtualhost configurations (thousands of SiteWorx domains), it might take a bit of time for the web server to completely process the entirety of the Apache configuration during startup.

    As a result, InterWorx offers the ability to do a Graceful restart, which sends a USR1 signal to the master Apache process. After the signal is sent, the following occurs:

    1. The master Apache process will then advise its children to terminate when they are done handling the current HTTP request. This allows any currently active HTTP clients to continue accessing the web server until they are complete

    2. The master Apache process re-reads the entire web server configuration and re-opens all log files. This allows for log rotation to occur if necessary

    3. As children processes die off, the master Apache process will replace them with a new generation of children that have the updated configuration settings

    This allows for a seamless restart without down-time. There are a few potential downsides, however:

    • Certain settings, such as ServerLimit cannot be modified without a full restart

    • The old generation children may still be writing to logs

    • /server-status pages will not be zeroed out or cleared

To Configure Web Server Options

  1. Log into NodeWorx from the browser (https://ip.ad.dr.ess:2443/nodeworx)

  2. From NodeWorx, navigate to System Services > Web Server > Overview

  3. Under Web Server Options, update the chosen field(s) to the desired value(s)

  4. Click Update

To Manage Start-On-Boot Options for the Web Server

  1. Log into NodeWorx from the browser (https://ip.ad.dr.ess:2443/nodeworx)

  2. From NodeWorx, navigate to System Services > Web Server > Overview

  3. Under Web Server Control, select either Yes or No from the Start On Boot-up dropdown

  4. Click Update

To Manage Auto-Restart Options for the Web Server

  1. Log into NodeWorx from the browser (https://ip.ad.dr.ess:2443/nodeworx)

  2. From NodeWorx, navigate to System Services > Web Server > Overview

  3. Under Web Server Control, select either Yes or No from the Auto-Restart SSH dropdown

  4. Click Update