Configuring a host

To open the configuration dialog of a host, go to the main console dialog and press the Configure button located on the same line as the host name in the Hosts dialog.

Host configuration dialog

Figure 5-2. Host configuration dialog

The following subsections describe all the host configuration options.

General

The General dialog contains the general configuration parameters of a host.

General dialog

Figure 5-3. General dialog

This dialog has the following elements:

Index Files

When a browser asks for a URL that does not contain a filename, the server checks for the existence of each index file in the mapped directory. If none is found and automatic directory indexing is enabled, a directory listing is generated and sent to the browser. Otherwise, an error is reported.

Index Files dialog

Figure 5-4. Index Files dialog

To edit, remove or add index filenames, use the Index Files table in the Index Files dialog.

Example 5-1. index.htm and index.html as index files

Assume that index.html and index.htm are set as index filenames. If a browser asks for http://<your host name>:<host port>/hello/, the server checks if <documents path>/hello/index.html exists. If not, it checks if <documents path>/hello/index.htm exists. If so, it is sent to the browser. If not, a listing of the directory <documents path>/hello/ is generated and sent to the browser if automatic directory indexing is enabled. If it is disabled, the server replies with a forbidden error message.

Directory Listing

When a browser asks for a URL that does not contain a filename, and if the server does not find an index file in the mapped directory, it generates a directory listing.

Directory Listing dialog

Figure 5-5. Directory Listing dialog

This dialog contains the following elements:

Aliases

Select Aliases in the host configuration menu to display the aliases table.

Aliases dialog

Figure 5-6. Aliases dialog

If a URL matches an alias' virtual path, the web server maps it to the alias' associated real path.

Use the displayed table to edit, remove or add aliases.

Example 5-2. Relative real path

Assume that there exists an alias which virtual path is /images and which real path is web/artwork. If a browser asks for http://<your host name>:<host port>/images/logo.jpg, the server maps the requested URL to the file <server root>/web/artwork/logo.jpg. The <server root> is added because the real path was relative.

Example 5-3. Absolute real path

Assume now that there exists an alias which virtual path is /images and which real path is d:\web\artwork. If a browser asks for http://<your host name>:<host port>/images/logo.jpg, the server maps the requested URL to the file d:\web\artwork\logo.jpg. The difference with the previous example is that the real path is absolute and not relative.

XSSI Parameters

To configure XSSI (eXtended Server Side Includes), select XSSI Parameters in the host configuration menu.

XSSI Parameters dialog

Figure 5-7. XSSI Parameters dialog

This dialog includes the following fields:

For more information about XSSI, refer to the "eXtended Server Side Includes" chapter.

Users and Groups

Select Users and Groups in the host configuration menu to display the users and groups tables.

Users and Groups dialog

Figure 5-8. Users and Groups dialog

Use the displayed tables to edit, remove or add users and groups.

A user is defined by its name and its password. A group is defined by its name and its members which can be users and other groups.

Note: The console hides automatically groups that can lead to circular references when editing a group.

Custom Error Pages

With Abyss Web Server, you can override the standard error pages and replace them with yours. To do so, select Custom Error Pages in the host configuration menu.

Custom Error Pages dialog

Figure 5-9. Custom Error Pages dialog

This dialog includes the following elements:

An error URL can be:

Note: It is only relevant to set 4xx and 5xx error codes. Other error codes are handled internally in the web server and do not lead to displaying an error page.

Note: When using a local URL that is a CGI script or an XSSI page as a custom error page, the server operates an internal redirection and adds to the custom error page's environment variables all the faulty request environment variables prefixed with REDIRECT_. It adds also the special variables REDIRECT_STATUS and REDIRECT_STATUS_CODE which contain the status code of the faulty request. For more information, read "CGI environment variables" section in "CGI, FastCGI, and ISAPI" chapter.

Scripting Parameters

To configure CGI, FastCGI, ISAPI, and scripts execution, select Scripting Parameters in the host configuration menu.

Scripting parameters dialog

Figure 5-10. Scripting Parameters dialog

This dialog includes the following fields:

The dialog contains also the following tables:

For more information about scripts, see "CGI, FastCGI, and ISAPI" chapter.

ASP.NET Parameters

Select ASP.NET Parameters in the host configuration menu to display the ASP.NET applications table.

ASP.NET Parameters dialog

Figure 5-11. ASP.NET Parameters dialog

Abyss Web Server features genuine support for ASP.NET applications. If you do not see the ASP.NET Parameters icon in the host menu, it is probably because you have not installed ASP.NET support in Abyss Web Server. To remedy to that, launch the installer package again to upgrade your current setup of Abyss Web Server and ensure that the ASP.NET Support component is selected.

If you do not have a version of Microsoft .NET Framework 1.1 (or higher) correctly installed on your system, Abyss Web Server will report the problem and provide you with a link to install the missing system component.

Unlike other scripting languages and platforms, ASP.NET has the concept of application which is a set of files related to the same ASP.NET program. ASP.NET must know where each program is to be able to locate the configuration files of the application and to process it correctly.

If ASP.NET support is correctly set up and a recognized Microsoft .NET Framework version is installed, the ASP.NET Parameters dialog shows a table to edit, remove or add ASP.NET applications.

Each ASP.NET application is defined by the following parameters:

Access Control

To restrict and manage the access to paths in your web site, select Access Control in the host configuration.

Access Control dialog

Figure 5-12. Access Control dialog

To edit, remove or add path access rules, use the displayed table.

Path access dialog

Figure 5-13. Path access dialog

The path access edition dialog contains the following fields:

Note: If Deny for list is empty and the order is Deny/Allow, access is granted to all declared users and groups.

IP Address Control

To restrict and manage the access to paths in your web site, select IP Address Control in the host configuration.

IP Address Control dialog

Figure 5-14. IP Address Control dialog

To edit, remove or add path IP Address Control rules, use the displayed table.

IP Address Control Rule dialog

Figure 5-15. IP Address Control Rule dialog

The IP address control rule edition dialog contains the following fields:

Note: If Denied IP Addresses list is empty and the order is Deny/Allow, access is granted to any client.

URL Rewriting

To automatically redirect certain requests or rewrite their URL, select URL Rewriting in the host configuration menu.

URL Rewriting dialog

Figure 5-16. URL Rewriting dialog

This dialog includes the following elements:

Compression

Compression is performed on any content (be it static or dynamically generated) provided that all the following conditions are satisfied:

If one or more of the above conditions is not met, the current content is sent back to the browser uncompressed.

Compression dialog

Figure 5-18. Compression dialog

The Compression dialog contains the following elements:

Bandwidth Limits

With Abyss Web Server, you can have fine control on the bandwidth every host uses. You can even control the bandwidth allowed for a particular file or script, or for the contents of a directory.

The Bandwidth Limits dialog has the following fields:

Note: To set a limit on the bandwidth of the whole host, add a bandwidth limit with / as its scope.

Note: If the virtual path of a request matches with more than a single bandwidth limit, Abyss Web Server will respect all of them.

Logging

Select Logging in the host configuration menu to display the Logging options.

Logging dialog

Figure 5-19. Logging dialog

The dialog contains the following fields:

Reverse Proxy

Abyss Web Server can act as a reverse proxy to provide content transparently from another Web server behind it (commonly called a back-end server.) The proxied server can be another Web server or an application server with a restricted or even a trivial HTTP support that has to be shielded from external clients. Reverse proxying is also the recommended way to take advantage of JSP (Java Servlet Pages) and Tomcat Web applications.

Abyss Web Server automatically selects the best version of the HTTP protocol when communicating with a back-end server. It is also able to keep-alive connections with HTTP/1.1 back-end servers and sharing pools of connections between several requests and hosts. It also transparently supports the HTTP/1.1 Upgrade mechanism which allows it to relay WebSockets connections out-of-the-box. Abyss Web Server may instruct the client to downgrade from HTTP/2 to HTTP/1.1 if the back-end server is trying to use a HTTP/1.1 feature that cannot be proxied over HTTP/2.

Select Reverse Proxy in the host configuration menu to display a dialog containing the Reverse Proxy Rules table. Use that table to to edit, remove or add reverse proxy mapping rules rewriting rules.

Each reverse proxy mapping rule is defined by the following parameters:

Example 5-4. An example of a reverse proxy rule

Let's assume that the current host includes a reverse proxy rule defined with the following parameters:

  • Local Virtual Path: /app/photo

  • Remote IP Address: 192.168.1.233

  • Remote Port: 8080

  • Remote Virtual Path: /txp

If a client makes a request to the virtual path /app/photo/abc/test.py on the current host, the local Web server will forward the request to the URL http://192.168.1.233:8080/txp/abc/test.py. The retrieved result is sent back to the client.

Restricted Downloads Areas

To prevent direct access to files contained in some directories, it is possible to create links to them which expire after a certain duration and which may be restricted to a certain IP address. Such links are to be generated using scripts and look like:

   http://www.mysite.com/dir1/dir2/1d0dc35b10df59a45638a78228fdfe4d/5183d1da/file.txt

To configure virtual paths associated with such a behavior, select Restricted Downloads Areas in the host configuration menu. Each restricted downloads area is defined by the following parameters:

An URL referring to a restricted download area is of the form: http://<your host name>:<host port>/vpath/hash/hextimestamp/file.ext:

Example 5-5. Script to generate a restricted download URL (PHP version)

   <HTML>
     <HEAD>
       <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
       <TITLE>
           Test
       </TITLE>
     </HEAD>
   
     <BODY>
   
   	<?php
   
   		$secret_string = "secret string";
   		$virtual_path = "/downloads/";
   		$limit_by_ip = false;
   		$hex_timestamp = dechex(time());
   		$file_name = "/file_to_protect.txt";
   
   		if ($limit_by_ip) {
   			$t = $secret_string . $file_name . $hex_timestamp . $_SERVER['REMOTE_ADDR'];
   		}
   		else {
   			$t = $secret_string . $file_name . $hex_timestamp;
   		}
   
   		$hash = md5($t);
   		$url = $virtual_path . $hash . "/" . $hex_timestamp . $file_name;
   
   		echo "<TR><TD><A HREF=\"$url\">Click here to download the file</A>";
   	?>
   
      </BODY>
   </HTML>

Example 5-6. Script to generate a restricted download URL (Python version)

   import os, time, hashlib
   
   secret_string = "secret string"
   virtual_path = "/downloads/"
   limit_by_ip = False
   hex_timestamp = "{0:x}".format(int(time.time()))
   file_name = "/file_to_protect.txt"
   
   if limit_by_ip:
     t = secret_string + file_name + hex_timestamp + os.environ["REMOTE_ADDR"]
   else:
     t = secret_string + file_name + hex_timestamp
   
   hash = hashlib.md5(t).hexdigest()
   url = virtual_path + hash + "/" + hex_timestamp + file_name
   
   # Output CGI headers
   print "Content-Type : text/html"
   print
   
   # Output body
   print '<HTML><BODY><A SRC="%s">Click here to download the file</A></BODY></HTML>' % url

Anti-Leeching

Anti-Leeching is a system that prevents web pages not belonging to your host from referring or linking to materials available in your web site. Leeching is also known as cross-site linking.

When a request is sent to the host, and if its virtual path is in the configured Anti-Leeching Scope, the server checks if the Referer header in the request matches with the current host or with one of the host names or the patterns in the Allow Links from table. The Referer header is usually set by the browser to indicate to the server from which web page the current URL was requested (or linked to.) If it does not match, the request is considered as a leeching attempt and is redirected to the URL configured in the Redirect Leechers to URL parameter.

Anti-Leeching dialog

Figure 5-20. Anti-Leeching dialog

The dialog contains the following fields:

Statistics

The Statistics dialog displays a set of statistics on the host's activity since the server installation or the last host statistics reset:

The host statistics are refreshed automatically every 10 seconds. You can also press Refresh for immediate refreshing. They can be reset by pressing Reset.

Note: The statistics are preserved when the server is shut down or when the host is stopped.

Note: The host statistics are also available in real time to scripts and XSSI pages. Refer to "CGI environment variables" for more information.