{"id":9612,"date":"2017-01-06T06:24:35","date_gmt":"2017-01-05T21:24:35","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=9612"},"modified":"2017-01-06T06:24:35","modified_gmt":"2017-01-05T21:24:35","slug":"http2%e5%af%be%e5%bf%9cnginx%e3%81%aerpm%e3%83%91%e3%83%83%e3%82%b1%e3%83%bc%e3%82%b8%e4%bd%9c%e6%88%90%e3%81%a8%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/http2%e5%af%be%e5%bf%9cnginx%e3%81%aerpm%e3%83%91%e3%83%83%e3%82%b1%e3%83%bc%e3%82%b8%e4%bd%9c%e6%88%90%e3%81%a8%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab\/","title":{"rendered":"HTTP\/2\u5bfe\u5fdcnginx\u306erpm\u30d1\u30c3\u30b1\u30fc\u30b8\u4f5c\u6210\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u3053\u3093\u306b\u3061\u306f\u3002kenji\u3067\u3059\u3002<\/p>\n<p>\u5148\u65e5CentOS7.3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u4e0a\u3067HTTP\/2\u304c\u52d5\u4f5c\u3059\u308b\u74b0\u5883\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059<br \/>\nHTTP\/2\u3068\u306f\u306a\u3093\u305e\u3084\u3001\u3068\u3044\u3046\u65b9\u306f<a href=\"https:\/\/ja.wikipedia.org\/wiki\/HTTP\/2\" target=\"_blank\">wikipedia\u306e\u3053\u3061\u3089\u306e\u30ea\u30f3\u30af\u5148<\/a>\u3078\u3001\u3069\u3046\u305e<\/p>\n<p><a href=\"http:\/\/www.skyarch.net\/blog\/?p=3950\" target=\"_blank\">\u904e\u53bb\u306b\u3082\u5f0a\u793eblog\u3067\u3082HTTP\/2\u3092\u6271\u3063\u305f<\/a>\u306e\u3067\u3059\u304c\u3001<br \/>\nGoogeChrome 51\u4ee5\u964d\u3067\u306fNPN\u306aHTTP\/2\u306f\u5229\u7528\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081ALPN\u5bfe\u5fdc\u306e\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"#overview\">\u6982\u8981<\/a><\/li>\n<li><a href=\"#env\">\u5b9f\u884c\u74b0\u5883<\/a><\/li>\n<li><a href=\"#install1\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"#setting1\">\u74b0\u5883\u6e96\u5099<\/a><\/li>\n<li><a href=\"#setting2\">\u30bd\u30fc\u30b9\u7528\u610f<\/a><\/li>\n<li><a href=\"#setting3\">spec\u4fee\u6b63<\/a><\/li>\n<li><a href=\"#setting4\">rpmbuild<\/a><\/li>\n<li><a href=\"#setting5\">yum\u306b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"#setting6\">\u52d5\u4f5c\u78ba\u8a8d<\/a><\/li>\n<li><a href=\"#conclusion\">\u307e\u3068\u3081<\/a><\/li>\n<\/ul>\n<h2 id=\"overview\">\u6982\u8981<\/h2>\n<p>nginx\u306erpm\u4f5c\u6210\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<h2 id=\"env\">\u5b9f\u884c\u74b0\u5883<\/h2>\n<p>CentOS 7.3<\/p>\n<h2 id=\"install1\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h2>\n<p>yum\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089nginx\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001<br \/>\nCentOS\u306eopenssl\u306e\u6a19\u6e96\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.0.1\u7cfb\u3068\u306a\u3063\u3066\u304a\u308a\u3001HTTP\/2\u3067\u306f1.0.2\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081openssl1.0.2\u3092include\u3057\u305frpm\u3092rpmbuild\u304b\u3089\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u57f7\u7b46\u6642\u306e\u305d\u308c\u305e\u308c\u306e\u6700\u65b0\u5b89\u5b9a\u30d0\u30fc\u30b8\u30e7\u30f3\u306f<br \/>\n\u3000nginx-1.10.2<br \/>\n\u3000openssl-1.0.2j<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u672c\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3059\u308b\u5834\u5408\u3001\u8106\u5f31\u6027\u306e\u89b3\u70b9\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u6700\u65b0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u304a\u9858\u3044\u3057\u307e\u3059<\/p>\n<h3 id=\"setting1\">\u74b0\u5883\u6e96\u5099<\/h3>\n<p>rpmbuild\u306b\u3042\u305f\u308a\u3001rpmbuild\u306e\u63a8\u5968\u8a2d\u5b9a\u3067\u3042\u308b\u5c02\u7528\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\uff08\u65e2\u306b\u4f5c\u6210\u6e08\u307f\u306e\u5834\u5408\u672c\u624b\u9806\u306f\u4e0d\u8981\u3067\u3059\uff09<\/p>\n<pre>\nuseradd rpmbuilder\nsu - rpmbuilder\necho '%_topdir %(echo $HOME)\/rpmbuild' &gt; ~\/.rpmmacros\n<\/pre>\n<h3 id=\"setting2\">\u30bd\u30fc\u30b9\u7528\u610f<\/h3>\n<p>nginx\u306esrc\u30d1\u30c3\u30b1\u30fc\u30b8\u3068openssl1.0.2\u3092\u7528\u610f\u3057\u307e\u3059<\/p>\n<pre>\nwget http:\/\/nginx.org\/packages\/centos\/7\/SRPMS\/nginx-1.10.2-1.el7.ngx.src.rpm\nwget https:\/\/www.openssl.org\/source\/openssl-1.0.2j.tar.gz\n\nrpm -ivh nginx-1.10.2-1.el7.ngx.src.rpm\ntar zxvf openssl-1.0.2j.tar.gz\n<\/pre>\n<h3 id=\"setting3\">spec\u4fee\u6b63<\/h3>\n<p>\u6b21\u306bspec\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<br \/>\n\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u3068configure\u306e\u66f4\u65b0\u306b\u76f8\u5f53\u3059\u308b\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059<\/p>\n<p>\u4eca\u56de\u306f\u5c06\u6765\u7684\u306b\u5229\u7528\u3059\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b\u3001<br \/>\ngeoip_module<br \/>\n\u3082\u8ffd\u52a0\u3067\u5165\u308c\u307e\u3059\u3002<br \/>\n\u3053\u3061\u3089\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30a2\u30af\u30bb\u30b9\u5143\u306e\u30e6\u30fc\u30b6\u306e\u5730\u57df\u3092\uff08\u304a\u304a\u3056\u3063\u3071\u3067\u3059\u304c\uff09\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3082\u306e\u306b\u306a\u308a\u307e\u3059<br \/>\nGeoIP\u306e\u30ea\u30b9\u30c8\u306fCentOS7.3\u6a19\u6e96\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u4e0a\u306e\u65b9\u3067\u3082\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001openssl1.0.2\u3092\u5185\u5305\u3057\u3066\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<br \/>\n\u5909\u66f4\u524d\u5f8c\u306ediff -u\u3092\u8a18\u8f09\u3057\u307e\u3059<\/p>\n<pre>\ndiff -u ~\/nginx.spec  ~\/rpmbuild\/SPECS\/nginx.spec\n--- \/home\/rpmbuilder\/nginx.spec 2016-12-14 22:46:41.131426934 +0900\n+++ \/home\/rpmbuilder\/rpmbuild\/SPECS\/nginx.spec  2016-12-14 22:52:12.007201290 +0900\n@@ -31,9 +31,9 @@\n Epoch: %{epoch}\n Requires(pre): shadow-utils\n Requires: systemd\n-Requires: openssl &gt;= 1.0.1\n+#Requires: openssl &gt;= 1.0.1\n BuildRequires: systemd\n-BuildRequires: openssl-devel &gt;= 1.0.1\n+#BuildRequires: openssl-devel &gt;= 1.0.1\n %endif\n\n %if 0%{?suse_version} == 1315\n@@ -54,7 +54,7 @@\n\n %define WITH_CC_OPT $(echo %{optflags} $(pcre-config --cflags))\n\n-%define BASE_CONFIGURE_ARGS $(echo \"--prefix=%{_sysconfdir}\/nginx --sbin-path=%{_sbindir}\/nginx --modules-path=%{_libdir}\/nginx\/modules --conf-path=%{_sysconfdir}\/nginx\/nginx.conf --error-log-path=%{_localstatedir}\/log\/nginx\/error.log --http-log-path=%{_localstatedir}\/log\/nginx\/access.log --pid-path=%{_localstatedir}\/run\/nginx.pid --lock-path=%{_localstatedir}\/run\/nginx.lock --http-client-body-temp-path=%{_localstatedir}\/cache\/nginx\/client_temp --http-proxy-temp-path=%{_localstatedir}\/cache\/nginx\/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}\/cache\/nginx\/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}\/cache\/nginx\/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}\/cache\/nginx\/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module\")\n+%define BASE_CONFIGURE_ARGS $(echo \"--prefix=%{_sysconfdir}\/nginx --sbin-path=%{_sbindir}\/nginx --modules-path=%{_libdir}\/nginx\/modules --conf-path=%{_sysconfdir}\/nginx\/nginx.conf --error-log-path=%{_localstatedir}\/log\/nginx\/error.log --http-log-path=%{_localstatedir}\/log\/nginx\/access.log --pid-path=%{_localstatedir}\/run\/nginx.pid --lock-path=%{_localstatedir}\/run\/nginx.lock --http-client-body-temp-path=%{_localstatedir}\/cache\/nginx\/client_temp --http-proxy-temp-path=%{_localstatedir}\/cache\/nginx\/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}\/cache\/nginx\/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}\/cache\/nginx\/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}\/cache\/nginx\/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-openssl=\/home\/rpmbuilder\/openssl-1.0.2j --with-http_geoip_module\")\n\n Summary: High performance web server\n Name: nginx\n\n<\/pre>\n<h3 id=\"setting4\">rpmbuild<\/h3>\n<p>rpmbuild\u3057\u307e\u3059<\/p>\n<pre>\nrpmbuild -bb rpmbuild\/SPECS\/nginx.spec\n<\/pre>\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u4e0d\u8db3\u3059\u308b\u5834\u5408\u306fyum\u306a\u3069\u3067\u88dc\u3063\u3066\u304f\u3060\u3055\u3044<\/p>\n<pre>\nyum install zlib-devel pcre-devel GeoIP-devel\n<\/pre>\n<h3 id=\"setting5\">yum\u306b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u554f\u984c\u304c\u306a\u3051\u308c\u3070<br \/>\n\/home\/rpmbuilder\/rpmbuild\/RPMS\/x86_64\/nginx-1.10.2-1.el7.centos.ngx.x86_64.rpm<br \/>\n\u306brpm\u304c\u3067\u304d\u307e\u3059<\/p>\n<p>\u4ee5\u4e0broot\u6a29\u9650\u306b\u3066\u5b9f\u65bd<\/p>\n<pre>\nyum install \/home\/rpmbuilder\/rpmbuild\/RPMS\/x86_64\/nginx-1.10.2-1.el7.centos.ngx.x86_64.rpm\n<\/pre>\n<p>rpm\u3067\u306f\u306a\u304fyum\u306b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u7406\u7531\u306f<br \/>\n\u30fb\u4f9d\u5b58\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7c21\u5358<br \/>\n\u30fb\u524a\u9664\u3059\u308b\u969b\u306byum remove\u3067\u7c21\u5358\u306b\u524a\u9664<\/p>\n<h3 id=\"setting6\">\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>nginx OpenSSL1.0.2\u540c\u68b1\u7248\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3057\u305f<\/p>\n<pre>\n# nginx -V\n\nnginx version: nginx\/1.10.2\nbuilt by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)\nbuilt with OpenSSL 1.0.2j  26 Sep 2016\nTLS SNI support enabled\nconfigure arguments: --prefix=\/etc\/nginx --sbin-path=\/usr\/sbin\/nginx --modules-path=\/usr\/lib64\/nginx\/modules --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-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-openssl=\/home\/rpmbuilder\/openssl-1.0.2j --with-http_geoip_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'\n\n<\/pre>\n<h3 id=\"conclusion\">\u307e\u3068\u3081<\/h3>\n<p>HTTP\/2\u306e\u307b\u3046\u304c\u5c06\u6765\u7684\u306bSEO\u6709\u5229\u306b\u306a\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u3057\u3001<br \/>\n\u753b\u50cf\u304c\u591a\u3044EC\u30b5\u30a4\u30c8\u3084blog\u306a\u3069\u3067\u306fHTTP\/2\u3092\u6709\u52b9\u306b\u3059\u308b\u3053\u3068\u3067\u4e26\u5217\u8ee2\u9001\u304c\u53ef\u80fd\u3068\u306a\u308a\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u8868\u793a\u901f\u5ea6\u304c\u65e9\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30da\u30fc\u30b8\u306e\u8868\u793a\u901f\u5ea6\u3092\u6c17\u306b\u3055\u308c\u308b\u5834\u5408\u306f\u662f\u975e\u691c\u8a0e\u3092<\/p>\n<p>\u6b21\u56de\u306f\u672c\u74b0\u5883\u3067php-fpm\u3092\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3059<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u3053\u3093\u306b\u3061\u306f\u3002kenji\u3067\u3059\u3002 \u5148\u65e5CentOS7.3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u4e0a\u3067HTTP\/2\u304c\u52d5\u4f5c\u3059\u308b\u74b0\u5883\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059 HTTP\/2\u3068\u306f\u306a\u3093\u305e\u3084\u3001\u3068\u3044\u3046\u65b9\u306fwikipedia\u306e\u3053\u3061\u3089\u306e\u30ea\u30f3\u30af\u5148\u3078\u3001\u3069\u3046\u305e&#8230;<\/p>\n","protected":false},"author":43,"featured_media":3974,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"9612","footnotes":""},"categories":[29,35],"tags":[192,99,49,193],"class_list":{"0":"post-9612","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-linux","8":"category-web-linux","9":"tag-centos","10":"tag-http2","11":"tag-nginx","12":"tag-rpm","13":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/9612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=9612"}],"version-history":[{"count":24,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/9612\/revisions"}],"predecessor-version":[{"id":9915,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/9612\/revisions\/9915"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/3974"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=9612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=9612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=9612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}