
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
The Web Server
|
317
I still use Apache 1.3 with PHP. Since most users are still working with 1.3, that’s
what will be used in the examples in this chapter, with some 2.0 notes where needed.
The book Apache Security (O’Reilly) has more details on security for 2.0.
Build Time: Installing Apache
Attacks are so frequent on today’s Internet that you don’t want to leave a window for
attack, even for the few minutes it takes to set up a secure server. This section covers
setting up your environment and obtaining the right version of Apache.
Setting up your firewall
A public web server is commonly located with email and nameservers in a DMZ,
between outer and inner firewalls. You want to configure access for two classes of
visitor:
• The public, visiting your site from the Internet
• Web administrators, who may be coming from the outside, inside, or another
server in the DMZ
Web servers normally listen on TCP ports 80 (http:) and 443 (secure HTTP, https:).
While you’re installing Apache and the pieces are lying all around, block external
access to these ports at your firewall (with iptables or other open source or com-
mercial tools). If you’re installing remotely, open only port 22 and use ssh. After
you’ve configured Apache, tightened your CGI scripts (as described in this chap-
ter), and tested ...