[ Pobierz całość w formacie PDF ]
.The empty srm.conf and access.conf files are also in the /etc/httpd/conf/ directory.The srm.conf and access.conf files were formerly used, along with httpd.conf, as con-figuration files for Apache.If you need to configure Apache, edit httpd.conf and then either reload, or stop and startthehttpdprocess.How to reload, stop and start Apache is covered in Section 15.2.Before you edit httpd.conf, you should first copy the original file to something likehttpd.conf-old, for example.By creating a backup, you can recover potential mistakesmade while editing the new configuration file.If you do make a mistake, and your Web server does not work correctly, first review whatyou have recently edited in httpd.conf.Make sure that you did not make a typo.The nextplace to look is your Web server s error log (/var/log/httpd/error_log).The error log 184 Chapter 15.Apachemay not be easy to interpret, depending on your level of experience.If you have just experi-enced a problem, however, the last entries in the error log should provide information aboutwhat has happened.The next sections provide short descriptions of the directives included in httpd.conf.These descriptions are not exhaustive.If you need more information, refer to theApache documentation provided in HTML format at http://localhoast/manual/ orto the Apache group documentation at http://httpd.apache.org/docs/.For moreinformation about mod_ssl directives, refer to the documentation included in HTMLformat at http://localhost/manual/mod/mod_ssl/ or see the mod_ssl User Manual athttp://www.modssl.org/docs/2.8/.15.3.1.ServerTypeYour ServerTypemust be set to standalone.By default, your Web server is set to Server-Type standalone.ServerType standalonemeans that the server is started once and then that server handlesall of the connections.15.3.2.ServerRootTheServerRootis the top-level directory which contains the server s files.Both your secureand non-secure servers are set to use aServerRootof"/etc/httpd".15.3.3.LockFileLockFilesets the path to the lockfile used when the Apache server is compiled with eitherUSE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT.LockFile should beleft at its default value.15.3.4.PidFilePidFilenames the file where the server records its process ID (pid).Your Web server is setto record its pid in/var/run/httpd.pid.15.3.5.ScoreBoardFileThe ScoreBoardFile stores internal server process information, which is usedfor communication between the parent server process and its child processes.Red Hat Linux uses shared memory to store the ScoreBoardFile, the default of/etc/httpd/logs/apache_runtime_statusis only used as a fallback.15.3.6.ResourceConfigThe ResourceConfig directive instructs the server to read the file named after Resource-Configfor more directives.TheResourceConfigdirective is commented out, because yourWeb server only useshttpd.conffor configuration directives. Chapter 15.Apache 18515.3.7.AccessConfigTheAccessConfigdirective instructs the server to read the file named after AccessConfigfor more directives, after it has read the file named byResourceConfig.TheAccessConfigdirective is commented out, because your Web server only uses httpd.conf for configura-tion directives.15.3.8.TimeoutTimeout defines, in seconds, the amount of time that your server will wait for receipts andtransmissions during communications.Specifically, Timeout defines how long your serverwill wait to receive a GET request, how long it will wait to receive TCP packets on a POST orPUT request and how long it will wait between ACKs responding to TCP packets.Timeoutis set to 300 seconds, which is appropriate for most situations.15.3.9.KeepAliveKeepAlive sets whether your server will allow more than one request per connection (inother words, it will allow persistent connections).KeepAlive can be used to prevent anyone client from consuming too much of the server s resources.By default Keepalive is set to off.If Keepalive is set to on and the server becomes verybusy, the server can quickly spawn the maximum number of child processes.In thissituation, the server will slow down significantly.If Keepalive is enabled, it is a goodidea to set the the KeepAliveTimeout low (see Section 15.3.11) and monitor the servers/var/log/httpd/error_log.This log will report when the server is running out of childprocesses.15.3.10.MaxKeepAliveRequestsThis directive sets the maximum number of requests allowed per persistent connection.TheApache Group recommends a high setting, which will improve your server s performance.MaxKeepAliveRequestsis set to100by default, which should be appropriate for most situ-ations.15.3.11.KeepAliveTimeoutKeepAliveTimeout sets the number of seconds your server will wait after a request hasbeen served before it closes the connection.Once the server receives a request, theTimeoutdirective applies instead.15.3.12.MinSpareServers and MaxSpareServersThe Apache Web server dynamically adapts to the perceived load by maintaining an appro-priate number of spare server processes based on the traffic.The server checks the numberof servers waiting for a request and kills some if there are more than MaxSpareServers orcreates some if the number of servers is less thanMinSpareServers.Your server s default MinSpareServersis 5; your server s default MaxSpareServersis 20.These default settings should be appropriate in most situations.You should not increase theMinSpareServersto a large number.Doing so will create a heavy processing load on yourserver even when traffic is light. 186 Chapter 15.Apache15.3.13.StartServersStartServers sets how many server processes are created upon startup.Since your Webserver dynamically kills and creates server processes based on traffic load, you will not needto change this parameter.Your Web server is set to start eight server processes at startup.15.3.14.MaxClientsMaxClients sets a limit on the total number of server processes, or simultaneously con-nected clients, that can run at one time.You should keep MaxClients at a high number(your server s default is set to 150), because no one else will be allowed to connect oncethat number of simultaneously connected clients is reached.You can not setMaxClientstohigher than 256 without recompiling Apache.The main reason for havingMaxClientsis tokeep a runaway Web server from crashing your operating system.15.3.15.MaxRequestsPerChildMaxRequestsPerChild sets the total number of requests each child server process servesbefore the child dies.The main reason for setting MaxRequestsPerChild is to avoid long-lived process induced memory leaks.The default MaxRequestsPerChildfor your server is1000.15.3.16.ListenThe Listen command identifies the ports on which your Web server will accept incomingrequests.Your Web server is set to listen to port 80 for non-secure Web communications and(in the virtual host tags that define the secure server) to port 443 for secure Web communi-cations.If you set Apache to listen to a port under 1024, you must be root to start it.For port 1024and above,httpdcan be started as a regular user.Listencan also be used to specify particular IP addresses over which the server will acceptconnections.15.3.17 [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • personata.xlx.pl