Build basic WEB Servers
1. Extract
A. Tar zxvf httpd-2.2.9.tar.gz-C/usr/src
B) Cd/user/src/httpd-2.2.9
2. Configure compilation options
A)./configure -- prefix =/usr/local/httpd -- enable-so -- enable-rewrite -- enable-charset-lite
-- Enable-cgi
B)--enble-so: function of loading dynamic modules
C)-enble-rewrite web page Function
3. Compile and install the server program
A) Make & makeinstall
Httpd service directory structure
1. subdirectory list
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0534564062-0.jpg "title =" 1.jpg" alt = "172005352.jpg"/>
2. Execution programs included in the Httpd server
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345B2Z-1.jpg "title =" 2.jpg" alt = "172020785.jpg"/>
3. Configuration File
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0534562622-2.jpg "title =" 3.jpg" alt = "172032752.jpg"/>
4. webpage root directory
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345AZ1-3.jpg "title =" 4.jpg" alt = "172044107.jpg"/>
Optimized execution path
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345B550-4.jpg "style =" float: none; "title =" 5.jpg" alt = "172115483.jpg"/>
650) this. width = 650; "src =" http://img1.51cto.com/attachment/201309/172118756.jpg "style =" float: none; "title =" 6.jpg" alt = "172118756.jpg"/>
View httpd version information
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345B455-6.jpg "title =" 7.jpg" alt = "172148536.jpg"/>
Add httpd System Service
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345A4a-7.jpg "style =" float: none; "title =" 8.jpg" alt = "172217211.jpg"/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345C008-8.jpg "style =" float: none; "title =" 9.jpg" alt = "172217946.jpg"/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345Bc9-9.jpg "style =" float: none; "title =" 10.jpg" alt = "172217188.jpg"/>
Build basic web Servers
1. modify the configuration file
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345B951-10.jpg "style =" float: none; "title =" 11.jpg" alt = "1722520.8.jpg"/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345AK5-11.jpg "style =" float: none; "title =" 12.jpg" alt = "1722520.4.jpg"/>
2. Check the syntax of the httpd. conf file.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0534561228-12.jpg "title =" 13.jpg" alt = "172327320.jpg"/>
3. Start the httpd service
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345C229-13.jpg "title =" 14.jpg" alt = "172345776.jpg"/>
4. View service status
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345B196-14.jpg "title =" 15.jpg" alt = "17240341_jpg"/>
5. view the web site access status: log records
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/05345A221-15.jpg "title =" 16.jpg" alt = "172423894.jpg"/>
6. Check the error log file to troubleshoot the problem.
Httpd. confGlobal configuration in
1. ServerRoot "/usr/local/httpd" // set the server root directory
2. Listen 80 // port number
3. User // set the User who runs Httpd
4. Group // the Group that runs httpd
5. ServerAdmin // administrator email
6. ServerName ww.benet.com // The complete host name of the web site
7. DocumentRoot "/usr/local/httpd/htdocs" // webpage root directory
8. DirectoryIndex index.html // Home Page
9. ErrorLog Error Log
10. LogLevel Log Level
11. mlog log format
12. PidFile: Save the service process number
13. Timeout
14. keepAlive connection persistence
15. MaxKeepAliveRequests maximum number of files connected to each connection
16. KeepAliveTimeout connection timeout seconds
17. Special Features of Include
Region settings
1. <Directory> Directory Area
2. <VirtualHost> Virtual Host
Test httpd server performance
1. AB-q-c concurrent requests-n total requests http: // Domain Name: Port/path
A)-q does not display the process
Use the ulimit command to modify the maximum number of files
1. Ulimit-a | grep "open files" to view the maximum number of opened files
2. Ulimit-n 10000 modify the maximum number of opened files
Restrict Access Control of client addresses
Write Control for this region in the <Directory> Directory area of the httpd. conf file
1. Order allow, deny first allowed and then refused
2. Order deny, allow deny first and then allow
A) For example:
I. Order allow, deny
Allow from all Allow all
Order deny, allow
Deny from benet.com.cn
Deny from 192.168.1.1 does not allow access from users in the benet.com.cn domain and 192.168.1.1