httpd.conf file Configuration

Source: Internet
Author: User
Tags access address apache basic client configuration content course

Apache basic settings mainly to httpd.conf to set management, we want to modify the relevant settings Apache, mainly through the modification of httpd.cong to achieve. Let's take a look at Httpd.conf's content, which is divided into 3 major parts:
Section 1:global Environnement
Section 2: ' Main ' server revisit
Section 3:virtual Hosts

"The first part"

· ServerType Standalone
This means that Apache starts with standalone, or it can be inetd. The so-called standalone is to start to pick up all the wiring, and inetd is connected to the HTTP request to start, with the end of the connection, the burden is not very much? So it's usually started with standalone.
· ServerRoot "/USR/LOCAL/HTTPD"
This is Apache directory
• #LocdFile/use/local/httpd/logs/httpd.lock
Keep preset, do not change
· Pidfile/usr/local/httpd/logs/httpd.pid
This file records Apache's parent handler ID
· Scoreboardfile/usr/local/httpd/logs/httpd.scoreboard
Information for this file store handler
• #ResourceConfig conf/srm.conf
# AccessConfig conf/access.conf
Because we co-ordinate the management by httpd.conf, the two file presets are annotated, and you can keep the preset values unchanged
· Timeout
Set the time of the Stare timeout. If the client is not connected to the server for more than 300 seconds, or if the server has not yet transmitted information to the client for more than 300 seconds, the line is disconnected.
· KeepAlive on
allow the client to have multiple requests on the line, set to off to indicate not allowed
· Maxkeepaliverequests
Each time the largest request of the tree, the larger the number, the better the efficiency. 0 means no limit to
· Minspareserver 5
· Maxspareservers
Minspareserver 5 means that there will be at least 5 idle handlers, and if the actual number is less than this, the handler will be incremented. Maxspareservers 10 represents the largest number of idle processing programs, if your site is in great demand, you can set this number larger, don't arbitrarily set this number too large.
· Startservers 5
Number of servers at startup
MaxClients
Limit the maximum number of connections to the same time, of course, cannot be set too small, once this number is reached, you can no longer add users-Side
· Maxrequestperchild 0
Limit the number of requests before the result of a child handler, 0 means no Limit
• #Listen 3000
• #Listen 12.34.56.78:80
Use a different connection port or IP
· Bindaddress *
can answer * (all IP address), specified IP address or full domain name
• #LoadModule foo_module libexec/mod_foo.so
Use DSO module
# Extendedstatus on
to review Apache status information, preset to OFF (annotated)
"Part Two"

If the previous servertype is inetd, skip to serveradmin.
· Port
Standalone the connection ports that the server listens to, and of course it can be other port numbers less than 1023
· User Nobody
· Group Nobody
performing httpd users and Groups
· ServerAdmin Administrator's e-mail address
This is the administrator's e-mail address, if the Apache has a problem, will send a letter to the administrator, of course, you can also create a dedicated web account to receive the letter
· ServerName Your host name
This is the host name, if there is no domain name, can also use IP
·   DocumentRoot "Usr/local/httpd/htdocs"
Where this directory places the Web page for Apache, where index.html is the default for connecting to this host home

Options followsymlinks
allowoverride None

This directory sets the execution action of the directory where the user places the Web page (public_html).   Detailed Directory access methods are described later in the

Options Indexes folloesymlinks
allowoverride None
Order Allow,deny
Allow to all

This directory sets the execution action of the Apache Web page directory (htdocs)
· Userdir public_html
Users can set up public_html directory in their own directory to place Web pages, enter http://host address/~ user name to connect to ... Laura Fat Mary/a>
· DirectoryIndex index.html
Set the name of the preset home page
·   Accessfilename. htaccess
This is the name of the file that controls access, typically a preset. htaccess name, followed by a description of how htaccess is used

Order Allow,deny
deny from all

This is used to prevent others from seeing the contents of a file that begins with HT, not only the content of the protected. htaccess, but also the inner of the. htpasswd.Tolerance。 Of course, it can be written directly. If you have changes to accessfilename, for example, htaccess to. Accessht, please remember to make the relevant changes here, so as to prevent others from seeing Oh
• #CacheNegotiatedDocs
The annotation is to tell proxy not to put the interactive file into the cache, if you take away the #, there will be a cache of
· Usecanonicalname on
uses the standard name, and the preset is on. Suppose that the full name of a Web server is www.sample.com, commonly called www; Youli TTP://WWW/ABC
· Typeconfig/usr/local/httpd/conf/mime.types
Specifies the file that holds the MIME file type. You can edit the Mime.types file yourself.
·   DefaultType filetype
Default format when server does not recognize this file type, this setting is general text

The Mimemagicfile/usr/local/httpd/conf/magic

Mod_mime_magic module enables the server to determine its MIME type from the contents of the file. If a mod_mime_magic module is loaded, the Mimemagicfile section is processed. If it is ..., it means that this section will be processed if the module is not loaded
· Hostlookups off
If on, each time the IP is resolved to the name server, recording the name of the line (for example, www.apache.org) from min 牟簧偈 ben Qinglie ... Off to record only IP
· Errorlog/usr/local/httpd/logs/error_log The
Specifies the location of the record file (error_log) where the error occurred. If you do not specify a record file where the error occurred, the file

is used.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.