9.6.1 Linux APACHE server configuration
1, for RedHat Linux systems, Apache configuration files in / etc / httpd / conf / directory. If it is installed to compile Apache, compile-time depends on the directory path may be specified, the default is / usr / regional / apache / conf. In the conf directory, there are three Apache configuration file: httpd.conf; access.conf; srm.conf Apache startup, first phone the httpd.conf, then phone srm.conf, the final shriek to access.conf. But the modern version of the Apache in order to dodge muddle in the management and maintenance, has changed always the pertinent configuration commands on the Apache httpd.conf file, no longer used srm.conf and access.conf files. While these 2 documents still exist, but nobody of the contents of configuration commands, useless. httpd.conf file is divided into the following three parts:
Global Environment
Main 'server configuration
Virtual Hosts
2, Global Environment partition of the circumstance
ServerType parameter settings standalone
accustomed to clarify Apache's startup mode: standalone and inetd. Apache standalone mode is escape independently, is the default startup mode. inetd mode is http daemon listens as connection requests before starting httpd process, the request is completed afterward the end of the httpd process, so that the waiter heavy burden.
ServerRoot Do not add back the directory
LockFile / var / latch / httpd.lock
leave the default values,
Lacoste Radiate Croc Trainers, do not change.
PidFile / var / run / httpd.pid
Apache's parent process the specified record id of the file appoint and way.
ScoreBoard / var / run / httpd.scoreboard
designated for arsenal of information server process treatment the file name and path.
# ResourceConfig conf / srm.conf
# AccessConfig conf / way.conf
in the standard configuration, the server will start processing the two documents. Only because of the Apache httpd.conf file, eliminating the srm.conf and access.conf files, so these two lines with
Timeout 300
set the timeout. If the remote client has not connected on more than 300 seconds Apache Server, Apache Server more than 300 seconds, or not to send bytes to the client swiftly loosened.
KeepAlive On
KeepAlive allows a client's multiple requests per connection, this is ineffective when set to Off.
MaxKeepAliveRequests 100
set during the connection each time the most allowed number of requests. Set to 0 that allows an unlimited number. Set the larger the number, the higher extravaganza of the server.
KeepAliveTimeout 15
set to wait for a client with a connection publish with the next connection request over a decisive time to crash.
MinSpareServers 5
MaxSpareServers 20
set the minimum number of lazy processing services and the largest number of laze processing services. If the substantial number is less than MinSpareServers, will amplify the process; the other hand, if the actual number exceeds MaxSpareServers,
Lacoste Shua Lace Trainers, some of the extra processing will be killed.
StartServers 8
set up and initialize the number of start service process.
MaxClient 150
set the total number of services running. Once you reach this number, fashionable client to be rejected, so the number can not set the limit also small.
MaxRequestsPerChild 100
set before the results for each subroutine number of requests, set to 0 means not limit.
# Listen 3000
# Listen 12.34.56.78:80
Listen 80
set Apache listening port or IP address and wharf, the default is 80.
# BindAddress *
This discretion is used to support virtual host, and differentiate what IP address the server listens. You can use
# LoadModule foo_module libexec / mod_foo.so
DSO (Dynamic Shared Object) support. DSO module conception and role of the DLL files with Windows is very alike.
# ExtendedStatus On
when the The default is Off.
3, 'Main' Server Configuration section of the parameter setting conditions
If the first chapter of the not have anyone achieve, bounce ServerAdmin command.
Port 80
set Standalone server listening port,
Lacoste Zepher MR2 Trainers, you can also set other ports, must be less than 1 023. Must be root, to change the port.
User apache
Group apache
run httpd user and the specified consumer group. Must 1st be assigned to basis identity.
ServerAdmin root @ localhost
set the administrator's e-mail address,
Lacoste Strap Trainers, there is a problem when Apache will automatically bring E-mail superintendent.
# ServerName localhost
set the host name, you can use the domain name and IP address.
DocumentRoot
Options FollowSymLinks
AllowOverride None
set Apache to access the directory is accessed each action acted. Described in more detail later in this chapter Apache directory access method.
here to set Apache's network directory of execution actions. Described in detail later in this section, the directory access method.
AllowOverride None
Options None
Allow from all
here to prevent users to create their own. htaccess files . In this file can change universal parameters that influence the security of the entire system. Can be additional in the httpd.conf file, increase the above command, all the code.
UserDir public_html
set the user build their own directory public_html for website, that is, / home / * / public_html /. This in the explorer address bar enter The directory must be set to inform the user, alternatively they do not understand where above the sheet.
DirectoryIndex concordance.html concordance.htm index.shtml index.php index.php4 index.php3 index.cgi
set Apache's default home page file.
AccessFileName. htacess
control access to the file name specified. Apache is the default. Htaccess. Described in detail in a later chapter of the document method
ht to prevent the client watch the starting of the file contents. Because. Htaccess recorded message,. Htpasswd password information recorded, or grant others to access these files.
# CacheNegotiatedDocs
specify whether the interaction Proxy server generated file exists in the Cache. Comment out the command is not specified.
UseCanonicalName On
set whether to use the criterion name, the default is On.
TypeConfig / etc / mime.types
MIME file types specified in the file cache.
Default Type text / plain
If Apache does not recognize this file type, then the default format in consensus with generally exhibit a text file.
MIMEMagicFile conf / magic
mod_mime_magic module allows Apache apt resolve its MIME content of the file type. If there namely the module ahead processing MIMEMagicFile this paragraph. The on 3 lines is when the paucity of the module apt handle with this paragraph.
HostnameLookups off
Apache is the name of the server set to determine the IP address, record the name of this link (such as Hacker.com.cn). Take some time because of DNS resolution, so the default is set off, merely records IP.
ErrorLog / var / log / httpd / error_log
specify when the Apache peccadillo log file. If not specified in the log file , then use / var / log / httpd / error_log, or use the specified file.
LogLevel warn
specified class of detail records, there are 8 levels: debug, info, notification, advise, error, crit, vigilant, and emerg. According to the summarize from the detailed preparation.
LogFormat ; ; referer
LogFormat
# CustomLog / var / log / httpd / access_log common
CustomLog / var / log.httpd / access_log combind
which specified a custom log file format to use. Others do not use the custom format ambition be commented out.
above is almost the log file will be later in the Apache log files described in detail.
ServerSignature On
set to On, when the Apache error when, in the version of Apache web page display information, host name, port and other line of information. Set to Off, not shown relevant information. E-mail is set when there is
Alias / icons / Create unlimited aliases. Note that if the back of the alias
ScriptAlias / cgi-bin /
ScriptAlias command should be imperative to limit the use of CGI programs or several by a characteristic situation. Generally can set up multiple ScriptAlias. Cgi-bin directory must be certified not html directory, this is very essential, so you can outlook them opposition hackers and outlook through CGI programs.
IndexOptions FancyIndexing
to a specific account of graphics files.
AddIconByEncoding (CMP, / icons / ziped.gif) x-compress x-gzip
... ...
DefaultIcon / icons / nameless.gif
display the file list specified in a variety of file types corresponding graphics.
4, Virtual Hosts section: This section is to set the virtual host. The so-called virtual host, refers to more than one domain name server as a Web server. ISP often through a unattached server providing Web services to its buyers. And clients typically ambition their own home page name appears, not in the back of the ISP's name, for a separate domain name and root URL may look more prim. Traditionally, users must set up their own a domain name server in order to fulfill a single purpose, but it needs to nourish a divide server. Many small units of the absence of ample maintenance capabilities, a more proper way is to hire something to nourish the server. ISP there is no absence for a body to invest a single server,
Womens Lacoste Observe Trainers, virtual host can use the capability of the server to cater Web services for multiple domain names, and another services interfere with each other,
Lacoste, external to the performance for several assorted servers. Hosting the procedure is to solve this problem, so that the actual point to the ISP customer's name on the same server. Support the direction Apache virtual host, Apache supports virtual hosts in two ways. One set for each virtual host a separate httpd process, and second, for all the hosts to set up a separate httpd process.