Apache Virtual Server Options
As admin, you can view and change Apache webserver virtual host settings for your domains, such as filters,
error handling, mime types, document options.
To view and change virtual server options under the domain admin:
- Select Apache webserver in the System Monitor section of the left panel in your admin CP+.
- In the Virtual Servers list choose necessary server.
- On the page that shows there is a range of virtual server options that are subject to changes:

- Processes and Limits option sets many of the limits for Apache.
- Networking and Addresses option configures the network addresses and ports where Apache will listen.
- Log Files option allows to keep track of servers' actions and operations.
It can log information to a separate file and in a custom format.
- Document Options allow to specify your site's Document root - the path
to the directory containing your web pages.
- MIME Types option sets a standard method of determining data type for many types of network connection.
- Custom Error Handling option allows to configure the error types that you want to provide with custom messages.
- User and Group option allows to configure the user and group under which the Apache server will run.
- Aliases and Redirects option allows configuring directory aliases and URL redirects for the server.
- CGI programs option allows setting CGI directory aliases and other CGI-related features.
- Directory Indexing allows setting directory index options, files, default icon etc
- Proxying allows to set proxy server options.
- Filters : set input and output filters, apply them for all files.
- Languages option allows setting language and character set for the virtual website.
- Image Maps allows setting default base and action for image maps.
- Show Directives option sets the appearance and information contained in Apache-generated indexes.
Processes and Limits
In most cases, the defaults set for processes and limits are pretty suitable, but sometimes you may want
to change them due to high load or low memory situations.
Click the Processes and Limits icon and you will see the following page:

- Maximum Request Body size: enter custom length of your request in bytes, if necessary.
- Memory resource limit: set the maximum memory in bytes used by a process
- CPU Resource limit: configure the maximum CPU time in seconds used by a process.
CPU resource limits are expressed in seconds per process.
- Process limit: a number of simultaneous Apache processes.
Make sure to click Save to preserve changes.
Networking and Addresses
This section allows configuring the network addresses and ports where Apache will listen, and some other access limits.
Click the Networking and Addresses icon and you will see the following page:

- Lookup hostnames: if it's checked, it will resolve hostnames to your connections.
- Server Admin Email Address: enter administrator's email, if necessary.
- Use hostname supplied by browser: choose "no" if you yes if you want to avoid false requests on your web server.
- Do RFC1413 user lookups: this option allows to retrieve user names from a remote system using the
protocol described in RFC 1413.
- Server hostname: enter specific server hostname, if necessary.
Make sure to click Save to preserve changes.
Log Files
Log files help to keep track of the activity and performance of the server. Errors and accessed pages are written
by Apache into a journal that is managed by the Log Files option of the virtual server.
Click the Log Files icon and you will see the following page:

- Error log to: you can choose where you want the logs to be written: system log, file or program.
- Error log level: choose which level of the logs you want the system to write from the drop-down box.
Make sure to click Save to preserve changes.
Document Options
This option gives an access to many of the virtual server specific options that will effect permissions, locations, and behaviors.
Click the Document Options icon and you will see the following page:

- Document root directory: the path to the directory that contains your web pages.
- Per-directory options file: specify a filename to be checked for directory access options.
- Directory options: you can choose to use default options for this directory or choose from the selected options.
It will effect the root directory for your virtual server and all subdirectories.
- Generate MD5 digests: turn on generation of Content-MD5 digest headers.
With this option enabled, Apache generates a message digest, or fingerprint, for each static page served.
- Virtual server path: leave at default. If necessary, provide a path from the default server to each virtual server.
- Error message footer: optionally, you can add a footer to all server generated documents (such as error pages and etc.).
Make sure to click Save to preserve changes.
MIME Types
The MIME types take care of file associations and char sets in Apache.
You can set up which command will be executed when a request is made for certain file types.
Click the MIME Types icon and you will see the following page:

Default MIME type: use default MIME type or add new MIME type in the field.
Make sure to click Save to preserve changes.
Error Handling
The Error Handling section allows to specify which web page is called when some specific error takes place upon request.
For instance, if a requested web page is not found, Apache displays a 404 error.
Click the Error Handling icon and you will see the following page:

- Error code Response: enter a code that corresponds to an error and choose the response to the error: URL or a message.
- URL or message: due to the chosen error response, enter either a URL or a message into this field.
Make sure to click Save to preserve changes.
User and Group
The User and Group option allows you to specify which user owns the Apache processes corresponding to the current virtual server.
Click the User and Group icon and you will see the following page:

- Run as Unix user: set User name or User ID in this section.
- Run as Unix group: set Group name or Group ID in this section.
Note: good choice is to configure it to 'nobody' and 'nogroup', as they do on many UNIX operating systems.
Don't set this to 'root' unless you are absolutely sure what you need it for and if you are aware of the security implications of doing so.
Make sure to click Save to preserve changes.
Aliases and Redirects
The Aliases and Redirects options allow you to manipulate and
control URLs as requests incoming to the server.
Click the Aliases and Redirects icon and you will see the
following page:

- Document directory aliases: if your documents are stored in
definite directory (other than DocumentRoot), you can use this setting
to reduce the link to the target directory. Specify the alias you wish in the "From" field and the real path to the directory in the local filesystem in the "To" field.
- Regexp document directory aliases: this setting allows you
to set aliases for several directories of the same type simultaneously using standard regular expressions
- URL redirects: if some of requested resources were moved, you can use this setting to map an old URL to a new one. The old URL-path must be specified in the "From" field. Any request for documents beginning with this path will be redirected to a new URL - in the "To" field. Also you can set the status parameter in the "Status" field (if this argument is not given, the redirection will be "temporary"). To do it you should use corresponding HTTP status codes, in particular, the following:
301 corresponds to a permanent redirect status (the resource has moved permanently)
302 corresponds to a temporary redirect status (default)
303 corresponds to a "See Other" status (the resource has been replaced)
410 corresponds to a "Gone" status (the resource has been permanently removed; in this case the "To" field must be omitted)
- Regexp URL redirects: this setting allows you to redirect several URLs of the same type simultaneously using standard regular expressions
- Permanent URL redirects: you can use this setting in case if the requested resource has been moved permanently
- Temporary URL redirects: you can use this setting in case if the requested resource has been moved temporarily
Make sure to click Save to preserve changes
CGI Programs
This section is to adjust your web-server interaction with CGI programs.
Click the CGI Programs icon and you will see the
following page:

- CGI directory aliases: this setting works in the same way as Document directory aliases setting in the previous section, but
it also marks the target directory as containing CGI scripts.
- Regexp CGI directory aliases: you can use this setting if you need to
set aliases for several CGI directories with similar names, using standard regular expressions.
- Handler or MIME type CGI actions: this option lets you activate CGI scripts as soon as a request for the file of certain type is arrived to the server;
you should specify either a MIME content type or a handler and the URL-path to a resource that has been designated as a CGI using one of the previous options.
- HTTP method CGI actions: you can use this option to activate the CGI-script when the file is requested using some HTTP method; just choose one of HTTP methods from the drop-down box and set the URL-path to the CGI-script.
- Environment variables for CGI scripts: this setting is used to define and control environment variables that will be provided to CGI scripts; specify the name of the variable in corresponding field and choose its value:
"Pass through" means that this variable passes to the CGI scripts from the environment of the shell which invoked the httpd process;
"Clear" means that this variable is removed from those passed on to CGI scripts;
"Set to..." - in this case you can set definite value for this variable, which is then passed on to CGI scripts.
- Process includes on files with execute bit?: this option controls the parsing of ordinary html documents;
choose "No" to set no special treatment of executable files
if you choose "Yes", then any text/html file with the user-execute bit will be treated as a server-parsed html document
if you choose "Yes and set last-modified date", then the file with the user-execute bit not only will be treated as a server-parsed html document, but also the last-modified date will be set (in case if this file contains the group-execute bit).
- Variables set based on browser type: this option allows to set environment variables depending on client's browser type; in the "Browser regex" field you should specify the browser type pattern using standard regular expressions, then indicate, if it's a case sensitive; enter the variable name in the "Set variable" field and set its value.
- Variables set based on request headers: this option allows to set environment variables depending on attributes of the request; in the "Header" field you should specify the attribute of the request, in the "Match" field - the standard regular expression,then indicate, if it's a case sensitive; enter the variable name in the "Variable" field and set its value.
Make sure to click Save to preserve changes
Directory Indexing
This section allows setting directory index options, files, default icon etc.
Click the Directory Indexing icon and you will see the
following page:

- Directory index options: you can choose default setting or select options from the list below to specify the behavior of the directory indexing :
Display fancy directory indexes - if enabled, the column headers
are links that control the order of the display
Display HTML title as description - if enabled, the title will be extracted from the HTML document for fancy indexing (this is CPU and disk intensive);
Icon height and Icon width - you can set their values in pixels
to allow browser to precalculate the page layout without without holding until all the images have been loaded; if you choose default settings for these options, then the standard width and height of the icons supplied with the Apache software will be set;
Include icon in link - if enabled, makes the icons part of the anchor for the filename, for fancy indexing;
Filename width allows you to specify the width of the filename column in bytes ("*" means, that the column enlarges to the necessary width);
Description width (Apache 2.0.23 and later) allows you to specify the width of the description column in characters ("*"grows the column to the width necessary to accommodate the longest description string);
Display directories first - if enabled, subdirectory listings will always appear first, followed by normal files in the directory; this option makes sense only if Display fancy directory indexes is enabled too;
Generate HTML table (Apache 2.0.23 and later) - if enabled, this option constructs a simple table for fancy directory listing;
Ignore client variables - if enabled, all query variables from the client, including sort order, will be ignored;
Include ETags in header (Apache 2.0.23 and later) - if enabled, this returned the Last-Modified and ETag values for the listed directory in the HTTP header; this option works properly only if the operating system and file system return appropriate stat() results; also you should consider that changes to the size or date stamp of an existing file will not update the Last-Modified header on all Unix platforms;
Sort by version strings (Apache 2.0a3 and later)- if enabled, all files containing version numbers are sorted in a natural way;
- Directory index file - here you can set the list of resources, which must be returned when the client requests an index of the directory using the "/" symbol at the end of the directory name;
- Files to ignore in directory index - here you can list files, which must be hidden when listing a directory, using a shell-style wildcard expression or full filename;
- Directory index default icon - this option allows you to set the icon to display for files, when no specific icon is known; you should specify the relative URL to the icon.
- Directory index header file - this option allows you to specify the name of file that will be inserted at the top of the index listing.
- Directory index footer file - this option allows you to specify the name of file that will be appended to the end of the index listing.
- Sort directory index by... - this option allows you to choose the order of displaying of the fancyindexed directories: they can be listed in ascending or descending order and sorted by Name, Date, Size, or Description.
- Directory index icons - this option allows you to set the icon, that will be displayed next to a file ending.
- Directory index ALT tags - this option allows you to specify the alternate text to display for a file, instead of an icon; it's useful in case if the client is image-incapable, has image loading disabled, or failed to retrieve the icon.
- Directory index descriptions - this option helps to add a description to a file.
Make sure to click Save for saving changes
Proxying
This section allows you to configure proxy server options for your server.
Click the Proxying icon and you will see the
following page:

Make sure to click Save to preserve changes
Filters
This section allows you to set input and output filters. Click the Filters icon and you see the following page:

- Apply input filters for all files - if enabled, this options sets the filters which will process client requests when they are received by the server
- Apply output filters for all files - if enabled, this options sets the filters which will process responses from the server before they are sent to the client
- Input filters - this setting allows you to specify the input filters and extensions of the files, which are to be processed with these filters
- Output filters - this setting allows you to specify the output filters and extensions of the files, which are to be processed with these filters
Languages
Set languages for the virtual server:

Set charsets for the virtual server:

Image Maps

Show Directives
All configurations mentioned above can be accessed through the Show Directives section.
It presents the part of the Apache configuration file associated with the virtual host.
Each link directs you to the appropriate CP+ section and you can view or configure it:
1. To view all directives, click the Show Directives icon.

2. You can edit directives by choosing the directive from the drop-down box and clicking the Edit Apache Directive button.
It will take you to the section in CP+ that deals with it.
|