Oracle9iAS/Apache Web Server Setup Options

It is important that the Web environment options are set correctly. This allows for Web pages and code to make generic references to images and other objects and enables those generic references to get interpreted correctly into physical computer locations. It is also important that login information be hidden from Web users. This is accomplished with Database Access Descriptors, or DAD.

Apache Virtual Directory Setup

You can set up virtual directories in Oracle9iAS, in the httpd.conf file, as you would for any standard Apache installation. Setting up some aliases will allow for more Web-environment-neutral access to files (such as pictures, code, and so on).

Find the httpd.conf file. This file is the configuration file for Apache. It contains all the directives that customize Apache for your Web-server installation. This file is usually located in $ORACLE_HOME/Apache/Apache/conf/httpd.conf.

NOTE

I HIGHLY recommend making a copy of any configuration file prior to making any changes to it!


Open the file in an edit session and find the section of the file that talks about directory aliases. This maps your logical directory structure to a physical location on your hard drive. The section in httpd.conf looks like Listing 11.1.

Listing 11.1. Apache httpd.conf File
#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL.  So "/icons" isn't aliased in this
# example, only "/icons/"..
#
Alias /icons/ "C:oracleora81ApacheApacheicons/"
Alias /jservdocs/ "C:oracleora81ApacheJservdocs/"
Alias /mm/ "C:metromotors/"
Alias /mmimage/ "C:metromotors/img/"

The last two lines, alias mm and mmimage, are the aliases that will be used throughout the coding examples in this chapter. The Apache listener will need to be stopped and started to implement any changes made to this file.

Apache Listener Setup and Database Access Descriptor (DAD) Setup

The listener for Oracle Web traffic is set by default to run on port 80. You may need to adjust this value if the computer running the Apache or Oracle9iAS Web server is running more than one Web server.

All these configuration values can be found in the $ORACLE_HOME/Apache/ Apache/conf/httpd.conf file. If necessary, modify which the port that the Web server is configured to use by looking for a line similar to Listing 11.2. This is the port that the Apache or Oracle9iAS Web server will listen for requests on.

Listing 11.2. Apache httpd.conf Port Configuration
#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#

Port 80

Once the port is determined the Web server needs to be started. Run the executable ORACLE_HOME/Apache/Apache/bin/startapache.exe starts the Apache Web server as background process and if no error messages are displayed the Web server should be running. Test this by attempting to navigate a Web browser to the machine serving the database. If your computer has a local database, navigate to http://localhost, if your port is 80. If your port is configured for anything else then navigate to http://localhost:port. You should now see something like Figure 11.1.

Figure 11.1. Oracle HTTP server splash screen.


Apache Database Access Descriptor (DAD) Setup

Any Web procedure needing access to the database will need a database access descriptor set up for it. This essentially hides the login process from the Web user and allows the oracle database administrator to control the type of access that the Web environment can have to this particular database.

Select the mod_plsql link (this is the Apache PL/SQL processor) on this page and you should get the Oracle Portal Homepage. From here select the Administer' tab. On this page you will see a Services section from which you will select Listener Gateway Settings. On the Gateway Configuration Menu, select Gateway Database Access Descriptor Settings to add additional DADs to this Web server. Scroll down until you see the configured DADs. Click on the edit icon of the SAMPLE DAD. You should now have a screen that will allow you to change or add DAD parameters (see Figure 11.2).

Figure 11.2. Database Access Descriptor configuration screen.


Configuring DADs will allow the pages being developed in the remainder of this chapter to be browsed. Leave all the defaults as they are, with the exception of the Oracle User Name, Oracle Password, and Oracle Connect String. Fill these in with the appropriate values (the same account that owns the PSP) and then click the OK button at the top of the screen.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.8.82