# cat ../conf/httpd.conf ?| grep -vE "^$|^#"ServerTokens OSServerRoot "/etc/httpd"PidFile run/httpd.pidTimeout 60KeepAlive OffMaxKeepAliveRequests 100KeepAliveTimeout 15<IfModule prefork.c>StartServers ??????8MinSpareServers ???5MaxSpareServers ??20ServerLimit ?????256MaxClients ??????256MaxRequestsPerChild ?4000</IfModule><IfModule worker.c>StartServers ????????4MaxClients ????????600MinSpareThreads ????25MaxSpareThreads ????75 ThreadsPerChild ????25MaxRequestsPerChild ?0</IfModule>Listen 80LoadModule auth_basic_module modules/mod_auth_basic.soLoadModule auth_digest_module modules/mod_auth_digest.soLoadModule authn_file_module modules/mod_authn_file.soLoadModule authn_alias_module modules/mod_authn_alias.soLoadModule authn_anon_module modules/mod_authn_anon.soLoadModule authn_dbm_module modules/mod_authn_dbm.soLoadModule authn_default_module modules/mod_authn_default.soLoadModule authz_host_module modules/mod_authz_host.soLoadModule authz_user_module modules/mod_authz_user.soLoadModule authz_owner_module modules/mod_authz_owner.soLoadModule authz_groupfile_module modules/mod_authz_groupfile.soLoadModule authz_dbm_module modules/mod_authz_dbm.soLoadModule authz_default_module modules/mod_authz_default.soLoadModule ldap_module modules/mod_ldap.soLoadModule authnz_ldap_module modules/mod_authnz_ldap.soLoadModule include_module modules/mod_include.soLoadModule log_config_module modules/mod_log_config.soLoadModule logio_module modules/mod_logio.soLoadModule env_module modules/mod_env.soLoadModule ext_filter_module modules/mod_ext_filter.soLoadModule mime_magic_module modules/mod_mime_magic.soLoadModule expires_module modules/mod_expires.soLoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soLoadModule usertrack_module modules/mod_usertrack.soLoadModule setenvif_module modules/mod_setenvif.soLoadModule mime_module modules/mod_mime.soLoadModule dav_module modules/mod_dav.soLoadModule status_module modules/mod_status.soLoadModule autoindex_module modules/mod_autoindex.soLoadModule info_module modules/mod_info.soLoadModule dav_fs_module modules/mod_dav_fs.soLoadModule vhost_alias_module modules/mod_vhost_alias.soLoadModule negotiation_module modules/mod_negotiation.soLoadModule dir_module modules/mod_dir.soLoadModule actions_module modules/mod_actions.soLoadModule speling_module modules/mod_speling.soLoadModule userdir_module modules/mod_userdir.soLoadModule alias_module modules/mod_alias.soLoadModule substitute_module modules/mod_substitute.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_ftp_module modules/mod_proxy_ftp.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule cache_module modules/mod_cache.soLoadModule suexec_module modules/mod_suexec.soLoadModule disk_cache_module modules/mod_disk_cache.soLoadModule cgi_module modules/mod_cgi.soLoadModule version_module modules/mod_version.soInclude conf.d/*.confUser apacheGroup apacheServerAdmin root@localhostServerName -UseCanonicalName OffDocumentRoot "/var/www/html"Header set Accept-Ranges bytes<Directory /> ???Options FollowSymLinks ???AllowOverride None</Directory><Directory "/var/www/html"> ???Options FollowSymLinks ???AllowOverride None ???Order allow,deny ???Allow from all</Directory><IfModule mod_userdir.c> ???# ???# UserDir is disabled by default since it can confirm the presence ???# of a username on the system (depending on home directory ???# permissions). ???# ???UserDir disabled ???# ???# To enable requests to /~user/ to serve the user‘s public_html ???# directory, remove the "UserDir disabled" line above, and uncomment ???# the following line instead: ???# ????#UserDir public_html</IfModule>DirectoryIndex index.html index.html.varAccessFileName .htaccess<Files ~ "^\.ht"> ???Order allow,deny ???Deny from all ???Satisfy All</Files>TypesConfig /etc/mime.typesDefaultType text/plain<IfModule mod_mime_magic.c> ???MIMEMagicFile conf/magic</IfModule>HostnameLookups OffErrorLog logs/error_logLogLevel warnLogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedLogFormat "%h %l %u %t \"%r\" %>s %b" commonLogFormat "%{Referer}i -> %U" refererLogFormat "%{User-agent}i" agentCustomLog logs/access_log combinedServerSignature OnAlias /icons/ "/var/www/icons/"<Directory "/var/www/icons"> ???Options Indexes MultiViews FollowSymLinks ???AllowOverride None ???Order allow,deny ???Allow from all</Directory><IfModule mod_dav_fs.c> ???# Location of the WebDAV lock database. ???DAVLockDB /var/lib/dav/lockdb</IfModule>ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"<Directory "/var/www/cgi-bin"> ???AllowOverride None ???Options None ???Order allow,deny ???Allow from all</Directory>IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzipAddIconByType (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 .exeAddIcon /icons/binhex.gif .hqxAddIcon /icons/tar.gif .tarAddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .ivAddIcon /icons/compressed.gif .Z .z .tgz .gz .zipAddIcon /icons/a.gif .ps .ai .epsAddIcon /icons/layout.gif .html .shtml .htm .pdfAddIcon /icons/text.gif .txtAddIcon /icons/c.gif .cAddIcon /icons/p.gif .pl .pyAddIcon /icons/f.gif .forAddIcon /icons/dvi.gif .dviAddIcon /icons/uuencoded.gif .uuAddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tclAddIcon /icons/tex.gif .texAddIcon /icons/bomb.gif coreAddIcon /icons/back.gif ..AddIcon /icons/hand.right.gif READMEAddIcon /icons/folder.gif ^^DIRECTORY^^AddIcon /icons/blank.gif ^^BLANKICON^^DefaultIcon /icons/unknown.gifReadmeName README.htmlHeaderName HEADER.htmlIndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,tAddLanguage ca .caAddLanguage cs .cz .csAddLanguage da .dkAddLanguage de .deAddLanguage el .elAddLanguage en .enAddLanguage eo .eoAddLanguage es .esAddLanguage et .etAddLanguage fr .frAddLanguage he .heAddLanguage hr .hrAddLanguage it .itAddLanguage ja .jaAddLanguage ko .koAddLanguage ltz .ltzAddLanguage nl .nlAddLanguage nn .nnAddLanguage no .noAddLanguage pl .poAddLanguage pt .ptAddLanguage pt-BR .pt-brAddLanguage ru .ruAddLanguage sv .svAddLanguage zh-CN .zh-cnAddLanguage zh-TW .zh-twLanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TWForceLanguagePriority Prefer FallbackAddDefaultCharset UTF-8AddType application/x-compress .ZAddType application/x-gzip .gz .tgzAddType application/x-x509-ca-cert .crtAddType application/x-pkcs7-crl ???.crlAddHandler type-map varAddType text/html .shtmlAddOutputFilter INCLUDES .shtmlAlias /error/ "/var/www/error/"<IfModule mod_negotiation.c><IfModule mod_include.c> ???<Directory "/var/www/error"> ???????AllowOverride None ???????Options IncludesNoExec ???????AddOutputFilter Includes html ???????AddHandler type-map var ???????Order allow,deny ???????Allow from all ???????LanguagePriority en es de fr ???????ForceLanguagePriority Prefer Fallback ???</Directory></IfModule></IfModule>BrowserMatch "Mozilla/2" nokeepaliveBrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0BrowserMatch "RealPlayer 4\.0" force-response-1.0BrowserMatch "Java/1\.0" force-response-1.0BrowserMatch "JDK/1\.0" force-response-1.0BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefullyBrowserMatch "MS FrontPage" redirect-carefullyBrowserMatch "^WebDrive" redirect-carefullyBrowserMatch "^WebDAVFS/1.[0123]" redirect-carefullyBrowserMatch "^gnome-vfs/1.0" redirect-carefullyBrowserMatch "^XML Spy" redirect-carefullyBrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully#虚拟主机的配置# cd /etc/httpd/conf.d# cat test1.abc.com.conf <VirtualHost *:80> ???????DocumentRoot /data/web/ ???????ServerName test1.abc.com ???????ErrorLog logs/test1.abc.com-error_log ???????CustomLog logs/test1.abc.com-access_log common</VirtualHost># cat test2.abc.com.conf <VirtualHost *:80> ???????DocumentRoot /data/web/ ???????ServerName test2.abc.com ???????ErrorLog logs/test2.abc.com-error_log ???????#RewriteEngine On ???????#RedirectMatch 301 ^tyl/(.+)$ http://aaa.test2.abc.com/$1 ???????CustomLog logs/test2.abc.com-access_log common ???????<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule ^/aaa/(.*) http://aaa.test2.abc.com/aaa/$1 [R=301,L]RewriteRule ^/bbb/(.*) http://bbb.test2.abc.com/bbb/$1 [R=301,L]RewriteRule ^/ccc/(.*) http://ccc.test2.abc.com/ccc/$1 [R=301,L] ???????</IfModule></VirtualHost>
[记录]一则HTTP配置文件参考记录
原文地址:https://www.cnblogs.com/wsjhk/p/8664189.html