September 2008 Migration Guide




Download 1.14 Mb.
bet5/11
Sana21.03.2017
Hajmi1.14 Mb.
1   2   3   4   5   6   7   8   9   10   11

7.2.1 Migrating mod_proxy

The 2.0.x mod_proxy module included both proxy and cache functionality.These functionalities are separated by HP-UX Apache-based Web Server. The mod_proxy module proxying.performs the function

mod_cache implements an RFC 2616 compliant HTTP content cache that can be used to cache either local or proxied content. mod_cache requires the services of one or more storage management modules. Two storage management modules are included in HP-UX Apache-based Web Server:


  • mod_disk_cache

A disk-based storage manager that is generally used for proxy caching. For a cached file, the proxy server serves the request directly and avoids the overhead of sending the request on to the web server.

  • mod_file_cache

An mmap-based and/or file handle-based storage manager that allows the server file system to control whether the file is in memory or not. This replaces all the functionality of the 2.0.x module, mod_mmap_static.

  • mod_mem_cache

An in-memory based storage manager, primarily useful for caching local content.

7.2.2 Migrating How Documents are Cached by Proxy Servers

If it is set, the CacheNegotiatedDocs directive allows content-negotiated documents to be cached by proxy servers. Suite,Earlierthe CacheNegotiatedDocs did not take an argument; it was activated by the presence of the directive by itself.

In HP-UX Web Server Suite, the CacheNegotiatedDocs directive takes the argument on or off. In the httpd.conf file, replace existing instances of CacheNegotiatedDocs with CacheNegotiatedDocs on.

7.3 Migrating Security

To migrate Security from HP Web Server Suite 2.x to HP-UX Web Server Suite 3.x, see the following sub-sections:



  • Migrating SSL

  • Migrating Chroot

7.3.1 Migrating SSL

In the 2.0.x version of HP Apache-based Web Server, SSL configuration information was provided in the httpd.conf file. In the HP-UX Apache-based Web Server, SSL configuration information has been moved to httpd-ssl.conf.

To migrate SSL from 2.0.x to 3.x, you must move your customized SSL configuration information from the 2.0.x version of the /opt/hpws/apache/conf/httpd.conf file to /opt/hpws22/apache/conf/extra/httpd-ssl.conf.

In addition, edit your ServerName directives by adding a colon and port number after each ServerName directive. Also, replace your SSL logging directives with the Apache logging directives. See the following example.



SSL in HP Apache 2.0.x:

SSL was enabled in 2.0.x with the following entry in /opt/hpws/apache/conf/httpd.conf.

##

## SSL Virtual Host Context ##



# General setup for the virtual host

DocumentRoot "/opt/hpws/apache/htdocs" ServerName yourserver.com

SSL Logging has its own directives in /opt/hpws/apache/conf/httpd-ssl.conf.

SSLLog /opt/hpws/apache/logs /ssl _engine _log
SSLLogLevel info

SSL in HP-UX Apache-based Web Server:
You can no longer proxy through SSL.

SSL is enabled with the following entry in /opt/hpws22/apache/conf/extra/httpd-ssl.conf.

##

## SSL Virtual Host Context ##



# General setup for the virtual host

DocumentRoot "/opt/hpws22/apache/htdocs"

ServerName yourserver.com: 443

SSL logging uses the Apache directives in /opt/hpws22/apache/conf/extra/httpd-ssl.conf.

ErrorLog logs/error_log

LogLevel info

7.3.2 Migrating Chroot

Chroot remains unchanged between HP Apache 2.0.x and HP-UX Web Server Suite 3.x.



7.4 Migrating Scripting Modules

To migrate Scripting Modules from HP Apache 2.0.x to HP-UX Apache-based Web Server, see the following sub-sections:



  • Migrating PHP

  • Migrating Perl




  • Migrating CGI

  • Migrating Server-Side Includes

7.4.1 Migrating PHP

PHP in HP-UX Apache-based Web Server:

To enable PHP, uncomment the following lines or sureenthat they are present in /opt/hpws22/apache/conf/httpd.conf:

LoadModule php5_module modules/libphp5.so

SetOutputFilter PHP SetInputFilter PHP

To use PATH_INFO, you must explicitly set the AcceptPathInfo, directive otherwise a 404 response is returned. In 2.0, PATH_INFO is enabled by default, therefore a PHP script /script.php is invoked if a request is made to the location /script .php/foo/bar, passing a PATH_INFO of /foo/bar to the script.

7.4.2 PHP Oracle support in HP-UX Apache-based Web Server

PHP Oracle support is new feature in HP-UX Web Server Suite.

To enable PHP Oracle, edit the file /opt/hpws22/apache/bin/apachectl. Uncomment the four individual lines that begins with export:

export ORACLE _HOME=/opt/oracle

export ORACLE _SID=dummy _sid

export


LD_PRELOAD="$LD_PRELOAD: $ORACLE _HOME/JRE/lib/PA _RISC/native _threads/libjava.sl"

export SHLIB _PATH="$SHLIB _PATH: $ORACLE_HOME/lib"



7.4.3 Migrating Perl

Perl in HP Apache 2.0.x:

See,


For information about incompatibilities between mod_pe rl 1.0 and 2.0, s http://perl.apache.org/docs/2.0/user/compat/compat.html.

Perl in HP-UX Apache-based Web Server:

Perl is enabled with the following entry in /opt/hpws22/apache/conf/httpd.conf: .

LoadModule perl_module modules/mod_perl.so

PerlModule ModPerl::Registry



SetHandler perl-script

PerlHandler ModPerl::Registry::handler Options ExecCGI

PerlOptions ParseHeaders







7.4.4 Migrating Common Gateway Interface (CGI)

The mod _cgid module is a new feature inthe HP-UX Apache-based Web Server.

Forking a process from a multi-threaded server can be an expensive operation because the new process replicates all the threads of the parent process. toT avoid incurring this expense on each CGI invocation, the mod_cgidmodule, in the HP-UX Apache-based Web Server, creates an external daemon that is responsible for forking child processes to run CGI scripts. The main server communicates with this daemon using a UNIX domain socket.

At the user level, this module is identical in configuration and operation to the mod_cgi. module The only exception is the additional directive Scriptsock, which provides the name of the socket to use for communication with the cgid daemon.



CGI in HP Apache 2.0.x:

CGI in HP-UX Apache-based Web Server:

The cgid daemon is activated inthe HP-UX Apache-based Web Server by default. The Scriptsock directive is used to set the UNIX socket to communicate with cgid.

The relevant sections of the httpd.conf fileare:

LoadModule cgid_module modules/mod_cgid.so #LoadModule cgi_module modules/mod_cgi.so



Scriptsock logs/cgisock




7.4.5 Migrating Server-Side Includes (SSI) In HP Apache 2.0.x:

In 2.0.xHP Apache ,the Server-Side Includes were provided by the mod_include. module Any document with handler of “server-parsed” was handled by mod_include, if the Includes option was set. IfAlso, i documents containing the server-side include directives had the extension.shtml, the following directives made Apache parse them and assign the resulting document the mime type of text/html:

AddType text/html.shtml AddHandler server-parsed.shtml

Options Includes



In HP-UX Apache-based Web Server:

The Server-Side Includes provided by mod include are now implemented using the new filter system rather than as a handler. This provides much more power and flexibility, but requires the use of the SetOutputFilter to activate server-parsed content. If you were using AddHandler server-parsed.shtml in HP Apache 2.0.x, you can get similar functionality in HP-UX Apache-based Web Server by using,



SetOutputFilter INCLUDES

7.5 Migrating Java

HP Apache 2.0.x has two servlet containers for running java server applications. One container is JServ and the other is Tomcat. In 2.0.x, modjserv connects Apache to JServ or Tomcat. In 2.0.27, modjk is also available to connect Apache to Tomcat. Migrating from 2.0.x to HP-UX Apache-based Web Server is, mainly, a path change.The HP-UX Apache-based Web Server does not support the modjserv connector or the JServ container.



7.5.1 Migrating Tomcat with modjserv to Tomcat with modjk

The new HP-UX Tomcat-based Servlet Engine uses Tomcat 5.5.234.1. for more information, see /op/hpws/hp_docs/tomcat/tomcat.migration.guide.

In 2.0.x, Tomcat uses modjserv or modjk as the connector while in 2.x Tomcat uses modjk and modjk2.

  1. File structure

2.0.x with Tomcat (modjserv) /opt/hpws/apache/conf/httpd.conf

/opt/hpws/tomcat/conf/tomcat. conf

server. Xml


2.0.27 with Tomcat (modjk) /opt/hpws/apache/conf/httpd.conf

/opt/hpws/tomcat/conf/server.xml

apps-examples.xml jk/mod_jk.conf workers.properties


3.x

/opt/hpws22/apache/conf/httpd.conf /opt/hpws22/tomcat/conf/server.xml

/opt/hpws22/apache/conf/mod_jk.conf

/opt/hpws22/apache/conf/mod_jk2.conf

/opt/hpws22/apache/conf/workers.properties


  1. Apache configuration file

file, enter file, enter

In the 2.x httpd.conf:

Include /opt/hpws/tomcat/conf/tomcat.conf

the 3.x file httpd. conf: file, enter

#Include conf/mod_jk.conf

#Include conf/mod_jk2.conf



  1. Passing URLs from Apache to Tomcat In the 3.x file, entermod_jk.conf:

file, enterJkMount /examplesajp13

JkMount /examples/* ajp13



  1. Log files

In the 2.0.x file, enter:

tomcat.conf:

ApJServLogLevel debug

server.xml:



path="logs/tomcat. log" customOutput="yes" />

In the 2.0.27 file, enter: mod_jk.conf:

JkLogFile /opt/hpws/tomcat/logs/jk.log

JkLogLevel emerg

server.xml:



In the 3.x file, enter:

mod_jk.conf:

JkLogFile /opt/hpws22/apache/logs/jk.log

JkLogLevel emerg

server.xml:



="org.apache.catalina.logger.FileLogger" prefix="catalina _log." suffix=" .txt"

timestamp="true"/>



  1. Defining the connection worker

In the 2.0.x tomcat.conf:conf file, enter

ApJServDefaultProtocol ajpv12 ApJServDefaultPort 8007

In the 2.0.27 workers.properties: file worker.ajp12.port=8007

worker.ajp12 .host=localhost worker. ajp12.type=ajp12 worker.ajp13.port=8009

worker.ajp13 .host=localhost worker. ajp13.type=ajp13
In the 2.x workers . properties file:

worker.ajp13.port=8009

worker.ajp13.host=localhost

worker.ajp13.type=ajp13



  1. Web application contexts

In the 2.0.x server.xml: file, enter ="/examples"

In the 2.0.26 apps-examples.xml: file, enter

In the 2.x server. Xml file, enter:

G) Handling .jsp files

In the 2.0.x tomcat.conf:conf file, enter

ApJServMount default /root AddType text/jsp .jsp

AddHandler jserv-servlet .jsp

In 2.0.26 and 2.x:

Tomcat is a servlet/jsp container; therefore, web applications, such as "examples", handle jsp'sJSP properly. For instance, Apache passes URIs beginning with /examples to Tomcat and Tomcat handles the *.jsps. In Tomcat, the JSP interceptor handles the loading of JSP pages. Its behavior can be customized in the server.xml file.

7.5.2 Migrating JServ to Tomcat

If you are migrating from JServ, see:

/opt/hpws22/hp_docs/tomcat/tomcat.migration.guide

Also see the following:website



http://tomcat.apache.org/tomcat-5.5-doc/index.html

Listed below is an example, with the procedure, to enable the following URL to work with "HelloWorldExample" servlet: yourserver.com/my_app/HelloWorldExample



  1. Assumptions

A) All your java classes are in:

/my_servlets



  1. Create a myapp directory inside Tomcat’s /opt/hpws22/tomcat/webapps:

$ cd /opt/hpws22/tomcat/webapps

$ mkdir myapp

$ mkdir myapp/WEB-INF


  1. Create a symbolic link so that servlets in /my_servlets are visible inside WEB-IN F:

$ cd /opt/hpws22/tomcat/webapps/myapp/WEB-INF $ ln -s /my_servlets classes

  1. Create a web.xml file in /opt/hpws22/tomcat/webapps/myapp/WEB-INF with the following contents:

="1.0" encoding="ISO-8859-1"?>

"http://java.sun.com/j2ee/dtds/web-app 2 3.dtd">



<web-app>

invoker


/*



Restart Tomcat. You should be able to access servlets by using http://yourserver.com:8081/myapp.

5. To access servlets through Apache, map the Tomcat context to Apache. Edit /opt/hpws22/apache/conf/httpd.the conf file and uncomment the
following line:

Include /opt/hpws22/tomcat/j k/apache2/j k/mod _j k. conf

Edit /opt/hpws22/tomcat/jk/apache2/mod _jk.conf and add:

JkMount /servlet ajp13 JkMount /servlet/* ajp13

6 Add servlets to CLASSPATH.

Because Tomcat does not read the CLASSPATH environment variable, you must perform the following:

Edit /opt/hpws22/tomcat/bin/setenv.sh

Below CATALINA _OPTS=" -XdoCloseWithReadPending", add the following as a single line:

CATALINA _OPTS=" $CATALINA _OPTS -

Dorg.apache.tomcat.apps.classpath=/my_servlets"



Note: You can add /my_servlets to the CLASSPATH by setting the following system property: org.apache.tomcat.apps.classpath

7. Verify the following:

Stop and start tomcat:reTomcat

cd /opt/hpws22/tomcat/bin



  • /shutdown.sh

  • /startup.sh

Stop and start apache:A

cd /opt/hpws22/apache/bin



  • /apachectl stop

  • /apachectl start

Enterthe URL in browser yourserver.com/myapp/

8. CreateIf the previous step fails, ca test environment. If you do not have your own servlets, you can set up a test environment, based on the servlets available in Tomcat., by following the procedure below:

Create servlet home: mkdir /my_servlets

Add a test servlet:

cp /opt/hpws22/tomcat/webapps/examples/WEB-INF/classes/HelloWorldExample /my_servlets

Stop and start tomcat:Tomcat

cd /opt/hpws22/tomcat/bin


  • /shutdown.sh

  • /startup.sh

Stop and start apache:Apache

cd /opt/hpws22/apache/bin



  • /apachectl stop /apachectl start

Enterthe following URL:



yourserver.com/myapp/HelloWorldExample

The following message is displayed:



Hello World!

Note:

Notice the different functions of the following:



  1. /myapp causes Apache to connect with Tomcat.

  2. /my_servlets is the actual location of the servlets.

If you prefer, you can use the name "/my _servlets" for both. instances

c. This scenario assumes that the servlets do not need to be reloadable. In other words, if you recompile the servlet, you will need to restart Tomcat for the changes to be recognized. Servlets can be made reloadable by referencing them in /opt/hpws22/tomcat/webapps/ROOT/WEB-INF/web . xml and creating individual symbolic links to the classes in /opt/hpws22/tomcat/webapps/ROOT/WEB-INF/classes.



7.5.3 Methods to Enable Servlets in Tomcat

The class-loader-howto.html of tomcat-5.5.26 -doc refers to configuring what classes are available and the scope of their availability. Tomcat uses some classes (in particular, xml parsers) that applications may want to replace with other classes. toT avoid conflicts, Tomcat separates Tomcat-required classes from application-required classes. To accomplish this, your CLASSPATH environment variable is ignored by Tomcat.

The following summarizes processes to make your classes available to Tomcat and to each other.

Enabling Classes Based on Scope of Class Availability:



  1. Classes that are used in a particular web application.

*.jar files

/opt/hpws22/tomcat/webapps//WEB-INF/lib *.class files

/opt/hpws22/tomcat/webapps//WEB-INF/classes


  1. Classes that are shared by all web applications. *.jar files

Place the jar files in the following directory: /opt/hpws /tomcat/ shared/lib

*.class files

/opt/hpws /tomcat/ shared/classes

7.6 Other Migration Tasks

For additional migration tasks:, see the following sub-sections



  1. Migrating the Selection of Server Type

  2. Migrating Webmin

7.6.1 Migrating the Selection of Server Type In HP Apache 2.0.x:

In 2.0.x, the ServerType directive could be set to one of the following two values in the /opt/hpws/apache/conf/httpd.conf file:

ServerType inetd

OR

ServerType standalone


In HP-UX Apache-based Web Server:

In Apache 2.x, the ServerType directive has been removed and the server type is selected using an MPM. HP-UX Apache-based Web Server integrates the worker MPM, which supports only one behavior, the standalone. This behavior does not require any directive. There is, currently, no MPM designed by ASF to be launched by inetd.



7.6.2 Migrating Webmin

NewA n functionality has been added to the HP-UX Webmin-based Admin, a GUI interface that enables you to administer the HP-UX Web Server Suite.



Starting HP-UX Webmin-based Admin:

To Start Webmin on the HP-UX Web Server Suite, perform the following steps: Log in as root, enter:

/opt/hpws/webmin/webmin-init start

Access the URL http://yourserver.com:10000

And login using the following credentails

Login : admin

Default Password : hp.com

To change the password, see /opt/hpws22/hp_docs/webmin/webmin.admin.guide

For more information, see: /opt/hpws22/hp_docs/webmin/webmin.admin.guide



7.6.2.1 Changes to “the HP-Apache-based Web Server screen in HP-UX Webmin-based Admin:

On the HP-UX Webmin-based Admin page, click HP-UX Apache-based Web Server.

The Default/Global Server field appears below.

The major areas of the new and changed Webmin functionalities, in the HP-UX Web Server Suite, have been circled in the screenshot.





7.6.2.2 Changed “Processes and Limits” screen in HP-UX Webmin-based Admin

The HP-UX Apache-based Web Server Processes and Limits screen now displays the directives corresponding to the MPM worker module (as shown in the table header).

For more information about worker directives, see Migrating Process Handling.




7.6.2.3 Changed “Apache Modules” screen in HP-UX Webmin-based Admin

The fourth section, Other, is blank in this example but will contain other modules you might add, that are not part of the HP-UX Apache-based Web

Server distribution. For example, if you add a personal module









The Apache Modules screen is grouped into five categories:

  1. Statically linked-in modules

  2. Standard Apache modules (DSO)

  1. Standard HP-UX Apache Add-on modules (DSO)

  2. Other

5) Add new modules

The first section contains modules that are always loaded and are not configurable.

The modules in the second section are available in the standard Apache distribution.

The third set of modules is not in Apache’s standard distribution but has been included in the HP-UX Apache-based Web Server. These modules include auth_ldap, modjk, mod_perl and mod_php4.




mod_personal, it will be displayed in this section. The final section is where you can add your own modules. These input boxes require the Module Name and the Location of the Module. This uses the LoadModule directive. For example, foo_module and modules/mod_foo are the two required fields.



Note for mod_ssl and auth_ldap:

Since the configuration directives for mod_ssl and auth_ldap are not in the standard configuration file (conf/httpd.conf), these two modules are enabled differently. Instead, the directive Include path/to/config_file is uncommented to load the module. This means that when mod_ssl is enabled, the directives in the conf/ssl.conf file are automatically included. Likewise, for auth_ldap, the directives in the conf/ldap.conf file are automatically included.



Note for mod_ssl:

If you change Apache settings when the mod_ssl module is loaded, you must stop and then restart Apache for these settings to take effect. If the mod_ssl module is not loaded, a simple restart should work.



7.6.2.4 New “Filters” screen in HP-UX Webmin-based Admin



The HP-UX Apache-based Web Server Filters screen allows configuration of filter directives.

For references on filters, see Writing 3.x Modules - Bibliography.



7.6.2.5 New “Generating Certificates and Keys” in HP-UX Webmin-based Admin



This screen allows you to generate keys and certificates for your server or for your own self-signed Certificate Authority (CA). You can use a previously generated CA certificate and key to generate new Server certificates or Keys.

To generate only a CA Key, specify the CA Key File and Key Size and click Make Certs at the bottom of the screen. If there is already a file with the same name at that location and you wish to overwrite it, check the box labeled Overwrite existing Key, Certificate and Certificate Request files.

Creating a CA Certificate Request depends on the CA Key, so both file locations must be specified, and the Information for the Request must be filled out as well. The fields, Organizational Unit and State or Province, may remain blank.

Creating a CA Certificate depends on both the CA Key and Certificate Request. To ensure that you do not accidentally overwrite the CA Certificate, an extra box must be checked to (Re)generate CA Certificate.

Generating a Server Key, Certificate, and Certificate Request have similar dependencies on each other. The Server Certificate has an additional dependency on the CA Key and CA Certificate.

1   2   3   4   5   6   7   8   9   10   11


Download 1.14 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa


September 2008 Migration Guide

Download 1.14 Mb.