<version> <status> <reason-phrase>
7. HTTP Status Code
①1xx: Pure information Class
②2xx: Information on "Success" Class (201, 202)
③3xx: Redirect class information (301, 302, 304)
④4xx: Information for the client error class (404)
⑤5xx: Server-side error class information
8, the main operation of the Web server
① Establishing a connection--accepting or rejecting a client connection request
② receiving requests-Read HTTP request messages over the network
③ Processing Request--parsing the request message and making the corresponding action
④ Access Resources-resources related to access request messages
⑤ Build Response-generates an HTTP response message with the correct header
⑥ Send response-sends a generated response message to the client
⑦ Logging--When a completed HTTP transaction is logged into the log file
9, http/1.1
Enhanced caching capabilities
Long connection: keep-alive
10, Mpm:multi-processing Modules
①mpm_winnt:windowsnt Dedicated
②prefork ( One request responds with one process, starting multiple processes)
<IfModule prefork.c>StartServers 8 # The number of httpd processes started at the start of the service minspareservers 5 The minimum number of idle processes maintained during the operation of the # service maxspareservers 20 The maximum number of idle processes maintained during the operation of the # service serverlimit 256 # Specify maxclients Upper Limit maxclients 256 # The maximum number of concurrent requests that a service is allowed to request connections during the run maxrequestsperchild 4000  The maximum number of user requests per process allowed to be processed by the; # service during the run </IfModule>
③worker (one request responds with one thread, (starting multiple processes, generating multiple threads per process))
<ifmodule Worker.c>startservers 4 # Number of httpd processes started at service startup MaxClients 300 # The maximum number of users allowed to request connections during service run Minsparethreads 25 # The minimum number of idle threads maintained during the service run Maxsparethreads 75 # The maximum number of idle threads maintained during the service run Threadsperchild 25 # The number of threads generated per process Maxrequestsperchild 0 # The maximum number of user requests per process allowed (0, because threads are processing user requests, not processes) </IfModule>
④event (one process handles multiple requests)
11, httpd
-V: View httpd service version and compiled parameters
-L: Displays a list of modules compiled into httpd, but does not show dynamic modules loaded with Loadmodules
-M: Displays the loaded static and dynamic modules
-T: Check configuration file for syntax errors
12. User-or group-based access control
(1), allowing users to access
allowoverride authconfigauthtype basicauthname "Personal area ..." AuthUserFile "/etc/httpd/conf/.htpasswd" Require Valid-usertouch/etc/httpd/conf/.htpasswdhtpasswd-c-m/etc/httpd/conf/.htpasswd tomhtpasswd-m/etc/httpd/conf/. HTPASSWD Hadoop
(2), allow user groups to access
allowoverride authconfigauthtype basicauthname "Personal area ..." AuthUserFile "/etc/httpd/conf/.htpasswd" AuthGroupFile "/etc/httpd/conf/.htgroup" Require Group groupnametouch/etc/httpd/conf/.htpasswdtouch/etc/httpd/conf /.htgrouphtpasswd-c-m/etc/httpd/conf/.htpasswd tomhtpasswd-m/etc/httpd/conf/.htpasswd hadoop/etc/httpd/conf/. Htgroup format: Groupname:user1 user2 ...
13. IP-based access control
AllowOverride Noneorder Deny,allowdeny from 172.16.1.100 address representation method ip:172.16.1.110network/netmask:172.16.1.110/ 16host:www.soysauce.com domain name:soysauce.comPartial ip:172.16 (172.16.0.0/16)
14. User's personal home directory site
Note Userdir disabled enable Userdir Public_htmluseradd hadoopsu-hadoopmkdir Public_htmlecho "Hadoop's personal site" >> Public_html/index.htmlchmod O+x/home/hadoopexitservice httpd Restart
15, PV and UV
PV (page View): Number of pages visited per day
UV (User View): Independent IP traffic per day
16. Path aliases
Alias/url "Local_path" for example: alias/images/"/tmp/test" http://172.16.1.102/images/is equivalent to accessing the document under the Tmp/test directory
17. Virtual Host Configuration
(1), IP-based virtual host configuration
<VirtualHost 172.16.1.110:80> ServerName www.a.com DocumentRoot "/data/www/a.com" CustomLog "/var/log/httpd/a.com/access_ Log " ErrorLog "/var/log/httpd/a.com/error_log " < directory "/data/www/a.com" > Options none AllowOverride none Order Deny,Allow Allow From all </Directory></VirtualHost><VirtualHost 172.16.1.111:80> ServerName www.b.net DocumentRoot "/data/www/b.net" CustomLog "/var/log/httpd/b.net/access_log" ErrorLog "/var/log/ Httpd/b.net/error_log " <directory "/data/www/b.net" > Options none allowoverride none Order Deny,Allow Allow From All </directory></virtualhost>
(2), Port-based virtual host configuration
<VirtualHost 172.16.1.110:80> ServerName www.a.com DocumentRoot "/data/www/a.com" CustomLog "/var/log/httpd/a.com/access_ Log " ErrorLog "/var/log/httpd/a.com/error_log " < directory "/data/www/a.com" > Options none AllowOverride none Order Deny,Allow Allow From all </Directory></VirtualHost><VirtualHost 172.16.1.110:8080> ServerName www.c.edu DocumentRoot "/data/www/c.edu" CustomLog "/var/log/httpd/c.edu/access_log" ErrorLog "/var/log/ Httpd/c.edu/error_log " <directory "/data/www/c.edu" > Options none allowoverride none Order Deny,Allow Allow From All </directory></virtualhost>
(3), hostname-based virtual host configuration
DNS resolution correctly resolves two host names to their IP addresses/etc/hosts172.16.1.103 www.b.net172.16.1.103 www.d.org NameVirtualHost 172.16.1.111:80<VirtualHost 172.16.1.111:80> ServerName www.b.net DocumentRoot "/data/www/b.net" CustomLog "/var/log/httpd/b.net/access_log" ErrorLog "/var/log/ Httpd/b.net/error_log " <Directory "/data/www/b.net "> Options none AllowOverride none order deny,allow Allow From all </Directory></VirtualHost>< virtualhost 172.16.1.111:80> servername www.d.org documentroot "/data/wwW/d.org " CustomLog "/var/log/httpd/d.org/access_log " errorlog "/var/log/httpd/d.org/error_log" <Directory "/data/www/d.org" > Options none AllowOverride none Order Deny,Allow allow from all </directory></ Virtualhost>
18. Default Virtual Host Configuration
<virtualhost _default_:80>documentroot/www/default80# ... </virtualhost><virtualhost _default_:* >documentroot/www/default# ...</virtualhost>
19. Server-status Configuration
<Loacation/server-status> SetHandler server-status Order Deny,allow deny from all to 172.16.1.1 02</location><location> directives for defining url<directory> directives for local file system paths
20. CGI Scripts
Modify Master Profile httpd.conf enable LoadModule cgi_module modules/mod_cgi.so scriptalias/cgi-bin/"/var/www/cgi-bin/" in/var/www/ Create a script under the Cgi-bin directory Test#!/bin/bashcat << eofcontent-type:text/html<pre>
21. How Apache and PHP are combined
①cgi
②module
③fastcgi
This article is from the "Hello,linux" blog, make sure to keep this source http://soysauce93.blog.51cto.com/7589461/1725316
Linux Web Services and HTTP protocol basic concepts