Apache master configuration file (configuration explanation)

xiaoxiao2021-03-06  55

Apache provides a variety of features for network administrators, including directory index, directory alias, content negotiation, configurable HTTP error report, CGI program's setuid execution, child process resource management, server-side image map, rewrite URL, URL spell check and online manual MAN, etc. That is, if you have successfully installed Apache on Linux Server, your computer will also turn around with Apache, becoming a veritable web server, which is indeed exciting. In the Internet era, the release of the external homepage has become an important means of establishing the company's image, and the internal home page has become the main way of company management. However, if you want to implement these features, you should first configure our Linux Server to become a powerful web server. This chapter will detail how to configure the APACHE server. I hope that all the colleagues can achieve the purpose of reading this film to reach the theoretical practice, and quickly become an excellent network administrator in a short period of time.

1.2 Required Resources 1.2.1 Required Package RedHat 6.2 Server Installation 1.2.2 Required Profile / Etc/httpd/conf/httpd.conf system comes with, administrator configuration /etc/httpd/conf/access.conf system Bette, no need to modify the /etc/httpd/conf/srm.conf system, no need to modify 1.3 configuration scenario /etc/httpd/conf/httpd.conf Description: Apache master configuration file source file: Servertype Standalone # Defines Web Server The start-up mode is Standalone to enhance its timely response ServerRoot "/ etc / httpd" on a large number of access to the directory containing the HTTPD server file LockFile /Var/lock/httpd.lock pidfile /var/run/httpd.pid scoreboardFile /var/run/httpd.scoreboard Timeout 300 # Response Timeout, Units for Second Keepalive ON # Allow users to create permanent connection MaxkeePaliveRequests 100 KeepaliveTimeout 15 minSpareServers 5 # To be retained Free server process Minimum MaxSpareServers 20 # To reserve free servers The maximum value of the process STARTSERVERS 8 # system starts the maximum client number that MaxClients 150 # can serve the service.

Greater than its part is 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 LoadModul e 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_refere.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_P3.C Port 80 # Declining the TCP port number User Nobody Group Nobody # above two lines allocated to the new user of HTTPD, for security considerations Set their permissions It is the lowest. ServerAdmin root@weboa.com.cn # Setting Web Administrator's Mail Address ServerName Weboa # Defines the host name to the client from the server from the server, the default is localhost, often installing Linux, often Here is wrong here. Documentroot "/ home / weboa / jakarta-tomcat / webapps / weboa" sets the root directory of all Apache documents, for example, users have access requests for http://www.weboa.com.cn/index.html, Apache its 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 everyone access to UserDir public_html DirectoryIndex index.html index. htm index.shtml index.cgi # successfully set up a variety of ways to access the home page, in order to improve the system's fault tolerance AccessFileName .htaccess order allow, deny deny from all UseCanonicalName On TypesConfig /etc/mime.types DefaultType text / plain MIMEMagicFile share / MAGIC HOSTNAMELOKUPS OFF ERRORLOG / USR / HTTPD / LOG / ERROR_LOG Loglevel Warn # Defines those error types to log log log log log log logs "% h% L% u% T /"% r / "%> s% b /"% {RE

FERER} I / "/"% {user-agent} i / "" Combined # All logformats are used to define entry logformat "% h% l% u% t /"% r / "%> s% in the log B "common logformat"% {referer} i ->% u "referer logformat"% {user-agent} i "agent customlog / usr / httpd / log / access_log common serversignature on alias / icons /" / home / home / home / icons / "correspondence between Options # define virtual host directory and system directory Indexes MultiViews AllowOverride None Order allow, deny Allow from all ScriptAlias ​​/ cgi-bin /" / home / httpd / cgi-bin / "# define 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 adricon/icons/world2.gif .wrl .wrl.gz .vrml .vrm .g 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 / p .gif.pl .py addicon /icons/f.gif .for addicon /icons/dvi.gif .dvi addicon /icons/uuencoded.gif .uu addicon /icons/script.gif .conf .sh .shar .csh .ksh .tcl addicon /icons/tex.gif .tex addicon /icons/bomb.gif core addicon /icons/back.gif .. addicon /icons/hand.right.gif readme addicon /icons/folder.gif ^^ Directory ^^ AddIcon /icons/blank.gif ^^ BLANKICON ^^ DefaultIcon /icons/unknown.gif ReadmeName README HeaderName HEADER AddEncoding x-compress Z AddEncoding x-gzip gz tgz AddLanguage en .en AddLanguage fr .fr AddLanguage de

.de AddLanguage da .da AddLanguage el .el AddLanguage it .it LanguagePriority en fr de AddType application / x-httpd-php3 .php3 AddType application / x-httpd-php3-source .phps AddType application / x-httpd-php .phtml AddType application / x-tar .tgz AddType text / html .shtml AddHandler server-parsed .shtml AddHandler imap-file map BrowserMatch "RealPlayer 4 / .0" force-response-1.0 BrowserMatch "Java / 1 / .0" force-response -1.0 Browsermatch "JDK / 1 / .0" Force-Response-1.0 Alias ​​/ Perl / / Home / HTTPD / Perl / SetHandler Perl-Script Perlhandler Apache :: Registry Options Execcgi Alias ​​/ Doc / / USR / DOC / Order Deny , allow deny from all allow from localhost Options Indexes FollowSymLinks include /etc/httpd/conf/tomcat-apache.conf Alias ​​/ netcard "/ home / weboa / jakarta-tomcat / webapps / weboa / net_card" Options Indexes FollowSymLinks allow from all CacheSize 5 # Define the cache area size, in KB. You can check the cachegcinterval 4 # every 4 hours according to the needs and hard disk space size, if you have exceeded Cachesize, delete file cacheMaxExpire 24 #http files Most 24 hours CacheLastModifiedFactor 0.1 # Defines the HTTP file failure period, the default is 0.1 It means that the failure period = the time X of the last revision, such as 5 hours from the last revised time, then the expiration date is 5x0.1 = 0.5 hours CacheDefaultExpire 1 # This instruction provides a default time (hours) ) To destroy the cache file, the last change time of these files is unknown. The cachemaxexpire command does not overwrite this setting ## How is the method of logging in to a directory ## Add the following in /etc/httpd/conf/httpd.conf: Alias ​​/ WEBOA / "/ Home / Weboa /" Options establish .htaccess file Indexes MultiViews AllowOverride authconfig Order allow, deny Allow from all in / home / weboa directory authname "shared files" authtype basic authuserfile / etc / httpd / conf / passwd require valid-user in / etc / httpd / conf directory Run the command to generate a authentication file htpasswd -c thj THJ # Create a authentication file and the first name and password htpasswd Weboa Weboa #

转载请注明原文地址:https://www.9cbs.com/read-113412.html

New Post(0)