Apache2 configuration file httpd. conf Chinese Version

Source: Internet
Author: User
# Configuration file based on the NCSA service. # This is the main configuration file of the Apache server. # It contains the configuration commands that affect the running of the server. # See URL: http: httpd. ache. orgdoc-2.0 to get detailed information about these commands # Don't simply read the instructions without understanding them. # Here is just a simple example

# Configuration file based on the NCSA service.
#
# This is the main configuration file of the Apache server.
# It contains the configuration commands that affect the running of the server.
# See Httpd.Ache.org/doc-2.0/> to obtain detailed information about these commands.
#
# Do not simply read the instruction information without understanding it.
# Here is a simple description. If you do not refer to online files, you will be warned.
#
# These configuration commands are divided into the following three parts:
#1. Control the behavior of the entire Apache server (that is, the global environment variable)
#2. Define commands for main or default service parameters, and provide default setting parameters for all Virtual Hosts
#3. VM setting parameters
#
# Configuration and Log File Name: if the specified file name starts with "/" ("dirver:/" in win32 :/"),
# The server uses an absolute path. If the file name does not start with "/", the server uses ServerRoot
# The value is appended before the file name. For example, for "logs/foo. log \", if the ServerRoot Value
# For "/usr/local/apache2", the file should be "/usr/local/apache2/logs/foo. log"
#
# Area 1: Global Environment Parameters
#
# The parameters set here will affect the behavior of the entire Apache server;
# For example, the number of concurrent requests that Apache can process.
#
# ServerRoot: Specifies the root directory for the server to save its configuration, errors, and log files.
#
# Note! If you want to specify it as an NFS or another network location,
# Be sure to read the LockFile-related documents (
# File> ).
# This will allow you to solve many problems on your own.
#
# Do not add a slash at the end of the path.
#
ServerRoot \ "/usr/loacl/apache2 \"
#
# The lock file for serial access must be saved on the local disk.
#
DuLe! Mpm_winnt.c>

# LockFile logs/accept. lock

# ScoreBoardFile: A file used to save information about internal service processes.
# If not specified (default), the score board (scoreboard) will be saved in an anonymous shared memory segment,
# And it cannot be used by third-party software.
# If this parameter is specified, make sure that two Apache servers cannot use the same scoreboard file,
# This scoreboard file must be saved on a local disk.
#


# ScoreBoardFile logs/apache_run Time_ StatUs

#
# PIdFile: The File that records the server startup process number.
#

PidFile logs/httpd. pid

#
# Timeout: Timeout seconds before receiving and sending
#
Timeout 300

#
# KeepAlive: whether to allow secure connections (each connection has multiple requests ),
# Disabled if it is set to \ "Off.
#
KeepAlive On

#
# MaxKeepAliveRequests: Maximum number of requests allowed during a secure connection,
# Setting 0 indicates unrestricted access.
# We recommend that you set it to a large value to improve performance.
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: the number of seconds in which requests are received from the same customer on the same connection
#
KeepAliveTimeout 15

##
# Server-Pool size setting (for MPM)
##

# Prefork MPM
# StartServers: Number of processes started by the server at startup
# MinSpareServers: Minimum number of existing standby Processes
# MaxSpareServers: the maximum number of existing standby Processes
# MaxClients: Maximum number of processes allowed to be started on the server
# MaxRequestsPerChild: Maximum number of requests allowed by a service process

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestPerChild 0

# Worker MPM
# StartServers: number of service processes when the server is started
# MaxClients: Maximum number of users allowed to connect simultaneously
# MinSpareThreads: Minimum number of working threads
# MaxSpareThreads: Maximum number of worker threads that can be stored
# ThreadsPerChild: Working thread constant in each service process
# MaxRequestsPerChild: Maximum number of requests allowed by the Service Process

StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

# Perchild MPM
# NumServers: number of service processes
# StartThreads: Number of start threads in each service process
# MinSpareThreads: Minimum number of threads
# MaxSpareThreads: Maximum number of threads
# MaxThreadsPerChild: Maximum number of threads allowed by each service process
# MaxRequestsPerChild: Maximum number of connections allowed by each service process

NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0

# WinNT MPM
# ThreadsPerChild: constant of the working thread in the Service Process
# MaxRequestsPerChild: Maximum number of requests allowed by the Service Process

ThreadsPerChild 250
MaxRequestsPerChild 0

# BeOS MPM
# StartThreads: Number of threads started at server startup
# MaxClients: Maximum number of threads that can be started (one thread equals one user)
# MaxRequestsPerThread: Maximum number of requests allowed by each thread

StartThreads 10
MaxClients 50
# MaxRequestsPerThread 10000

# NetWare MPM
# ThreadStachSize: stack size allocated to each worker thread
# StartThreads: Number of threads started at server startup
# MinSpareThreads: Number of Idle threads used to process real-time requests
# MaxSpareThreads: Maximum number of Idle threads
# MaxThreads: Maximum number of threads active at the same time
# MaxRequestPerChild: Maximum number of requests for a thread service,
# It is recommended to set it to 0 to achieve unlimited access.

ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
Maxsparethread s 250
MaxThreads 1000
MaxRequestPerChild 0

# OS/2 MPM
# StartServers: number of service processes started
# MinSpareThreads: Minimum idle thread allowed by each process
# MaxSpareThreads: Maximum number of Idle threads allowed by each process
# MaxRequestsPerChild: Maximum number of connections allowed by each service process

StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 0

#
# Listen: allows you to bind the Apache service to the specified IP address and port to replace the default value.
# See Command
# Use the following CommandEnable Apache to only listen on the specified IP address,
# To prevent listening on IP address 0.0.0.0
#
# Listen 12.34.56.78: 80

Listen 80

#
# Dynamic sharing support (DSO)
#
# To be able to use functions in the modules compiled in DSO mode, you must have the corresponding "LoadModule" line,
# Therefore, these commands are included here so that they can be activated before being used.
# The modules for static compilation do not need to be listed here (that is, the modules listed in "httpd-l)
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#

#
# ExtendEdStatus: When "server-status" is called, Apache is controlled to generate a "full" Status.
# ExtendedStatus On or ExtendedStatus Off ).
# The default value is off.
#
# ExtendedStatus On

### Area 2: "master" service configuration
#
# This area establishes the command value used by the "master" server to respond to
# Define any request to be processed.
# The default values are also provided to the values defined later. Container.
# If The command value defined here will be
# .
#



#
# If you want httpd to run as another user or group, you must start it as root at the beginning.
# Switch it to the user or group you want to use.
#
# User/Group: users and groups running httpd
# Use "User nouser" and "Group nogroup" on SCO (ODT3"
# On HPUX, you may not be able to use shared memory as nobody. We recommend that you create a www user.
# Note that some core (kernel) are rejected when the Group ID is greater than 60000 SetGid (Group) or se McTl (IPC_SET ),
# Do not use "Group #-1" on these systems ".
#
User nobody
Group #-1

#
# ServerAdmin: your email address. Apache will send you an email when a problem occurs.
# As an error document, this address is displayed on the server-generated page,
# Example: admin@your-domain.com
#
ServerAdmin root @ localhost

#
# ServerName: Apache is used to identify its own name and port number.
# This value is usually automatically specified, but we recommend that you explicitly specify it to prevent errors during startup.
#
# If you specify an invalid DNS name for your host, server-generated redirection will not work.
# See UseCanonicalName command
#
# If your host does not have a DNS name registered, enter its IP address here
# In any case, you must use its IP address to provide services,
# Use an easy-to-understand method to redirect services
ServerName www.linuxidc.com: 80

#
# UseCanonicalName: determines how Apache constructs URLS, SERVER_NAME, and SERVER_PORT commands.
# When it is set to "Off", Apache uses the host name and port number provided by the user end.
# If it is set to "On", Apache uses the ServerName command value.
#
UseCanonicalName Off

#
# DocumentRoot: root directory of your document. By default, all requests are responded from this directory.
# However, you can use Symbolic Links and aliases to point to other locations.
#
DocumentRoot \ "/home/RedHat/public_html \"

#
# Access permissions (including its subdirectories) can be configured for each directory that Apache can access ).
#
# First, we configure a high-limit feature.

# This will prohibit access to the directory where the file system is located, and add the directory block you want to allow access.
# As shown below

Order Deny, Allow
Deny from all

#
# Note: From here on, you must specify which special features can be used.
#-If Apache does not work as expected,
# Check whether you explicitly specify that it is available below.
#

#
# This will change to the DocumentRoot you set.
#

#
# Options: the value of this command can be "None", "All", or any combination of the following Options:
# IndExEs INcLudes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note: "MultiViews" must be explicitly specified. "Options All" cannot provide this feature for you.
#
# This command is complex and important. For more information, see
# "Http://httpd.apache.org/docs-2.0/mod/core.html?optioins=to get more information.
#
Options FollowSymLinks

#
# AllowOverride controls commands placed in the. htaccess file.
# It Can Be "All", "None", or a combination of the following commands:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Control who can get the service.
#
Order allow, deny
Allow from all

#
# UserDir: Specify To Get ~ The user will be added to the directory name after the user's home directory in the request.
#

UserDir public_html

# To prevent vulnerabilities in the UserDir command, Set
# UserDir like "./" is very useful.
# If you use Apache 1.3 or later, we strongly recommend that you
# Include the following lines in your server configuration file

UserDir disabled root

#
# The following is an example of using the UserDir command to make the directory of a site have a read-only attribute:
#
#
# AllowOverride FileInfo AuthConfig Limit Indexes
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludeNoExec
#
# Order allow, deny
# Allow from all
#
#
# Order deny, allow
# Deny from all
#
#

#
# DirectoryIndex: indicates the file name of the service that Apache provides to users when a request is defined as a directory.
#
# Index.html. var file (a type image file) is used to provide a document processing list,

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.