Building a web server, a step-by-step instruction guide
Httpd.conf - linux
Listen 80ServerRoot / usr / local / apache2DocumentRoot / usr / local / webrootServerName localhost: 80ServerAdmin admin @ localhostServerSignature OnServerTokens FullDefaultType text / plainAddDefaultCharset ISO-8859-1UseCanonicalName OffHostnameLookups OffErrorLog logs / error_logLogLevel warnPidFile logs / httpd.pidTimeout 300KeepAlive OnMaxKeepAliveRequests 100KeepAliveTimeout 15User nobodyGroup nobody MaxClients 150 StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxRequestsPerChild 0 IfModule> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 IfModule> LoadModule access_module modules / mod_access.soLoadModule deflate_module modules / mod_deflate .soLoadModule log_config_module modules / mod_log_config.soLoadModule headers_module modules / mod_headers.soLoadModule setenvif_module modules / mod_setenvif.so LoadModule ssl_module modules / mod_ssl.so IfDefine> LoadModule mime_module modu les / mod_mime.soLoadModule status_module modules / mod_status.soLoadModule info_module modules / mod_info.soLoadModule dir_module modules / mod_dir.soLoadModule php4_module modules / libphp4.so AddOutputFilterByType DEFLATE text / html text / plain text / css Header append Vary User-Agent IfModule> IfModule> Location> Options FollowSymLinks AllowOverride None order allow, deny deny from all Directory> ORDER ALOW, DENY Allow from All Directory> logformat"% h% L% u% T / "% r /"
%> S% b / "% {Referer} i /" / "% {User-agent} i /" "combined CustomLog logs / access_log combined DeflateFilterNote Input instream DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '" % r "% {outstream} n /% {instream} n (% {ratio} n %%) 'deflate CustomLog logs / deflate_log deflate IfModule> IfModule> DirectoryIndex index.html index. php IfModule> TypesConfig conf / mime.types AddType application / x-tar .tgz AddType application / x-rar-compressed .rar AddType application / x-httpd-php. php AddType application / x-httpd-php-source .phps IfModule> IfModule> BrowserMatch "Mozilla / 2" nokeepalive BrowserMatch "MSIE 4 / .0b2;" nokeepalive downgrade-1.0 force-response -1.0 Browsermatch "RealPlayer 4 / .0" Force-response-1.0 Browsermatch "Java / 1 / .0" Force-Response-1.0 Browsermatch "JDK / 1 / .0" Force-response-1.0 Browsermatch "Microsoft Data Access in ternet Publishing Provider "redirect-carefully BrowserMatch" ^ WebDrive "redirect-carefully BrowserMatch" ^ WebDAVFS / 1. [012] "redirect-carefully BrowserMatch" ^ gnome-vfs "redirect-carefully BrowserMatch ^ Mozilla / 4 Gzip-only-text / html browsermatch ^ mozilla / 4 / .0 [678] no-gzip browsermatch / bmsie! no-gzip! gzip-only-text / html ifmodule> ifmodule> ExtendedStatus on setHandler Server-status Order Deny, Allow Deny from all allow from 37.0.0.1