{"id":6921,"date":"2020-06-23T17:51:39","date_gmt":"2020-06-23T08:51:39","guid":{"rendered":"https:\/\/www.stuffy.site\/wordpress\/?p=6921"},"modified":"2021-05-02T12:29:46","modified_gmt":"2021-05-02T03:29:46","slug":"install-php7-4-from-source-on-aws-centos7-openssl1-1-1-tls1-3-supported","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/wordpress\/?p=6921","title":{"rendered":"AWS\u306eCentOS7\u306bPHP7.4\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb &#8211; OpenSSL1.1.1 TLS1.3 \u5bfe\u5fdc"},"content":{"rendered":"\n<p>AWS\u306eCentOS7.8\u306bPHP7.4\u3092yum\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3082\u306e\u306e\u3001OpenSSL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.0.2k-fips 26 Jan 2017\u3068\u53e4\u3044\u307e\u307e\u3060\u3063\u305f\u306e\u3067OpenSSL-1.1.1g PHP7.4.7 \u3092\u30bd\u30fc\u30b9\u30d3\u30eb\u30c9\u3057\u3066Code-IT\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089Apache2.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u985b\u672b\u3092\u30e1\u30e2\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/Esfahan\/items\/4e2002f4a24589b2d0bf\">CentOS7\u306bOpenSSL1.1.1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb | Qiita<\/a><\/p>\n\n\n\n<p>OpenSSL\u306f\u4e0a\u8a18\u8a18\u4e8b\u3092\u53c2\u8003\u306b\/usr\/local\/openssl-1.1.1 \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3059\u3002\u305f\u3060\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u4ee5\u4e0b\u306e\u901a\u308a\u306b\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u8cbc\u308a\u307e\u3057\u305f\u3002\u8ffd\u8a18\uff09\/usr\/local\/openssl-1.1.1 \u3078\u306e\u74b0\u5883\u5909\u6570\u3082\u8ffd\u52a0\u3067\u767b\u9332\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n<pre># mv \/usr\/bin\/openssl \/usr\/bin\/openssl.bak\n# ln -s \/usr\/local\/openssl-1.1.1\/bin\/openssl \/usr\/bin\/openssl<br><br>\n# export PATH=\/usr\/local\/openssl-1.1.1\/bin:$PATH<\/pre>\n\n\n<p><a href=\"https:\/\/qiita.com\/ssaita\/items\/9e0170251d45ed1b8818\">CentOS 6 \u306e\u74b0\u5883\u306bPHP7\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Apache\u3067\u52d5\u304b\u3059\u307e\u3067<\/a><\/p>\n\n\n\n<p>\u5c11\u3005\u53e4\u3044\u8a18\u4e8b\u3067\u3059\u304cPHP7.4\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u306b\u5fc5\u8981\u305d\u3046\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306fyum\u3067\u4e00\u6c17\u306b\u63c3\u3048\u307e\u3059\u3002<\/p>\n\n\n<pre># yum -y install httpd-devel gd-devel libxml2-devel mysql-devel t1lib-devel\n# yum -y install bzip2-devel curl-devel gmp-devel aspell-devel recode-devel\n# yum -y install libmcrypt-devel<\/pre>\n\n\n<p>PHP7.4.7\u306f\u516c\u5f0f\u304b\u3089\/usr\/local\/src \u306bwget \u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u89e3\u51cd\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre># cd \/usr\/local\/src\n# wget https:\/\/www.php.net\/distributions\/php-7.4.7.tar.gz\n# tar zxvf php-7.4.7.tar.gz<br># cd php-7.4.7\n#  .\/configure --with-apxs2=\/usr\/bin\/apxs --bindir=\/usr\/local\/bin --with-openssl=\/usr\/local\/openssl-1.1.1 --with-libxml --with-mysqli --with-zlib --with-curl --with-xsl --with-gettext --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gmp \\\n--enable-mysqlnd \\\n--enable-mbstring \\\n--enable-bcmath \\\n--enable-pcntl \\\n--enable-cgi \\\n--enable-cli \\\n--enable-exif \\\n--enable-ftp \\\n--enable-sockets \\\n--enable-sysvsem \\\n--enable-sysvshm \\\n--enable-sysvmsg \\\n--enable-shmop \\\n--enable-calendar \\\n--enable-opcache \\\n--enable-intl \\\n--disable-debug<\/pre>\n\n\n<p>\u9014\u4e2d\u3001make test\u3067opcache\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u306a\u3044\u3088\uff01\u3068\u304b\u3044\u308d\u3044\u308d\u6012\u3089\u308c\u307e\u3057\u305f\u304cyum\u3067\u305d\u306e\u90fd\u5ea6\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n<pre># yum --enablerepo=epel,remi-php74 install php-opcache<\/pre>\n\n\n<p>make &amp; make install<\/p>\n\n\n<pre># make\n# make install<\/pre>\n\n\n<p>\u3067\u8868\u984c\u306e\u4ef6\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.riscascape.net\/wordpress\/19692\">CentOS7\u306byum\u3067HTTP\/2.0\u5bfe\u5fdcApache\/OpenSSL\u3092\u5c0e\u5165\u3057\u3066\u307f\u308b<\/a><\/p>\n\n\n\n<p>CodeIT\u30ea\u30dd\u30b8\u30c8\u30ea\u5c0e\u5165\u3002Apache2.4\u672c\u4f53\u3001\u79d8\u5bc6\u9375\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u8d77\u52d5\u30fb\u30fb\u30fb<\/p>\n\n\n<pre># cd \/etc\/yum.repos.d &amp;&amp; wget https:\/\/repo.codeit.guru\/codeit.el`rpm -q --qf \"%{VERSION}\" $(rpm -q --whatprovides redhat-release)`.repo\n# yum install httpd\n\n# cd \/etc\/pki\/tls\/certs\/\n# make localhost.crt<br \/># make localhost.key\n# cd ..\/private\/\n# cp ..\/certs\/localhost.key .\/<br \/># cp localhost.key localhost.key.orig\n\n## \u79d8\u5bc6\u9375\u306e\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u3092\u89e3\u9664\n# openssl rsa -in localhost.key.orig -out localhost.key<br \/><br \/>## <a href=\"https:\/\/www.rem-system.com\/httpd-http2\/#8_Apache_httpd_HTTPSHTTP2\">Apache httpd HTTPS\u3068HTTP\/2\u901a\u4fe1\u7528\u306e\u8a2d\u5b9a<\/a><br \/>## ssl.conf\u306e # Virtual Host Context \u884c\u4e0b\u306b\u8ffd\u8a18<br \/><br \/># vi \/etc\/httpd\/conf.d\/ssl.conf<br \/><br \/>Protocols h2 http\/1.1 \uff08\u8ffd\u8a18\n\n# systemctl start httpd<\/pre>\n\n\n<p>\u8d77\u52d5\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u3067\u3059\u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"295\" src=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error-1024x295.png\" alt=\"\" class=\"wp-image-6926\" srcset=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error-1024x295.png 1024w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error-300x87.png 300w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error-768x221.png 768w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/apache_start_error.png 1061w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>systemctl status httpd.service -l \u3067\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\u3068\u3001<\/p>\n\n\n<pre>Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP<\/pre>\n\n\n<p>Google\u5148\u751f\u306b\u8a0a\u3044\u3066\u307f\u308b\u3068Apache \u304cWorker \u3068\u3057\u3066\u8d77\u52d5\u3057\u3066\u3044\u3066PHP\u3068\u4e0d\u6574\u5408\u3057\u3066\u3044\u308b\u65e8\u4e86\u89e3\u3057\u307e\u3057\u305f\u3002\/etc\/httpd\/conf.modules.d\/00-mpm.conf \u3092\u7de8\u96c6\u3057\u3066<\/p>\n\n\n<pre>#LoadModule mpm_event_module modules\/mod_mpm_event.so \u2190\u30c1\u30a7\u30c3\u30af\nLoadModule mpm_prefork_module modules\/mod_mpm_prefork.so \u2190\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3059<\/pre>\n\n\n<p>\u3059\u308b\u3068Apache \u8d77\u52d5\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.kmr-blog.com\/mpm-error\/\">PHP\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306eMPM\u306e\u30a8\u30e9\u30fc\u3092\u624b\u3063\u53d6\u308a\u65e9\u304f\u89e3\u6d88\u3059\u308b<\/a><\/p>\n\n\n\n<p>AWS\u306et2.micro\u3067\u306fPHP\u306e\u30bd\u30fc\u30b9\u30d3\u30eb\u30c9\u3067\u3082\u300caws virtual memory exhausted: \u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3067\u304d\u307e\u305b\u3093\u300d\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u30b9\u30ef\u30c3\u30d7\u3092\u4f5c\u3089\u306a\u3044\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u304b\u3063\u305f\u307b\u3069\u9650\u754c\u3067\u3001\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u304b\u3089\u30b7\u30f3\u30b0\u30eb\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u308a\u30b9\u30d4\u30fc\u30c9\u30c0\u30a6\u30f3\u306f\u5426\u3081\u306a\u3044\u306e\u3067Worker\u30e2\u30fc\u30c9\u3057\u3066\u3082\u3069\u306e\u7a0b\u5ea6\u8ca0\u8377\u8efd\u6e1b\u3067\u304d\u308b\u304b\u8ab2\u984c\u306e\u6b8b\u308b\u3068\u3053\u308d\u3067\u3059\u3002phpinfo.php \u3067\u78ba\u8a8d\u3059\u308b\u3068\u7121\u4e8b\u3001OpenSSL1.1.1g TLS1.3 \u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/openssl_on_php74_tls1.3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"596\" src=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/openssl_on_php74_tls1.3.png\" alt=\"\" class=\"wp-image-6922\" srcset=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/openssl_on_php74_tls1.3.png 977w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/openssl_on_php74_tls1.3-300x183.png 300w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2020\/06\/openssl_on_php74_tls1.3-768x469.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><\/figure>\n\n\n\n<p>\u30b9\u30ef\u30c3\u30d7\u4f5c\u6210\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/HrsUed\/items\/c156ed69e927b6165717\">[Rails] Capistrano\u3067EC2\u3078\u30c7\u30d7\u30ed\u30a4\uff1aEC2\u4eee\u60f3\u30e1\u30e2\u30ea\u4e0d\u8db3\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS\u306eCentOS7.8\u306bPHP7.4\u3092yum\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3082\u306e\u306e\u3001OpenSSL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.0.2k-fips 26 Jan 2017\u3068\u53e4\u3044\u307e\u307e\u3060\u3063\u305f\u306e\u3067OpenSSL-1.1.1g PHP7.4.7 \u3092\u30bd &hellip; <a href=\"https:\/\/www.stuffy.site\/wordpress\/?p=6921\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">AWS\u306eCentOS7\u306bPHP7.4\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb &#8211; OpenSSL1.1.1 TLS1.3 \u5bfe\u5fdc<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,110,3,111,33],"tags":[],"class_list":["post-6921","post","type-post","status-publish","format-standard","hentry","category-apache","category-aws-2","category-linux","category-openssl","category-php"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6921"}],"version-history":[{"count":16,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6921\/revisions"}],"predecessor-version":[{"id":7313,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6921\/revisions\/7313"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}