HTTP Server FAQ

From Oracle FAQ
Jump to: navigation, search

Oracle HTTP Server (Apache) FAQ:

Contents

[edit] What is the Oracle HTTP Server and how does it work?

The Oracle HTTP server is a simple Web HTTPD server (Web listener). It is based on the Apache Web Server provided by the Apache Group (www.apache.org). Both the Oracle database (8.1.7 and above) and Oracle iAS (Oracle Internet Application Server) ships with the Oracle HTTP Server.

The following virtual servers are predefined when one install the Oracle HTTP Server:

  • HTTP Server Home Page - http://machine-name:7777/ for the Apache, mod_plsql, mod_ose, mod_JServ, and JSP documentation.
  • Oracle Enterprise Manager (OEM) Web_stage - http://machine-name:3339/ for Oracle Enterprise Manager Console and applications.

Please note that these ports might be different on your system. Check the httpd.conf file to obtain the correct port numbers.

[edit] How does one start and stop the Oracle HTTP Server?

Look at these examples:

On Unix:

cd $ORACLE_HOME/Apache/Apache/bin/
./apachectl start        # or... httpdsctl start
                         # or... httpdsctl startssl

On Windows NT/2000 - just start the Apache service

NOTE: It is better to use the apachectl command than the httpdsctl command as apachectl also sets a number of required environment variables.

NOTE: If you use the Oracle Application Server and just want to start, stop or even update the http_conf file you use: dcmctl stop -ct ohs -v -d

[edit] How does one publish static HTML pages on the Oracle HTTP Server?

One can use the Oracle HTTP Server to publish standard HTML pages. Start by defining a alias (virtual directory on web) to point to the physical directory containing the HTML pages you need to publish.

  • cd $ORACLE_HOME/Apache/Apache/conf
  • Edit httpd.conf and add the following lines:
Alias /mydocs/ "/my/directory/name/"
<Directory "/my/directory/name">
Allow from all
</Directory>
  • Restart the Oracle HTTP Server
  • Open your Web browser and navigate to http://my.host.name:7777/mydocs/index.html

Notes: More options can be added to the "httpd.conf" file as per the Apache Server Documentation.

[edit] How does one execute standard CGI-BIN programs from the Oracle HTTP Server?

One can execute any program that conforms to the CGI (Common Gateway Interface) standard from the Oracle HTTP Server. Such a program can be written in Perl, TCL, C++, COBOL or any other programming language.

Add the following line into your httpd.conf file and restart the server:

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

Note the slash (/) at the end of the path.

[edit] How does one password protect certain directories?

Add the following directives to the [i]<Directory ...>[/i] entry (see example above) in your httpd.conf file and restart the Apache server. You can also add these directives to the $ORACLE_HOME/Apache/modplsql/cfg/plsql.conf file to protect ALL database access:

AuthName "Web User Authentication"
AuthType Basic
AuthUserFile /path/to/your/password/file
Require valid-user

Use the htpasswd utility to create the password file. Look at this example:

htpassswd -c /path/to/your/password/file username1     # Create initial password file
htpassswd /path/to/your/password/file username2        # Add second user to the password file

Note that you can add more users without having to restart the Apache server. Some handy Perl CGI-BIN scripts are available to handle user registration from a web page.

[edit] How does one configure the Oracle HTTP Server?

The Oracle HTTP Server is configured by editing the httpd.conf file in your $ORACLE_HOME/Apache/Apache/conf directory by hand. Oracle does not provide any GUI utilities to edit this file. Consult the standard Apache documentation before making any changes to this file. See http://www.apache-gui.com/ if you need some GUI management utilities to do the job.

[edit] Can one start the Apache listener on port 80?

Ports below 1024 (on Unix and Linux systems) are "privileged" ports; only accounts with superuser permissions (like root) can start programs that uses them. If you need to run the Apache Server on the default port (port 80), contact your system administrator to start and stop the server for you.

[edit] How does Oracle extend the Apache Web Server?

The Apache Web server can be extended by writing modules or Apache mods. Oracle provides mods for the following:

  • Oracle PL/SQL ToolKit (mod_plsql) - Execute PL/SQL on DB and return HTML to browsers. See the Mod_plsql FAQ for details.
  • Oracle Servlet Engine (mode_ose) - Call Servlets stored in an Oracle DB
  • Etc.

Some of the standard Apache mods that can be used:

  • mod_auth - Basic Web authentication
  • mod_perl - Run perl scripts faster using the Apache in-process Perl interpreter
  • mod_ssl - Secure Socket Layer (SSL)
  • mod_cgi - Run scripts and programs via the Common Gateway Interface