nginx安裝配置集成weblogic(20131107更新紅色背景內(nèi)容)_第1頁(yè)
nginx安裝配置集成weblogic(20131107更新紅色背景內(nèi)容)_第2頁(yè)
nginx安裝配置集成weblogic(20131107更新紅色背景內(nèi)容)_第3頁(yè)
nginx安裝配置集成weblogic(20131107更新紅色背景內(nèi)容)_第4頁(yè)
nginx安裝配置集成weblogic(20131107更新紅色背景內(nèi)容)_第5頁(yè)
已閱讀5頁(yè),還剩12頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

付費(fèi)下載

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、簡(jiǎn)介Nginx(發(fā)音同 engine x)是一款輕量級(jí)的Web 服務(wù)器/反向代理服務(wù)器及電子郵件(IMAP/POP3)代理服務(wù)器,并在一個(gè)BSD-like 協(xié)議下發(fā)行。由俄羅斯的程序設(shè)計(jì)師Igor Sysoev所開(kāi)發(fā),供俄國(guó)大型的入口網(wǎng)站及搜索引擎Rambler(俄文:)使用。其特點(diǎn)是占有內(nèi)存少,并發(fā)能力強(qiáng),事實(shí)上nginx的并發(fā)能力確實(shí)在同類型的網(wǎng)頁(yè)服務(wù)器中表現(xiàn)較好,中國(guó)大陸使用nginx網(wǎng)站用戶有:新浪、網(wǎng)易、 騰訊等。官網(wǎng):/cn/一、 yum配置1. 將光盤內(nèi)容拷貝到/mnt/redhat5.5目錄下 rootlocalhost redhat5.5# cp

2、 -fr /media/RHEL_5.5 x86_64 DVD/* /mnt/redhat5.5 #把光盤未見(jiàn)拷貝至root根目錄下的mnt文件下的redhat5.5中2. 檢查是否安裝createrepo(linux下的創(chuàng)建倉(cāng)庫(kù)的軟件包)rootlocalhost redhat5.5# rpm -qa |grep createrepo #如果裝了顯示版本號(hào);未裝則結(jié)果為空 1)安裝createreporootlocalhost redhat5.5# cd Server/rootlocalhost Server# pwd/mnt/redhat5.5/Serverrootlocalhost Se

3、rver# rpm -ivh ./createrepo-0.4.11-3.el5.noarch.rpmwarning: ./createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186Preparing. # 100% 1:createrepo # 100%rootlocalhost Server#檢查安裝結(jié)果rootlocalhost Server# rpm -qa |grep createrepocreaterepo-0.4.11-3.el53. 創(chuàng)建YUM倉(cāng)庫(kù)rootlocalhos

4、t Server# createrepo -g /mnt/redhat5.5/Server/repodata/comps-rhel5-server-core.xml /mnt/redhat5.5/Serverrootlocalhost Server# createrepo -g /mnt/redhat5.5/VT/repodata/comps-rhel5-vt.xml /mnt/redhat5.5/VT/rootlocalhost Server# createrepo -g /mnt/redhat5.5/Cluster/repodata/comps-rhel5-cluster.xml /mnt

5、/redhat5.5/Cluster/rootlocalhost Server#createrepo -g /mnt/redhat5.5/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /mnt/redhat5.5/ClusterStorage/4. 創(chuàng)建本地yum客戶端的repo文件rootlocalhost yum.repos.d# cd /etc/yum.repos.d/ rootlocalhost yum.repos.d# vi local.repo內(nèi)容如下:localname=hntlbaseurl=file:/mnt/redha

6、t5.5/Servergpgcheck=0enabled=1VTname=VTbaseurl=file:/mnt/redhat5.5/VTgpgcheck=0Clustername= Clusterbaseurl=file:/mnt/redhat5.5/Clustergpgcheck=0CSname= ClusterStoragebaseurl=file:/mnt/redhat5.5/ClusterStoragegpgcheck=05. Yum 安裝驗(yàn)證rootlocalhost yum.repos.d# yum install samba以下命令自己學(xué)習(xí)1.使用YUM查找軟件包命令:yum

7、search 2.列出所有可安裝的軟件包命令:yum list3.列出所有可更新的軟件包命令:yum list updates4.列出所有已安裝的軟件包命令:yum list installed5.列出所有已安裝但不在 Yum Repository 內(nèi)的軟件包命令:yum list extras6.列出所指定的軟件包命令:yum list 7.使用YUM獲取軟件包信息命令:yum info 8.列出所有軟件包的信息命令:yum info9.列出所有可更新的軟件包信息命令:yum info updates10.列出所有已安裝的軟件包信息命令:yum info installed11.列出所有已安

8、裝但不在 Yum Repository 內(nèi)的軟件包信息命令:yum info extras12.列出軟件包提供哪些文件命令:yum provides 六、清除YUM緩存yum會(huì)把下載的軟件包和header存儲(chǔ)在cache中,而不會(huì)自動(dòng)刪除。如果我們覺(jué)得它們占用了磁盤空間,可以使用yum clean指令進(jìn)行清除,更精確的用法是yum clean headers清除header,yum clean packages清除下載的rpm包,yum clean all一股腦兒端1.清除緩存目錄(/var/cache/yum)下的軟件包命令:yum clean packages2.清除緩存目錄(/var/c

9、ache/yum)下的 headers命令:yum clean headers3.清除緩存目錄(/var/cache/yum)下舊的 headers命令:yum clean oldheaders4.清除緩存目錄(/var/cache/yum)下的軟件包及舊的headers命令:yum clean, yum clean all (= yum clean packages; yum clean oldheaders)二、 nginx 安裝nginx安裝依賴pcre、zlib兩個(gè)包,安裝包的版本為:nginx-1.2.8(統(tǒng)一安裝最新版本的nginx即1.4.3版本)、pcre-8.30、zlib-

10、1.2.7下載地址分別為:/en/download.htmlftp:/ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 1. 選定源碼目錄可以是任何目錄,本文選定的是/usr/local/src,將上述安裝包上傳至/usr/local/src文件夾下。rootlocalhost src# cd /usr/local/srcrootlocalhost src# pwd/usr/local/src2. 安裝PCRE庫(kù)使用下面命令下載編譯和安裝 PCRE 包:rootlocalhost src# tar -zxvf pcr

11、e-8.30.tar.gzpcre-8.30/pcre-8.30/doc/pcre-8.30/doc/html/pcre-8.30/doc/html/pcre16.htmlpcre-8.30/doc/html/pcre_assign_jit_stack.htmlpcre-8.30/doc/html/pcre.htmlpcre-8.30/doc/html/pcreperform.htmlpcre-8.30/doc/html/pcrepartial.htmlpcre-8.30/doc/html/pcreunicode.html.rootlocalhost src# cd pcre-8.30root

12、localhost pcre-8.30# ./configurerootlocalhost pcre-8.30# makerootlocalhost pcre-8.30# make install輸出結(jié)果的后幾行如下,注意輸出過(guò)程是否報(bào)錯(cuò).make3: Leaving directory /usr/local/src/pcre-8.30'make2: Leaving directory /usr/local/src/pcre-8.30'make1: Leaving directory /usr/local/src/pcre-8.30'3. 安裝zlib庫(kù)使用下面命令下載

13、編譯和安裝 zlib包:rootlocalhost src# cd /usr/local/srcrootlocalhost src# tar -zxvf zlib-1.2.7.tar.gzrootlocalhost src# cd zlib-1.2.7rootlocalhost zlib-1.2.7# ./configurerootlocalhost zlib-1.2.7# pwd/usr/local/src/zlib-1.2.7rootlocalhost zlib-1.2.7# ./configurerootlocalhost zlib-1.2.7# makerootlocalhost zl

14、ib-1.2.7# make install輸出結(jié)果的后幾行如下,注意輸出過(guò)程是否報(bào)錯(cuò).chmod 644 /usr/local/share/man/man3/zlib.3cp zlib.pc /usr/local/lib/pkgconfigchmod 644 /usr/local/lib/pkgconfig/zlib.pccp zlib.h zconf.h /usr/local/includechmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h4. 安裝ssl(某些vps默認(rèn)沒(méi)裝ssl,需要手動(dòng)安裝,或者按照下面附錄1.

15、2的方法)Openssl openssl-develrootlocalhost nginx-1.2.8# yum -y install openssl openssl-devel5. 安裝nginxNginx 一般有兩個(gè)版本,分別是穩(wěn)定版和開(kāi)發(fā)版,可以根據(jù)您的目的來(lái)選擇這兩個(gè)版本的其中一個(gè),下面是把 Nginx 安裝到 /usr/local/nginx 目錄下的詳細(xì)步驟:rootlocalhost src# tar -zxvf nginx-1.2.8.tar.gzrootlocalhost src# cd nginx-1.2.8rootlocalhost nginx-1.2.8# ./conf

16、igure -sbin-path=/usr/local/nginx/nginx -conf-path=/usr/local/nginx/nginx.conf -pid-path=/usr/local/nginx/nginx.pid -with-http_ssl_module -with-pcre=/usr/local/src/pcre-8.30 -with-zlib=/usr/local/src/zlib-1.2.7運(yùn)行結(jié)果最后幾行如下,注意過(guò)程是否報(bào)錯(cuò).Configuration summary + using PCRE library: /usr/local/src/pcre-8.30 +

17、 using system OpenSSL library + md5: using OpenSSL library + sha1: using OpenSSL library + using zlib library: /usr/local/src/zlib-1.2.7 nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/nginx" nginx configuration prefix: "/usr/local/nginx" ngin

18、x configuration file: "/usr/local/nginx/nginx.conf" nginx pid file: "/usr/local/nginx/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary fil

19、es: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"rootlocalhost nginx-1.2.8# make objs/s

20、rc/http/modules/ngx_http_upstream_least_conn_module.o objs/src/http/modules/ngx_http_upstream_keepalive_module.o objs/ngx_modules.o -lpthread -lcrypt /usr/local/src/pcre-8.30/.libs/libpcre.a -lssl -lcrypto -ldl /usr/local/src/zlib-1.2.7/libz.amake1: Leaving directory /usr/local/src/nginx-1.2.8'm

21、ake -f objs/Makefile manpagemake1: Entering directory /usr/local/src/nginx-1.2.8'sed -e "s|%PREFIX%|/usr/local/nginx|" -e "s|%PID_PATH%|/usr/local/nginx/nginx.pid|" -e "s|%CONF_PATH%|/usr/local/nginx/nginx.conf|" -e "s|%ERROR_LOG_PATH%|/usr/local/nginx/logs/err

22、or.log|" < man/nginx.8 > objs/nginx.8make1: Leaving directory /usr/local/src/nginx-1.2.8'rootlocalhost nginx# make install6. 服務(wù)啟停啟動(dòng) rootlocalhost nginx# cd /usr/local/nginx/ rootlocalhost nginx#./nginx 停止 rootlocalhost nginx# cd /usr/local/nginx/rootlocalhost nginx#./nginx -s stop 重新啟

23、動(dòng) rootlocalhost nginx# cd /usr/local/nginx/rootlocalhost nginx#./nginx s reload 查看狀態(tài)rootlocalhost nginx# ps -ef|grep nginxroot 7425 1 0 13:38 ? 00:00:00 nginx: master process ./nginxnobody 7460 7425 0 13:42 ? 00:00:00 nginx: worker processnobody 7461 7425 0 13:42 ? 00:00:00 nginx: worker processnobo

24、dy 7462 7425 0 13:42 ? 00:00:00 nginx: worker processnobody 7463 7425 0 13:42 ? 00:00:00 nginx: worker processroot 7465 4683 0 13:42 pts/1 00:00:00 grep nginx7. 安裝成功驗(yàn)證默認(rèn)端口為80,在IE中輸入服務(wù)IP地址,頁(yè)面顯示如下圖,表明安裝成功8. Nginx配置(修改nginx.conf中的 配置如下,然后上傳至/usr/local/nginx目錄下即可)user root;worker_processes 10;#error_log

25、 logs/error.log;error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;worker_rlimit_nofile 65535;events worker_connections 65535;http include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user $time_local "$request&q

26、uot; ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"' #access_log logs/access.log main; sendfile on; server_names_hash_bucket_size 128; server_tokens off; client_header_buffer_size 32k; large_client_heade

27、r_buffers 4 32k; client_max_body_size 16m; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; fastcgi_

28、intercept_errors on; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; server listen 80; server_name 31; default_type 'text/html' charset utf-8; #acces

29、s_log logs/host.access.log main; location / root /weblogic/apps/cms; index /publish/html/main/index.html; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size

30、 64k; proxy_temp_file_write_size 64k; location /.*.(jsp|do) proxy_pass 31:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k

31、; proxy_temp_file_write_size 64k; proxy_max_temp_file_size 512m; location /(WEB-INF)/ deny all; #error_page 404 # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /404.html; location = /404.html root html; # proxy the PHP scripts to Apache listening on :

32、80 # #location .php$ # proxy_pass ; # # pass the PHP scripts to FastCGI server listening on :9000 # #location .php$ # root html; # fastcgi_pass :9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #

33、 # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # # another virtual host using mix of IP-, name-, and port-based configuration # #server # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / # root html; # inde

34、x index.html index.htm; # # # HTTPS server # #server # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location /

35、# root html; # index index.html index.htm; # # 檢查配置結(jié)果有無(wú)錯(cuò)誤rootlocalhost nginx# cd /usr/local/nginx/rootlocalhost nginx# ./nginx -t -c ./nginx.confnginx: the configuration file /usr/local/nginx/./nginx.conf syntax is oknginx: configuration file /usr/local/nginx/./nginx.conf test is successful 重新啟動(dòng) roo

36、tlocalhost nginx# cd /usr/local/nginx/rootlocalhost nginx#./nginx s reload測(cè)試配置結(jié)果:http:/ 30/(如果發(fā)生頁(yè)面亂碼的情況,先清除瀏覽器的緩存,再重新訪問(wèn))正常顯示結(jié)果為網(wǎng)站首頁(yè)地址測(cè)試集成結(jié)果:30/test_license_info.jsp顯示結(jié)果為license信息9. 升級(jí)查看服務(wù)狀態(tài)及進(jìn)程rootlocalhost local# ps -ef|grep nginxroot 7425 1 0 13:38 ? 00:00:00 nginx: ma

37、ster process ./nginxroot 8083 7425 0 14:47 ? 00:00:00 nginx: worker processroot 8084 7425 0 14:47 ? 00:00:00 nginx: worker processroot 8085 7425 0 14:47 ? 00:00:00 nginx: worker processroot 8086 7425 0 14:47 ? 00:00:00 nginx: worker processroot 8512 4683 0 15:36 pts/1 00:00:00 grep nginx查看原始版本rootlo

38、calhost local# nginx/nginx -Vnginx version: nginx/1.2.8built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)TLS SNI support disabledconfigure arguments: -sbin-path=/usr/local/nginx/nginx -conf-path=/usr/local/nginx/nginx.conf -pid-path=/usr/local/nginx/nginx.pid -with-http_ssl_module -with-pcre=/usr/local/

39、src/pcre-8.30 -with-zlib=/usr/local/src/zlib-1.2.7上傳新版本至/usr/local目錄,解壓編譯rootlocalhost local# tar -zxvf nginx-1.4.3.tar.gzrootlocalhost local# cd nginx-1.4.3rootlocalhost nginx-1.4.3# ./configure -sbin-path=/usr/local/nginx/nginx -conf-path=/usr/local/nginx/nginx.conf -pid-path=/usr/local/nginx/ngin

40、x.pid -with-http_ssl_module -with-pcre=/usr/local/src/pcre-8.30 -with-zlib=/usr/local/src/zlib-1.2.7Configuration summary + using PCRE library: /usr/local/src/pcre-8.30 + using system OpenSSL library + md5: using OpenSSL library + sha1: using OpenSSL library + using zlib library: /usr/local/src/zlib

41、-1.2.7 nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/nginx" nginx configuration prefix: "/usr/local/nginx" nginx configuration file: "/usr/local/nginx/nginx.conf" nginx pid file: "/usr/local/nginx/nginx.pid" nginx error l

42、og file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: &quo

43、t;fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"rootlocalhost nginx-1.4.3# make.objs/ngx_modules.o -lpthread -lcrypt /usr/local/src/pcre-8.30/.libs/libpcre.a -lssl -lcrypto -ldl /usr/local/src/zlib-1.2.7/libz.amake1:

44、 Leaving directory /usr/local/nginx-1.4.3'make -f objs/Makefile manpagemake1: Entering directory /usr/local/nginx-1.4.3'sed -e "s|%PREFIX%|/usr/local/nginx|" -e "s|%PID_PATH%|/usr/local/nginx/nginx.pid|" -e "s|%CONF_PATH%|/usr/local/nginx/nginx.conf|" -e "s

45、|%ERROR_LOG_PATH%|/usr/local/nginx/logs/error.log|" < man/nginx.8 > objs/nginx.8make1: Leaving directory /usr/local/nginx-1.4.3'注意:此時(shí)一定不要make installrootlocalhost nginx-1.4.3# mv /usr/local/nginx/nginx /usr/local/nginx/nginx1103rootlocalhost nginx-1.4.3# cp objs/nginx /usr/local/nginx/nginxrootlocalhost nginx-1.4.3# cd ./nginx回原目錄執(zhí)行升級(jí)rootlocalhost nginx# cd /usr/local/nginx-1.4.3rootlocalhost nginx-1.4.3# make up

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論