【正文】
基于 Linux_nginx_反向代理服務(wù)器的應用研究 I 基于 Linux nginx 反向代理服務(wù)器的應用研究 摘 要 隨著 Web , Web服務(wù)器的訪問者數(shù)量快速增加。服務(wù)器的 CPU、 I/O處理能力很快成為企業(yè)業(yè)務(wù)增長的瓶頸,此時可以通過多臺服務(wù)器提供網(wǎng)絡(luò)服務(wù)解決問題。 反向代理服務(wù)器,提供一個既可以提高系統(tǒng)性能又可以解決后期的動態(tài)擴展的方案。反向代理服務(wù)器是相對于正向代理服務(wù)器而言的,反向代理的對象是服務(wù)器集群。通過反向代理服務(wù)器實現(xiàn)多臺服務(wù)器協(xié)作提供不同的服務(wù),但對于客戶端表現(xiàn)為一臺服務(wù)器。本設(shè)計采用 nginx實現(xiàn),主要是利用nginx 的高并發(fā)連接支持的特點,在中小型企業(yè)中是一個兼顧性能和成本的不錯選擇。 本文主要研究了在 Linux平臺下通過 nginx的反向代理功能來實現(xiàn)負載均衡的方法。通過在后端搭建多臺 Web 服務(wù)器實現(xiàn)負載均衡,通過搭建MySQL數(shù)據(jù)庫和 FTP服務(wù)器實現(xiàn)動、靜態(tài)和靜態(tài)附件的分離。 關(guān)鍵字 Nginx, 反向代理,負載均衡 ABSTRACT With the arrival of the era of Web ,the number of visitors of the Web server increases CPU and I/O processing power soon bees the bottleneck of enterprise business growth,now we can solve the problem through work services which offered by multiple servers. Reverse proxy server,providing a plan which can improve system 基于 Linux_nginx_反向代理服務(wù)器的應用研究 II performance and solve dynamic expansion for proxy server is relative to the proxy server,reverse proxy object is a server reverse proxy server realize multiple servers provides different services,but for client it acts as one design uses the nginx to realize, mainly using its characteristic of high concurrent connections ,it is a good choice for small and mediumsized enterprises between performance and cost . This paper mainly studied in the method of using nginx reverse proxy function to achieve load balancing on Linux building multiple Web servers backend realize load balancing,through constructing the MySQL database and FTP server realize static and dynamic and static attachment of separation. Key Words: Nginx Reverse proxy Load balancing 基于 Linux_nginx_反向代理服務(wù)器的應用研究 III 目 錄 1 緒論 ........................................................................................................................................ 1 課題研究的背景 ............................................................................................................ 1 課題研究的意義 ............................................................................................................ 1 2 系統(tǒng)實現(xiàn)的原理 ....................................................................................................................... 2 基于 Web 的分布式系統(tǒng) ................................................................................................. 2 Ubuntu Server LTS .............................................................................................. 2 nginx............................................................................................................................. 2 反向代理 ....................................................................................................................... 3 Discuz! X ...................................................................................................................... 3 XAMPP......................................................................................................................... 3 Apache ............................................................................................................... 4 MySQL............................................................................................................... 4 phpMyAdmin ...................................................................................................... 4 FileZilla .............................................................................................................. 4 ApacheBench ...................................................................................................... 4 3 系統(tǒng)的需求分析、可行性分析和總體設(shè)計 ................................................................................ 5 需求分析 ....................................................................................................................... 5 可行性分析 ................................................................................................................... 5 技術(shù)實現(xiàn)可行性分析 ........................................................................................... 6 經(jīng)濟可行性分析 .................................................................................................. 6 系統(tǒng)總體設(shè)計 ................................................................................................................ 6 負載均衡系統(tǒng)的拓撲圖