This section describes how you can configure and manage content for virtual servers.
Click Content Handling tab > General tab to edit basic content handling settings.
Configure the following parameters under the Directory Listing sections:
|
Field |
Description |
|---|---|
|
Directory Listing |
You can customize the startup page for an application folder with the following parameters. |
|
Listing Type |
You can choose from Fancy/Simple/None
|
|
Error Response |
Error response file to use when directory listing is disabled. |
|
Initial Page |
Path to the home page file. |
|
Index Files |
Provide a list of welcome files or startup pages for the virtual server. Enter comma separated values of files for more than one file |
HTML parsing allows the server to search HTML files for special commands (parse the HTML). Click New button under Parsed HTML/SSI section for configuring the settings. You can use the following fields to create a URI pattern for which HTML Parsing will be enabled:
|
Field |
Description |
|---|---|
|
Applies To |
You can either apply the changes to the entire virtual server or the specific URI pattern provided in the New URI field. |
|
Execute Tag |
Enabling the exec tag allows the HTML files to execute arbitrary programs on the server. You may not want to allow the exec tag for security or performance reasons. |
|
Parsed Files |
Choose which files to parse. You can choose whether to parse only files with the .shtml extension, or all HTML files, which has an impact on performance. If you are using UNIX/Linux, you can also choose to parse UNIX/Linux files with the execute permission turned on, though that can be unreliable. |
Click New button under Document Footer section for configuring the settings. The following fields allow you to specify a document footer that can be included in your documents. You can include the document footer for the entire virtual server or a specific URI pattern.
Click New button under HTTP Compression section. The following page allows you to administer serving of compressed content. You can enable Pre-compressed content serving or On-Demand compression for the entire virtual server or for a specific URI pattern.
|
Field |
Description |
|---|---|
|
Applies To |
You can either apply the changes to the entire virtual server or the specific URI pattern provided in the New URI field. |
|
On-demand Compression |
Use this option to enable on-demand compression. |
|
Insert Vary Header |
Specifies whether to insert a Vary: Accept-encoding header. If set to True, A Vary: Accept-encoding header is never inserted. If set to False, A Vary: Accept-encoding header is always inserted when a compressed version of a file is selected. The value is set to True by default. |
|
Fragment Size |
Specifies the memory fragment size (in bytes) that has to be used by the compression library (zlib) to control the rate of compression (the amount to compress at one time). |
|
Compression Level |
Use the drop-down list to specify the level of compression. Choose NONE or a value between 1 and 9. The value 1 yields the best speed; the value 9 the best compression. A middle value provides a compromise between speed and compression. |
The primary document directory (also called the document root) is the central directory where you store all the files you want to make available to remote clients.
You can create a document directory, which is in addition to the primary document directory. By doing this, you can let someone manage a group of documents without giving them access to your primary document root.
Creating
a New Document Directory
Select the Configuration.
Select the configuration from the configurations list. Click Configurations tab to get the available configurations.
Select the Virtual Server.
Select the virtual server for which you need to add a new document directory. Click Virtual Servers tab to get the list of configured virtual servers for the selected configuration.
Click Document Directories tab.
Click New Document Directory button. Configure the following parameters:
URL Prefix -- URI prefix that has to be mapped to a directory.
Directory Path -- Absolute server path and a valid directory for storing documents.
Sun Java System Web Server allows you to add CGI document directories using the administration console GUI.
To add a new CGI document directory, perform the following tasks:
Click Configurations tab and select the configuration from the configuration list.
Click Virtual Servers sub tab and select the virtual server from the virtual server list.
Click Content Handling sub tab and CGI sub tab.
Click New button to add a new CGI document directory.
Provide necessary values for fields URI Prefix and Directory as described in the following table. Click OK button. Click Deployment Pending Link > Deploy to deploy the modified configuration.
The following table describes the CGI parameters.
Table 5 CGI Parameters
|
Parameter |
Description |
|---|---|
|
Prefix |
Type the URL prefix to use for this directory. That is, the text you type appears as the directory for the CGI programs in URLs. For example, if you type cgi-bin as the URL prefix, then all URLs to these CGI programs have the following structure: http://yourserver.domain.com/cgi-bin/program-name |
|
CGI Directory |
In the CGI Directory text field, type the location of the directory as an absolute path. Note that this directory doesn't have to be under your document root. This is the reason that you need to specify a URL prefix. Note - The URL prefix you specify can be different from the real CGI directory. |
|
User |
Specify the name of the user to execute CGI programs as. |
|
Group |
Specify the name of the group to execute the CGI programs as. |
|
Chroot |
Specify the directory to chroot to before execution begins. (Only for UNIX based systems). |
|
Nice |
Specify a nice value, an increment that determines the CGI program's priority relative to the server. Typically, the server is run with a nice value of 0 and the nice increment would be between 0 (the CGI program runs at same priority as server) and 19 (the CGI program runs at much lower priority than server). While it is possible to increase the priority of the CGI program above that of the server by specifying a nice increment of -1, this is not recommended. |
To remove an existing CGI directory, select the CGI directory and click Delete button. To change the URL prefix or CGI directory of an existing directory, Click the directory link.
Copy your CGI programs into the directories you've specified. Remember that any files in those directories will be processed as CGI files, so don't put HTML files in your CGI directory.
For specifying CGI as a file type, perform the following tasks:
Click Configurations tab and select the configuration from the configuration list.
Click Virtual Servers sub tab and select the virtual server from the virtual server list.
Click Content Handling sub tab and CGI sub tab.
Click New button under CGI as File Type section.
You can either apply these settings at the virtual server level or restrict it to a specific URI. Configure the rest of the parameters as discussed in the previous table.
The CGI files must have the file extensions .bat, .exe, or .cgi. Any non-CGI files with those extensions are processed by your server as CGI files, causing errors.
URL redirection allows you to redirect document requests for one HTTP URL to another HTTP URL. Forwarding URLs or redirection is a method for the server to tell a user that a URL has changed (for example, because you have moved files to another directory or server). You can also use redirection to seamlessly send request for a document on one server to a document on another server.
For example, if you forward http://www.sun.com/info/movies to a prefix film.sun.com, the URL http://www.sun.com/info/movies redirects to http://film.sun.com/info/movies.
Sometimes you may want to redirect requests for all the documents in one subdirectory to a specific URL. For example, if you had to remove a directory because it was causing too much traffic, or because the documents were no longer to be served for any reason, you could direct a request for any one the documents to a page explaining why the documents were no longer available. For example, a prefix on /info/movies could be redirected to http://www.sun.com/explain.html.
You can set URL redirection at the virtual server level.
To configure URL redirection, perform the following steps:
Click Configurations tab and select the configuration from the configuration list.
Click Virtual Servers sub tab and select the virtual server from the virtual server list.
Click Content Handling sub tab and URL Redirects sub tab.
Click New button to add a new URL redirect rule.
Provide necessary values for fields described in the following table. Click Save button. You may need to click Apply Changes button for the configuration if needed.
The following table describes the fields required while adding a new URL Redirect rule.
Table 6 Field Description > Adding new URL redirect
You can specify a custom error response that sends a detailed message to clients when they encounter errors from your virtual server. You can specify a file to send or a CGI program to run.
For example, you can change the way the server behaves when it gets an error for a specific directory. If a client tries to connect to a part of your server protected by access control, you might return an error file with information on how to get an account.
Before you can enable a custom error response, you must create the HTML file to send or the CGI program to run in response to an error.
To add a custom error page, follow these steps:
Click Configurations tab and select the configuration from the configuration list.
Click Virtual Servers sub tab and select the virtual server from the virtual server list.
Click Content Handling sub tab and Error Pages sub tab.
Click New button to add a custom error page.
For each error code you want to change, specify the absolute path to the file or CGI that contains the error response.
Click OK to return to the error pages list.
A reverse proxy is a proxy that appears to be a web server (origin server) to clients but in reality forwards the requests it receives to one or more origin servers. Because a reverse proxy presents itself as an origin server, clients do not need to be configured to use a reverse proxy. By configuring a given reverse proxy to forward requests to multiple similarly configured origin servers, a reverse proxy can operate as an application level software load balancer.
Note - In a typical deployment one or more reverse proxies will be deployed between the browsers and the origin servers.
Adding a
new Proxy URI
Click Configurations tab and select the configuration.
Click Virtual Servers tab and select the virtual server.
Click Content Handling > Reverse Proxy tab.
Click New Proxy URI button.
Specify values for the following parameters:
URI -- The reverse proxy URI
Server URL -- Comma separated list of server names. The server name must be a hostname, a fully qualified domain name, an IP address, or a URL prefix without the path component, for example https://origin.server.com or origin.server.com. If multiple values are given, the server will distribute load among the specified servers.
To
Configure Reverse Proxy Settings
Click Configurations tab and select the configuration.
Click Virtual Servers tab and select the virtual server.
Click Content Handling > Reverse Proxy tab.
Click URI
You can edit the following parameters:
URI -- The reverse proxy URI
Server URL -- Comma separated URLs of the remote server. If multiple values are given, the server will distribute load among the specified servers.
Sticky Cookie -- Name of a cookie that when present in a response, will cause subsequent requests to stick to that origin server.
Sticky URI Parameter -- Name of a URI parameter to inspect for route information. When the URI parameter is present in a request URI and its value contains a colon `:' followed by a route ID, the request will "stick" to the origin server identified by that route ID.
Route Header -- Name of the HTTP request header used to communicate route IDs to origin servers.
Route Cookie -- Name of the cookie generated by the server when it encounters a sticky-cookie cookie in a response. The route-cookie cookie stores a route ID that enables the server to direct subsequent requests back to the same origin server.
FastCGI is an open extension to CGI (Common Gateway Interface), which is a standard for interfacing external applications with web servers. Like CGI, FastCGI applications run in separate, isolated processes. You can use FastCGI applications to achieve better performance over CGI applications.
The FastCGI Plug-in allows the Sun Java System Web Server to safely work with popular third party dynamic content generation technologies (PHP, Perl, Python, etc.) in a scalable way. The FastCGI Plug-in implements the client side of the FastCGI protocol. This protocol allows producers of dynamic content (and content engines) to implement a common, scalable API that can be utilized by many web servers.
For more information on FastCGI and the SAFs provided by the FastCGI plug-in, see the Sun Java System Web Server Administrator's Guide.
To Add a
FastCGI Handler
Click Configurations tab and select the configuration.
Click Virtual Servers tab and select the virtual server.
Click Content Handling > FastCGI tab.
Click New button under FastCGI Enabled URIs table.
You can edit the following parameters:
Applies To -- You have the option of adding a FastCGI handler for the entire virtual server or for a specific URI pattern.
Role -- FastCGI provides expanded functionality with support for four different application "roles". Choose a role for which you want to create a FastCGI handler.
Responder -- Responder is the basic FastCGI role, and corresponds to the simple functionality offered by CGI today.
Filter -- The FastCGI application filters the requested Server file before sending it to the client. When a client requests a URL with that MIME-type, the Web Server invokes service-fastcgi SAF which sends the request to filter application. This filter application processes the file at the specified URL and sends a response back to the client.
Authorizer -- The FastCGI program performs an access control decision for the request (such as performing a username/password database lookup).
Error -- The error-fastcgi Error SAF is called when the FastCGI plug-in encounters some error. This is used to display the user specified error page.
MIME Type -- MIME Type for the FastCGI handler.
Bind Path -- A UNIX Domain Socket (UDS) name or a Named Pipe or of the form host:port.
Application Path -- FastCGI server application path that processes the request.
Arguments -- Comma separated values that are passed as the arguments to the FastCGI application process.
Environmental Variables -- Comma separated value pairs that are passed as environment variables to the FastCGI server application process.
In the HTTP protocol used by web browsers to communicate with web server, the file extension of the URL is not used to determine the type of information that the server will return. Indeed, there may be no file extension at all at the end of the URL. Instead, the web server specifies the correct MIME type using a Content-type: header when it responds to the web browsers HTTP request.
You can configure MIME types at both the configuration level and the virtual server level.
You can view the configured MIME mappings for a virtual server by performing the following tasks:
Click Configurations tab and select the configuration from the configuration list.
Click Virtual Servers sub tab and select the virtual server from the virtual server list.
Click Content Handling sub tab and MIME Types sub tab.
The MIME Mappings page has a list of MIME headers and values for the selected configuration. To add a new MIME mapping, perform the following tasks:
Click New button and configure the following properties:
MIME Header -- Select from Content-type, Content-encoding and Content-language.
MIME Value -- Enter the value for the MIME header. For example, For Content-type MIME header, the MIME value could be text/plain, text/html etc.
File Suffix -- File extension for the MIME value. For example, For text/html MIME value, the file extension could be htm/html.
Click Save button to save the new MIME mapping.