• No results found

Understanding the AS/400 Integrated File System allows you to make decisions about storing your hypertext markup language (HTML) files. You also need to understand how you enable the server to serve the files. This includes

understanding Pass directives and Welcome pages.

The Integrated File System treats the library support and folders support as separate file systems.

Before you start serving your home page from the Integrated File System, you must ensure that the world can access the files that you want to serve. You must grant the QTMHHTTP user profile or *PUBLIC the following authorities and permissions to enable Web serving with IBM HTTP Server for AS/400:

v QTMHHTTP or *PUBLIC must have *USE authority to all AS/400 library system objects that you intend to serve.

v If you use any of the log directives (such as the AccessLog or ErrorLog) with any Integrated File System directory name, the directory must exist, and QTMHHTTP or *PUBLIC must have *RWX authority.

v The QTMHHTTP user profile or *PUBLIC must be granted *RX authority to all objects (HTML pages, graphics, and so on) that you intend to serve.

v To use “CGI” on page 95 programs to access any of the objects you serve, the QTMHHTP1 user profile or *PUBLIC needs the same authority to the objects as QTMHHTTP.

A file system provides the support that allows users and applications to access specific segments of storage that are organized as logical units. These logical units are files, directories, libraries, and objects.

Each file system has a set of logical structures and rules for interacting with information in storage. These structures and rules may be different from one file system to another. From the perspective of structures and rules, the AS/400

support for accessing database files and various other object types through libraries can be thought of as a file system. Similarly, you can think of the AS/400 support for accessing documents (which are really stream files) through the folders structure as a separate file system. The following topics, listed in order of

preference, will help you choose the file system, within the Integrated File System, that is right for you:

v “Serving Web pages from the root (or /) file system” on page 27 v “Serving Web pages from the QOpenSys file system” on page 28 v “Serving Web pages from the QSYS.LIB file system” on page 29 v “Serving Web pages from the QDLS file system” on page 30 v “Serving Web pages from the QOPT file system” on page 31 v “Serving Web pages from the UDFS file system” on page 32

As you decide from which file system to serve files, you might want to consider the following:

v Serving from the root (or /) directory gives you the fastest response times. v Will the tools you use to maintain your site be compatible with the file system

you choose?

v How easy must it be to move content from platform to platform?

Remember that any individual server instance can serve content (CGI scripts; HTML files; graphics such as .jpegs, GIFs, and image maps; and so on) from many file systems at once. You can configure your server instances to serve content from whatever file systems suit your needs.

It is possible, too, to develop your Web pages beyond the basics.

Once your Web page has been created you may wish to test your URL routing.

Working with Welcome directives and Pass directives

Your server serves content depending on the order of statements or directives in the server configuration. If you are using the DEFAULT server instance, the server configuration that the server uses is CONFIG. If you are using an instance other than the DEFAULT instance, you will need to refer to the server configuration that is associated with the server instance.

Two important directives affect your server’s welcome page. They are the Welcome directive and the Pass directive. The server uses the Welcome directive to specify which file it serves when it receives a request that does not contain a specific file name. For example:

WELCOME WELCOME.HTML

In the above example the server looks for a file that is called welcome.html to serve as the welcome page.

The other important directive that affects your server’s welcome page is the Pass directive. The Pass directive specifies a template for requests your server accepts. If the request matches the template, the server responds by serving the appropriate document. For example:

Pass / /QIBM/ProdData/HTTP/Public/HTML/Welcome.html

In the above example, the template is blank. If the server receives a request with no directory or file name, it matches this template. Then, the server serves the welcome.html document.

Use the Configuration and Administration forms to add Pass directives.

1. Click Configurations.

2. Click Request Processing.

3. Click Request routing.

4. Complete the Request routing form that is provided.

5. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must restart the server.

Not only are Pass directives and Welcome directives order dependent, but any combination of the PASS, EXEC, REDIRECT, FAIL, Service, Translate directives is also order dependent.

You will need to add Pass directives after enabling any of the file systems: v Root (or /)

v QOpenSys v QSYS.LIB v QDLS v QOPT v UDFS

Use this same form to customize your server’s request processing.

Serving Web pages from the root (or /) file system

The root (or / (slash)) file system takes full advantage of the stream file support and hierarchical directory structure of the Integrated File System. The root file system has the characteristics of the Disk Operating System (DOS) and IBM OS/2 (Operating System/2) file systems.

You can serve content (HTML files; graphics such as .jpegs, GIFs, and image maps; and so on) from the root file system. To serve content from root, you must

complete three steps.

1.

Storing your home page in the root file system.

In the root file system, use the Create Directory (CRTDIR) CL command to create a directory:

CRTDIR DIR(WEBSAMP)

You can then copy your home page and other related files into that directory by using file transfer protocol (FTP) or by using a PC with Client Access/400.

2.

Authorizing your server to serve your home page from the root file system.

Authorize the HTTP profile QTMHHTTP to serve your home page. For root, use the Change Authority (CHGAUT) command:

CHGAUT OBJ('/WEBSAMP') USER(QTMHHTTP) DTAUT(*RX)

CHGAUT OBJ('/WEBSAMP/WELCOME.HTM') USER(QTMHHTTP) DTAAUT(*RX)

3.

Enabling your server to serve your home page from the root file system.

When a client uses a URL to request a document from the server and the URL refers to a directory with no file specified, the server searches the directory for a name specified on a Welcome directive. Without a specified Welcome directive, the default name is Welcome.html.

If you intend to serve welcome files from the root file system, you will need two welcome directives in your configuration file:

Welcome Welcome.htm Welcome Welcome.html

Use the Configuration and Administration forms to add Welcome directives to your configuration.

a. Click Configurations.

b. Click Directories and Welcome Page.

c. Click Welcome page.

d. Complete the Welcome page form that is provided.

e. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must stop and start the server.

Serving Web pages from the QOpenSys file system

The open systems file system is compatible with UNIX-based open system standards, such as the Portable Operating System Interface for Computer

Environments (POSIX) and the X/Open Portability Guide (XPG). Like the root (/) file system, it takes advantage of the stream file and directory support that is provided by the Integrated File System. In addition, it supports case-sensitive object names.

You can serve content (HTML files; graphics such as .jpegs, GIFs, and image maps; and so on) from the QOpenSys file system. To serve content from QOpenSys, you must complete three steps.

1.

Storing your home page in the QOpenSys file system.

Create a directory or folder in which to store your home page as well as other documents.

In the QOpenSys file system use the CRTDIR command to create a directory:

CRTDIR DIR('/QOpenSys/websamp')

Substitute the name of your directory where WEBSAMP appears in the example. You must grant *RX rights to the QTMHTTP user profile for every directory in the path from where you serve documents.

You can then copy your home page and other related files into that directory by using file transfer protocol (FTP) or by using a PC with Client Access/400.

Note: File names in the QOpenSys are case sensitive.

2.

Authorizing your server to serve your home page from the QOpenSys file system.

To authorize your server to serve your home page from QOpenSys, authorize the HTTP profile QTMHHTTP to your home page by using the Change Authorization (CHGAUT) command:

CHGAUT OBJ('/QOpenSys/WEBSAMP') USER(QTMHHTTP) DTAUT(*RX)

CHGAUT OBJ('/QOpenSys/WEBSAMP/WELCOME.HTM') USER(QTMHHTTP) DTAAUT(*RX)

3.

Enabling your server to serve your home page from the QOpenSys file system.

When a client uses a URL to request a document from the server and the URL refers to a directory with no file specified, the server searches the directory for a name specified on a Welcome directive. The default name is Welcome.html for an unspecified Welcome directive.

If you intend to serve welcome files from the QOpenSys file system, you will need two welcome directives in your configuration file:

Welcome Welcome.htm Welcome Welcome.html

Use the Configuration and Administration forms to add Welcome directives to your configuration.

a. Click Configurations.

b. Click Directories and Welcome Page.

c. Click Welcome page.

d. Complete the Welcome page form that is provided.

e. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must stop and start the server.

Serving Web pages from the QSYS.LIB file system

The library file system supports the AS/400 library structure. This file system provides access to database files and all of the other AS/400 object types that the library support manages.

You can serve content (HTML files; CGI scripts; and so on) from the QSYS.LIB file system. To serve content from QSYS.LIB, you must complete four steps.

To store your home page in the QSYS.LIB, you will need to create a library in QSYS.LIB. This stores your HTML file and other related documents and objects. In the following example, we use″WEBSAMP″ simply as a sample name.

1.

Create a separate file.

You must also create a separate file, which we will call HTMLDOC. In QSYS.LIB, use the Create Library (CRTLIB) command to create a user library:

CRTLIB LIB(WEBSAMP)

Now proceed to create the HTML.DOC file:

CRTSRCPF FILE(WEBSAMP/HTMLDOC) RCDLEN(240)

2.

Store your home page in the QSYS.LIB file system.You must use SEU or DFU to create a member in the file with the welcome page. Or, you may use file transfer protocol (FTP) to move a member into the file with the welcome page.

3.

Authorize your server to serve your home page from the QSYS.LIB file system.

Authorize the HTTP profile QTMHHTTP to serve your home page. For the QSYS.LIB, use the Grant Object Authority (GRTOBJAUT) command:

GRTOBJAUT OBJ(WEBSAMP/HTMLDOC)

OBJTYPE(*FILE) USER(QTMHHTTP) AUT(*USE)

after you create the HTMLDOC file.

4.

Enabling your server to serve your home page from the QSYS.LIB file system.

When a client uses a URL to request a document from the server and the URL refers to an AS/400 file with no member specified, the server searches the file

for a member with a name specified on a Welcome directive. The default name is Welcome for an unspecified Welcome directive. The member source type must be HTML.

Use the Configuration and Administration forms to add Welcome directives to your configuration.

a. Click Configurations.

b. Click Directories and Welcome Page.

c. Click Welcome page.

d. Complete the Welcome page form that is provided.

e. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must stop and start the server.

Serving Web pages from the QDLS file system

The document library services file system supports the folders structure. It provides access to documents and folders.

You should use this file system if the data you want to serve resides in the AS/400 PC Support Shared Folders of the AS/400 office support. You can also use this file system if you intend to use Office or PC Support Shared Folders to populate the data you want to serve.

You can serve content (HTML files; CGI scripts; graphics such as .jpegs, GIFs, and image maps; and so on) from the QDLS file system. To serve content from QDLS, you must complete three steps.

1.

Storing your home page in the QDLS file system.

Create a directory or folder in which to store your home page as well as other documents.

In the QDLS file system, use the Create Folder (CRTFLR) command to create a folder:

CRTFLR(WEBSAMP)

Substitute the name of your folder where WEBSAMP appears in the example. You can then copy your home page and other related files into that directory by using file transfer protocol (FTP) or by using a PC with Client Access/400.

2.

Authorizing your server to serve your home page from the QDLS file system.

To authorize your server to serve your home page from QDLS, follow these steps:

a. Add a directory entry to the system distribution directory for the QTMHHTTP user profile. You can use the Work with Directory Entries (WRKDIRE) CL command or use the administrative function of OfficeVision.

b. Authorize the HTTP profile QTMHHTTP to your home page by using the Change Authorization (CHGAUT) command:

CHGAUT OBJ('/QDLS/WEBSAMP') USER(QTMHHTTP) DTAUT(*RX)

CHGAUT OBJ('/QDLS/WEBSAMP/WELCOME.HTM') USER(QTMHHTTP) DTAAUT(*RX)

3.

Enabling your server to serve your home page from the QDLS file system.

When a client uses a URL to request a document from the server and the URL refers to a directory with no file specified, the server searches the directory for a name specified on a Welcome directive. The default name is Welcome.html for an unspecified Welcome directive.

If you intend to serve welcome files from the QDLS file system, you will need two welcome directives in your configuration file:

Welcome Welcome.htm Welcome Welcome.html

Use the Configuration and Administration forms to add Welcome directives to your configuration.

a. Click Configurations.

b. Click Directories and Welcome Page.

c. Click Welcome page.

d. Complete the Welcome page form that is provided.

e. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must stop and start the server.

Serving Web pages from the QOPT file system

The optical file system provides access to stream data that is stored on optical media, such as CD-ROM.

You can serve content (HTML files; graphics such as .jpegs, GIFs, and image maps; and so on) from the QOPT file system. To serve content from QOPT, you must complete three steps.

1.

Storing your home page in the QOPT file system.

Create a directory or folder in which to store your home page as well as other documents.

In the QOPT file system, use the Create Folder (CRTFLR) command to create a folder:

CRTFLR(QOPT/WEBSAMP)

Substitute the name of your folder where WEBSAMP appears in the example. You can then copy your home page and other related files into that directory.

2.

Authorizing your server to serve your home page from the QOPT file system.

To authorize your server to serve your home page from QOPT, authorize the HTTP profile QTMHHTTP to your home page by using the Change

Authorization (CHGAUT) command:

CHGAUT OBJ('/QOPT/WEBSAMP') USER(QTMHHTTP) DTAUT(*RX)

CHGAUT OBJ('/QOPT/WEBSAMP/WELCOME.HTM') USER(QTMHHTTP) DTAAUT(*RX)

3.

Enabling your server to serve your home page from the QOPT file system.

When a client uses a URL to request a document from the server and the URL refers to a directory with no file specified, the server searches the directory for a name specified on a Welcome directive. The default name is Welcome.html for an unspecified Welcome directive.

If you intend to serve welcome files from the QOPT file system, you will need two welcome directives in your configuration file:

Welcome Welcome.htm Welcome Welcome.html

Use the Configuration and Administration forms to add Welcome directives to your configuration.

a. Click Configurations.

b. Click Directories and Welcome Page.

c. Click Welcome page.

d. Complete the Welcome page form that is provided.

e. Click the Apply button.

You will receive a message that tells you whether or not the task completed successfully.

If you wish to activate your changes, you must stop and start the server.

Serving Web pages from the UDFS file system

The user-defined file system resides on the Auxiliary Storage Pool (ASP) of your choice. You can create and manage this file system.

You can serve content (HTML files; graphics such as .jpegs, GIFs, and image maps; and so on) from the UDFS file system. To serve content from UDFS, you must complete three steps.

1.

Storing your home page in the UDFS file system.

Create the directory where you will mount your UDFS. This must be in the Root or QOpenSys file system.

You can use an existing directory, but its contents will be masked when your UDFS is mounted. Use the Create Directory (CRTDIR) command to create the directory:

CRTDIR(UDFSMOUNT)

or

CRTDIR(QOpenSys/UDFSMOUNT)

Create the UDFS using the Create UDFS (CRTUDFS) command:

Substitute the name of your UDFS where name appears in the example. Substitute a valid Auxiliary Storage Pool (ASP) number where the XX appears in the example. The other parts of the path name must appear as in the example above.

Use the Mount (MOUNT) command to mount your UDFS on the directory:

MOUNT TYPE(*UDFS) MFS(/dev/qaspXX/name.udfs) MNTOVRDIR(UDFSMOUNT)

Substitute your UDFS name where name appears in the example. Substitute a valid Auxiliary Storage Pool (ASP) number where the XX appears in the example. The rest of the MFS name must appear as in the example. Substitute the directory name you want to mount where UDFSMOUNT appears in the example. The Mount will not survive an IPL, so you will either have to manually Mount your UDFS after an IPL or put the Mount command in your startup program.

In the UDFS file system, use the Create Directory (CRTDIR) command to create a folder:

CRTDIR(UDFSMOUNT/WEBSAMP)

Substitute the name of your UDFS mount directory where UDFSMOUNT appears in the example.

You can then copy your home page and other related files into that directory by using file transfer protocol (FTP) or by using a PC with Client Access/400.

2.

Authorizing your server to serve your home page from the UDFS file system.

To authorize your server to serve your home page from UDFS, authorize the HTTP profile QTMHHTTP to your home page by using the Change

Authorization (CHGAUT) command:

CHGAUT OBJ('/UDFSMOUNT/WEBSAMP') USER(QTMHHTTP) DTAUT(*RX)

CHGAUT OBJ('/UDFSMOUNT/WEBSAMP/WELCOME.HTM') USER(QTMHHTTP) DTAAUT(*RX)

3.

Enabling your server to serve your home page from the UDFS file system.