[Root @ localhost ~] # Yum-ygroupinstall "World Wide Web server" [root @ localhost ~] # Grep-v '^ #'/etc/httpd/conf/httpd. conf | uniqServerTokensOS // allow errors
[Root @ localhost ~] # Yum-y groupinstall "World Wide Web server"
[Root @ localhost ~] # Grep-v '^ #'/etc/httpd/conf/httpd. conf | uniq
ServerTokens OS // allows the operating system version to be displayed on the error page. changing it to Prod can hide this information.
ServerRoot "/etc/httpd" // apache configuration file path
PidFile run/httpd. pid // pid File Location
Timeout 120 // The request Timeout time is 2 minutes.
KeepAlive Off // The KeepAlive configuration command determines whether to close the TCP connection immediately after the user initiates an HTTP request.
MaxKeepAliveRequests 100
KeepAliveTimeout 15
# The following configuration involves server tuning aspects, refer to the http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mpm_common.html ##
// Set the server performance of the Apache mpm prefork module.
StartServers 8 // eight processes are generated when Apache is started.
MinSpareServers 5 // there should be at least 5 Apache Processes
MaxSpareServers 20 // The maximum number of processes cannot exceed 20
ServerLimit 256 // maximum number of allowed Sub-Processes
MaxClients 256 // maximum number of concurrent client connections
MaxRequestsPerChild 4000 // maximum number of requests allowed by each sub-process during its lifetime
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
######################################## #######
Listen 80 // Listen on port 80
LoadModule auth_basic_module modules/mod_auth_basic.so // The loaded module. You can run the/usr/sbin/apachectl-l command to view the loaded module.
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
.............................. The output is omitted ....................................
Include conf. d/*. conf // contains all configuration files ending with conf in/etc/httpd/conf. d /.
User apache // run as an Apache User and group
Group apache
ServerAdmin root @ localhost // administrator's email address
UseCanonicalName Off
DocumentRoot "/var/www/html" // default website working directory
Options FollowSymLinks'
AllowOverride None
Options Indexes FollowSymLinks // enable index and soft link access
AllowOverride None // The request header cannot be rewritten.
Order allow, deny // defines the access policy. allow the policy first and then reject it.
Allow from all // Allow all access