{"id":777,"date":"2023-03-15T14:52:23","date_gmt":"2023-03-15T06:52:23","guid":{"rendered":"http:\/\/blog.nonot.cn\/?p=777"},"modified":"2024-07-08T12:43:35","modified_gmt":"2024-07-08T04:43:35","slug":"%e6%9c%ac%e5%9c%b0%e5%9c%a8phpstudy-%e9%85%8d%e7%bd%ae%e6%a8%a1%e6%8b%9fhttps","status":"publish","type":"post","link":"https:\/\/blog.nonot.cn\/index.php\/2023\/03\/15\/%e6%9c%ac%e5%9c%b0%e5%9c%a8phpstudy-%e9%85%8d%e7%bd%ae%e6%a8%a1%e6%8b%9fhttps\/","title":{"rendered":"\u672c\u5730\u5728phpstudy \u914d\u7f6e\u6a21\u62dfhttps"},"content":{"rendered":"<p data-pid=\"H-zUQUvr\">\u524d\u63d0\uff1a\u6211\u672c\u5730\u914d\u7684\u662fphpstudy\uff0c\u6709\u8fd9\u4e2a\u5c31\u591f\u4e86\u3002<\/p>\n<h2>1.\u751f\u6210\u670d\u52a1\u5668\u8bc1\u4e66<\/h2>\n<p data-pid=\"f2n45Od4\">1.\u8fdb\u5165dos\u547d\u4ee4<\/p>\n<p data-pid=\"JgLMPXEW\">dos\u547d\u4ee4\u8fdb\u5165phpstudy\u5b89\u88c5\u76ee\u5f55\u91cc\u9762\u7684Apache\u7684bin\u76ee\u5f55<\/p>\n<p data-pid=\"U9R1nsuB\">\u4f8b\u5982\uff1aD:\\programs\\phpStudy\\Apache\\bin<\/p>\n<p data-pid=\"fwEQB9Kf\">2.\u8bbe\u7f6eOpenssl\u73af\u5883\u53d8\u91cf<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-adl\">set OPENSSL_CONF=..\/conf\/openssl.cnf<\/code><\/pre>\n<\/div>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-94944.png\" width=\"575\" height=\"60\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"575\" data-rawheight=\"60\" data-original=\"https:\/\/pic2.zhimg.com\/v2-8388be840c4206370943d44b42fbd965_r.jpg\" data-actualsrc=\"https:\/\/pic2.zhimg.com\/v2-8388be840c4206370943d44b42fbd965_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"fUw2TLAt\">\u7528\u6765\u6307\u660epenssl.cnf\u7684\u6240\u5728\u4f4d\u7f6e\uff0c\u4e0d\u6307\u660e\u7684\u8bdd\uff0c\u4e0b\u9762\u6267\u884c\u7b7e\u7f72\u670d\u52a1\u5668\u8bc1\u4e66\u6587\u4ef6\u547d\u4ee4\u65f6\u4f1a\u62a5\u9519\uff08WARNING: can&#8217;t open config file: \/apache24\/conf\/openssl.cnf\uff09<\/p>\n<p data-pid=\"WzdkFtuM\">\u50cf\u8fd9\u6837\u7684<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-1c9b6.png\" width=\"536\" height=\"83\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"536\" data-rawheight=\"83\" data-original=\"https:\/\/pic3.zhimg.com\/v2-1da581df14e536defd77230c2a934536_r.jpg\" data-actualsrc=\"https:\/\/pic3.zhimg.com\/v2-1da581df14e536defd77230c2a934536_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"lVRLan69\">3.\u751f\u6210\u5bc6\u94a5\u6587\u4ef6<\/p>\n<p data-pid=\"ZJ0hoMTO\">openssl genrsa 1024 &gt;ssl.key<\/p>\n<p data-pid=\"kJALcdrC\">\uff08\u8fd9\u662f\u7528128\u4f4drsa\u7b97\u6cd5\u751f\u6210\u5bc6\u94a5\uff0c\u5f97\u5230ssl.key\u6587\u4ef6\uff09<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-56701.png\" width=\"545\" height=\"108\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"545\" data-rawheight=\"108\" data-original=\"https:\/\/pic2.zhimg.com\/v2-da53a83dfbcffa87d52a27cec5e6606d_r.jpg\" data-actualsrc=\"https:\/\/pic2.zhimg.com\/v2-da53a83dfbcffa87d52a27cec5e6606d_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"6vZk3mcL\">4.\u751f\u6210\u8bc1\u4e66\u8bf7\u6c42\u6587\u4ef6<\/p>\n<p data-pid=\"2_xlfLlE\">\uff081\uff09\u6267\u884c\u751f\u6210\u6587\u4ef6\u547d\u4ee4<\/p>\n<p data-pid=\"2CydcNqt\">openssl req -new -key ssl.key &gt; ssl.csr<\/p>\n<p data-pid=\"YH14KN4p\">\u8fd9\u662f\u7528\u4e4b\u524d\u751f\u6210\u5bc6\u94a5\u6587\u4ef6\uff08ssl.key\uff09\u6765\u751f\u6210\u8bc1\u4e66\u8bf7\u6c42\u6587\u4ef6ssl.csr<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-44307.png\" width=\"611\" height=\"154\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"611\" data-rawheight=\"154\" data-original=\"https:\/\/pic4.zhimg.com\/v2-8fbf1346ae3cc4b015134a05e7dac617_r.jpg\" data-actualsrc=\"https:\/\/pic4.zhimg.com\/v2-8fbf1346ae3cc4b015134a05e7dac617_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"TCGPlibL\">\uff082\uff09\u6839\u636e\u63d0\u793a\u586b\u5199\u5404\u9879\u53c2\u6570<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">Country Name (2 letter code) [AU]:CN ISO\u56fd\u5bb6\u4ee3\u7801\nState or Province Name (full name) [Some-State]:SD\u6240\u5728\u7701\u4efd\nLocality Name (eg, city) []:YT\u6240\u5728\u57ce\u5e02\nOrganization Name (eg, company):test1\u516c\u53f8\u540d\u79f0\nOrganizational Unit Name (eg, section) []:test2\u7ec4\u7ec7\u540d\u79f0\nCommon Name (eg, YOUR name) []:mywww.com\u7533\u8bf7\u8bc1\u4e66\u7684\u57df\u540d\nEmail Address []:admin@admin.com \u7ba1\u7406\u5458\u90ae\u7bb1\n<\/code><\/pre>\n<\/div>\n<p data-pid=\"Zsk9r96C\">\u8f93\u5165\u5bc6\u7801\uff0c\u6211\u5199\u7684\u662f111111<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">Please enter the following 'extra' attributes\nto be sent with your certificate request\nA challenge password []:111111<\/code><\/pre>\n<\/div>\n<p data-pid=\"qrhTcUpn\">\u7ee7\u7eed\u8f93\u5165\u7533\u8bf7\u8bc1\u4e66\u7684\u57df\u540d<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">An optional company name []:myww.com<\/code><\/pre>\n<\/div>\n<p data-pid=\"ci_j3WI8\">\u91cd\u8981\u8bf4\u660e\uff1acompany name\u4e0e\u4e0a\u9762\u7684Common Name\u4e00\u5b9a\u8981\u4fdd\u6301\u4e00\u81f4<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-2d0d7.png\" width=\"562\" height=\"222\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"562\" data-rawheight=\"222\" data-original=\"https:\/\/pic4.zhimg.com\/v2-401cec41aa5b30f1761252b3d95368bf_r.jpg\" data-actualsrc=\"https:\/\/pic4.zhimg.com\/v2-401cec41aa5b30f1761252b3d95368bf_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"S-avZHX2\">5.\u7b7e\u7f72\u670d\u52a1\u5668\u8bc1\u4e66\u6587\u4ef6\u3002<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">openssl req -x509 -days 5000 -key ssl.key -in ssl.csr &gt; ssl.crt<\/code><\/pre>\n<\/div>\n<p data-pid=\"lfnemNwu\">\u8fd9\u662f\u524d\u51e0\u6b65\u751f\u6210\u7684\u5bc6\u94a5ssl.key\u548c\u8bc1\u4e66ssl.csr\u8bf7\u6c42\u751f\u6210\u8bc1\u4e66 ssl.crt\uff0c-days\u53c2\u6570\u6307\u660e\u8bc1\u4e66\u6709\u6548\u671f\uff0c\u5355\u4f4d\u4e3a\u5929\uff0c<\/p>\n<p data-pid=\"MDzUNZYv\">\u7528openssl x509 -noout -text -in ssl.crt \u53ef\u4ee5\u67e5\u770b\u8bc1\u4e66\u7684\u5185\u5bb9<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-3564f.png\" width=\"788\" height=\"60\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"788\" data-rawheight=\"60\" data-original=\"https:\/\/pic2.zhimg.com\/v2-418bb29ae9fce80253b7559203a05809_r.jpg\" data-actualsrc=\"https:\/\/pic2.zhimg.com\/v2-418bb29ae9fce80253b7559203a05809_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"mMqks5DG\">2.\u914d\u7f6eApache<\/p>\n<p data-pid=\"jhSbc4Lx\">\u5c06\u751f\u6210\u7684\u4e09\u4e2a\u6587\u4ef6\u79fb\u52a8\u5230ssl.crt,ssl.csr,ssl.key\u79fb\u52a8\u5230Apache\\conf\u76ee\u5f55\u4e0b\u9762\uff08\u4e2a\u4eba\u4e60\u60ef\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u79fb\u52a8\uff0c\u4e0b\u9762\u914d\u7f6e\u65f6\u8def\u5f84\u5199\u5bf9\u5c31\u53ef\u4ee5\uff09<\/p>\n<p data-pid=\"lLQVr5jn\">1.\u4fee\u6539httpd.conf<\/p>\n<p data-pid=\"Vpp1A2hn\">\u53d6\u6d88\u4e0b\u9762\u4e24\u884c\u7684\u6ce8\u91ca#<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">Include conf\/extra\/httpd-ssl.conf\nLoadModule ssl_module modules\/mod_ssl.so<\/code><\/pre>\n<\/div>\n<p data-pid=\"3LKcTUBM\">\u589e\u52a0\uff1aListen 443<\/p>\n<p data-pid=\"TsyFqbvg\">\u76d1\u542c443\u7aef\u53e3<\/p>\n<p data-pid=\"tw8H1RKw\">2.\u914d\u7f6evohosts<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-text\">&lt;VirtualHost *:443&gt;\n   DocumentRoot \"D:\\SERVER\\work\\bbspre\"\n   ServerName mytestbbs.com\n &lt;Directory \"D:\\SERVER\\work\\bbspre\"&gt;\n     Options FollowSymLinks ExecCGI\n     AllowOverride All\n     Order allow,deny\n     Allow from all\n     Require all granted\n &lt;\/Directory&gt;\n   SSLEngine on\n   SSLCipherSuite AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5 \n   SSLCertificateFile  D:\\programs\\phpStudy\\Apache\\conf\\ssl.crt\n   SSLCertificateKeyFile D:\\programs\\phpStudy\\Apache\\conf\\ssl.key\n   SSLHonorCipherOrder on \n&lt;\/VirtualHost&gt;<\/code><\/pre>\n<\/div>\n<p data-pid=\"8WtoJQCG\">\u91cd\u70b9\u8bf4\u660e\uff1a\u201c&lt;VirtualHost *:443&gt;\u201d\uff0c\u4e00\u5b9a\u8981\u662f443\uff0c\u7aef\u53e3\uff0c<\/p>\n<p data-pid=\"9687m_7V\">SSLEngine on<\/p>\n<p data-pid=\"dxa-cVsH\">SSLCipherSuite AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5<\/p>\n<p data-pid=\"LbGfLxOq\">SSLCertificateFile D:\\programs\\phpStudy\\Apache\\conf\\ssl.crt<\/p>\n<p data-pid=\"5ZXiIGZ2\">SSLCertifcateKeyFile D:\\programs\\phpStudy\\Apache\\conf\\ssl.key<\/p>\n<p data-pid=\"fABEYK-X\">SSLHonorCipherOrder on<\/p>\n<p data-pid=\"hU4T9XBS\">\u8fd9\u51e0\u9879\u662f\u9488\u5bf9https\u7684\u8bbe\u7f6e\uff0c\u5176\u4f59\u53c2\u8003\u666e\u901a\u914d\u7f6e\u5c31\u53ef\u4ee5<\/p>\n<p data-pid=\"DnU3_AKf\">\u914d\u7f6e\u5b8c\u7ed3\u3001\u6492\u82b1<\/p>\n<p data-pid=\"2RNDp2ym\">dos\u547d\u4ee4\u76f4\u63a5 httpd\uff0c\u6ca1\u62a5\u9519\u5c31\u8bf4\u660e\u6210\u529f\u4e86<\/p>\n<p data-pid=\"iCWbrw6U\">3.\u610f\u5916<\/p>\n<p data-pid=\"201YXMYH\">\u6211\u6267\u884c\u65f6\u5c31\u51fa\u9519\u4e86\uff0c\u201c(OS 10048)\u901a\u5e38\u6bcf\u4e2a\u5957\u63a5\u5b57\u5730\u5740(\u534f\u8bae\/\u7f51\u7edc\u5730\u5740\/\u7aef\u53e3)\u53ea\u5141\u8bb8\u4f7f\u7528\u4e00\u6b21\u3002 : AH00072: make_sock: could not bind to address [::]:443\u201d<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145246-c54c3.png\" width=\"696\" height=\"145\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"696\" data-rawheight=\"145\" data-original=\"https:\/\/pic4.zhimg.com\/v2-50bf0e9ac9e0e259c2c814aff658b51b_r.jpg\" data-actualsrc=\"https:\/\/pic4.zhimg.com\/v2-50bf0e9ac9e0e259c2c814aff658b51b_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n<p data-pid=\"k2x1isSa\">\u662f443\u7aef\u53e3\u88ab\u5360\u7528\u4e86<\/p>\n<p data-pid=\"5oQtjUWS\">\u901a\u8fc7netstat -a -o \u547d\u4ee4\u627e\u5230\u5360\u7528\u7aef\u53e3\u7a0b\u5e8f\u7684pid\uff0c\u5728\u901a\u8fc7pid\u5728\u4efb\u52a1\u7ba1\u7406\u4e2d\u627e\u5230\u8be5\u7a0b\u5e8f\uff0c\u5173\u95ed\uff0c\u518d\u6267\u884chttpd\uff0c\u771f\u6b63\u5b8c\u7ed3\u6492\u82b1\u3002<\/p>\n<figure data-size=\"normal\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"origin_image zh-lightbox-thumb lazy\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2023\/03\/20230315145247-76b89.png\" width=\"704\" height=\"477\" data-caption=\"\" data-size=\"normal\" data-rawwidth=\"704\" data-rawheight=\"477\" data-original=\"https:\/\/pic3.zhimg.com\/v2-92165e31ed8ed1ed61f119b7345bdaa6_r.jpg\" data-actualsrc=\"https:\/\/pic3.zhimg.com\/v2-92165e31ed8ed1ed61f119b7345bdaa6_b.jpg\" data-lazy-status=\"ok\" \/><\/div>\n<\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u63d0\uff1a\u6211\u672c\u5730\u914d\u7684\u662fphpstudy\uff0c\u6709\u8fd9\u4e2a\u5c31\u591f\u4e86\u3002 1.\u751f\u6210&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/comments?post=777"}],"version-history":[{"count":1,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/777\/revisions"}],"predecessor-version":[{"id":1127,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/777\/revisions\/1127"}],"wp:attachment":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/media?parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/categories?post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/tags?post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}