Red Hat DIRECTORY SERVER 2.0 - GATEWAY Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Serwery Red Hat DIRECTORY SERVER 2.0 - GATEWAY. Web Server Management: Running Apache 2 on Red Hat Linux [en] Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 96
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 0
Web Server Management: Running Apache 2 on Red
Hat Linux
Bob Dowling
University of Cambridge Computing Service
Przeglądanie stron 0
1 2 3 4 5 6 ... 95 96

Podsumowanie treści

Strona 1 - Hat Linux

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

Strona 2

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

Strona 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

Strona 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

Strona 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

Strona 6 - Installing the packages

Chapter 1. Installing the software10

Strona 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

Strona 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

Strona 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

Strona 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.

Strona 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

Strona 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

Strona 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

Strona 14

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 19 - Chapter 3. Getting started

Chapter 3. Getting started22

Strona 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

Strona 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

Strona 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

Strona 23 - Syntax summary: Virtual hosts

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

Strona 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

Strona 25

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

Strona 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.

Strona 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

Strona 28

Chapter 5. Symbolic links30

Strona 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

Strona 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

Strona 31 - Chapter 5. Symbolic links

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

Strona 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

Strona 33

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 39 - • Description

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

Strona 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

Strona 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

Strona 42

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

Strona 43 - Manipulating rows

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

Strona 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

Strona 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

Strona 46 - Adding icons to the listing

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

Strona 47

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

Strona 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

Strona 49

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

Strona 50 - Using an HTML table

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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.#!/

Strona 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

Strona 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

Strona 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

Strona 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

Strona 68

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

Strona 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

Strona 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

Strona 71 - Indexes which enables

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

Strona 72 - Simple uses of AllowOverride

Chapter 9. Delegated control70

Strona 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

Strona 74

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 79

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

Strona 80

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

Strona 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

Strona 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

Strona 83

Chapter 10. Access control80

Strona 84

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

Strona 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

Strona 86

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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_

Strona 92

Appendix A. Apache modules88

Strona 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

Strona 94

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

Strona 95

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

Strona 96

Appendix B. Reference information for logging92

Komentarze do niniejszej Instrukcji

Brak uwag