markdown How-To-Install-Nginx.md

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown How-To-Install-Nginx.md相关的知识,希望对你有一定的参考价值。

How To Install Nginx v1.6.2
----
Description: 


1. Nginxのリポジトリを登録する
	<pre>
	# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
	</pre>

2. インストールされるNginxのバージョンを確認する
	<pre>
	[root@Meiden001stg ~]# yum info nginx
	Loaded plugins: amazon-id, product-id, rhui-lb, security, subscription-manager
	Updating certificate-based repositories.
	Unable to read consumer identity
	Repository 'epel-erlang' is missing name in configuration, using id
	Repository 'epel-erlang-source' is missing name in configuration, using id
	nginx                                                                                                  | 2.9 kB     00:00
	nginx/primary_db                                                                                       |  33 kB     00:00
	Available Packages
	Name        : nginx
	Arch        : x86_64
	Version     : 1.6.2
	Release     : 1.el6.ngx
	Size        : 336 k
	Repo        : nginx
	Summary     : High performance web server
	URL         : http://nginx.org/
	License     : 2-clause BSD-like license
	Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
	            : a mail proxy server.
	</pre>


2. Nginxをインストールする

	<pre>
	[root@Meiden001stg ~]# yum install nginx
	Loaded plugins: amazon-id, product-id, rhui-lb, security, subscription-manager
	Updating certificate-based repositories.
	Unable to read consumer identity
	Repository 'epel-erlang' is missing name in configuration, using id
	Repository 'epel-erlang-source' is missing name in configuration, using id
	Setting up Install Process
	Resolving Dependencies
	--> Running transaction check
	---> Package nginx.x86_64 0:1.6.2-1.el6.ngx will be installed
	--> Processing Dependency: openssl >= 1.0.1 for package: nginx-1.6.2-1.el6.ngx.x86_64
	--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: nginx-1.6.2-1.el6.ngx.x86_64
	--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: nginx-1.6.2-1.el6.ngx.x86_64
	--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) for package: nginx-1.6.2-1.el6.ngx.x86_64
	--> Running transaction check
	---> Package openssl.x86_64 0:1.0.0-27.el6_4.2 will be updated
	--> Processing Dependency: openssl = 1.0.0-27.el6_4.2 for package: openssl-devel-1.0.0-27.el6_4.2.x86_64
	---> Package openssl.x86_64 0:1.0.1e-30.el6 will be an update
	--> Running transaction check
	---> Package openssl-devel.x86_64 0:1.0.0-27.el6_4.2 will be updated
	---> Package openssl-devel.x86_64 0:1.0.1e-30.el6 will be an update
	--> Finished Dependency Resolution
	
	Dependencies Resolved
	
	==============================================================================================================================
	 Package                 Arch             Version                    Repository                                          Size
	==============================================================================================================================
	Installing:
	 nginx                   x86_64           1.6.2-1.el6.ngx            nginx                                              336 k
	Updating for dependencies:
	 openssl                 x86_64           1.0.1e-30.el6              rhui-ap-northeast-1-rhel-server-releases           1.5 M
	 openssl-devel           x86_64           1.0.1e-30.el6              rhui-ap-northeast-1-rhel-server-releases           1.2 M
	
	Transaction Summary
	==============================================================================================================================
	Install       1 Package(s)
	Upgrade       2 Package(s)
	
	Total download size: 3.0 M
	Is this ok [y/N]: y
	Downloading Packages:
	(1/3): nginx-1.6.2-1.el6.ngx.x86_64.rpm                                                                | 336 kB     00:00
	(2/3): openssl-1.0.1e-30.el6.x86_64.rpm                                                                | 1.5 MB     00:00
	(3/3): openssl-devel-1.0.1e-30.el6.x86_64.rpm                                                          | 1.2 MB     00:00
	------------------------------------------------------------------------------------------------------------------------------
	Total                                                                                         1.9 MB/s | 3.0 MB     00:01
	Running rpm_check_debug
	Running Transaction Test
	Transaction Test Succeeded
	Running Transaction
	Warning: RPMDB altered outside of yum.
	  Updating   : openssl-1.0.1e-30.el6.x86_64                                                                               1/5
	  Installing : nginx-1.6.2-1.el6.ngx.x86_64                                                                               2/5
	----------------------------------------------------------------------
	
	Thanks for using nginx!
	
	Please find the official documentation for nginx here:
	* http://nginx.org/en/docs/
	
	Commercial subscriptions for nginx are available on:
	* http://nginx.com/products/
	
	----------------------------------------------------------------------
	  Updating   : openssl-devel-1.0.1e-30.el6.x86_64                                                                         3/5
	  Cleanup    : openssl-devel-1.0.0-27.el6_4.2.x86_64                                                                      4/5
	  Cleanup    : openssl-1.0.0-27.el6_4.2.x86_64                                                                            5/5
	Installed products updated.
	  Verifying  : nginx-1.6.2-1.el6.ngx.x86_64                                                                               1/5
	  Verifying  : openssl-devel-1.0.1e-30.el6.x86_64                                                                         2/5
	  Verifying  : openssl-1.0.1e-30.el6.x86_64                                                                               3/5
	  Verifying  : openssl-devel-1.0.0-27.el6_4.2.x86_64                                                                      4/5
	  Verifying  : openssl-1.0.0-27.el6_4.2.x86_64                                                                            5/5
	
	Installed:
	  nginx.x86_64 0:1.6.2-1.el6.ngx
	
	Dependency Updated:
	  openssl.x86_64 0:1.0.1e-30.el6                             openssl-devel.x86_64 0:1.0.1e-30.el6
	
	Complete!
	</pre>

2. Nginxのconfを設定する
	
	<pre>
	server {
	    listen       80;
	    server_name  localhost;
	    # Tomcat
	    location /xxx {
	        proxy_pass         http://localhost:8080/xxx/;
	        proxy_cookie_path  /xxx/ /xxx/;
	        proxy_set_header   X-Forwarded-For $remote_addr;
	    }
	    # Node.js
	    location /yyy {
	        proxy_pass         http://localhost:9000/yyy/;
	        proxy_cookie_path  /yyy/ /yyy/;
	        proxy_set_header   X-Forwarded-For $remote_addr;
	    }
	}
	# SSLはELB?不要?
	server {
	    listen       443 ssl;
	    server_name  localhost;
	
	    ssl_certificate      /etc/nginx/cert.pem;
	    ssl_certificate_key  /etc/nginx/cert.key;
	
	    ssl_session_cache shared:SSL:1m;
	    ssl_session_timeout  5m;
	
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers   on;
	
	    location /xxx {
	        proxy_pass         http://localhost:8080/xxx/;
	        proxy_cookie_path  /xxx/ /xxx/;
	        proxy_set_header   X-Forwarded-For $remote_addr;
	    }

	    location /yyy {
	        proxy_pass         http://localhost/yyy/;
	        proxy_cookie_path  /yyy/ /yyy/;
	        proxy_set_header   X-Forwarded-For $remote_addr;
	    }
	}
	</pre>

2. Nginxを起動する
	<pre>
	# service nginx start
	</pre>

2. Nginxのサービスが自動起動するよう設定する
	<pre>
	# chkconfig nginx on
	</pre>

以上是关于markdown How-To-Install-Nginx.md的主要内容,如果未能解决你的问题,请参考以下文章

转换rst到markdown总结

markdown [Markdown HowTo]作为Markdown语法的秘籍

python markdown干啥用的

markdown前端渲染

如何用markdown生成目录

markdown排版示例