Common commands in the httpd. conf file of Apache explain ServerTypestandalone # set whether the server is started independently (standalone) or by the interconnected network servo program inetd. The former is generally used. ServerRootusrlocalapache # set the Home directory of the server to store the server's setting files, error files, and record files Apache
Explanation of common commands in the httpd. conf file of Apache
ServerType standalone
# Set the server to standalone or inetd. The former is generally used.
ServerRoot "/usr/local/apache"
# Set the Home directory of the server to store the setting files, error files, and record files of the server.
PidFile logs/httpd. pid
# Store the httpd process id of the parent process in this file when the program starts. The file name can be changed with the PidFile command.
ScoreBoardFile logs/apache_status
# Set the record files of some execution programs on the WWW server on the network.
# ResourceConfig conf/srm. conf
# AccessConfig conf/access. conf
# The content of these two files is already included in the httpd. conf file.
Timeout 300
# If the client has not been connected for 300 seconds, or the server has not transferred data to the client for 300 seconds, it will be automatically disconnected.
KeepAlive On
# Set whether to support continuous data transfer.
MaxKeepAliveRequests 100
# Set the number of support for continuous data transfer. More disk space is wasted. If the value is set to 0, data is not transmitted continuously.
KeepAliveTimeout 15
# If the user does not send a request to the server after 15 seconds, the user cannot resume the transfer.
MaxRequestsPerChild 0
# Set the number of child processes in the same time.
ThreadsPerChild 50
# Set the number of processes used by the server.
# Listen 3000.
# Listen 12.34.56.78: 80
# Allow other ports or IP addresses to access the server. In this example, Port is 3000 and IP is 12.34.56.78: 80.
# BindAddress *
# You can specify the IP addresses that Apache listens.
# LoadModule anon_auth_module modules/ApacheModuleAuthAnon. dll
......
# Open the pre-activated module.
# ExtendedStatus On
# Set the status information generated by the server.
Port 80
# Set the Port used by the server.
ServerAdmin you@your.address
# Set the email address of the server manager.
# ServerName new. host. name
# Server host name. If you have a fixed IP address, you do not need to set it.
DocumentRoot "/usr/local/apache/htdocs"
# Set the directory for storing html files of the website.
Options FollowSymLinks
AllowOverride None
# Set/directory commands. Details:
Option: defines the operations that can be performed in the directory.
None: indicates that only browsing is allowed,
FollowSymLinks: Allows page connections to other places,
ExecCGI: allows CGI execution,
MultiViews: allows operations such as watching animations or listening to music,
Indexes: allows the server to return a formatted list of directories,
Allowed des: SSI is allowed. You can check these settings.
All: you can do anything, but not MultiViews.
AllowOverride: adding the None parameter indicates that anyone can browse the files in this directory.
Other parameters include FileInfo, AuthConfig, and Limit.
UserDir public_html
# Define the directory where the user stores html files.
DirectoryIndex index.html
# Define the first file to be displayed.
AccessFileName. htaccess
# Define the name of each directory access control file.
# CacheNegotiatedDocs
Define the proxy server not to Cache your page. It is not recommended.
UseCanonicalName On
# The Server uses the server name specified by ServerName and the Port address specified by Port.