• Change from old to new functions
  • Change in existing functions
  • Change from old to new types
  • Change from 2.0.32 to 2.0.39 functions
  • 7.8.6 Header files Note
  • 7.9 Miscellaneous Changes
  • 8 Tuning HP-UX Web Server Suite Performance
  • 8.1 Basic HTTP
  • 9 Verifying the Migration
  • 10 Appendix 10.1 Directive Changes by Name
  • September 2008 Migration Guide




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

    7.8.5 Functions and Types

    Many ap_ functions have new apr_ versions. apr stands for Apache Portable Runtime. apu stands for Apache Portable Runtime Utilities. The following tables list the common changes. For more information on changes, see ap_compat.h, apu_compat.h, and apr_ compat.h. These compatibility headers allow old function names to work in the new environment.



    Change from old to new functions

    Apache 2.0.x

    Apache 2.2.x




    apr_pool _cleanup _register ( apr_pool_t* p,

    server _rec* s,


    my_child_exit, my_child_exit);

    /* Allocate space from pool supplied*/

    tocfg *cfg;

    cfg = (tocfg *) ap_pcalloc(p,

    sizeof(tocfg)

    );


    /* Allocate space from pool supplied*/

    tocfg *cfg;

    cfg = (tocfg *) apr_pcalloc(p,

    sizeof(tocfg)

    );


    ap_palloc( ... );

    /* No change to signature */ apr_palloc( ... );

    /* Allocate memory for pool use */ toMyPool = ap _make _sub_pool (r->pool);

    /* Allocate memory for pool use */ apr _make _sub_pool (&toMyPool,

    r->pool,


    NULL);

    Apache 2.0.x

    Apache 2.2.x







    ap_snprintf ( valueString,

    sizeof (valueString), "%s\n",

    value);


    apr_snprintf ( valueString,

    sizeof (valueString),

    "%s\n",

    value);





    ap _table _do ( ... );







    /* Second argument has changed */

    apr_table_do ( ... );









    ap_pool_destroy( ...

    );




    /* No change to signature */ apr_pool _destroy( ... );







    ap_table_set( ... );







    /* No change to signature */ apr _table _set( ... );







    ap_table_set( ... );







    /* No change to signature */ apr _table _set( ... );







    ap_make_array( ... );







    /* No change to signature */ apr_array_make( ... );







    ap_push_array( ... );







    /* No change to signature */ apr_array_push( ... );







    ap_pstrdup( ... );







    /* No change to signature */ apr_pstrdup( ... );







    ap_send_http_header(

    r

    );

    /* This function was removed in 2.0. defined in ap_compat.h to do nothing ap_send_http_header( r );

    It */

    is

    Change in existing functions





    Apache 2.0.x




    Apache 2.2.x

    ap_log_error(

    APLOG _MARK, APLO G_DEBUG, r->server,

    "error text")



    ap_log_error(

    APLOG _MARK, APLO G_DEBUG, 0,

    r->server,



    "error text")

    Change from old to new types




    Apache 2.0.x




    Apache2.2.xxe 2.2.2.2.x

    pool




    apr pool t




    array header




    apr array header

    t

    Change from 2.0.32 to 2.0.39 functions




    Apache 2.0.32




    Apache 2.0.39




    apr

    lock create

    ( ...

    );

    apr

    thread mutex create

    ( ...

    );

    apr_lock_acquire

    ( ...

    );

    apr _thread _mutex _lock

    ( ...

    );

    apr

    lock release

    ( ...

    );

    apr

    thread mutex unlock

    ( ...

    );

    apr

    lock destroy

    ( ...

    );

    apr

    thread mutex destroy

    ( ...

    );

    7.8.6 Header files

    Note: You can use ap_compat.h in HP-UX Apache-based Web Server to allow compatability with 2.0.x. It maps function names and signatures to the HP-UX Apache-based Web Server.

    Header files





    Apache 2.0.x




    Apache 2.2.x

    #include

    "httpd.h"

    #include

    "httpd.h"

    #include

    "http_config.h"

    #include

    "http_config.h"

    #include

    "http_core.h"

    #include

    "http_core.h"

    #include

    "http_log.h"

    #include

    "http_log.h"

    #include

    "http_main.h"

    #include

    "http_main.h"

    #include

    "http . h"
    _protocol

    #include

    "http . h"
    _protocol

    #include

    "util h"
    _script.

    #include

    "http h"
    _request.







    #include

    "util h"
    _script.

    #include

    #include

    "http_connection.h"







    #include

    "apr _strings .h"







    #include



    7.8.7 Bibliography

    For information on writing HP-UX Web Server Suite modules, see: http://httpd.apache.org/docs/2.2/developer/



    www.onlamp.com/pub/a/apache/2001/09/27/apache 2.html

    For information on HP-UX Web Server Suite filters, see: Official Apache Software Foundation document



    http://httpd.apache.org/docs/2.2/filter.html

    For information on writing Apache 2.0.x modules, see:



    Writing Apache Modules with Perl and C, by Stein and MacEachern, O'Reilly and Associates Inc.

    7.9 Miscellaneous Changes

    • Graceful restarts of the server are now executed by signaling the parent process with WINCH rather than USR1.

    • The httpd command line option -X still exists but most MPMs allow the same functionality to be requested by using the -D ONE_PROCESS command line option. In addition, a -D NO_DETACH command line option is available.

    8 Tuning HP-UX Web Server Suite Performance

    The following are suggestions only and may not apply to your specific situation.

    SeeFor more information about improving performance of the HP-UX Web Server Suite, see the FAQ at www.hp.com/products1/unix/webservers/apache/faqs/index.html.

    8.1 Basic HTTP

    For the basic http server, perform the following: steps



    1. Disable indexing of directories in "the httpd.conf". file

    With the Options directive don't, not use Indexes or All, which enable index generation. Indexes are dynamically generated for every access. It is better to create an index.html file instead so that the server does not need to dynamically generate text.

    1. Logging

    Disable logging as much as possible. If necessary, write each log to their own file system using different high speed disks. This will decrease delays caused by disk scheduling.

    1. KeepAlive on

    With this directive set to on, Apache will attempt to maintain a rapid dialog with the client. KeepAlive on does not mean that the connection will be maintained too long. The KeepAliveTimeout and MaxKeepAliveRequests directives restrict clients from excessive, persistent connection times.

    1. HostNameLookups off

    With this directive set to off, Apache will log IP addresses instead of host names. Even though Apache caches DNS lookups, this can be very time consuming.

    1. Options FollowSymLinks

    not

    Options FollowSymLinksIfOwnerMatch

    FollowSymLinksIfOwnerMatch causes Apache to check the entire path for symbolic links and check that the ownership is the same as the server or virtual host. This can be time consuming. The FollowSymLinks directive is less secure because it does no checking.t performverification If neither FollowSymLinks nor FollowSymLinksIfOwnerMatch directives are used, Apache will not follow symbolic links. This slows Apache because it has to search for symbolic links sothat it can avoid them but this situation is the most secure.


    1. For local directory URLs, put a forward slash, "/", at the end. That way the server can avoid needless file searches.

    2. Deny access to well mannered spiders or web crawlers with a robots.txt file under the document root. The file has User-Agent and Disallow directives that limit access to specified URLs by the spider. This will eliminate unnecessary web traffic.

    3. Verify that there are no performance bottlenecks between servers and databases.

    4. For images:

    • Specify height and width.

    • Keep size of image small.

    • Minimize number of images.

    • Avoid animations.

    • Do not use macromedia flash on home pages.

    1. Do not combine large and small images into the same file.

    Keep alternate large images in a separate file because not many users will choose to view the large image.

    8.2 SSL

    By default, HP-UX Apache-based Web Server Suite SSL is tuned to maximize performance. SeeFor more information, see /opt/hpws22/apache/hpws_docs/ssl.admin.guide.



    8.3 PHP

    To use PHP following are some set of suggestions which will help to improve performance:



    1. Use only one echo or print statement in the script. Use array or concatenation to compose the html and send with only one echo or print.

    2. Use the set of output buffer (ob_*) functions available in PHP5. For example, ob_start.

    3. Use an accelerator. Search the web for PHP Accelerator and you will find several accelerators, some of which are free.




    1. The Alternative PHP Cache (APC) is a an accelerator for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

    8.4 Tomcat

    To tune the tomcat server use the following procedure to improve the performance

    For the latest Tomcat suggestions to improve the performance , see: /opt/hpws22/hp_docs/tomcat/tomcat.admin.guide


    1. Avoid JSP's.

    Instead use Perl, C, C , or Java modules. JSPs automatically create and compile servlets which they then run. Typically, the JSP creates the servlet, which it calls later, the first time it is accessed. StillTherefore, there is some delay.

    The following suggestions to improve the performance are based on: http://tomcat.apache.org/tomcat-5.5-doc/index.html

    The above website contains the complete Tomcat User Guide.


    1. Modify and Customize the Batch Files

    As stated in the earlier sections, the startup scripts are there for convenience. purposes Yet, sometimes the scripts that are needed for deployment must be modified:

    • To set resource limits, such as maximum number of descriptors.

    • To add new PATH/LD_LIBRARY_PATH entries, such as JDBC drivers DLLs).

    • To modify the JVM command line settings.

    Ensure that you are using a specific JVM (out of the two or three JVMs installed on your machine).

    To switch user from root to some other user using the "su" UNIX command.
    Some of these changes can be done without explicit changes to the basic scripts; for example, the tomcat script can use an environment variable named TOMCAT_OPTS to set extra command line parameters to the JVM, such as memory setting.

    On UNIX, you can also create a file named.tomcatrc in your home directory and Tomcat will take environment information, such as PATH, JAVA_HOME, TOMCAT_HOME, and TOMCAT_INSTALL from this file. OnHowever, o NT (and also on UNIX when the modifications are for command lines, such as the JVM command line), you are forced to rewrite some of the startup script.

    3. Modify the Default JVM Settings

    The default JVM settings in the tomcat script are very naive; everything is left for defaults. There are a few things that you must consider to improve your Tomcat performance:

    Modify your JVM memory configuration. Normally, the JVM allocates an initial size for the Java heap, which is the maximum size.

    Nevertheless, in loaded sites, giving more memory to the JVM improves Tomcat's performance. You must use command line parameters, such as -Xms/-Xmx/-ms/-mx to set the minimum/maximum size of the Java heap (and check to see if the performance was improved).

    Modify your JVM threading configuration. The SUN JDK1 .2.2 for Linux comes with support for green and native threads. In general, native threads are known to provide improved performance for I/O bound applications, and green threads put less stress on the machine. You must experiment with these two threading models and see which model is better for your site (in general, native threads are better).

    Select the best JVM for the task. If your application does not require a specific JDK functionality, you must benchmark the two JVMs and select the better one.

    4. Disable Servlet Auto-Reloading

    The Servlet auto-reloading feature is useful for development time. However, it is very expensive (in performance degradation terms) and may put your application in strange conflicts when classes that were loaded by a certain classloader cannot cooperate with classes loaded by the current classloader.

    So,Therefore unless you have an essential requirement for class reloading during your deployment, you must turn off the reloadable flag in your contexts. You can disable reloading globally by removing the ReloaderInterceptor found in the server.xml file.

    9 Verifying the Migration
    Following is the procedure to verify the migration


    After migration check for errors:

    • Check /opt/hpws22/apache/logs/error _log for error messages.

    • If errors occurred, determine the cause and adjust configuration files.

    • After manual updates, start the HP-UX Web Server Suite. As root type:,enter

    //bin/apachectl start

    • Verify servlet and JSP migration by checking a known servlet and a known JSP page.

    • Run customer applications and access customer files.

    • Run previous performance and load tests. Tune HP Apache directives and HP-UX kernel parameters if the migrated web server is not meeting expected performance.

    10 Appendix

    10.1 Directive Changes by Name

    The table includes all removed, changed, or added directives.






    Status

    Module

    How to migrate from 2.0.x

    END

    Removed

    mod perl




    =back

    Removed

    mod perl




    =cut

    Removed

    mod perl




    =pod

    Removed

    mod perl




    AcceptMutex

    Added

    core




    AcceptPathInfo

    Added

    core




    AccessConfig

    Removed

    core

    Migrating Access to Configuration Files

    AddInputFilter

    Added

    mod_mime




    AddModule

    Removed

    core

    Migrating Module Loading

    AddOutputFilter

    Added

    mod_mime




    AddOutputFilterByType

    Added

    core




    AgentLog

    Removed

    mod_log_agent

    Migrating Logging

    ApJServAction

    Removed

    modjserv




    ApJServBalance

    Removed

    modjserv




    ApJServDefaultHost

    Removed

    modjserv




    ApJServDefaultPort

    Removed

    modjserv




    ApJServDefaultProtocol

    Removed

    modjserv




    ApJServEnvVar

    Removed

    modjserv




    ApJServHost

    Removed

    modjserv




    ApJServLogFile

    Removed

    modjserv




    ApJServLogLevel

    Removed

    modjserv




    ApJServManual

    Removed

    modjserv




    ApJServMount

    Removed

    modjserv




    ApJServMountCopy

    Removed

    modjserv




    ApJServProperties

    Removed

    modjserv




    ApJServProtocol Parameter

    Removed

    modjserv




    ApJServRetryAttempts

    Removed

    modjserv




    ApJServRoute

    Removed

    modjserv




    ApJServSecretKey

    Removed

    modjserv




    ApJServShmFile

    Removed

    modjserv




    ApJServVM Interval

    Removed

    modjserv




    ApJServVMTimeout

    Removed

    modjserv




    AuthDBMType

    Added

    mod_auth_dbm




    AuthDigestShmemSize

    Added

    mod_auth_digest




    Auth LDAPAuthoritative

    Added

    auth_ldap




    AuthLDAPBindDN

    Added

    auth_ldap




    Auth LDAPBindPassword

    Added

    auth_ldap




    AuthLDAPCacheCompareOps

    Added

    auth_ldap




    AuthLDAPCacheSize

    Added

    auth_ldap




    AuthLDAPCacheTTL

    Added

    auth_ldap




    Auth LDAPCertDBPath

    Added

    auth_ldap




    AuthLDAPCompareDNOnServer

    Added

    auth_ldap




    Auth LDAPDereferenceAliases

    Added

    auth_ldap




    AuthLDAPEnabled

    Added

    auth_ldap




    Auth LDAPGroupAttribute

    Added

    auth_ldap




    AuthLDAPGroupAttributeIsDN

    Added

    auth_ldap




    AuthLDAPOpCacheSize

    Added

    auth_ldap




    AuthLDAPOpCacheTTL

    Added

    auth_ldap




    Directive

    Status

    Module

    How to migrate from 2.0.x

    AuthLDAPRemoteUserIsDN

    Added

    auth_ldap




    Auth LDAPStartTLS

    Added

    auth_ldap




    AuthLDAPURL

    Added

    auth_ldap




    BindAddress

    Removed

    core




    Buffered Logs

    Added

    mod_log_config

    experimental

    CacheDefaultExpireMin

    Added

    mod_cache




    CacheDirLength

    Added

    mod_disk_cache




    CacheDirLength

    Removed

    mod_proxy




    CacheDirLevels

    Added

    mod_disk_cache




    CacheDirLevels

    Removed

    mod proxy




    CacheDisable

    Added

    mod cache




    CacheEnable

    Added

    mod_cache




    Cache ExpiryCheck

    Added

    mod_disk_cache




    CacheFile

    Added

    mod_file_cache




    CacheGcClean

    Added

    mod_disk_cache




    CacheGcDaily

    Added

    mod_disk_cache




    CacheGcInterval

    Added

    mod_disk_cache




    CacheGcI nterval

    Removed

    mod_proxy




    CacheGcMemUsage

    Added

    mod_disk_cache




    CacheGcUnused

    Added

    mod_disk_cache




    CacheIgnoreCacheControl

    Added

    mod_cache




    CacheIgnoreNoLastMod

    Added

    mod_cache




    CacheMaxFileSize

    Added

    mod_disk_cache




    CacheMaxStreamingBuffer

    Added

    mod_cache




    CacheMinFileSize

    Added

    mod_disk_cache




    CacheNegotiatedDocs

    Changed

    mod_negotiation

    How to Migrate Documents Cached by

    Proxy Servers

    CacheRoot

    Added

    mod_disk_cache




    CacheRoot

    Removed

    mod_proxy




    CacheSize

    Added

    mod_disk_cache




    CacheSize

    Removed

    mod_proxy




    CacheTimeMargin

    Added

    mod_disk_cache




    CaseFilter

    Added

    mod_casefilter




    CaseFilterIn

    Added

    mod_casefilterin




    CharsetDefault

    Added

    mod_charset_lite




    CharsetOptions

    Added

    mod_charset_lite




    CharsetSourceEnc

    Added

    mod_charset_lite




    ClearModuleList

    Removed

    core

    Migrating Module Loading

    CookieDomain

    Added

    mod_usertrack




    CookieStyle

    Added

    mod_usertrack




    DAV

    Added

    mod_dav




    DAVDepthInfinity

    Added

    mod_dav




    DAVLockDB

    Added

    mod_dav_fs




    DAVMinTimeout

    Added

    mod_dav




    Define

    Removed

    mod_define




    DeflateBufferSize

    Added

    mod_deflate




    DeflateFilterNote

    Added

    mod_deflate




    DeflateMemLevel

    Added

    mod_deflate




    DeflateWindowSize

    Added

    mod_deflate




    ErrorDocument

    Changed

    core

    Migrating the Printing of Error Messages

    ExcessRequestsPerChild

    Removed

    core




    ExtFilterDefine

    Added

    mod_charset_lite




    ExtFilterDefine

    Added

    mod_ext_filter




    ExtFilterOptions

    Added

    mod_charset_lite




    ExtFilterOptions

    Added

    mod_ext_filter




    Directive

    Status

    Module

    How to migrate from 2.0.x

    FancyIndexing

    Removed

    mod_authindex




    FileETag

    Added

    core




    ForceLanguagePriority

    Added

    mod_negotiation




    Header echo

    Added

    mod_headers




    HeaderName filename

    Changed

    mod_authindex




    Include

    Changed

    core

    Migrating Access to Configuration Files

    IndexOptions FancyIndexing

    Added

    mod_authindex




    IndexOptions HTMLTable

    Added

    mod_authindex




    IndexOptions IgnoreClient

    Added

    mod_authindex




    IndexOptions SuppressIcon

    Added

    mod authindex




    IndexOptions SuppressRules

    Added

    mod authindex




    IndexOptions VersionSort

    Added

    mod_authindex




    JkAutoMount

    Added

    modjk




    JkCERTSIndicator

    Added

    modjk




    JkCIPHERIndicator

    Added

    modjk




    JkEnvVar

    Added

    modjk




    JkExtractSSL

    Added

    modjk




    JkHTTPSIndicator

    Added

    modjk




    JkKEYSIZEIndicator

    Added

    modjk




    JkLogFile

    Added

    modjk




    JkLogLevel

    Added

    modjk




    JkLogStampFormat

    Added

    modjk




    JkMount

    Added

    modjk




    JkMountCopy

    Added

    modjk




    JkOptions

    Added

    modjk




    JkSESSIONIndicator

    Added

    modjk




    JkWorker

    Added

    modjk




    JkWorkersFile

    Added

    modjk




    LimitXMLRequestBody

    Added

    core




    Listen

    Changed

    core

    Supports Ipv6

    LoadModule

    Changed

    core

    Migrating Module Loading

    Log Format

    Changed

    mod_log_config




    MaxServers

    Removed

    core




    MaxSpareThreads

    Added

    core




    MCacheMaxObjectCount

    Added

    mod_mem_cache




    MCacheMaxObjectSize

    Added

    mod_mem_cache




    MCacheMinObjectSize

    Added

    mod_mem_cache




    MCacheRemovalAlgorithm

    Added

    mod_mem_cache




    MCacheSize

    Added

    mod_mem_cache




    MinSpareThreads

    Added

    core




    mmapfile

    Added

    mod_file_cache

    (Directive is in ASF Apache 2.0.x but not in HP Apache 2.0.x)

    ModMimeUsePath Info

    Added

    mod_mime




    MultiviewsMatch

    Added

    mod_mime




    NameVirtualHost

    Changed

    core

    Supports Ipv6

    NoCache

    Removed

    mod_proxy







    Removed

    mod_perl

    Not yet implemented

    PerlFreshRestart

    Removed

    mod_perl




    PerlInitHandler

    Added

    mod_perl




    PerlInterpMax

    Added

    mod_perl




    PerlI nterpMaxRequests

    Added

    mod_perl




    PerlI nterpMaxSpare

    Added

    mod_perl




    PerlI nterpMinSpare

    Added

    mod_perl




    PerlInterpScope

    Added

    mod_perl




    PerlInterpStart

    Added

    mod_perl




    Directive

    Status

    Module

    How to migrate from 2.0.x

    PerlOpmask

    Removed

    mod_perl




    PerlOptions

    Added

    mod_perl




    PerlScript

    Removed

    mod_perl




    PerlSwitches

    Added

    mod_perl




    PerlTrace

    Added

    mod_perl




    PHPINIDir

    Added

    mod_php




    Port

    Removed

    core

    Migrating Port Number Assignments

    ProtocolEcho

    Added

    mod_echo







    Added

    mod_proxy

    (A Container for other directives)

    ProxyErrorOverride

    Added

    mod proxy




    ProxyIOBufferSize

    Added

    mod proxy







    Added

    mod_proxy

    (A Container for other directives)

    ProxyMaxForwards

    Added

    mod_proxy




    ProxyPass

    Changed

    mod_proxy




    ProxyPassReversed

    Changed

    mod_proxy




    ProxyPreserveHost

    Added

    mod_proxy




    ProxyRemoteMatch

    Added

    mod_proxy




    ProxyTimeout

    Added

    mod_proxy




    RefererIgnore

    Removed

    mod_log_referer

    Migrating Logging

    RefererLog

    Removed

    mod_log_referer

    Migrating Logging

    RemoveCharset

    Added

    mod_mime




    RemoveInputFilter

    Added

    mod_mime




    RemoveLanguage

    Added

    mod_mime




    RemoveOutputFilter

    Added

    mod_mime




    RequestHeader

    Added

    mod_headers




    ResourceConfig

    Removed

    core

    Migrating Access to Configuration Files

    ScoreBoardFile

    Added

    core




    Scriptsock

    Added

    mod_cgid




    SendBufferSize

    Removed

    core




    ServerLimit

    Added

    core




    ServerName

    Changed

    core

    Migrating Security (SSL)

    ServersSafetyLimit

    Removed

    core




    ServerTokens major

    Changed

    core

    New option

    ServerType

    Removed

    core

    Migrating the Selection of Server Type

    SetInputFilter

    Added

    core




    SetOutputFilter

    Added

    core




    SSIEndTag

    Added

    mod_include




    SSIErrorMsg

    Added

    mod_include




    SSIStartTag

    Added

    mod _include




    SSITimeFormat

    Added

    mod _include




    SSI UndefinedEcho

    Added

    mod_include




    SSLLog

    Removed

    mod_ssl

    Use ErrorLog instead

    SSLLogLevel

    Removed

    mod_ssl

    Use LogLevel instead

    SuexecUserGroup

    Added

    mod_suexec




    ThreadLimit

    Added

    core




    UnsetEnv

    Changed

    mod_env






    Changed

    core

    Supports Ipv6

    VirtualScriptAlias

    Changed

    mod_vhost_alias




    10.2 Module Changes

    The tables include all removed, changed, or added modules or directives.


    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.