{"id":1534,"date":"2021-03-14T22:16:34","date_gmt":"2021-03-14T13:16:34","guid":{"rendered":"http:\/\/sunao-mita.pgw.jp\/blog\/?p=1534"},"modified":"2021-03-15T23:16:25","modified_gmt":"2021-03-15T14:16:25","slug":"apache2-%e3%81%8c%e8%b5%b7%e5%8b%95%e3%81%97%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"http:\/\/sunao-mita.pgw.jp\/blog\/?p=1534","title":{"rendered":"apache2 \u304c\u8d77\u52d5\u3057\u306a\u3044"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u73fe\u72b6\u306e\u74b0\u5883\u304b\u3089\u306e\u6a21\u7d22<\/h3>\n\n\n\n<p>\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u5199\u771f\u3092\u30cd\u30c3\u30c8\u74b0\u5883\u306b<strong>\u516c\u958b\u3057\u3066\u3044\u308bWeb\u30b5\u30fc\u30d0\u30fc<\/strong>\u7528\u306b\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30c7\u30fc\u30bf\u30fc\u7b49\u3092\u4f5c\u6210\u3057\u305f\u308a\u3001\u52d5\u4f5c\u306e\u691c\u8a3c\u3092\u3059\u308b\u305f\u3081\u306b<strong>\u5225\u306e\u6a5f\u5668<\/strong>\u3092\u7acb\u4e0a\u3052\u3001\u305d\u3053\u306b\u30c7\u30fc\u30bf\u30fc\u3092\u5909\u63db\u3059\u308b\u30a2\u30d7\u30ea\u3084\u691c\u8a3c\u306e\u305f\u3081\u306b apache http \u30b5\u30fc\u30d0\u30fc\u3092\u8a2d\u5b9a\u3057\u3066\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u53e4\u304f\u3066\u9045\u3044\u30ce\u30fc\u30c8PC<\/h4>\n\n\n\n<p><strong>\u5225\u306e\u6a5f\u5668<\/strong>\u3068\u3057\u3066\u306e\u4f5c\u696d\u306f\u3001\u73fe\u72b6\u306f\u975e\u529b\u3067\u51e6\u7406\u306e\u9045\u3044\u53e4\u3044\u30ce\u30fc\u30c8PC\u3067\u306e\u4f5c\u696d\u3067\u3059\u3002\u57fa\u672c\u7684\u306b\u5199\u771f\u3092\u30ab\u30e1\u30e9\u3067\u5199\u3057\u3001\u5c45\u305f\u5834\u6240\u3092GPS\u30ed\u30ac\u30fc\u3067\u53ce\u96c6\u3057\u3066\u3001\u30ce\u30fc\u30c8PC\u306b\u79fb\u3057\u3066\u52a0\u5de5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u52d5\u4f5c\u306e\u691c\u8a3c\u3082\u30ce\u30fc\u30c8PC\u5185\u306b\u7acb\u4e0a\u3052\u305f Web \u30b5\u30fc\u30d0\u30fc apache \u3067\u884c\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u5168\u3066\u304c\u30ef\u30f3\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u5b8c\u7d50\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u307e\u3068\u307e\u3063\u3066\u3044\u3066\u64cd\u4f5c\u6027\u306f\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u975e\u529b\u3067\u30b9\u30c8\u30ec\u30b9\u306b\u306a\u3063\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u66f4\u306b\u975e\u52b9\u7387\u306aos\u5207\u66ff<\/h5>\n\n\n\n<p>GPS\u30ed\u30ac\u30fc\u306f\u30a2\u30d7\u30ea\u304cWindows\u5bfe\u5fdc\u306a\u306e\u3067\u305d\u308c\u306b\u5f93\u3044\u3001\u5199\u771f\u306b\u4f4d\u7f6e\u60c5\u5831\u3092\u8ffd\u52a0\u3057\u305f\u308a\u516c\u958b\u7528\u306b\u30b5\u30a4\u30ba\u3092\u7e2e\u5c0f\u3057\u305f\u308a\u306e\u52a0\u5de5\u306f Linux \u306e\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u52a0\u5de5\u3057\u3066\u3044\u307e\u3059\u3002OS\u306e\u5207\u66ff\u306f\u6614\u304b\u3089\u3042\u308b\u30aa\u30fc\u30bd\u30c9\u30c3\u30af\u30b9\u306a\u30c7\u30e5\u30a2\u30eb\u30d6\u30fc\u30c8\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u5207\u66ff\u306b\u6642\u9593\u304c\u639b\u304b\u308a\u3068\u3066\u3082\u52b9\u7387\u304c\u60aa\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30fc\u52a0\u5de5\u3068Web\u30b5\u30fc\u30d0\u30fc<\/h5>\n\n\n\n<p>\u65b0\u3057\u3044\u30ce\u30fc\u30c8PC\u3092\u8cfc\u5165\u3059\u308b\u3068\u304b\u3001\u901f\u304f\u3066\u52b9\u7387\u7684\u306a\u4f5c\u696d\u74b0\u5883\u306b\u79fb\u884c\u3067\u304d\u308c\u3070\u30b9\u30c8\u30ec\u30b9\u3082\u6e1b\u308b\u306e\u3067\u3059\u304c\u3001\u4f55\u3088\u308a\u3082\u307e\u305a\u8cc7\u91d1\u304c\u5fc5\u8981\u306a\u4e8b\u3060\u3057\u3001\u4eca\u3042\u308b\u6a5f\u5668\u3067\u5206\u6563\u3067\u304d\u306a\u3044\u3082\u306e\u304b\u3068\u6a21\u7d22\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6a5f\u5668\u306e\u5206\u6563\u3092\u6a21\u7d22<\/h3>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30fc\u5909\u63db\u3084\u691c\u8a3c\u306eWeb\u30b5\u30fc\u30d0\u30fc\u3092\u5225\u306b\u7acb\u3066\u3001\u30ea\u30e2\u30fc\u30c8\u74b0\u5883\u3092\u4f5c\u308d\u3046\u304b\u3068\u6a21\u7d22\u3057\u3066\u3044\u3066\u3001\u5206\u6563\u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u5229\u7528\u3059\u308b\u4e88\u5b9a\u306e\u6a5f\u5668\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u306a\u306e\u306b20\u5206\u3067\u505c\u6b62\u3057\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u81f4\u547d\u7684\u306a\u554f\u984c\u306fapache \u304c\u7acb\u4e0a\u3052\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u306e\u6a5f\u80fd<\/h5>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u304c 20\u5206\u3067\u505c\u6b62\u3059\u308b\u554f\u984c\u306f\u3001\u5225\u306b\u307e\u3068\u3081\u305f Linux Ubuntu \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306e\u4ed5\u69d8\u304c\u554f\u984c\u3067\u3057\u305f\u304c\u3001\u305d\u306e\u5f8c\u306e\u72b6\u6cc1\u304b\u3089\u89e3\u6c7a\u3067\u304d\u307e\u3057\u305f\u3002<br>(<a href=\"http:\/\/sunao-mita.pgw.jp\/blog\/?p=1529\">systemd \u306e\u5bfe\u7b56\u3067\u505c\u6b62\u3092\u89e3\u6c7a<\/a>)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Web\u30b5\u30fc\u30d0\u30fc\u3092\u8a2d\u5b9a<\/h4>\n\n\n\n<p>\u691c\u8a3c\u7528Web\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u5b9f\u7e3e\u306e\u3042\u308b\u30ce\u30fc\u30c8PC\u304b\u3089 apache \u306e\u30b5\u30a4\u30c8\u60c5\u5831\u7b49\u306e\u30b3\u30d4\u30fc\u3092\u884c\u3063\u305f\u306e\u306b\u7acb\u4e0a\u3052\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n<pre>$ sudo systemctl start apache2\n<code>Job for apache2.service failed because the control process exited with error code.\nSee \"systemctl status apache2.service\" and \"journalctl -xe\" for details.<\/code>\n<\/pre>\n\n\n<p>\u30ed\u30b0\u7b49\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001https \u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3057\u3066\u3044\u308b\u8a8d\u8a3c\u60c5\u5831\u306b\u554f\u984c\u304c\u3042\u308b\u3089\u3057\u304f\u3001\u4eca\u307e\u3067\u306b\u5b9f\u7e3e\u306e\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u3066\u624b\u3092\u629c\u3053\u3046\u3068\u8003\u3048\u305f\u306e\u3067\u3059\u304c\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u30ad\u30fc\u304c\u77ed\u904e\u304e\u308b\u306e\u304c\u539f\u56e0\u3089\u3057\u3044\u3067\u3059\u3002<\/p>\n\n\n<pre>$ sudo systemctl status apache2\n<code>\u25cf apache2.service - The Apache HTTP Server\n     Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\n     Active: failed (Result: exit-code) since Sun 2021-03-14 13:35:13 JST; 11min ago\n       Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\n    Process: 561706 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=1\/FAILURE)\n\n 3\u6708 14 13:35:13 big-book systemd[1]: Starting The Apache HTTP Server...\n 3\u6708 14 13:35:13 big-book apachectl[561721]: AH00558: apache2: Could not reliably determine the server's fully&gt;\n 3\u6708 14 13:35:13 big-book apachectl[561706]: Action 'start' failed.\n 3\u6708 14 13:35:13 big-book apachectl[561706]: The Apache error log may have more information.\n 3\u6708 14 13:35:13 big-book systemd[1]: apache2.service: Control process exited, code=exited, status=1\/FAILURE\n 3\u6708 14 13:35:13 big-book systemd[1]: apache2.service: Failed with result 'exit-code'.\n 3\u6708 14 13:35:13 big-book systemd[1]: Failed to start The Apache HTTP Server.\nlines 1-13\/13 (END)<\/code><\/pre>\n<p>error.log \u3092\u958b\u3044\u3066\u307f\u308b\u3068\u3001:ee key too small \u3068\u51fa\u3066\u3044\u308b\u306e\u3067\u8a3c\u660e\u66f8\u306e key \u304c\u5c0f\u3055\u3044\u306e\u304c\u539f\u56e0\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n<pre>$ less \/var\/log\/apache2\/error.log\n<code>[Sun Mar 14 13:35:13.253066 2021] [ssl:emerg] [pid 561721:tid 140387924089920] AH02562: Failed to configure certificate sunao-mita.pgw.jp:443:0 (with chain), check \/etc\/apache2\/ssl\/server.cert\n[Sun Mar 14 13:35:13.253158 2021] [ssl:emerg] [pid 561721:tid 140387924089920] SSL Library Error: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small\nAH00016: Configuration Failed\n\/var\/log\/apache2\/error.log (END)<\/code>\n<\/pre>\n\n\n<h2 class=\"wp-block-heading\">\u30aa\u30ec\u30aa\u30ec\u8a3c\u660e\u66f8\u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>\u6614\u3005\u3001\u30cd\u30c3\u30c8\u306e\u60c5\u5831\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u9802\u304d\u30aa\u30ec\u30aa\u30ec\u8a3c\u660e\u66f8\u3092\u4f5c\u6210\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u305d\u308c\u3092\u6d41\u7528\u3057\u3066\u66ab\u304f\u4f7f\u3048\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u4eca\u56de\u306f\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u8a3c\u660e\u66f8\u306e\u6761\u4ef6\u3082\u5e74\u6708\u3068\u5171\u306b\u53b3\u3057\u304f\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u5c11\u3057\u305a\u3064\u5bfe\u5fdc\u3057\u3066\u3044\u304b\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u30cd\u30c3\u30c8\u3092\u8272\u3005\u3068\u8abf\u3079\u5185\u5bb9\u306e\u91cd\u3052\u306a\u30b5\u30a4\u30c8\u3092\u898b\u4ed8\u3051\u307e\u3057\u305f\u3002\u307b\u307c\u4e38\u30b3\u30d4\u30fc\u3067\u8a66\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br><a href=\"https:\/\/one-it-thing.com\/63\/\">https:\/\/one-it-thing.com\/63\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u307e\u305a\u306f\u3001\u30aa\u30ec\u30aa\u30ec\u8a8d\u8a3c\u5c40\u304b\u306a<\/h3>\n\n\n\n<p>\u3042\u307e\u308a\u610f\u8b58\u3057\u305f\u3053\u3068\u304c\u306a\u304b\u3063\u305f\u3051\u3069 OpenSSL \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d\u3042\u305f\u308a\u304b\u3089\u9032\u3081\u3066\u3044\u3053\u3046\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<pre>$ openssl version\nOpenSSL 1.1.1f  31 Mar 2020\n<\/pre>\n\n\n<p>root \u30e6\u30fc\u30b6\u30fc\u306b\u306a\u3063\u3066\u3001\u4f5c\u696d\u7528\u306b \/openssl \u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3001\u305d\u3053\u306b\u79fb\u52d5\u3057\u3066\u30b5\u30f3\u30d7\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\u4f5c\u696d\u3092\u9032\u3081\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre>$ sudo su -\n# mkdir \/openssl\n# cd \/openssl\n# cp \/etc\/ssl\/openssl.cnf .\/<\/pre>\n<p>\u4f5c\u696d\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30ab\u30ec\u30f3\u30c8\u306b\u5b9a\u7fa9\u3001\u30b7\u30ea\u30a2\u30eb\u30ca\u30f3\u30d0\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre># vi openssl.cnf<br>\n<code>\u301c\u9014\u4e2d\u7701\u7565\u301c<br>\ndir   = .\/    # Where everything is kept<br>\n\u301c\u9014\u4e2d\u7701\u7565\u301c<\/code><br><br># touch .\/index.txt <br># echo 00 &gt; .\/serial<\/pre>\n<p>CA\u79d8\u5bc6\u9375\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u9014\u4e2d\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\uff12\u56de\u6253\u9375\u3057\u3066\u7d99\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<pre># openssl genrsa -aes256 -out .\/cakey.pem 2048\nGenerating RSA private key, 2048 bit long modulus (2 primes)\n......................................................+++++\n.................................................................+++++\ne is 65537 (0x010001)\nEnter pass phrase for .\/cakey.pem: \uff08\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u5099\u5fd8\u3057\u3066\u304a\u304f\uff09\nVerifying - Enter pass phrase for .\/cakey.pem:<\/pre>\n\n\n<h4 class=\"wp-block-heading\">CA\u8a3c\u660e\u66f8\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210<\/h4>\n\n\n\n<p>CA \u3068\u306f\u8a3c\u660e\u66f8\u8a8d\u8a3c\u5c40\u306a\u306e\u3067\u3057\u3087\u3046\u304b\u3001\u3042\u307e\u308a\u7406\u89e3\u3067\u304d\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u30cd\u30c3\u30c8\u60c5\u5831\u3092\u53c2\u8003\u306b\u9032\u3081\u307e\u3059\u3002<\/p>\n\n\n<pre># openssl req -new -key .\/cakey.pem -config .\/openssl.cnf -out cacert.csr\nEnter pass phrase for .\/cakey.pem:\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\nWhat you are about to enter is what is called a Distinguished Name or a DN.\nThere are quite a few fields but you can leave some blank\nFor some fields there will be a default value,\nIf you enter '.', the field will be left blank.\n-----\nCountry Name (2 letter code) [AU]:JP\nState or Province Name (full name) [Some-State]:Gunma\nLocality Name (eg, city) []:Fujioka\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Mita\nOrganizational Unit Name (eg, section) []:Mita-sec\nCommon Name (e.g. server FQDN or YOUR name) []:192.168.11.5\nEmail Address []:sunao.mita@nifty.com\n\nPlease enter the following 'extra' attributes\nto be sent with your certificate request\nA challenge password []:\nAn optional company name []:\n<\/pre>\n\n\n<p>\u7406\u89e3\u3092\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001X509 v3 \u62e1\u5f35\u9818\u57df\u306b\u5165\u308c\u308b\u305f\u3081\u306b\u3001v3_ca.txt \u3092\u4f5c\u6210\u3059\u308b\u306e\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n<pre># vi v3_ca.txt\n<code>basicConstraints = critical, CA:true\nkeyUsage = critical, cRLSign, keyCertSign\nsubjectKeyIdentifier=hash<\/code>\n<\/pre>\n\n\n<h4 class=\"wp-block-heading\">CA\u8a3c\u660e\u66f8\u4f5c\u6210<\/h4>\n\n\n\n<p>\u3053\u3053\u3067\u3084\u3063\u3068CA\u8a3c\u660e\u66f8\u306e\u4f5c\u6210\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<pre># openssl ca -in cacert.csr -selfsign -keyfile .\/cakey.pem -notext -config .\/openssl.cnf \n-outdir . -days 3650 -extfile v3_ca.txt -out cacert.pem\nUsing configuration from .\/openssl.cnf\nEnter pass phrase for .\/cakey.pem:\nCheck that the request matches the signature\nSignature ok\nCertificate Details:\n        Serial Number: 0 (0x0)\n        Validity\n            Not Before: Mar 14 06:43:10 2021 GMT\n            Not After : Mar 12 06:43:10 2031 GMT\n        Subject:\n            countryName               = JP\n            stateOrProvinceName       = Gunma\n            organizationName          = Mita\n            organizationalUnitName    = Mita-sec\n            commonName                = 192.168.11.5\n            emailAddress              = sunao.mita@nifty.com\n        X509v3 extensions:\n            X509v3 Basic Constraints: critical\n                CA:TRUE \n            X509v3 Key Usage: critical\n                Certificate Sign, CRL Sign\n            X509v3 Subject Key Identifier:\n                CD:2A:04:41:9A:3D:D3:23:1E:BE:C6:FE:FD:E4:3C:8D:1D:9C:1A:79\nCertificate is to be certified until Mar 12 06:43:10 2031 GMT (3650 days)\nSign the certificate? [y\/n]:y\n\n\n1 out of 1 certificate requests certified, commit? [y\/n]y\nWrite out database with 1 new entries\nData Base Updated\n<\/pre>\n\n\n<p>\u3067\u304d\u3042\u304c\u3063\u305f\u8a3c\u660e\u66f8\u3092\u30c6\u30ad\u30b9\u30c8\u3067\u78ba\u8a8d\u3057\u3066\u307f\u3066\u3001X509v3 \u306e\u8a18\u8ff0\u304c\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u306e\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n<pre># openssl x509 -in cacert.pem -text\n<code>\u301c\u7701\u7565\u301c\n       X509v3 extensions:\n            X509v3 Basic Constraints: critical\n                CA:TRUE\n            X509v3 Key Usage: critical\n                Certificate Sign, CRL Sign\n            X509v3 Subject Key Identifier: \n                CD:2A:04:41:9A:3D:D3:23:1E:BE:C6:FE:FD:E4:3C:8D:1D:9C:1A:79\n\u301c\u7701\u7565\u301c<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\">\u30aa\u30ec\u30aa\u30ec \u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u79d8\u5bc6\u9375\u306e\u4f5c\u6210<\/h4>\n\n\n<pre># openssl genrsa -aes256 -out .\/server.key 2048\nGenerating RSA private key, 2048 bit long modulus (2 primes)\n........................................................................................................................................................................................................................+++++\n..........................+++++\ne is 65537 (0x010001)\nEnter pass phrase for .\/server.key: \uff08\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u5099\u5fd8\u3057\u3066\u304a\u304f\uff09\nVerifying - Enter pass phrase for .\/server.key:\n<\/pre>\n\n\n<h4 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8\u30ea\u30af\u30a8\u30b9\u30c8\u4f5c\u6210<\/h4>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002\u500b\u4eba\u4f7f\u7528\u306a\u306e\u3067 CA\u8a3c\u660e\u66f8\u3068\u5185\u5bb9\u306f\u540c\u3058\u3067\u826f\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n<pre># openssl req -new -key .\/server.key -config .\/openssl.cnf -out server.csr\nEnter pass phrase for .\/server.key: \uff08\u79d8\u5bc6\u9375\u306b\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\uff09\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\nWhat you are about to enter is what is called a Distinguished Name or a DN.\nThere are quite a few fields but you can leave some blank\nFor some fields there will be a default value,\nIf you enter '.', the field will be left blank.\n-----\nCountry Name (2 letter code) [AU]:JP\nState or Province Name (full name) [Some-State]:Gunma\nLocality Name (eg, city) []:Fujioka\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Mita\nOrganizational Unit Name (eg, section) []:Mita-sec\nCommon Name (e.g. server FQDN or YOUR name) []:sunao-mita.pgw.jp\nEmail Address []:sunao.mita@nifty.com\n\nPlease enter the following 'extra' attributes\nto be sent with your certificate request\nA challenge password []:\nAn optional company name []:\n<\/pre>\n\n\n<h4 class=\"wp-block-heading\">\u8a3c\u660e\u66f8\u306eX509 v3\u62e1\u5f35\u60c5\u5831<\/h4>\n\n\n<pre># vi v3_server.txt\n<code>[SAN]\nbasicConstraints = CA:false\nkeyUsage = critical, digitalSignature, keyEncipherment\nextendedKeyUsage = serverAuth\nauthorityKeyIdentifier=keyid,issuer\n\nsubjectAltName=@alt_names\nbasicConstraints=CA:FALSE\n[alt_names]\nDNS.1=192.168.11.2\nIP.1=192.168.11.5\nIP.2=127.0.0.1<\/code>\n<\/pre>\n\n\n<h4 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8\u306e\u4f5c\u6210<\/h4>\n\n\n<pre># openssl ca -in server.csr -config openssl.cnf -keyfile .\/cakey.pem -outdir . -extfile v3_server.txt -extensions SAN -out server.crt -days 3650\nUsing configuration from openssl.cnf\nEnter pass phrase for .\/cakey.pem:\nCheck that the request matches the signature\nSignature ok\nCertificate Details:\n        Serial Number: 1 (0x1)\n        Validity\n            Not Before: Mar 14 07:43:48 2021 GMT\n            Not After : Mar 12 07:43:48 2031 GMT\n        Subject:\n            countryName               = JP\n            stateOrProvinceName       = Gunma\n            organizationName          = Mita\n            organizationalUnitName    = Mita-sec\n            commonName                = sunao-mita.pgw.jp\n            emailAddress              = sunao.mita@nifty.com\n        X509v3 extensions:\n            X509v3 Key Usage: critical\n                Digital Signature, Key Encipherment\n            X509v3 Extended Key Usage: \n                TLS Web Server Authentication\n            X509v3 Authority Key Identifier: \n                keyid:CD:2A:04:41:9A:3D:D3:23:1E:BE:C6:FE:FD:E4:3C:8D:1D:9C:1A:79\n\n            X509v3 Subject Alternative Name: \n                DNS:192.168.11.2, IP Address:192.168.11.5, IP Address:127.0.0.1\n            X509v3 Basic Constraints: \n                CA:FALSE\nCertificate is to be certified until Mar 12 07:43:48 2031 GMT (3650 days)\nSign the certificate? [y\/n]:y\n\n\n1 out of 1 certificate requests certified, commit? [y\/n]y\nWrite out database with 1 new entries\nData Base Updated\n<\/pre>\n\n\n<p>\u78ba\u8a8d\u306e\u305f\u3081\u306b\u3067\u304d\u305f\u30b5\u30fc\u30d0\u30fc\u8a3c\u660e\u66f8\u3092\u30c6\u30ad\u30b9\u30c8\u30c0\u30f3\u30d7\u3057\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre># openssl x509 -in server.crt -text\n<code>\u301c\u7701\u7565\u301c\n        X509v3 extensions:\n            X509v3 Key Usage: critical\n                Digital Signature, Key Encipherment\n            X509v3 Extended Key Usage: \n                TLS Web Server Authentication\n            X509v3 Authority Key Identifier: \n                keyid:CD:2A:04:41:9A:3D:D3:23:1E:BE:C6:FE:FD:E4:3C:8D:1D:9C:1A:79\n\n            X509v3 Subject Alternative Name: \n                DNS:192.168.11.2, IP Address:192.168.11.5, IP Address:127.0.0.1\n            X509v3 Basic Constraints: \n                CA:FALSE\n\u301c\u7701\u7565\u301c<\/code><\/pre>\n\n\n<p>\u30d1\u30b9\u306a\u3057\u30b5\u30fc\u30d0\u30fc\u79d8\u5bc6\u9375\u306e\u751f\u6210<\/p>\n\n\n<pre># openssl rsa -in .\/server.key -out nopass_server.key\nEnter pass phrase for .\/server.key:\nwriting RSA key\n<\/pre>\n\n\n<h3 class=\"wp-block-heading\">\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u3067\u304d\u305f\u6210\u679c<\/h3>\n\n\n\n<p>\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u306f\u4e0d\u8981\u306a\u4f5c\u696d\u30d5\u30a1\u30a4\u30eb\u3082\u542b\u3081\u3001\u8272\u3005\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u5fc5\u8981\u306a\u3082\u306e\u306f\u6b21\u306e\uff14\u70b9\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<ol><li>CA\u79d8\u5bc6\u9375\uff1acakey.pem     \u2026\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u3092\u4f5c\u308b\u305f\u3081\u3067\u3001\u4e0d\u4f7f\u7528<\/li><li>CA\u8a3c\u660e\u66f8\uff1acacert.pem     \u2026\u30b5\u30fc\u30d0\u30fc\u3092\u5229\u7528\u3059\u308b\u7aef\u672b\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u4f7f\u7528<\/li><li>\u30b5\u30fc\u30d0\u79d8\u5bc6\u9375\uff1anopass_server.key   \u2026\u30b5\u30fc\u30d0\u30fc\u306e apache \u306b\u6307\u5b9a<\/li><li>\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\uff1aserver.crt       \u2026\u30b5\u30fc\u30d0\u30fc\u306e apache \u306b\u6307\u5b9a<\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc ssl\u306e\u8a2d\u5b9a\u306b<\/h4>\n\n\n\n<p>\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u5834\u6240\u304c\u8907\u6570\u3042\u308a\u3001\u305d\u306e\uff11\u7b87\u6240\u3092\u6b21\u306b\u793a\u3057\u307e\u3059\u3002\u540c\u69d8\u306b sites-available \u5185\u306essl \u306b\u95a2\u9023\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<pre># vi \/etc\/apache2\/sites-available\/default-ssl.conf\n<code>\u301c\u7701\u7565\u301c\n                SSLCertificateFile    \/openssl\/server.crt\n                SSLCertificateKeyFile \/openssl\/nopass_server.key\n\u301c\u7701\u7565\u301c<\/code><\/pre>\n\n\n<h4 class=\"wp-block-heading\">\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d<\/h4>\n\n\n<pre>$ apache2ctl configtest\nAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\nSyntax OK\n<\/pre>\n\n\n<h4 class=\"wp-block-heading\">apache2 \u306e\u8d77\u52d5\u3068\u78ba\u8a8d<\/h4>\n\n\n\n<p>Syntax OK \u3068\u306a\u3063\u3066\u3044\u3066\u3082\u3001\u5b9f\u969b\u306b start \u3067\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u8d77\u52d5\u3057\u306a\u3044\u5834\u5408\u304c\u591a\u3044\u306e\u3067\u539f\u56e0\u3092\u3058\u3063\u304f\u308a\u6f70\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre>$ sudo systemctl start apache2\n$ sudo systemctl status apache2\n\u25cf apache2.service - The Apache HTTP Server\n     Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\n     Active: active (running) since Sun 2021-03-14 21:52:25 JST; 28s ago\n       Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\n    Process: 877445 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=0\/SUCCESS)\n   Main PID: 877471 (apache2)\n      Tasks: 57 (limit: 4413)\n     Memory: 8.2M\n     CGroup: \/system.slice\/apache2.service\n             \u251c\u2500877471 \/usr\/sbin\/apache2 -k start\n             \u251c\u2500877472 \/usr\/sbin\/apache2 -k start\n             \u251c\u2500877473 \/usr\/sbin\/apache2 -k start\n             \u251c\u2500877474 \/usr\/sbin\/apache2 -k start\n             \u2514\u2500877475 \/usr\/sbin\/apache2 -k start\n\n 3\u6708 14 21:52:25 big-book systemd[1]: Starting The Apache HTTP Server...\n 3\u6708 14 21:52:25 big-book apachectl[877454]: AH00558: apache2: Could not reliably determine the server's fully&gt;\n 3\u6708 14 21:52:25 big-book systemd[1]: Started The Apache HTTP Server.\nlines 2-18\/18 (END)<\/pre>\n\n\n<p>\u4f55\u3068\u304b\u6700\u5f8c\u306b\u8d77\u52d5\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u72b6\u306e\u74b0\u5883\u304b\u3089\u306e\u6a21\u7d22 \u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u5199\u771f\u3092\u30cd\u30c3\u30c8\u74b0\u5883\u306b\u516c\u958b\u3057\u3066\u3044\u308bWeb\u30b5\u30fc\u30d0\u30fc\u7528\u306b\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30c7\u30fc\u30bf\u30fc\u7b49\u3092\u4f5c\u6210\u3057\u305f\u308a\u3001\u52d5\u4f5c\u306e\u691c\u8a3c\u3092\u3059\u308b\u305f\u3081\u306b\u5225\u306e\u6a5f\u5668\u3092\u7acb\u4e0a\u3052\u3001\u305d\u3053\u306b\u30c7\u30fc\u30bf\u30fc\u3092\u5909\u63db\u3059\u308b\u30a2\u30d7\u30ea\u3084\u691c\u8a3c\u306e\u305f\u3081\u306b apach &hellip; <a href=\"http:\/\/sunao-mita.pgw.jp\/blog\/?p=1534\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">apache2 \u304c\u8d77\u52d5\u3057\u306a\u3044<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,9,13,14],"tags":[],"_links":{"self":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1534"}],"collection":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1534"}],"version-history":[{"count":14,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1534\/revisions"}],"predecessor-version":[{"id":1548,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1534\/revisions\/1548"}],"wp:attachment":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1534"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}