RHCEApache server-side write Configuration

Source: Internet
Author: User
[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

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.