Thứ Ba, 11 tháng 2, 2014

Tài liệu Apache Web Server Administration pdf


© International Technology Solutions Inc. 4 Apache_sw_1.3.14_9/10/01

CHOOSING THE SERVER’S USER AND GROUP 32
SETTING THE SERVER'S MAIN DIRECTORY 33
SELECTING SERVER INFORMATION FILES 33
SETTING THE DOCUMENT CONTENT DIRECTORY 34
SPECIFYING THE DEFAULT DIRECTORY FILENAMES 34
SETTING LOCK FILES 34
DEFINING HOSTNAMES 35
CACHE CONFIGURATION 35
SELECTING CONNECTION VALUES 36
NUMBER OF SERVER PROCESSES 37
SPECIFIC ADDRESS BINDING 38
CUSTOMIZING ERROR RESPONSES 38
USER-SPECIFIC WEB PAGES 39
DISABLING AND ENABLI NG USERS 39
DIRECTORY SPECIFICATION 40
CGI PROGRAMS 41
SERVER SIDE INCLUDES 41
CHAPTER SUMMARY 42
CHAPTER 4: EFFECTIVELY WORKING WITH APACHE 43
CHAPTER INTRODUCTION 43
CHAPTER OBJECTIVES 43
CONTROLLING APACHE 44
APACHECTL 44
SYSTEM V SCRIPT 46
APACHE COMMAND-LINE PARAMETERS 47
WORKING WITH THE APACHE LOGS 48
THE ERROR LOG 48
THE ACCESS LOG 49
CHAPTER SUMMARY 52
CHAPTER 5: VIRTUAL HOSTS 53
CHAPTER OVERVIEW 53
CHAPTER OBJECTIVES 53
IP ADDRESS VIRTUAL HOSTS 54
HOW TO SET UP APACHE 54
SETTING UP MULTIPLE DAEMONS 55
SETTING UP A SINGLE DAEMON 56
NAME-BASED VIRTUAL HOSTS 57
DYNAMICALLY-NAMED VIRTUAL HOSTS 58
SETTING UP THE CONFIGURATION FILE 58
SIMPLE DYNAMIC VIRTUAL HOSTS 59
COMBINING VIRTUAL HOSTING METHODS 60
MORE EFFICIENT IP ADDRESS-BASED VIRTUAL HOSTING 61
SYSTEM LIMITATIONS 62
FILE DESCRIPTOR LIMITS 62
IP ADDRESS LIMITS 63
CHAPTER SUMMARY 64
CHAPTER 6: ADVANCED CONFIGURATION 65
CHAPTER OVERVIEW 65

© International Technology Solutions Inc. 5 Apache_sw_1.3.14_9/10/01

CHAPTER OBJECTIVES 65
CONDITIONAL DIRECTIVES 66
TESTING FOR CONDITIONS 66
TESTING FOR MODULES 67
MODIFYING THE ENVIRONMENT 68
BROWSER MATCHING 68
PASSING THE ENVIRONM ENT ON 69
APACHE HANDLERS 70
HANDLERS 70
ASSOCIATING WITH FILES 71
CREATING HANDLERS 72
REDIRECTING CONTENT 73
SIMPLE ALIASES 73
PATTERN ALIASES 73
REDIRECTS 74
FANCY INDEXING 75
ASSOCIATING ICONS WITH FILES 75
ASSOCIATING DESCRIPTIONS WITH FILES 76
SPECIAL DIRECTORY FILES 76
EXCLUDING FILES 76
DELIVERING BROWSER-S ENSITIVE CONTENT 77
ENCODING 77
LANGUAGE 77
MEDIA TYPE 79
CHAPTER SUMMARY 80
CHAPTER 7: PERFORMANCE AND SECURITY 81
CHAPTER OVERVIEW 81
CHAPTER OBJECTIVES 81
APACHE'S SECURITY AND PERFORMANCE GOALS 82
HARDWARE AND PLATFORM CONSIDERATIONS 82
PERFORMANCE TUNING 84
RUN-TIME TUNING 84
SECURITY 87
RESTRICTING ACCESS 87
SETTING ACCESS OPTIONS 88
ENABLING ACCESS TO LOCAL DOCUMENTS 90
SERVERROOT DIRECTORY PERMISSIONS 90
SAFE CGI 91
CHAPTER SUMMARY 92
CHAPTER 8: URL REWRITING 93
CHAPTER OVERVIEW 93
CHAPTER OBJECTIVES 93
THE URL REWRITING ENGINE 94
REWRITING FUNDAMENTA LS 94
COMMON REWRITING NEEDS 98
TRAILING SLASHES 98
USERS ON ANOTHER SERVER 99
REDIRECT INVALID URLS 99
TIME IS IMPORTANT 100
FAKING STATIC PAGES 100
CHAPTER SUMMARY 101

© International Technology Solutions Inc. 6 Apache_sw_1.3.14_9/10/01

APPENDICES 103
LAB 1: INTRODUCTION 104
PART A (5 MINUTES) 104
LAB 2: APACHE INSTALLATION 105
PART A (10 MINUTES) 105
PART B (30-45 MINUTES) 105
LAB 3: APACHE CONFIGURATION 107
PART A (5 MINUTES) 107
PART B (40 MINUTES) 107
LAB 4: EFFECTIVELY WORKING WITH APACHE 109
PART A (5 MINUTES) 109
PART B (15 MINUTES) 109
PART C (30 MINUTES) 109
LAB 5: VIRTUAL HOSTS 110
PART A (10 MINUTES) 110
PART B (45 MINUTES) 110
PART C (15 MINUTES) 111
LAB 6: ADVANCED CONFIGURATION 112
PART A (5 MINUTES) 112
PART B (15 MINUTES) 112
PART C (15 MINUTES) 112
LAB 7: PERFORMANCE AND SECURITY 113
PART A (5 MINUTES) 113
PART B (45 MINUTES) 113
PART C (30 MINUTES) 114
LAB 8: URL REWRITING AND CUMULATIVE LAB 115
PART A (5 MINUTES) 115
PART B (90 MINUTES) 115
CHALLENGE 1 (90 MINUTES) 115
REFERENCES 116


© International Technology Solutions Inc. 7 Apache_sw_1.3.14_9/10/01

Chapter 1:
Introduction
Chapter Overview
Before using Apache, it is sensible to review the features it offers and how
it compares to other servers. In this chapter, you'll see the benefits Apache
gives administrators, and you'll see how Apache compares to other web
servers.
Chapter Objectives
After completing this chapter, you will be able to:
• describe the Apache web server.
• list Apache's features.
• compare Apache with other Web servers.

© International Technology Solutions Inc. 8 Apache_sw_1.3.14_9/10/01

Overview
The Apache web server began simply: to provide an open-source Web
server for Linux and other open-source operating systems. Originally
developed by the Apache Group, the Apache web server met that goal.
Today, Apache has grown far beyond its original scope. Currently funded
by the Apache Software Foundation (http://www.apache.org/),
the Apache web server is just one piece of a larger suite of many Internet-
oriented, open-source projects.
Apache's strength world-wide
Apache is a commercial- grade server actively designed, developed, and
debugged by volunteers worldwide. Apache serves (i.e. provides the
content for browsers to view) more Internet sites than any other web
server on the market does. With this kind of coverage, you can imagine
Apache is a strong and stable web server.
Apache's operating systems
Apache runs on many operating systems. Frequently, Apache runs on
Linux, but the Apache source code builds and runs perfectly well on:
• FreeBSD, OpenBSD, and NetBSD
• Solaris and SunOS
• HP-UX
• AIX
• IRIX
• Digital UNIX
• Windows NT/2000 and 9x
• Netware 5.x
• OS/2
• Macintosh
• BeOS
• SCO

© International Technology Solutions Inc. 9 Apache_sw_1.3.14_9/10/01

Features
There are numerous reasons to use Apache. Apache is:
• a powerful, flexible, HTTP/1.1-compliant web server.
• a modern server, implementing the latest protocols, including
HTTP/1.1 (RFC2616).
• highly configurable and extensible with third-party modules.
• very customizable with 'modules' conforming to the Apache
module API.
• free, provides full source code, and comes with an unrestrictive
license.
• actively developed by dedicated volunteers worldwide.
• robust because it encourages user feedback through new ideas, bug
reports, and patches.
• powerful as it implements:
o DBM databases for authentication.
o customized error messages.
o different directory index views.
o unlimited and flexible URL rewriting and aliasing.
o content negotiation.
o virtual hosts.
o reliable logging.

© International Technology Solutions Inc. 10 Apache_sw_1.3.14_9/10/01

Comparison to Other Servers
The overwhelming majority of Internet sites use Apache. That statistic
alone speaks for Apache's strength over other web servers. As The
Apache Software Foundation says:
"Apache has been shown to be substantially faster, more stable,
and more feature-full than many other web servers. Although
certain commercial servers have claimed to surpass Apache's
speed (it has not been demonstrated that any of these
"benchmarks" are a good way of measuring WWW server speed at
any rate), we feel that it is better to have a mostly-fast free server
than an extremely-fast server that costs thousands of dollars.
Apache is run on sites that get millions of hits per day, and they
have experienced no performance difficulties."
Independent third-party evaluations have shown that Apache excels in:
• CGI execution.
• configuration capability.
• security.
However, Apache uses an expensive process-oriented model that, for
static pages and some architectures, makes it a poor performer.
Fortunately, the Apache Software Foundation recognizes these
performance barriers and always works to improve them.



© International Technology Solutions Inc. 11 Apache_sw_1.3.14_9/10/01

Chapter Summary
Apache is a widely used, stable, and robust Web server. After five years
of development, Apache evolved a rich set of configuration and
performance features that make it a top choice for high- volume web sites
around the world.
Apache excels in CGI script execution and security, but lacks some
performance because of its process-oriented model. Because volunteer
developers worldwide care about Apache's success on a daily basis, these
performance barriers are rapidly being removed in favor of better models.

© International Technology Solutions Inc. 12 Apache_sw_1.3.14_9/10/01








This page intentionally left blank

© International Technology Solutions Inc. 13 Apache_sw_1.3.14_9/10/01

Chapter 2:
Apache Installation
Chapter Overview
Installing Apache can be very simple or extremely complex. The range of
configuration possibilities that Apache offers is staggering, but the default
Apache installation is sufficient for many sites. This chapter will illustrate
the installation procedure and point out many of the configuration
parameters you can use to change the standard behavior.
Chapter Objectives
After completing this chapter, you will be able to:
• describe what factors influence web server placement on a
network.
• install Apache from either tar or rpm archives.
• configure your system to start Apache at boot.
• test Apache's configuration.

Không có nhận xét nào:

Đăng nhận xét