nginx1.8.0 Installation
The #!/bin/bash#install nginx-1.8.0.tar.gz//source package is placed in the/USR/LOCAL/SRC directory cd /usr/local/srctar xzvf Nginx-1.8.0.tar.gzcd nginx-1.8.0./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module\ --with-http_gzip_static_module --with-http_stub_status_module -- with-pcremakemake install//adding nginx.conf configuration Files Cat /usr/local/nginx/conf/nginx.confuser nobody nobody;worker_processes 2;error_log /usr/local/nginx/logs/nginx_error.log crit;pid / usr/local/nginx/logs/nginx.pid;worker_rlimit_nofile 51200;events{ use epoll; worker_connections 6000;} http{ include mime.types; default_type application/ Octet-stream; server_names_hash_bucket_size 3526; server_ Names_hash_max_size 4096; log_format combined_realip ' $remote _addr $http _x_forwarded_for [$time _local] ' ' $host ' $ Request_uri " $status $http _referer" "$http _user_agent" '; sendfile on; tcp_nopush on; keepalive_timeout 30; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 8 4k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; client_max_body_size 10m; client_body_buffer_size 256k; client_body_temp_ path /usr/local/nginx/client_body_temp; proxy_temp_path /usr/local/nginx/proxy_temp; fastcgi_temp_path /usr/local/nginx/fastcgi_temp; fastcgi_intercept_errors on; tcp_nodelay on; gzip on; gzip_min_length 1k; gzip_buffers 4 8k; gzip _comp_level 5; gzip_http_version 1.1; gzip_types text/plain application/x-javascript text/css text/htm application/xml;server{listen 80;server_name localhost;index index.html index.htm index.php;root /usr/local/nginx/ Html;location ~ \.php$ {include fastcgi_params;fastcgi_pass 127.0.0.1:9000;fastcgi_ Index index.php;fastcgi_param script_filename /usr/local/nginx/html$fastcgi_script_name;}}} Add/etc/init.d/nginx file CAt /etc/init.d/nginx#!/bin/bash#/etc/init.d/nginx# chkconfig: - 30 21# description: http service.# source function library. /etc/init.d/functions# nginx settingsnginx_sbin= "/usr/local/nginx/sbin/nginx" nginx_conf= "/usr/local/nginx/conf/nginx.conf" Nginx_pid= "/usr/local/nginx/logs/nginx.pid" retval=0prog= "Nginx" Start () { echo -n $ "starting $prog: " mkdir -p /dev/shm/nginx_temp daemon $NGINX _sbin -c $NGINX _conf retval=$? echo return $RETVAL}stop () { echo -n $ "stopping $prog: " killproc -p $NGINX _pid $NGINX _sbin -term rm -rf /dev/shm/nginx_temp retval=$? echo return $RETVAL} Reload () { echo -n $ "reloading $prog: " killproc -p $NGINX _pid $NGINX _sbin -hup retval=$? echo return $RETVAL}restart () { stop start}configtest () { $NGINX _sbin -c $NGINX _conf -t return 0}case "$" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; configtest) configtest ;; *) echo $ "usage: $0 {start|stop| Reload|restart|configtest} " retval=1esac//to/etc/init.d/ Nginx Add Permissions chmod +x /etc/init.d/nginx//add nginx boot Chkconfig --add nginxchkconfig nginx on//Start Nginxservice nginx start
Verify the Nginx installation is successful, enter the server IP in the browser
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/83/20/wKioL1drf-PjlfHuAACTa60Q6mw409.jpg-wh_500x0-wm_3 -wmp_4-s_36101497.jpg "title=" nginx.jpg "alt=" Wkiol1drf-pjlfhuaacta60q6mw409.jpg-wh_50 "/>
This article is from the "Ubuntu" blog, so be sure to keep this source http://thankinglove.blog.51cto.com/2311485/1792181
nginx1.8.0 Installation