Red Hat DIRECTORY SERVER 2.0 - GATEWAY Bedienungsanleitung

Stöbern Sie online oder laden Sie Bedienungsanleitung nach Server Red Hat DIRECTORY SERVER 2.0 - GATEWAY herunter. Web Server Management: Running Apache 2 on Red Hat Linux [en] Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 96
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 0
Web Server Management: Running Apache 2 on Red
Hat Linux
Bob Dowling
University of Cambridge Computing Service
Seitenansicht 0
1 2 3 4 5 6 ... 95 96

Inhaltsverzeichnis

Seite 1 - Hat Linux

Web Server Management: Running Apache 2 on RedHat LinuxBob DowlingUniversity of Cambridge Computing [email protected]

Seite 2

Chapter 1. Installing the softwarecgi−binerrorhtmlicons*.html.varincludebottom.htmlspacer.htmltop.htmlusagemsfree.pngwebalizer.png*.png/var/wwwFigure

Seite 3 - Table of Contents

Chapter 1. Installing the software• /usr/bin/ab: This a stress-tester for the web server. Please do not stress-testpeople’s servers without their expl

Seite 4

Chapter 1. Installing the software# cd# /etc/init.d/httpd startStarting httpd: [ OK ]Figure 1-12. Manually starting the web serverIf you take this eas

Seite 5

Chapter 1. Installing the softwareWarningusermod’s -G option sets the user’s groups. It does not add tothem. You must quote all the user’s groups. Any

Seite 6 - Installing the packages

Chapter 1. Installing the software10

Seite 7

Chapter 2. The site’s designThis chapter will describe the design of a web site that we will set as our goal for thiscourse and discuss a small amount

Seite 8

Chapter 2. The site’s designMultiple addresses:A single system need not have a single IP address. It can have many and each canhave a different web si

Seite 9 - Changes made to the system

Chapter 2. The site’s designHost: noether.csi.cam.ac.ukThe second line indicates which server the query was addressed to. It is thiselement of the que

Seite 10 - /etc/group:apache:x:48:

Chapter 2. The site’s designKeep-Alive: 300This instructs the server to keep the connection alive for 300 seconds in casethere are any more requests.

Seite 11 - Quick and Dirty Web Server

Chapter 3. Getting startedClean slate:We will start by removing the existing configuration script. This may seem dramaticbut this course seeks to expla

Seite 12

Web Server Management: Running Apache 2 on Red Hat Linuxby Bob DowlingInstallation:This course will first illustrate how to load the Apache 2 package o

Seite 13 - # usermod -G webadmin bob

Chapter 3. Getting startedWe will start by detailing an absolutely minimal configuration file that gets the serverlaunched but nothing else.Listen 80Fig

Seite 14

Chapter 3. Getting startedListen 80User apacheGroup apacheServerRoot /etc/httpdOptions NoneFigure 3-8. httpd.conf: Minimal versionSyntax summary: Gett

Seite 15 - Chapter 2. The site’s design

Chapter 3. Getting startedreason the parent decides whether or not to replace it. (If they have all been idle forthe past 48 hours it may decide that

Seite 16 - HTTP Query Structure

Chapter 3. Getting startedentitled to update the sites.# cd /var/www# mkdir CHALK CHEESE# groupadd -r chalk# groupadd -r cheese# chgrp chalk CHALK# ch

Seite 17

Chapter 3. Getting startedServerNameThis sets the name of the server for the virtual host. If a query’s Host: headerdoes not match this then the virtu

Seite 18

Chapter 3. Getting startedstopStops the web server.restartStops and starts the web server.condrestartStops and starts the web server if the PID file ex

Seite 19 - Chapter 3. Getting started

Chapter 3. Getting started22

Seite 20 - Starting httpd: [ OK ]

Chapter 4. Supporting MIME typesMIME types:We will start with a very brief discussion about what MIME types are and in partic-ular what MIME content t

Seite 21

Chapter 4. Supporting MIME typesContent analysisThe first is to look in the file’s content and deduce the MIME content type from thecontent.You can see

Seite 22 - Use valid DNS names

Chapter 4. Supporting MIME typesLoading and using the MIME moduleModules:All the various elements of web server functionality are split out into modul

Seite 23 - Syntax summary: Virtual hosts

Table of Contents1. Installing the software...1The w

Seite 24 - /etc/init.d/httpd

Chapter 4. Supporting MIME typesFigure 4-7. chalk.dept.cam.ac.uk index page as HTMLSyntax summary: Loading modulesLoadModule library.so nameLoad the m

Seite 25

Chapter 5. Symbolic linksSymbolic linksIt is demonstrated that the web server does not follow symbolic links unless explicitlydirected to do so.Option

Seite 26

Chapter 5. Symbolic linksFigure 5-2. We are forbidden to access main.htmlTo instruct the web server to follow symbolic links we need to set an option.

Seite 27

Chapter 5. Symbolic linksFigure 5-4. We are permitted to access main.htmlBecause symbolic links might be used to circumvent access controls in the web

Seite 28

Chapter 5. Symbolic links30

Seite 29 - TypesConfig /etc/mime.types

Chapter 6. Handling directoriesDirectory URLsSome URLs (typically those that end in /) correspond to directories rather than plainfiles. We need to det

Seite 30 - Syntax summary: mime_module

Chapter 6. Handling directoriesThere are two solutions to this issue. The first, and simplest, is to nominate a filename(such as index.html) and instruc

Seite 31 - Chapter 5. Symbolic links

Chapter 6. Handling directoriesSyntax summary: dir_moduleDirectoryIndexSpecify the documents to be searched for given a directory query.Document names

Seite 32 - Options +FollowSymLinks

Chapter 6. Handling directoriesSeveral options we will meet rely on a specific module and their use must follow theLoadModule lin in the configuration fi

Seite 33

Chapter 6. Handling directoriesFigure 6-9. The fancy index of /Columns in default fancy index• Name• Size• Last modified• DescriptionThe layout of this

Seite 35 - / causing problems

Chapter 6. Handling directoriesFigure 6-10. A populated cheese.dept.cam.ac.uk websiteManipulating columnsWe will start by making some use of the Descr

Seite 36 - Using default documents

Chapter 6. Handling directoriesFigure 6-12. The cheese.dept.cam.ac.uk website with descriptionsNext, we will remove unwanted columns. For the sake or

Seite 37 - Syntax summary: dir_module

Chapter 6. Handling directoriesFigure 6-14. The displayed listing with columns suppressedFinally, we will look at modifying the widths of the various

Seite 38

Chapter 6. Handling directoriesscription of the file if it would push the row beyond this point and indicates the trun-cation with a “>”. There are

Seite 39 - • Description

Chapter 6. Handling directoriesFigure 6-18. Unwanted files in the listingIndexIgnore "#*#" "*~"Figure 6-19. httpd.conf: Ignoring ce

Seite 40 - Manipulating columns

Chapter 6. Handling directoriesFigure 6-20. Unwanted files removed from the listingWarningJust because a file name is not in the listing does not mean t

Seite 41

Chapter 6. Handling directoriesFigure 6-22. Putting subdirectories first in the listingNote: By now you may be starting to get confused about when a fa

Seite 42

Chapter 6. Handling directoriesthem in directory listings. The auto-indexing module provides a slew of commandsfor this purpose. The trick to producin

Seite 43 - Manipulating rows

Chapter 6. Handling directoriesAddIcon /icons/dir.gif "^^DIRECTORY^^"AddIcon /icons/back.gif ".."AddAlt "Directory" &quo

Seite 44

Chapter 6. Handling directoriesTo add HTML above the listing the configuration must identify a header file. This filemust have a name that identifies it a

Seite 45

Chapter 1. Installing the softwarePackages:We will describe the packages that Red Hat install if you request the Web Server groupat installation. We w

Seite 46 - Adding icons to the listing

Chapter 6. Handling directories</head><body bgcolor="#ffffff" text="#000000"link="#003399" alink="#cc0000&

Seite 47

Chapter 6. Handling directoriesIndexOptions ... HTMLTable ...Figure 6-34. httpd.conf: Using HTML tables for the indexFigure 6-35. The listing in HTML

Seite 48 - Adding text to the listing

Chapter 6. Handling directoriesAddIconByType icon mime_type (f)Specifies the icon that should be used for a particlar MIME content type. TheMIME conten

Seite 49

Chapter 6. Handling directoriesFoldersFirstList the subdirectories before the plain files.SuppressHTMLPreambleInstructs the web server not to create th

Seite 50 - Using an HTML table

Chapter 6. Handling directoriesLoadModule dir_module modules/mod_dir.soDirectoryIndex index.htmlLoadModule autoindex_module modules/mod_autoindex.soIn

Seite 51

Chapter 7. LoggingError logWe will examine the error log to see what is logged and to change the amount oflogging done.log_config_moduleWe will load an

Seite 52

Chapter 7. Logging[Mon Mar 24 09:50:58 2003] [notice] caught SIGTERM, shutting downFigure 7-2. error_log: Shutting downAnalogous to SIGHUP is SIGTERM

Seite 53 - Using both modules

Chapter 7. LoggingSyntax error on line 10 of /etc/httpd/conf/httpd.conf:Invalid directory indexing optionFigure 7-4. error_log: Unformatted error mess

Seite 54 - DirectoryIndex index.html

Chapter 7. LoggingThis provides us with one particularly useful command: CustomLog. This allows usto specify what information to record and where to r

Seite 55 - Chapter 7. Logging

Chapter 7. Logging• There is no record of whether chalk.dept.cam.ac.uk or cheese.dept.cam.ac.uk wasqueried.• The hostnames are addresses, not namesThe

Seite 56 - • message

Chapter 1. Installing the softwarephp-ldapThis package provides the hooks for PHP to perform lookups in LDAP directo-ries.php-pgsqlThis package provid

Seite 57 - Access logs

Chapter 7. LoggingThe escape sequences used in the Common Log Format%hThe client’s hostname%lIf the web server was doing IDENT (RFCnnnn) lookups then

Seite 58 - Four escape sequences

Chapter 7. LoggingFinding bad linksMost browsers also include a query header Referer: which contains the URL of thepage that contain the link the user

Seite 59

Chapter 7. LoggingThe three commands that specify how often rotation should take place are daily,weekly and monthly.rotate 4Keep four sets of log files

Seite 60

Chapter 7. Logging/bin/kill -HUP ‘cat /var/run/httpd.pid 2>/dev/null‘ 2> /dev/null || trueThis messy command sends a SIGHUP signal to the master

Seite 61 - Log rotation

Chapter 7. Logging# mkdir /var/www/CHALK/usage# mkdir /var/www/CHEESE/usage# chmod g+ws /var/www/CHALK/usage# chmod g+ws /var/www/CHEESE/usageFigure 7

Seite 62 - : commands

Chapter 7. LoggingWe need to run it multiple times for our various web sites using its command lineoption to select non-standard configuration files.#!/

Seite 63 - Log file analysis

Chapter 7. Logging62

Seite 64

Chapter 8. Users’ own web pagesuserdir_moduleWe will introduce the relevant module and the single command it provides.Simple useWe will start with the

Seite 65

Chapter 8. Users’ own web pageslooking for. Only the last entry in the list is allowed to be a redirection to anotherserver (i.e. a URL) because when

Seite 66

Chapter 9. Delegated control<Directory>Applying a specialised set of commands just to a subdirectory of a web site from thehttpd.conf file.Includ

Seite 67

Chapter 1. Installing the software$ \/bin/su -Password: password#Figure 1-1. Changing to be rootUnix Support keeps the Red Hat distributions on an NFS

Seite 68

Chapter 9. Delegated controlFigure 9-2. The games directoryWe can turn indexing off with the Options command as follows.<VirtualHost *>ServerNam

Seite 69 - Chapter 9. Delegated control

Chapter 9. Delegated controlFigure 9-4. Not the games directoryThe Options command sets various parameters that basically control whether a mod-ule’s

Seite 70

Chapter 9. Delegated controltells of its origins; it was used to set the access rights for a directory tree. It is, however,a fully generic delegated

Seite 71 - Indexes which enables

Chapter 9. Delegated controlAllowOverride IndexesThe delegated configuration file is allowed to run the IndexOptions commandand all the commands that mo

Seite 72 - Simple uses of AllowOverride

Chapter 9. Delegated control70

Seite 73

Chapter 10. Access controlTwo waysThere are two ways to do access control: by the location of the client and by theidentity of the user operating the

Seite 74

Chapter 10. Access controlAccess control by client IP addressAs ever, this functionality is provided by a module: access_module from librarymod_access

Seite 75 - Chapter 10. Access control

Chapter 10. Access controlquery redirected through a web proxy or cache will have the address of the webproxy or cache.Allow from 131.111Access is all

Seite 76

Chapter 10. Access controlWhat we need to know is how to set up the server so that userids and passwords areknown to the server and certain pages are

Seite 77 - </Directory>

Chapter 10. Access controlNow that we have a way to identify users we need to specify policies. As with ac-cess_module the restrictions on access can

Seite 78

Chapter 1. Installing the software# cd RedHat/RPMS# ls4Suite-0.11.1-10.i386.rpma2ps-4.13b-24.i386.rpmabiword-1.0.2-6.i386.rpm...zlib-1.1.4-4.i386.rpmz

Seite 79

Chapter 10. Access controlFigure 10-8. The userid and password challengeNote that the prompt contains the phrase “Restricted area”. That text comes di

Seite 80

Chapter 10. Access control<Directory /var/www/CHEESE/games>AuthType BasicAuthName "Cheese lovers only"AuthUserFile /etc/httpd/access/p

Seite 81 - Syntax summary: Require

Chapter 10. Access control$ touch /etc/httpd/access/digest_pw$ htdigest /etc/httpd/access/digest_pw "Cheese lovers only" rjd4Adding user rjd

Seite 82 - New password: password

Chapter 10. Access controlSatisfy any</Directory>Figure 10-15. Mixed restrictionsThe two worlds of access control are joined by the Satisfy comm

Seite 83

Chapter 10. Access control80

Seite 84

Chapter 11. ConclusionWhat’s next?University Computing Service courses that have this course as a prerequisite.Tidying upSome re-ordering of the final

Seite 85 - Chapter 11. Conclusion

Chapter 11. Conclusion# Put a header file above the listingHeaderName HEADER.html# Set up aliasingAlias /icons/ /var/www/icons/# Set up iconsAddIconBy

Seite 86

Chapter 11. ConclusionNameVirtualHost *<VirtualHost *>ServerName chalk.dept.cam.ac.ukDocumentRoot /var/www/CHALKCustomLog logs/chalk.log clf<

Seite 87 - Follow-on web server courses

Chapter 11. ConclusionCGI Scripting for Programmers: IntroductionThe Common Gateway Interface (CGI) underlies much of the modern web. It pro-vides the

Seite 88

Appendix A. Apache modulesThis lists the modules shipped with Red Hat Linux’s packages.Table A-1. Modules shipped as part of the base httpd package.Li

Seite 89 - Appendix A. Apache modules

Chapter 1. Installing the softwareChanges made to the systemWe should quickly examine what changes have been made to the system by the in-stallation o

Seite 90

Appendix A. Apache modulesLibrary Module name Descriptionmod_info.so info_module Lets the server report on itsconfiguration via a web request.mod_log_c

Seite 91

Appendix A. Apache modulesTable A-2. Modules shipped as part of other packages.Package Library Module namemod_auth_mysql mod_auth_mysql.so mysql_auth_

Seite 92

Appendix A. Apache modules88

Seite 93 - -” is inserted

Appendix B. Reference information for loggingTable B-1. Escape sequences for custom logs%% How to get “%” in the log line. Why would you want to?%a Cl

Seite 94

Appendix B. Reference information for loggingTable B-2. HTTP status codes100 Continue101 Switching protocols200 OK201 Created202 Accepted203 Nonauthor

Seite 95

Appendix B. Reference information for loggingNotes1. http://www.w3.org/Protocols/rfc2616/rfc2616.html91

Seite 96

Appendix B. Reference information for logging92

Kommentare zu diesen Handbüchern

Keine Kommentare