Apache Main configuration file (configuration description)

Source: Internet
Author: User
Article title: apache Main configuration file (configuration description ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Tang Haijing
  
Apache provides a variety of functions for network administrators, including Directory Index, directory alias, content negotiation, configurable HTTP error report, SetUID execution of CGI program, sub-process resource management, server-side image ING, URL rewriting, URL spelling check, and online manual man. That is to say, if you have successfully installed and configured Apache on the Linux Server, your computer will also change as Apache takes effect and become a real Web Server, this change is indeed exciting.
  
In the Internet era, the release of external homepage has become an important means to establish the company's image, and the internal homepage has become the main method of company management. However, to implement these functions, we should first configure our Linux Server as a powerful Web Server. This chapter describes how to configure the Apache server. I hope that my colleagues can read this article to achieve the goal of both theoretical practices and quickly become an outstanding network administrator in a short time.
  
1.2 required resources
1.2.1 Required packages
RedHat6.2 server installation
  
1.2.2 required configuration file
/Etc/httpd/conf/httpd. conf built-in system, administrator configuration
The/etc/httpd/conf/access. conf system comes with no modification required.
The/etc/httpd/conf/srm. conf system comes with no modification required.
  
1.3 configuration scheme
/Etc/httpd/conf/httpd. conf
Note: apache master configuration file
Source File:
  
ServerType standalone
# Define the WebServer startup method as standalone to enhance its responsiveness to a large number of accesses in a timely manner
ServerRoot "/etc/httpd"
# Specify the directory containing httpd server files
LockFile/var/lock/httpd. lock
PidFile/var/run/httpd. pid
ScoreBoardFile/var/run/httpd. scoreboard
Timeout 300
# Response timeout, in seconds
KeepAlive On
# Allow users to establish permanent connections
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
# Minimum number of idle server processes to be retained
MaxSpareServers 20
# Maximum number of idle server processes to be retained
StartServers 8
# Number of daemon processes at system startup
MaxClients 150
# The maximum client number that can provide services. parts greater than this number are placed in the request queue.
MaxRequestsPerChild 100
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule agent_log_module modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule db_auth_module modules/mod_auth_db.so
LoadModule digest_module modules/mod_digest.so
LoadModule proxy_module modules/libproxy. so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule perl_module modules/libperl. so
LoadModule php3_module modules/libphp3.so
ClearmoduleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
# AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_digest.c
AddModule mod_proxy.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_perl.c
AddModule mod_php3.c
Port 80
# Define the TCP port number used by the server
User nobody
Group nobody
# The above two lines are the file permissions assigned to new users of httpd. for security reasons
Their permissions are set to the lowest.
ServerAdmin root@weboa.com.cn
# Set the email address of the Web administrator
ServerName WebOA
# Defines the host name returned to the client when the client reads data from the server. its default value is
It is localhost. errors often occur during the first Linux installation.
DocumentRoot "/home/weboa/jakarta-tomcat/webapps/weboa"
# Set the root directory of all Apache documents, for example
Http://www.weboa.com.cn/index.html.
The response is/home/weboa/jakarta-tomcat/webapps/weboa/index.html.
  
Options FollowSymLinks
AllowOverride None
  
Options Indexes Includes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all # Allow all users to access
  
UserDir public_html
DirectoryIndex index.html index.htm index.shtml index. cgi
# Set multiple methods for successfully accessing the home page to improve system fault tolerance
AccessFileName. htaccess
  
Order allow, deny
Deny from all
  
UseCanonicalName On
TypesConfig/etc/mime. types
DefaultType text/plain
  
MIMEMagicFile share/magic
  
HostnameLookups Off
ErrorLog/usr/httpd/log/error_log
LogLevel warn
# Define which error types are recorded in the error log
LogFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined
# All logformats are used to define entries in logs.
LogFormat "% h % l % u % t \" % r \ "%> s % B" common
LogFormat "% {Referer} I-> % U" referer
LogFormat "% {User-agent} I" agent
CustomLog/usr/httpd/log/access_log common
ServerSignature On
Alias/icons/"/home/httpd/icons /"
# Define the correspondence between the VM directory and the system directory
  
Options Indexes MultiViews
AllowOverride None
Order allow, deny
Allow from all
  
ScriptAlias/cgi-bin/"/home/httpd/cgi-bin /"
# Define the CGI directory
  
AllowOverride None
Options ExecCGI
Order allow, deny
Allow from all
  
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text /*
AddIconByType (IMG,/icons/image2.gif) image /*
AddIconByType (SND,/icons/sound2.gif) audio /*
AddIconByType (VID,/icons/movie.gif) video /*
AddIcon/icons/binary.gif. bin. exe
AddIcon/icons/binhex.gif. hqx
AddIcon/icons/tar.gif. tar
AddIcon/icons/world2.gif. wrl .wrl.gz. FIG. vrm. iv
AddIcon/icons/compressed.gif. Z. z. tgz. gz. zip
AddIcon/icons/a.gif. ps. ai. eps
AddIcon/icons/layout.gif. html. shtml. htm. pdf
AddIcon/icons/text.gif. txt
AddIcon/icons/c.gif. c
AddIcon/icons/
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.