[email protected]@covalent.net
Happy Trails:Migrating to Apache 2.0
A Top Level Guide to theWhy and How
Of Migrating to Apache 2.0
[email protected]@covalent.net
Agenda
Why Apache? Why Apache 2.0 (what’s new) Migration from Apache 1.3 Migration from iPlanet / SunOne Migration from IIS
[email protected]@covalent.net
Why Apache?
Extremely portable Completely Open Source Proven track-record Most popular web server on the
planet Support available from informal
and formal channels
[email protected]@covalent.net
What’s New in Apache 2.0
Multi-processing modules Hooks registered at run-time Modules helping each other Filtering framework Protocol modules Apache Portable Run-time Build system
[email protected]@covalent.net
Multi-Processing Modules
Apache can be run as a process-based server, a thread-based one or a hybrid.
Allows Apache to be tailored for each platform
Allows system administrators control over how their site runs
Allows for admin control over robustness and scalability
[email protected]@covalent.net
Prefork MPM
Robust Proven technology (Apache 1.3) Not incredibly scalable Removes some optimization options (caching)
[email protected]@covalent.net
Worker MPM
More scalable Less robust Less reliable Thread-safeness of libs critical
[email protected]@covalent.net
Perchild MPM (experimental)
Most scalable Least robust Allows for better virtual host support
(perchild uses file descriptor passing)
[email protected]@covalent.net
Windows MPM
Very scalable Takes advantage of Windows native API Allows for Apache on Windows to be a
real contender!
[email protected]@covalent.net
mod_cgid
Forking threaded processes kills performance
mod_cgid creates a CGI daemon that actually forks the CGI process
[email protected]@covalent.net
Apache Framework
ftphttp Pop3
Protocol Modules Apache is no longer “just a Web
server!" It is possible to create protocol
moduleso mod_perl 2.0 already supports PMs
[email protected]@covalent.net
Apache Portable Run-time
Apache 1.3 was ported to almost every platform imaginableo It only really worked well on Unixo The assumption was always Posix
Apache 2.0 is ported to almost every platform imaginableo It works well on all of themo And can be ported to more platforms
easily!o The Apache code is much cleaner!
[email protected]@covalent.net
APR
Application
Operating System
apr.apache.org
Apache Portable Run-time
[email protected]@covalent.net
Migration from Apache 1.3
Why Migrate?
o Scalability improvementso Better utilization of server resourceso More robust proxy implementationo Easier for in-house module developmento Much better support for non-Unix platformso Utilization of additional protocolso All new development focuses on 2.0o Build system uses GNU autoconf
[email protected]@covalent.net
Migration from Apache 1.3
Potential Gotchaso Changes in directives (some went away,
like Port, and others are changed)o Availability of 3rd party modules (not yet
ported to Apache 2.0)o Questions and concerns on thread-
safeness of various modules (only a real concern with threaded MPMs)
[email protected]@covalent.net
Migration from Apache 1.3
Howo Easiest migrationo Look through httpd.confo Most likely, stay with Prefork at first
(same tuning as 1.3)o Move to Worker when appropriate
• Check out modules and libraries• OS has good threading implementation?
[email protected]@covalent.net
Migration from iPlanet/SunOne
Why?o Apache is finally threaded!o Better performance and reliabilityo Open Standards / Open Sourceo Some question commitment to Web
Server layero More control for the Administratoro Leverage module availability
[email protected]@covalent.net
Migration from iPlanet/SunOne
Potential Gotchaso Very different configuration and
administrationo Does Apache provide the same “control”
and capability that iPlanet/SunOne does?o Application Server “bundled in”o It’s a “sweet suite”
[email protected]@covalent.net
Migration from iPlanet/SunOne
Howo Get up to speed on terminology
differences (backup slides)o Prefork or Worker? Now no longer need
separate iPlanet instances.o Look at dynamic content: what makes
sense to port to server-side or application. In many cases, Tomcat helps!
o Need AdminServer? Check out open source and commercial offerings.
[email protected]@covalent.net
Migration from IIS
Why?o Security!o Other “traditional” open source
advantageso VERY similar native performanceo Leverage the number of modules
available for Apacheo Opens up migration opportunities
[email protected]@covalent.net
Migration from IIS
Potential Gotchaso BIG cultural shift.o I need a GUI.o Does Apache interface with everything I
need (MS centric infrastructure)?o Mistrust
[email protected]@covalent.net
Migration from IIS
How?o For many, simple “drop in” replacement
• Apache includes ISAPI interface• Commercial support for .NET• Some interfaces still not as clean as one
would likeo Protecting IIS via Apache Reverse Proxy
• Eases migration path• Reduces risk with no decrease in functionality• Minimal impact on developers
[email protected]@covalent.net
iPlanet/Apache Comparison:Languages/Backends
Netscapeo CGIo Java (LiveConnect)o Javascripto SAF/NSAPI
Apacheo CGIo Java (Tomcat,
JServ)o php, perl, lotso iAPI
[email protected]@covalent.net
iPlanet/Apache Comparison:Directives
Netscapeo Inito AuthTranso PathChecko NameTranso ObjectTypeo Serviceo Erroro AddLog
Apacheo init (configs)o auth/checko accesso translateo type_checkero handlero redirect()o log()
[email protected]@covalent.net
iPlanet/Apache Comparison:Directives (Init)
Netscape - Inito cache-init, init-clf, init-cgi
Init fn=load-modules shlib=/lib/msqlath.so
funcs=msql_auth
AuthTrans fn=basic-auth auth-type=basic userfn=sql_auth
[email protected]@covalent.net
iPlanet/Apache Comparison:Directives (Init)
Apache: Init, Command Table
LoadModule msqlauth_module/lib/msqlauth.so
<Directory /private>AuthType BasicAuthmSQL_Table foo...
[email protected]@covalent.net
iPlanet/Apache Comparison:“Homepage”
Netscape 3.xo PathCheck fn=find-index index-
names=index.html,home.html
Apache 1.xo DirectoryIndex index.html home.html
[email protected]@covalent.net
iPlanet/Apache Comparison:Error logging
Netscapeo Error fn=send-error code=401
path=/spot/errors/401.html
Apacheo ErrorDocument /spot/errors/401.html
[email protected]@covalent.net
iPlanet/Apache Comparison:Extensible logging
Netscapeo AddLog fn=recordit name=browserlog
Flex-log %Ses->client.ip%
Apacheo mod_log_config/CustomLog
• “%a”
[email protected]@covalent.net
iPlanet/Apache Comparison:Service
Netscapeo Service type=text/html method=GET
fn=append-trailer trailer="<hr><img src=/logo.gif> Copyright 1995"
o ‘parse-html’
Apacheo no direct equivalent o mod_includeo mod_ext_filter
[email protected]@covalent.net
iPlanet/Apache Comparison:SAF Interface
Netscapeo Co pb/pblocko sn/Sessiono rq/Requesto Result Codeso Memory Mgt
Apache 2.xo C, Perl, Javao conf/tableso session_reco request_reco Result Codeso pools
[email protected]@covalent.net
iPlanet/Apache Comparison:SAF interface (2)
Netscapeo Write ‘C’o each function
maps to an directive
o compile, linko edit obj.confo restart
Apache 2.xo Write Co each module has a
set of directives and separate handlers
o compile, linko edit httpd.confo restart