{"id":47432,"date":"2024-10-07T13:52:15","date_gmt":"2024-10-07T05:52:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/47432\/"},"modified":"2024-10-07T13:52:15","modified_gmt":"2024-10-07T05:52:15","slug":"iis%e6%96%b0%e6%89%8b%e6%8c%87%e5%8d%97%ef%bc%9a%e4%bd%bf%e7%94%a8iis%e5%af%a6%e6%96%bd%e6%bc%b8%e9%80%b2%e5%bc%8fweb%e6%87%89%e7%94%a8","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/47432\/","title":{"rendered":"IIS\u65b0\u624b\u6307\u5357\uff1a\u4f7f\u7528IIS\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528"},"content":{"rendered":"<h1 id=\"iis%e6%96%b0%e6%89%8b%e6%8c%87%e5%8d%97%ef%bc%9a%e4%bd%bf%e7%94%a8iis%e5%af%a6%e6%96%bd%e6%bc%b8%e9%80%b2%e5%bc%8fweb%e6%87%89%e7%94%a8-XTLZBhbIat\">IIS\u65b0\u624b\u6307\u5357\uff1a\u4f7f\u7528IIS\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u9078\u64c7\u5408\u9069\u7684Web\u4f3a\u670d\u5668\u5c0d\u65bc\u958b\u767c\u548c\u90e8\u7f72Web\u61c9\u7528\u81f3\u95dc\u91cd\u8981\u3002\u5fae\u8edf\u7684Internet Information Services\uff08IIS\uff09\u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684Web\u4f3a\u670d\u5668\uff0c\u9069\u5408\u7528\u65bc\u5404\u7a2eWeb\u61c9\u7528\u7684\u958b\u767c\u548c\u7ba1\u7406\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528IIS\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528\uff0c\u5e6b\u52a9\u65b0\u624b\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<h2 id=\"iis%e7%b0%a1%e4%bb%8b-XTLZBhbIat\">IIS\u7c21\u4ecb<\/h2>\n<p>IIS\u662f\u4e00\u500b\u7531\u5fae\u8edf\u958b\u767c\u7684Web\u4f3a\u670d\u5668\uff0c\u652f\u6301\u591a\u7a2eWeb\u6280\u8853\uff0c\u5305\u62ecASP.NET\u3001PHP\u548cHTML\u3002\u5b83\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u529f\u80fd\uff0c\u5982\u5b89\u5168\u6027\u3001\u6027\u80fd\u512a\u5316\u548c\u64f4\u5c55\u6027\uff0c\u9069\u5408\u7528\u65bc\u4f01\u696d\u7d1a\u61c9\u7528\u548c\u5c0f\u578b\u7db2\u7ad9\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9diis-XTLZBhbIat\">\u5b89\u88ddIIS<\/h2>\n<p>\u5728Windows\u7cfb\u7d71\u4e0a\u5b89\u88ddIIS\u76f8\u5c0d\u7c21\u55ae\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u6253\u958b\u201c\u63a7\u5236\u9762\u677f\u201d\u3002<\/li>\n<li>\u9078\u64c7\u201c\u7a0b\u5e8f\u201d &gt; \u201c\u555f\u7528\u6216\u95dc\u9589Windows\u529f\u80fd\u201d\u3002<\/li>\n<li>\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201cIIS\u201d\u9078\u9805\uff0c\u52fe\u9078\u6240\u9700\u7684\u529f\u80fd\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u3002<\/li>\n<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u901a\u904e\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165\u201chttp:\/\/localhost\u201d\u4f86\u6aa2\u67e5IIS\u662f\u5426\u904b\u884c\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e9%85%8d%e7%bd%aeiis-XTLZBhbIat\">\u914d\u7f6eIIS<\/h2>\n<p>\u5b89\u88ddIIS\u5f8c\uff0c\u63a5\u4e0b\u4f86\u9700\u8981\u9032\u884c\u57fa\u672c\u914d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u914d\u7f6e\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e5%89%b5%e5%bb%ba%e7%b6%b2%e7%ab%99-XTLZBhbIat\">\u5275\u5efa\u7db2\u7ad9<\/h3>\n<p>\u5728IIS\u7ba1\u7406\u5668\u4e2d\uff0c\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u5275\u5efa\u65b0\u7db2\u7ad9\uff1a<\/p>\n<ol>\n<li>\u6253\u958bIIS\u7ba1\u7406\u5668\u3002<\/li>\n<li>\u53f3\u9375\u9ede\u64ca\u201c\u7db2\u7ad9\u201d\u7bc0\u9ede\uff0c\u9078\u64c7\u201c\u6dfb\u52a0\u7db2\u7ad9\u201d\u3002<\/li>\n<li>\u586b\u5beb\u7db2\u7ad9\u540d\u7a31\u3001\u7269\u7406\u8def\u5f91\u548c\u7aef\u53e3\u865f\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u3002<\/li>\n<\/ol>\n<h3 id=\"%e8%a8%ad%e7%bd%ae%e6%87%89%e7%94%a8%e7%a8%8b%e5%ba%8f%e6%b1%a0-XTLZBhbIat\">\u8a2d\u7f6e\u61c9\u7528\u7a0b\u5e8f\u6c60<\/h3>\n<p>\u61c9\u7528\u7a0b\u5e8f\u6c60\u662fIIS\u4e2d\u7528\u65bc\u7ba1\u7406Web\u61c9\u7528\u7684\u5bb9\u5668\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u8a2d\u7f6e\u61c9\u7528\u7a0b\u5e8f\u6c60\uff1a<\/p>\n<ol>\n<li>\u5728IIS\u7ba1\u7406\u5668\u4e2d\uff0c\u9078\u64c7\u201c\u61c9\u7528\u7a0b\u5e8f\u6c60\u201d\u3002<\/li>\n<li>\u53f3\u9375\u9ede\u64ca\uff0c\u9078\u64c7\u201c\u6dfb\u52a0\u61c9\u7528\u7a0b\u5e8f\u6c60\u201d\u3002<\/li>\n<li>\u8a2d\u7f6e\u540d\u7a31\u548c.NET CLR\u7248\u672c\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%af%a6%e6%96%bd%e6%bc%b8%e9%80%b2%e5%bc%8fweb%e6%87%89%e7%94%a8-XTLZBhbIat\">\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528<\/h2>\n<p>\u6f38\u9032\u5f0fWeb\u61c9\u7528\uff08PWA\uff09\u662f\u4e00\u7a2e\u65b0\u8208\u7684Web\u61c9\u7528\u6280\u8853\uff0c\u65e8\u5728\u63d0\u4f9b\u985e\u4f3c\u539f\u751f\u61c9\u7528\u7684\u7528\u6236\u9ad4\u9a57\u3002\u4ee5\u4e0b\u662f\u5be6\u65bdPWA\u7684\u4e00\u4e9b\u95dc\u9375\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8https-XTLZBhbIat\">\u4f7f\u7528HTTPS<\/h3>\n<p>PWA\u8981\u6c42\u4f7f\u7528HTTPS\u5354\u8b70\u4f86\u78ba\u4fdd\u5b89\u5168\u6027\u3002\u53ef\u4ee5\u901a\u904eIIS\u914d\u7f6eSSL\u8b49\u66f8\u4f86\u5be6\u73fe\uff1a<\/p>\n<ol>\n<li>\u5728IIS\u7ba1\u7406\u5668\u4e2d\uff0c\u9078\u64c7\u7db2\u7ad9\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u7d81\u5b9a\u201d\u3002<\/li>\n<li>\u6dfb\u52a0HTTPS\u7d81\u5b9a\uff0c\u4e26\u9078\u64c7\u76f8\u61c9\u7684SSL\u8b49\u66f8\u3002<\/li>\n<\/ol>\n<h3 id=\"%e5%89%b5%e5%bb%bamanifest%e6%96%87%e4%bb%b6-XTLZBhbIat\">\u5275\u5efaManifest\u6587\u4ef6<\/h3>\n<p>Manifest\u6587\u4ef6\u662f\u4e00\u500bJSON\u6587\u4ef6\uff0c\u63cf\u8ff0\u4e86PWA\u7684\u57fa\u672c\u4fe1\u606f\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>{\n    \"name\": \"\u6211\u7684PWA\",\n    \"short_name\": \"PWA\",\n    \"start_url\": \"\/index.html\",\n    \"display\": \"standalone\",\n    \"background_color\": \"#ffffff\",\n    \"theme_color\": \"#000000\",\n    \"icons\": [\n        {\n            \"src\": \"icon.png\",\n            \"sizes\": \"192x192\",\n            \"type\": \"image\/png\"\n        }\n    ]\n}<\/code><\/pre>\n<p>\u5c07\u6b64\u6587\u4ef6\u653e\u7f6e\u5728\u7db2\u7ad9\u6839\u76ee\u9304\u4e2d\uff0c\u4e26\u5728HTML\u4e2d\u5f15\u7528\uff1a<\/p>\n<pre><code>&lt;link rel=\"manifest\" href=\"\/manifest.json\"&gt;<\/code><\/pre>\n<h3 id=\"%e8%a8%bb%e5%86%8aservice-worker-XTLZBhbIat\">\u8a3b\u518aService Worker<\/h3>\n<p>Service Worker\u662f\u4e00\u7a2e\u5728\u80cc\u666f\u4e2d\u904b\u884c\u7684\u8173\u672c\uff0c\u53ef\u4ee5\u5be6\u73fe\u96e2\u7dda\u529f\u80fd\u548c\u63a8\u9001\u901a\u77e5\u3002\u4ee5\u4e0b\u662f\u8a3b\u518aService Worker\u7684\u57fa\u672c\u4ee3\u78bc\uff1a<\/p>\n<pre><code>if ('serviceWorker' in navigator) {\n    window.addEventListener('load', function() {\n        navigator.serviceWorker.register('\/service-worker.js').then(function(registration) {\n            console.log('Service Worker\u8a3b\u518a\u6210\u529f:', registration);\n        }, function(error) {\n            console.log('Service Worker\u8a3b\u518a\u5931\u6557:', error);\n        });\n    });\n}<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-XTLZBhbIat\">\u7e3d\u7d50<\/h2>\n<p>\u4f7f\u7528IIS\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528\u662f\u4e00\u500b\u6709\u6548\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u63d0\u5347\u7528\u6236\u9ad4\u9a57\u4e26\u589e\u5f37\u61c9\u7528\u7684\u529f\u80fd\u6027\u3002\u901a\u904e\u5b89\u88dd\u548c\u914d\u7f6eIIS\uff0c\u5275\u5efa\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5e8f\u6c60\uff0c\u4e26\u5be6\u65bdPWA\u7684\u95dc\u9375\u6280\u8853\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u5feb\u901f\u4e0a\u624b\u4e26\u69cb\u5efa\u51fa\u9ad8\u6548\u7684Web\u61c9\u7528\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u591a\u6709\u95dc<em><a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a><\/em>\u548c<em><a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a><\/em>\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u6e90\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22IIS\u65b0\u624b\u6307\u5357\uff0c\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528IIS\u5be6\u65bd\u6f38\u9032\u5f0fWeb\u61c9\u7528\uff0c\u63d0\u5347\u7db2\u7ad9\u6027\u80fd\u8207\u7ba1\u7406\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-47432","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=47432"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47432\/revisions"}],"predecessor-version":[{"id":47433,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47432\/revisions\/47433"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=47432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=47432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=47432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}