Chapter 2: Definition of Terms Up Part I: Fundamental Webserver Management with InterWorx Chapter 4: Web Server Options 

3 The NodeWorx Webserver Management Interface

Figure 3.1 This is the interface which allows you to control the webserver’s status.
figure images/nodeworx/web-server/webserver-control.png
The Webserver Management page is available at NodeWorx ▷ System Services ▷ Web Server. Keep in mind that this guide is primarily written for the Apache web server, and certain features that do not translate to LiteSpeed will not be available. This page allows you control some of the more important facets of the InterWorx webserver configuration, such as its state, and settings which dictate performance and features.
Service Control
Much like other service control pages inside NodeWorx, InterWorx provides the ability to start/stop/restart the service which will control the server daemon via the /etc/init.d/httpd service control script as seen in figure 3.1↑. In addition, InterWorx allows you to set whether the server starts on boot, and whether to restart the server if it goes down. In most cases, you will probably want these both set to yes unless your InterWorx machine is not acting as a webserver.
Webserver Management Page RRD Graph
Figure 3.2 The Web Server RRD Graph, showing number of processes and a line showing the maximum number of processes allowed. Max clients corresponds to the maximum number of processes permitted by the current settings.
figure images/nodeworx/web-server/webserver-rrd.png
Additionally, you can also view the Webserver RRD graph, which shows the number of processes currently running for the webserver, and the maximum allowed. This can help diagnose issues where connections are being refused or taking too long. An example graph is shown in figure 3.2↑.

3.1 Web Server Information Box and Logs

Figure 3.3 The Web Server Information Box provides basic stats and gives you access to your server’s configuration file.
figure images/nodeworx/web-server/webserver-information.png
The webserver information box provides the server’s version number, Apache config file checks, links to the Server logs, and links to the Server Status and Server Info pages. This is shown in figure 3.3↑.

3.1.1 Apache httpd.conf Syntax checker and Editor

The Apache configuration checker uses Apache’s built in syntax check to do a full parse and verification of all the entire configuration of the webserver. This includes all the configuration files loaded from /etc/httpd/conf.d/*.conf. If there is an issue, the interface will warn you here. Keep in mind syntax errors will prevent the server from starting up, which means your server won’t come back up if it goes down (this occurs regularly during statistics generation and log rotation). The editor allows you to edit the Apache server’s main configuration file, /etc/httpd/conf/httpd.conf, and modify settings directly in the file as opposed to using the interface. The advantage is that you can modify settings that aren’t specifically available for modification through the interface. An example is configuring the mod_status /server-status page and allowing it to be viewed by the local server[D][D]http://httpd.apache.org/docs/2.2/mod/mod_status.html.

3.2 Apache Logs

Figure 3.4 The webserver log viewer, access_log is shown.
figure images/nodeworx/logs/httpd-server-logs.png
The Server Logs link takes you to the log viewer portion of the control panel which is shown in figure 3.4↑. Server logs are the critical for troubleshooting webserver issues, and we allow you to view the 4 global system-wide logs here. These logs are located on the system in /var/log/httpd/.
access_log provides information about general traffic to your webserver. Keep in mind that traffic that goes to SiteWorx domains will not be logged here as each SiteWorx domain has its own set of logs in /home/<linux user>/var/<domain>/logs. For the most part, you will see traffic from users that access your server directly by IP and the mod_watch flush operation that InterWorx performs every 5 minutes.
error_log is where server-wide errors and warnings go. Again, SiteWorx domains have their own error logs for when things go wrong with their PHP scripts or some other CGI program. Yet if you are having issues like the server crashing or the server having issues starting up, this log will likely contain the culprit. Essentially, any errors not directly related to a SiteWorx domain end up here.
ssl_request_log is where globally all access to SSL (port 443) is recorded.
suexec.log is the log that contains logged information from the suexec module. This module is responsible for changing a processes userid and groupid to the linux user of the SiteWorx account prior to executing any CGI program. Normally if say, the userid of a perl script is UID 0 (root), then suexec will refuse to execute the script, and that would be recorded here.
The log viewer lets you control how many lines of the log you want to view and additionally - you can elect to follow the log which means as new lines are added to the log by the server, you will see them updated in the interface in real time.

3.3 Status Pages

The modules, status_module and info_module, provide comprehensive data about the configuration and performance of the server. They do this by providing a dynamically generated web page on http://<your ip>/server-status and http://<your ip>/server-info, respectively. By default, these pages are not visible from outside the server due to security concerns. They could lead an attacker to gain compromising information about your server, leading to a break-in. In order for you to be able to see these pages, even from within the safety of the control panel, you must modify your server’s Apache configuration.

3.3.1 /server-status

Figure 3.5 The Apache Server-Status Page
figure images/nodeworx/web-server/server-status.png
In order to enable the server status page, edit your system’s httpd.conf (which is possible on the Webserver Management page in NodeWorx), and locate the portion of your configuration that looks like:
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
#<Location /server-status>
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>
and uncomment the <Location> directive block. You also want to allow the localhost server permission to view the server-status page. The reasoning is that this will still prevent any arbitrary user to view the server-status page while still allowing the page to be visible via the control panel. The resulting configuration block will now look like this:
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost 
</Location>
​
After you save and restart the server, you should see a similar page as shown in figure 3.5↑ when you click the “Server Status” link on the NodeWorx Webserver Management page. If you wish to see additional information on a per-process basis, you can enable extended status by adding a few lines to your server’s configuration:
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost 
</Location>
​
<IfModule mod_status.c>
    ExtendedStatus on
</IfModule>

3.3.2 /server-info

Figure 3.6 The server-info page
figure images/nodeworx/web-server/server-info.png
The server-info page is shown in figure 3.6↑ and will give you a detailed description of the server’s configuration, build parameters, and loaded modules. Like the status_module’s /server-status page, your httpd.conf’s configuration must be modified in order to make this page visible anywhere. Again, we recommend you make it visible only to the localhost server and the control panel will allow you to see the info page through the NodeWorx Webserver Management page. Find this portion of your configuration:
#
# Allow remote server configuration reports, with the URL of
#  http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>
and uncomment the <Location> block, replacing Allow from with localhost. The resulting configuration should look like:
#
# Allow remote server configuration reports, with the URL of
#  http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from localhost
</Location>
The /server-info page should now be accessible in the Webserver Management interface in NodeWorx by clicking the “Server Info” link.
 Chapter 2: Definition of Terms Up Part I: Fundamental Webserver Management with InterWorx Chapter 4: Web Server Options 

(C) 2017 by InterWorx LLC