23
Apache on Windows Rich Bowen <[email protected]> Part I: Installing, configuring, and running Apache on your Windows machines. ApacheCon 2000 7:30pm, March 9th, 2000

Apache on Windows Rich Bowen Part I: Installing, configuring, and running Apache on your Windows machines. ApacheCon 2000 7:30pm, March 9th, 2000 Orlando,

Embed Size (px)

Citation preview

Apache on WindowsRich Bowen

<[email protected]>

Part I: Installing, configuring, and running Apache on your Windows

machines.

ApacheCon 20007:30pm, March 9th, 2000

Orlando, Florida

History

• October, 1997 - Apache 1.3

• http://www.apacheweek.com/issues/97-10-17#13b2

• There were some ports available before that

“entirely experimental”

Please note that at this time, Windows support is entirely experimental, and is recommended only for experienced users.

… Warning: Apache on NT has not yet been optimized for performance. Apache still performs best, and is most reliable on Unix platforms.

In spite of this warning, I have found that, at least in the conditions where I use it, Apache works on NT as well as any of the alternatives. And, if you take administrator frustration into account, much better. ;-)

What are the alternatives?

• IIS

• Netscape

• WebSite

• Dozens of others

• Apache is newer to NT than many of the alternatives, but is based on a much more mature code base.

But IIS is better, right?

• Having long been told that IIS is a better server on NT, I’ve always had my doubts. Using Perl, I did some benchmarking. These results should not be taken as scientific, but are believable to me, at least.

Benchmarking: Apache vs IIS

D:\Apachecon>perl benchmark.pl

GET

Benchmark: timing 2000 iterations of Apache, IIS...

Apache: 34 wallclock secs ( 6.50 usr + 4.55 sys = 11.05 CPU)

IIS: 31 wallclock secs ( 6.65 usr + 4.43 sys = 11.08 CPU)

CGI

Benchmark: timing 2000 iterations of Apache, IIS...

Apache: 63 wallclock secs ( 5.73 usr + 3.82 sys = 9.54 CPU)

IIS: 64 wallclock secs ( 6.15 usr + 3.97 sys = 10.12 CPU)

And, in case you care ...

use Benchmark;

use LWP::Simple;

print "GET\n\n";

timethese(2000, {

'Apache' => 'get ("http://9.95.144.25/test.txt";)',

'IIS' => 'get ("http://9.95.144.25:90/test.txt";)',

});

print "CGI\n\n";

timethese(2000, {

'Apache' => 'get ("http://9.95.144.25/cgi-bin/test.pl";)',

'IIS' => 'get ("http://9.95.144.25:90/scripts/test.pl";)',

});

Other places where Apache is different from (better than) IIS

• Configuration– IIS lets you configure a small set of things.

– Apache lets you configure everything. And what you can’t configure, you can change in the source.

• Extensible– Apache is, IIS isn’t

• Authentication– IIS does authentication against the NT users database. That is, you have to

create an NT user to password protect part of your public web site.

What other servers are there for NT?

• See http://webcompare.internet.com/ for a large list.

Differences between Apache on Unix and NT

• Architecture

• Configuration differences

• Authentication

Architecture

• Unix has one parent process, and forks multiple child processes as needed.

• NT has one parent process, and one child process that is multi-threaded.

Configuration

• General configuration tips– File paths, drive letters, etc.– / vs \– Where to install it (not a problem any more,

just a habit).

Configuration directives

AccessConfig and ResourceConfig

AccessFileName

LoadModule

MaxRequestsPerChild

MaxSpareServers and MinSpareServers

ScriptInterpreterSource

Configuration directives

UserDir

XBitHack

ServerType

Authentication

• Unix uses Unix crypt, by default

• NT uses MD5 by default

Running as an NT service

• Running as an NT service– What are NT services?– Installing Apache as a service

apache -i -n Apache -f c:/httpd/conf/httpd.conf

(Or just select it from your Start menu)

apache -u -n Apache (to uninstall)

NT service

– Starting and stopping the serviceServices dialog (click start or stop)

From the command line:

apache -n “Apache” -k start

apache -n “Apache” -k restart

apache -n “Apache” -k shutdown

Or, the NT ‘net’ command:

net start Apache

net stop Apache

Console application

• Running as a console application– Starting and stopping the console app

• It’s in your Start menu, in the Apache folder

• To stop, open another DOS window, and type:apache -k shutdown

-- or --

apache -k restart

But there’s no GUI!!

• We don’t need no stinkin’ GUI!

• But if you really do, use Comanche– A GUI is important on NT, because Windows

users expect to have a GUI. Having on goes a long way towards convincing them that this is a real piece of software. Open Source advocacy is largely about perception, not about reality.

Apache modules on NT

• Apache modules provided as DLLs (rather like the shared objects option under Unix)

• LoadModule– LoadModule speling_module modules/ApacheModuleSpeling.dll

• mod_perl - get it at ftp://theoryx5.uwinnipeg.ca/pub/other/

The future of Apache on Windows

• That’s what Bill is here for

For more information

• http://www.apache.org/docs/windows.html

• http://www.rcbowen.com/imho/apache/