{"id":3273,"date":"2018-03-27T15:07:54","date_gmt":"2018-03-27T07:07:54","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=3273"},"modified":"2018-03-27T15:07:54","modified_gmt":"2018-03-27T07:07:54","slug":"openstack%e5%85%b1%e4%ba%ab80%e3%80%81443%e7%ab%af%e5%8f%a3%e7%9a%84%e5%ae%9e%e4%be%8b%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/fuwuqi\/openstack%e5%85%b1%e4%ba%ab80%e3%80%81443%e7%ab%af%e5%8f%a3%e7%9a%84%e5%ae%9e%e4%be%8b%e4%bb%a3%e7%a0%81\/","title":{"rendered":"openstack\u5171\u4eab80\u3001443\u7aef\u53e3\u7684\u5b9e\u4f8b\u4ee3\u7801"},"content":{"rendered":"<p><strong>\u524d\u8a00<\/strong><\/p>\n<p>\u56e0\u4e3aopenstack\u4f7f\u7528\u7684\u662fapache\uff0c\u6240\u4ee5\u4e0d\u80fd\u5171\u4eab80\u7aef\u53e3\uff0c\u4f46\u521b\u5efa\u7684\u8bb8\u591a\u4e91\u4e3b\u673a\uff0c\u867d\u7136\u53ef\u4ee5\u901a\u8fc7rinetd\u8fdb\u884c\u8df3\u8f6c\uff0c\u4f46\u6709\u65f6\u9700\u8981\u76f4\u63a5\u8bbf\u95ee80\u7aef\u53e3\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u9009\u62e9\u5305\u542b\u4e86nginx\u7684openrety\u3002<\/p>\n<p>1.1. \u5b89\u88c5 openresty<\/p>\n<p>1. \u5411 centos \u7cfb\u7edf\u4e2d\u6dfb\u52a0 openresty \u4ed3\u5e93<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#yum install yum-utils\r\n\r\n#yum-config-manager --add-repo https:\/\/openresty.org\/package\/centos\/openresty.repo\r\n<\/pre>\n<\/div>\n<p>2. \u5b89\u88c5\u8f6f\u4ef6\u5305<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#yum install openresty<\/pre>\n<\/div>\n<p>3. \u5b89\u88c5\u547d\u4ee4\u884c\u5de5\u5177<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#yum install openresty-resty<\/pre>\n<\/div>\n<p><strong>1.2. \u914d\u7f6e openresty<\/strong><\/p>\n<p>1. \u8fdb\u5165 nginx \u76ee\u5f55<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#cd \/usr\/local\/openresty\/nginx\/conf\/<\/pre>\n<\/div>\n<p>2. \u7f16\u8f91 nginx \u914d\u7f6e\u6587\u4ef6<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#vi nginx.conf\r\nuser root;\r\nworker_processes 12;\r\nerror_log logs\/error.log;\r\n#error_log logs\/error.log notice;\r\n#error_log logs\/error.log info;\r\n\r\n#pid  logs\/nginx.pid;\r\n\r\nevents {\r\n worker_connections 10240;\r\n}\r\n\r\nhttp {\r\n include  mime.types;\r\n default_type application\/octet-stream;\r\n\r\n log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\r\n\r\n      '$status $body_bytes_sent \"$http_referer\" '\r\n\r\n      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\r\n\r\n access_log logs\/access.log main;\r\n\r\n sendfile  on;\r\n #tcp_nopush  on;\r\n #keepalive_timeout 0;\r\n keepalive_timeout 65;\r\n\r\n #gzip on;\r\n include conf.d\/*;\r\n\r\n server {\r\n  listen  80;\r\n  #\r\n  server_name \u57df\u540d;\r\n  #\u6307\u5b9a\u65e5\u5fd7\u8def\u5f84\r\n  access_log logs\/access.log main;\r\n  error_log logs\/error.log;\r\n\r\n  # \r\n  location \/ {\r\n   proxy_pass https:\/\/172.17.17.113;\r\n  }\r\n }\r\n}\r\n<\/pre>\n<\/div>\n<p>3. \u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa conf.d \u6587\u4ef6\u5939<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#mkdir \/usr\/local\/openresty\/nginx\/conf\/conf.d\r\n\r\n#cd conf.d\r\n<\/pre>\n<\/div>\n<p>4. \u521b\u5efa\u8981\u88ab\u8bfb\u53d6\u7684\u6587\u4ef6\uff0c\u76ee\u524d\u5b9a\u4e49\u4e3a\u6bcf\u53f0\u673a\u5668\u521b\u5efa\u4e00\u53f0\uff0c\u8fd9\u91cc\u5b9a\u4e49\u6dfb\u52a0\u4e00\u53f0 aa \u673a\u5668\uff0c\u5219\u521b\u5efa aa.conf \u3002<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#vi aa.conf\r\nserver {\r\n listen  80;\r\n#\u7ed1\u5b9ahttps include \/usr\/local\/openresty\/nginx\/https\/https.conf;\r\n#\u7ed1\u5b9a\u57df\u540d\r\n server_name \u57df\u540d;\r\n#\u6307\u5b9a\u65e5\u5fd7\u8def\u5f84\r\n access_log logs\/ope.access.log main;\r\n error_log logs\/ope.error.log;\r\n\r\n#\u6307\u5b9a\u901a\u8fc7\u57df\u540d\u8df3\u8f6c\u7aef\u53e3\r\n location \/ {\r\n\r\n  proxy_pass https:\/\/172.17.17.136:8081;\r\n\r\n }\r\n}<\/pre>\n<\/div>\n<p><strong>1.3.\u00a0 \u4f7f\u7528 openresty<\/strong><\/p>\n<p>1. \u68c0\u6d4b nginx \u662f\u5426\u914d\u7f6e\u6b63\u786e<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#openresty -t\r\n\r\nnginx: the configuration file \/usr\/local\/openresty\/nginx\/conf\/nginx.conf syntax is ok\r\n\r\nnginx: configuration file \/usr\/local\/openresty\/nginx\/conf\/nginx.conf test is successful\r\n<\/pre>\n<\/div>\n<p>2. \u91cd\u8f7d openresty<\/p>\n<div class=\"jb51code\">\n<pre class=\"brush:bash;\">#openresty -s reload<\/pre>\n<\/div>\n<p>3.\u9a8c\u8bc1<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u4e0a\u8f93\u5165\u7ed1\u5b9a\u7684\u57df\u540d\u5373\u53ef\u76f4\u63a5\u8bbf\u95ee80\u6216\u8005\u6240\u9700\u7aef\u53e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u56e0\u4e3aopenstack\u4f7f\u7528\u7684\u662fapache\uff0c\u6240\u4ee5\u4e0d\u80fd\u5171\u4eab80\u7aef\u53e3\uff0c\u4f46\u521b\u5efa\u7684\u8bb8\u591a\u4e91\u4e3b\u673a\uff0c\u867d\u7136\u53ef\u4ee5\u901a\u8fc7rin &#8230; <a title=\"openstack\u5171\u4eab80\u3001443\u7aef\u53e3\u7684\u5b9e\u4f8b\u4ee3\u7801\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/fuwuqi\/openstack%e5%85%b1%e4%ba%ab80%e3%80%81443%e7%ab%af%e5%8f%a3%e7%9a%84%e5%ae%9e%e4%be%8b%e4%bb%a3%e7%a0%81\/\" aria-label=\"\u9605\u8bfb openstack\u5171\u4eab80\u3001443\u7aef\u53e3\u7684\u5b9e\u4f8b\u4ee3\u7801\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-3273","post","type-post","status-publish","format-standard","hentry","category-fuwuqi"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=3273"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3273\/revisions"}],"predecessor-version":[{"id":3274,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3273\/revisions\/3274"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=3273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=3273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=3273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}