服務(wù)器
linux 6下安裝編譯安裝nginx的步驟
前言:
nginx是一個高性能的http和反向代理服務(wù)器,也是一個imap/pop3/smtp服務(wù)器。在高連接并發(fā)的情況下,nginx是apache服務(wù)器不錯的替代品:nginx在美國是做虛擬主機生意的老板們經(jīng)常選擇的軟件平臺之一。能夠支持高達(dá)50,000個并發(fā)連接數(shù)的響應(yīng),而且內(nèi)存開銷極小。這也是nginx廣受歡迎的重要原因。本文演示了基于linux 6下編譯安裝nginx,供大家參考。
一、安裝環(huán)境
# cat /etc/issuered hat enterprise linux server release 6.3 (santiago)kernel \\\\r on an \\\\m# nginx -vnginx version: nginx/1.8.0二、配置安裝環(huán)境
###為簡化安裝及配置,此處關(guān)閉了防火墻,生產(chǎn)環(huán)境建議開啟# service iptables stop# chkconfig iptables off# vi /etc/selinux/config selinux=disabled###創(chuàng)建用戶及組#groupadd -r nginx#useradd -s /sbin/nologin -g nginx -r nginx###安裝環(huán)境依賴包 http://nginx.org/en/linux_packages.html# yum install pcre-devel zlib-devel openssl openssl-devel gcc gcc-c 三、編譯及安裝nginx
# cd /tmp/# tar -xvf nginx-1.8.0.tar.gz# cd /nginx-1.8.0# ./configure \\\\--prefix=/etc/nginx \\\\--sbin-path=/usr/sbin/nginx \\\\--conf-path=/etc/nginx/nginx.conf \\\\--error-log-path=/var/log/nginx/error.log \\\\--http-log-path=/var/log/nginx/access.log \\\\--pid-path=/var/run/nginx.pid \\\\--lock-path=/var/run/nginx.lock \\\\--http-client-body-temp-path=/var/cache/nginx/client_temp \\\\--http-proxy-temp-path=/var/cache/nginx/proxy_temp \\\\--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \\\\--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \\\\--http-scgi-temp-path=/var/cache/nginx/scgi_temp \\\\--user=nginx \\\\--group=nginx \\\\--with-http_ssl_module \\\\--with-http_realip_module \\\\--with-http_addition_module \\\\--with-http_sub_module \\\\--with-http_dav_module \\\\--with-http_flv_module \\\\--with-http_mp4_module \\\\--with-http_gunzip_module \\\\--with-http_gzip_static_module \\\\--with-http_random_index_module \\\\--with-http_secure_link_module \\\\--with-http_stub_status_module \\\\--with-http_auth_request_module \\\\--with-mail \\\\--with-mail_ssl_module \\\\--with-file-aio \\\\--with-http_spdy_module \\\\--with-ipv6 configuration summary using system pcre library using system openssl library md5: using openssl library sha1: using openssl library using system zlib library nginx path prefix: /etc/nginx nginx binary file: /usr/sbin/nginx nginx configuration prefix: /etc/nginx nginx configuration file: /etc/nginx/nginx.conf nginx pid file: /var/run/nginx.pid nginx error log file: /var/log/nginx/error.log nginx http access log file: /var/log/nginx/access.log nginx http client request body temporary files: /var/cache/nginx/client_temp nginx http proxy temporary files: /var/cache/nginx/proxy_temp nginx http fastcgi temporary files: /var/cache/nginx/fastcgi_temp nginx http uwsgi temporary files: /var/cache/nginx/uwsgi_temp nginx http scgi temporary files: /var/cache/nginx/scgi_temp###如果apache httpd服務(wù)啟動,建議先停止或更改端口號# service httpd stop# mkdir -p /var/cache/nginx/{client_temp,proxy_temp,fastcgi_temp,uwsgi_temp,scgi_temp}# make && make install###啟動nginx# /usr/sbin/nginx -c /etc/nginx/nginx.conf# ps -ef|grep nginx|grep -v greproot 33412 1 0 10:18 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.confnginx 33413 33412 0 10:18 ? 00:00:00 nginx: worker process[root@orasrv1 cache]# netstat -nltp|grep 80tcp 0 0 0.0.0.0:80 0.0.0.0:* listen 33412/nginx [root@orasrv1 cache]# 四、配置nginx為系統(tǒng)服務(wù)
vi /etc/init.d/nginx #!/bin/bash# nginx startup script for the nginx http server# chkconfig: - 85 15# description: nginx is an http(s) server, http(s) reverse \\\\# proxy and imap/pop3 proxy server# author : leshami# blog : http://blog.csdn.net/leshami #
重慶圣潔醫(yī)院結(jié)合醫(yī)院昨天綁定了這個域名云服務(wù)器ecs操作系統(tǒng)百度云服務(wù)器開小差怎么解決什么是宿主機,和虛擬機有什么區(qū)別?查看網(wǎng)站是哪一年備案的我剛剛買的云服務(wù)器怎么管局審核注銷了到現(xiàn)在西部還沒更新狀態(tài)外網(wǎng)云服務(wù)器價格對比