{"id":57180,"date":"2025-08-15T08:40:02","date_gmt":"2025-08-15T00:40:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/57180.html"},"modified":"2025-08-15T08:40:02","modified_gmt":"2025-08-15T00:40:02","slug":"%e3%80%90%e7%bd%91%e7%bb%9c%e8%bf%90%e7%bb%b4%e3%80%91linux%ef%bc%9a%e5%b8%b8%e8%a7%81-web-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/57180.html","title":{"rendered":"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668"},"content":{"rendered":"<h2>\u5e38\u89c1 WEB \u670d\u52a1\u5668<\/h2>\n<h4>WEB \u670d\u52a1\u5668\u7b80\u4ecb<\/h4>\n<p>WEB\u4e5f\u79f0\u4e3aWWW(WORLD WIDE WEB)&#xff0c;\u4e2d\u6587\u540d\u5b57\u4e3a\u4e07\u7ef4\u7f51\u3001\u5168\u7403\u4fe1\u606f\u7f51\u7b49&#xff0c;\u4e3b\u8981\u529f\u80fd\u662f\u63d0\u4f9b\u7f51\u4e0a\u4fe1\u606f\u6d4f\u89c8\u670d\u52a1\u3002Web\u670d\u52a1\u5668\u53ef\u4ee5\u4e3aInternet\u4e0a\u7684\u7528\u6237\u63d0\u4f9bWWW\u3001Email\u548cFTP\u7b49\u5404\u79cdInternet\u670d\u52a1\u3002<\/p>\n<p>WEB\u8d77\u6e90\u4e8e1989\u5e743\u6708&#xff0c;\u4f2f\u7eb3\u65af-\u674e (Tim Berners-Lee) \u4e3a\u4e86\u66f4\u6709\u6548\u7387\u5730\u8ba9\u6b27\u6d32\u6838\u7269\u7406\u5b9e\u9a8c\u5ba4\u7684\u79d1\u5b66\u5bb6\u53ef\u4ee5\u5206\u4eab\u53ca\u66f4\u65b0\u4ed6\u4eec\u7684\u7814\u7a76\u6210\u679c&#xff0c; \u4e8e\u662f\u4ed6\u5f00\u53d1\u51fa\u8d85\u6587\u4ef6\u4f20\u8f93\u534f\u8bae(Hyper Text Transport Protocol, HTTP)\u3002\u4e3a\u4e86\u8ba9 HTTP \u8fd9\u4e2a\u534f\u8bae\u5f97\u4ee5\u987a\u5229\u7684\u5e94\u7528&#xff0c;\u5927\u7ea6\u572890 \u5e74\u4ee3\u521d\u671f&#xff0c;\u7531\u4f0a\u5229\u8bfa\u5927\u5b66\u7684\u56fd\u5bb6\u8d85\u7ea7\u8ba1\u7b97\u673a\u5e94\u7528\u4e2d\u5fc3 \u5f00\u53d1\u51fa\u4e86HTTPd (HTTP daemon )\u670d\u52a1\u5668&#xff0c;\u4e5f\u5c31\u662f\u540e\u6765\u7684Apache\u3002<\/p>\n<p>\u5e38\u89c1\u7684WEB\u670d\u52a1\u5668&#xff0c;\u9664\u4e86Apache&#xff0c;\u8fd8\u6709\u4e00\u4e9bNginx&#xff0c;Lighttpd&#xff0c;IIS\u7b49\u3002<\/p>\n<p>\u672c\u6587\u4e3b\u8981\u4ecb\u7ecdNginx\u670d\u52a1\u5668\u548cTomcat\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e0e\u5e94\u7528\u3002<\/p>\n<h4>Nginx<\/h4>\n<p>Nginx\u662f\u4e00\u6b3e\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668&#xff0c;\u80fd\u591f\u9009\u62e9\u9ad8\u6548\u7684epoll\u3001kqueue\u3001eventport\u6700\u4e3a\u7f51\u7edcI\/O\u6a21\u578b&#xff0c;\u5728\u9ad8\u8fde\u63a5\u5e76\u53d1\u7684\u60c5\u51b5\u4e0b&#xff0c;\u80fd\u591f\u652f\u6301\u9ad8\u8fbe5\u4e07\u4e2a\u5e76\u53d1\u8fde\u63a5\u6570\u7684\u54cd\u5e94&#xff0c;\u800c\u5185\u5b58\u3001CPU\u7b49\u7cfb\u7edf\u8d44\u6e90\u6d88\u8017\u5374\u975e\u5e38\u4f4e&#xff0c;\u8fd0\u884c\u975e\u5e38\u7a33\u5b9a\u3002<\/p>\n<h5>\u5b89\u88c5 nginx<\/h5>\n<p><span class=\"token comment\"># \u5b89\u88c5 nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8 nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable nginx &#8211;now<\/span><\/p>\n<p><span class=\"token comment\"># \u51c6\u5907\u4e3b\u9875<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mv \/usr\/share\/nginx\/html\/index.html{,.ori}<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo Hello World From Nginx &gt; \/usr\/share\/nginx\/html\/index.html<\/span><\/p>\n<p><span class=\"token comment\"># \u9632\u706b\u5899<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-service&#061;http &#8211;permanent<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;reload<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud<\/span><br \/>\n<span class=\"token comment\"># windows\u5ba2\u6237\u7aef\u4fee\u6539C:\\\\Windows\\\\System32\\\\drivers\\\\etc\\\\hosts<\/span><br \/>\n<span class=\"token comment\"># Linux\u6216Unix\u4fee\u6539 \/etc\/hosts<\/span><br \/>\n<span class=\"token comment\"># \u6dfb\u52a0\u5982\u4e0b\u8bb0\u5f55<\/span><br \/>\n<span class=\"token number\">10.1<\/span>.8.10 www.furongwang.cloud<\/p>\n<h5>\u542f\u7528 UserDir<\/h5>\n<p><span class=\"token comment\"># \u914d\u7f6e nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/nginx.conf<\/span><br \/>\n<span class=\"token comment\"># add into [server] section<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    location ~ ^\/~<span class=\"token punctuation\">(<\/span>.&#043;?<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span>\/.*<span class=\"token punctuation\">)<\/span>?$ <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token builtin class-name\">alias<\/span> \/home\/<span class=\"token variable\">$1<\/span>\/public_html<span class=\"token variable\">$2<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        index  index.html index.htm<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># If SELinux is enabled, change boolean setting.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># setsebool -P httpd_enable_homedirs on<\/span><\/p>\n<p><span class=\"token comment\"># Create a test page with a common user to make sure it works normally.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>furongwang&#064;server ~<span class=\"token punctuation\">]<\/span>$ <span class=\"token function\">chmod<\/span> <span class=\"token number\">711<\/span> \/home\/furongwang<br \/>\n<span class=\"token punctuation\">[<\/span>furongwang&#064;server ~<span class=\"token punctuation\">]<\/span>$ <span class=\"token function\">mkdir<\/span> ~\/public_html<br \/>\n<span class=\"token punctuation\">[<\/span>furongwang&#064;server ~<span class=\"token punctuation\">]<\/span>$ <span class=\"token function\">chmod<\/span> <span class=\"token number\">755<\/span> ~\/public_html<br \/>\n<span class=\"token punctuation\">[<\/span>furongwang&#064;server ~<span class=\"token punctuation\">]<\/span>$ <span class=\"token function\">vim<\/span> ~\/public_html\/index.html<br \/>\n<span class=\"token operator\">&lt;<\/span>html<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>body<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>div <span class=\"token assign-left variable\">style<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;width: 100%; font-size: 40px; font-weight: bold; text-align: furongwanger;&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\nNginx UserDir Test Page<br \/>\n<span class=\"token operator\">&lt;<\/span>\/div<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/body<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/html<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/~furongwang\/<\/span><\/p>\n<h5>\u865a\u62df\u4e3b\u673a<\/h5>\n<p>\u540c\u4e00\u4e2aweb\u670d\u52a1\u5668\u63d0\u4f9b\u591a\u4e2a\u7ad9\u70b9\u3002<\/p>\n<h6>\u6839\u636e\u540d\u79f0<\/h6>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/conf.d\/vhost-name.conf<\/span><\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\n    server_name  web1.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n    root         \/usr\/share\/nginx\/web1<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    server_name  web2.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n    root         \/usr\/share\/nginx\/web2<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>\u8981\u5728Windows\u8bbf\u95ee\u7f51\u9875&#xff0c;\u9700\u8981\u5728hosts\u6587\u4ef6\u6dfb\u52a010.1.8.10 web1.furongwang.cloud&#xff08;web2\u540c\u7406&#xff09;<\/li>\n<\/ul>\n<h6>\u6839\u636e port<\/h6>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/conf.d\/vhost-port.conf<\/span><\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\n    listen       <span class=\"token number\">8081<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    server_name  www.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n    root         \/usr\/share\/nginx\/8081<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    listen       <span class=\"token number\">8082<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    server_name  www.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n    root         \/usr\/share\/nginx\/8082<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>\u914d\u7f6eSSL\/TLS<\/h5>\n<h6>\u751f\u6210\u8bc1\u4e66<\/h6>\n<p><span class=\"token comment\">#&#8211;1&#8211;\u751f\u6210\u79c1\u94a5 <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># openssl genrsa -out www.key 2048  <\/span><\/p>\n<p><span class=\"token comment\">#&#8211;2&#8211;\u751f\u6210\u8bf7\u6c42\u6587\u4ef6csr<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># openssl req -new -key www.key -out www.csr -subj &#034;\/C&#061;CN\/ST&#061;JS\/L&#061;NJ\/O&#061;LM\/OU&#061;DEVOPS\/CN&#061;www.furongwang.cloud\/emailAddress&#061;furongwang&#064;furongwang.cloud&#034; <\/span><br \/>\n<span class=\"token comment\">#CN\u7684\u503c\u5fc5\u987b\u662f\u7f51\u7ad9\u57df\u540d  <\/span><\/p>\n<p><span class=\"token comment\">#&#8211;3&#8211;\u4f7f\u7528\u81ea\u5df1\u7684\u79c1\u94a5\u5bf9\u8bf7\u6c42\u6587\u4ef6\u7b7e\u540d&#xff0c;\u4ee5\u751f\u6210\u8bc1\u4e66 <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># openssl x509 -req -days 3650 -in www.csr -signkey www.key -out www.crt<\/span><\/p>\n<h6>\u914d\u7f6e\u7ad9\u70b9<\/h6>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir \/etc\/ssl\/certs\/www.furongwang.cloud<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mv www* \/etc\/ssl\/certs\/www.furongwang.cloud<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/conf.d\/ssl.conf<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    listen       <span class=\"token number\">443<\/span> ssl http2 default_server<span class=\"token punctuation\">;<\/span><br \/>\n    listen       <span class=\"token punctuation\">[<\/span>::<span class=\"token punctuation\">]<\/span>:443 ssl http2 default_server<span class=\"token punctuation\">;<\/span><br \/>\n    server_name  www.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n    root         \/usr\/share\/nginx\/html<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u8bc1\u4e66<\/span><br \/>\n    ssl_certificate <span class=\"token string\">&#034;\/etc\/ssl\/certs\/www.furongwang.cloud\/www.crt&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\"># \u79c1\u94a5<\/span><br \/>\n    ssl_certificate_key <span class=\"token string\">&#034;\/etc\/ssl\/certs\/www.furongwang.cloud\/www.key&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u914d\u7f6eHTTP\u91cd\u5b9a\u5411\u5230https.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/nginx.conf<\/span><br \/>\n    server <span class=\"token punctuation\">{<\/span><br \/>\n        listen       <span class=\"token number\">80<\/span> default_server<span class=\"token punctuation\">;<\/span><br \/>\n        listen       <span class=\"token punctuation\">[<\/span>::<span class=\"token punctuation\">]<\/span>:80 default_server<span class=\"token punctuation\">;<\/span><br \/>\n        server_name  www.furongwang.cloud<span class=\"token punctuation\">;<\/span><br \/>\n        root         \/usr\/share\/nginx\/html<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\"># \u6dfb\u52a0 \u91cd\u5b9a\u5411<\/span><br \/>\n        <span class=\"token builtin class-name\">return<\/span>       <span class=\"token number\">301<\/span> https:\/\/<span class=\"token variable\">$host<\/span><span class=\"token variable\">$request_uri<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u9632\u706b\u5899\u8bbe\u7f6e<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-service&#061;https &#8211;permanent<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;reload<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl -k https:\/\/www.furongwang.cloud\/<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815003955-689e81db13c20.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h5>\u914d\u7f6e\u57fa\u672c\u8ba4\u8bc1<\/h5>\n<p>\u7528\u6237\u540d\u548c\u5bc6\u7801\u4f7f\u7528plain text\u53d1\u9001&#xff0c;\u6240\u4ee5\u6700\u597d\u914d\u7f6eSSL\/TLS\u3002<\/p>\n<p><span class=\"token comment\">#\u5b89\u88c5\u5de5\u5177<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install httpd-tools<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/conf.d\/ssl.conf<\/span><br \/>\n<span class=\"token comment\"># add into the [server] section<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span>.<br \/>\n    location \/auth-basic\/ <span class=\"token punctuation\">{<\/span><br \/>\n        auth_basic            <span class=\"token string\">&#034;Basic Auth&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        auth_basic_user_file  <span class=\"token string\">&#034;\/etc\/nginx\/.htpasswd&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># add user for Basic authentication<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># htpasswd -c \/etc\/nginx\/.htpasswd furongwang<\/span><br \/>\nNew password:<br \/>\nRe-type new password:<br \/>\nAdding password <span class=\"token keyword\">for<\/span> user furongwang<\/p>\n<p><span class=\"token comment\"># create a test page<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir \/usr\/share\/nginx\/html\/auth-basic<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/usr\/share\/nginx\/html\/auth-basic\/index.html<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>html<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>body<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>div <span class=\"token assign-left variable\">style<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;width: 100%; font-size: 40px; font-weight: bold; text-align: furongwanger;&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\nTest Page <span class=\"token keyword\">for<\/span> Basic Authentication<br \/>\n<span class=\"token operator\">&lt;<\/span>\/div<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/body<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/html<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/auth-basic\/<\/span><\/p>\n<h5>\u652f\u6301\u52a8\u6001\u811a\u672c<\/h5>\n<h6>\u4f7f\u7528 PHP<\/h6>\n<p><span class=\"token comment\"># \u5b89\u88c5PHP\u548cphp-fpm&#xff0c;\u5efa\u8bae\u628a\u5176\u4ed6\u7684\u6269\u5c55\u5305\u4e00\u8d77\u5b89\u88c5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y php php-fpm<\/span><\/p>\n<p><span class=\"token comment\"># \u5efa\u8bae\u628a\u5176\u4ed6\u7684\u6269\u5c55\u5305\u4e00\u8d77\u5b89\u88c5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y php-gd php-common php-pear php-mbstring php-mcrypt<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b php \u7248\u672c<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># php -v<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5 php \u662f\u5426\u6b63\u5e38<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo &#034;&lt;?php echo &#039;PHP Test Page&#039;.\\\\&#034;\\\\n\\\\&#034;; ?&gt;&#034; &gt; php_test.php <\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># php php_test.php <\/span><br \/>\nPHP Test Page<\/p>\n<p><span class=\"token comment\"># \u51c6\u5907\u6d4b\u8bd5\u9875&#xff0c;\u4f7f\u7528phpinfo\u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo &#034;&lt;?php phpinfo(); ?&gt;&#034; &gt; \/usr\/share\/nginx\/html\/info.php <\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/info.php<\/span><\/p>\n<h6>\u4f7f\u7528 FastCGI<\/h6>\n<p><span class=\"token comment\"># install from EPEL<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y fcgiwrap<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/fcgiwrap.conf<\/span><br \/>\n<span class=\"token comment\"># for example, enable CGI under [\/cgi-bin]<\/span><br \/>\nlocation \/cgi-bin\/ <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">gzip<\/span> off<span class=\"token punctuation\">;<\/span><br \/>\n    root  \/usr\/share\/nginx<span class=\"token punctuation\">;<\/span><br \/>\n    fastcgi_pass  unix:\/var\/run\/fcgiwrap.socket<span class=\"token punctuation\">;<\/span><br \/>\n    include \/etc\/nginx\/fastcgi_params<span class=\"token punctuation\">;<\/span><br \/>\n    fastcgi_param SCRIPT_FILENAME  <span class=\"token variable\">$document_root<\/span><span class=\"token variable\">$fastcgi_script_name<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir -m 755 \/usr\/share\/nginx\/cgi-bin<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/conf.d\/ssl.conf<\/span><br \/>\n<span class=\"token comment\"># add settings into [server] section of a site definition<\/span><\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span>.<br \/>\n        include fcgiwrap.conf<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># Create Systemd file for FastCGI Wrap service and Start them.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/usr\/lib\/systemd\/system\/fcgiwrap.service<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>Unit<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Description<\/span><span class=\"token operator\">&#061;<\/span>Simple CGI Server<br \/>\n<span class=\"token assign-left variable\">After<\/span><span class=\"token operator\">&#061;<\/span>nss-user-lookup.target<br \/>\n<span class=\"token assign-left variable\">Requires<\/span><span class=\"token operator\">&#061;<\/span>fcgiwrap.socket<\/p>\n<p><span class=\"token punctuation\">[<\/span>Service<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">EnvironmentFile<\/span><span class=\"token operator\">&#061;<\/span>\/etc\/sysconfig\/fcgiwrap<br \/>\n<span class=\"token assign-left variable\">ExecStart<\/span><span class=\"token operator\">&#061;<\/span>\/usr\/sbin\/fcgiwrap <span class=\"token variable\">${DAEMON_OPTS}<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token variable\">${DAEMON_PROCS}<\/span><br \/>\n<span class=\"token assign-left variable\">User<\/span><span class=\"token operator\">&#061;<\/span>nginx<br \/>\n<span class=\"token assign-left variable\">Group<\/span><span class=\"token operator\">&#061;<\/span>nginx<\/p>\n<p><span class=\"token punctuation\">[<\/span>Install<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Also<\/span><span class=\"token operator\">&#061;<\/span>fcgiwrap.socket<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/usr\/lib\/systemd\/system\/fcgiwrap.socket<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>Unit<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">Description<\/span><span class=\"token operator\">&#061;<\/span>fcgiwrap Socket<\/p>\n<p><span class=\"token punctuation\">[<\/span>Socket<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">ListenStream<\/span><span class=\"token operator\">&#061;<\/span>\/run\/fcgiwrap.socket<\/p>\n<p><span class=\"token punctuation\">[<\/span>Install<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">WantedBy<\/span><span class=\"token operator\">&#061;<\/span>sockets.target<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable &#8211;now fcgiwrap<\/span><\/p>\n<p><span class=\"token comment\"># If SELinux is enabled, change policy.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim nginx-www.te<\/span><br \/>\nmodule nginx-server <span class=\"token number\">1.0<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>require <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token builtin class-name\">type<\/span> httpd_t<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token builtin class-name\">type<\/span> var_run_t<span class=\"token punctuation\">;<\/span><br \/>\n        class sock_file <span class=\"token function\">write<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\">#&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; httpd_t &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\nallow httpd_t var_run_t:sock_file <span class=\"token function\">write<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># checkmodule -m -M -o nginx-server.mod nginx-server.te<\/span><\/p>\n<p>checkmodule: loading policy configuration from nginx-server.te<br \/>\ncheckmodule: policy configuration loaded<br \/>\ncheckmodule: writing binary representation <span class=\"token punctuation\">(<\/span>version <span class=\"token number\">19<\/span><span class=\"token punctuation\">)<\/span> to nginx-server.mod<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># semodule_package &#8211;outfile nginx-server.pp &#8211;module nginx-server.mod<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># semodule -i nginx-server.pp<\/span><\/p>\n<p>\u6d4b\u8bd5<\/p>\n<p><span class=\"token comment\"># \u51c6\u5907\u6d4b\u8bd5\u6587\u4ef6<\/span><br \/>\n<span class=\"token comment\"># Create a test scripts with a language (example below is Python3) under the directory you set CGI executable ([\/usr\/share\/nginx\/cgi-bin] on this example) and Access to it to verify CGI works normally.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/usr\/share\/nginx\/cgi-bin\/index.cgi<\/span><br \/>\n<span class=\"token comment\">#!\/usr\/bin\/python3<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Content-type: text\/html<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&lt;html&gt;<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>&lt;body&gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&lt;div style&#061;<span class=\"token entity\" title=\"\\\\&#034;\">\\\\&#034;<\/span>width: 100%; font-size: 40px; font-weight: bold; text-align: furongwanger;<span class=\"token entity\" title=\"\\\\&#034;\">\\\\&#034;<\/span>&gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;CGI Script Test Page&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&lt;\/div&gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nprint<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&lt;\/body&gt;<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>&lt;\/html&gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># chmod 755 \/usr\/share\/nginx\/cgi-bin\/index.cgi <\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/cgi-bin\/index.cgi<\/span><\/p>\n<h5>\u90e8\u7f72\u53cd\u5411\u4ee3\u7406<\/h5>\n<p>\u5ba2\u6237\u7aef\u8bbf\u95ee\u4ee3\u7406\u670d\u52a1\u5668&#xff0c;\u4ee3\u7406\u670d\u52a1\u5668\u4f1a\u5c06\u5ba2\u6237\u7aef\u8bf7\u6c42\u53d1\u9001\u7ed9\u771f\u5b9e\u670d\u52a1\u5668\u3002<\/p>\n<p>\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0\u4e86\u9690\u85cf\u5185\u90e8\u670d\u52a1\u5668\u3002<\/p>\n<h6>\u89d2\u8272\u8bf4\u660e<\/h6>\n<ul>\n<li>\n<p>\u4ee3\u7406\u670d\u52a1\u5668proxy 10.1.8.20<\/p>\n<\/li>\n<li>\n<p>\u771f\u5b9e\u670d\u52a1\u5668server 10.1.8.10<\/p>\n<\/li>\n<\/ul>\n<h6>\u4ee3\u7406\u670d\u52a1\u5668\u914d\u7f6e<\/h6>\n<p><span class=\"token comment\"># \u914d\u7f6e\u89e3\u6790<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo &#039;10.1.8.10 www.furongwang.cloud&#039; &gt;&gt; \/etc\/hosts<\/span><\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5 nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8 nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable &#8211;now nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u9632\u706b\u5899<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-service&#061;http &#8211;permanent<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;reload<\/span><\/p>\n<p><span class=\"token comment\"># \u914d\u7f6e\u4ee3\u7406&#xff0c;server\u90e8\u5206\u66f4\u6539\u5982\u4e0b<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/nginx\/nginx.conf<\/span><br \/>\n<span class=\"token comment\"># change [server] section like follows<\/span><\/p>\n<p>    server <span class=\"token punctuation\">{<\/span><br \/>\n        listen      <span class=\"token number\">80<\/span> default_server<span class=\"token punctuation\">;<\/span><br \/>\n        listen      <span class=\"token punctuation\">[<\/span>::<span class=\"token punctuation\">]<\/span>:80 default_server<span class=\"token punctuation\">;<\/span><br \/>\n        server_name _<span class=\"token punctuation\">;<\/span><br \/>\n        root         \/usr\/share\/nginx\/html<span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\">#\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9<\/span><br \/>\n        proxy_redirect      off<span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header    X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header    X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header    Host <span class=\"token variable\">$http_host<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span><\/p>\n<p>        <span class=\"token comment\">#\u65b0\u589e location \u89c4\u5219<\/span><br \/>\n        location \/proxy\/ <span class=\"token punctuation\">{<\/span><br \/>\n            proxy_pass http:\/\/www.furongwang.cloud\/<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart nginx<\/span><\/p>\n<p><span class=\"token comment\"># If SELnux is enabled, change boolean setting.<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;proxy ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># setsebool -P httpd_can_network_connect on<\/span><\/p>\n<h6>\u771f\u5b9e\u670d\u52a1\u5668\u914d\u7f6e<\/h6>\n<p><span class=\"token comment\"># \u5b89\u88c5nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable &#8211;now nginx<\/span><\/p>\n<p><span class=\"token comment\"># \u9632\u706b\u5899<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;add-service&#061;http &#8211;permanent<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># firewall-cmd &#8211;reload<\/span><\/p>\n<p><span class=\"token comment\"># \u51c6\u5907\u6d4b\u8bd5\u9875<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># echo hello furongwang &gt; \/usr\/share\/nginx\/html\/test.html<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5\u6548\u679c<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;client ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud\/test.html<\/span><\/p>\n<h3>Tomcat<\/h3>\n<h5>Tomcat \u7531\u6765<\/h5>\n<p>\u6700\u521d\u662f\u7531Sun\u516c\u53f8\u8a79\u59c6\u65af\u00b7\u9093\u80af\u00b7\u6234\u7ef4\u68ee\u5f00\u53d1\u7684&#xff0c;\u540e\u6765\u4ed6\u5c06\u5176\u53d8\u4e3a\u5f00\u6e90\u9879\u76ee&#xff0c;\u5e76\u7531Sun\u8d21\u732e\u7ed9Apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a\u3002\u7531\u4e8e\u5927\u90e8\u5206\u5f00\u6e90\u9879\u76eeO\u2019Reilly\u90fd\u4f1a\u51fa\u4e00\u672c\u76f8\u5173\u7684\u4e66&#xff0c;\u5e76\u4e14\u5c06\u5176\u5c01\u9762\u8bbe\u8ba1\u6210\u67d0\u4e2a\u52a8\u7269\u7684\u7d20\u63cf&#xff0c;\u56e0\u6b64\u4ed6\u5e0c\u671b\u5c06\u6b64\u9879\u76ee\u4ee5\u4e00\u4e2a\u52a8\u7269\u7684\u540d\u5b57\u547d\u540d\u3002\u56e0\u4e3a\u4ed6\u5e0c\u671b\u8fd9\u79cd\u52a8\u7269\u80fd\u591f\u81ea\u5df1\u7167\u987e\u81ea\u5df1&#xff0c;\u6700\u7ec8&#xff0c;\u4ed6\u5c06\u5176\u547d\u540d\u4e3aTomcat&#xff08;\u82f1\u8bed\u516c\u732b\u6216\u5176\u4ed6\u96c4\u6027\u732b\u79d1\u52a8\u7269&#xff09;\u3002\u800cO\u2019Reilly\u51fa\u7248\u7684\u4ecb\u7ecdTomcat\u7684\u4e66\u7c4d&#xff08;ISBN 0-596-00318-8&#xff09;[1]\u7684\u5c01\u9762\u4e5f\u88ab\u8bbe\u8ba1\u6210\u4e86\u4e00\u4e2a\u516c\u732b\u7684\u5f62\u8c61\u3002\u800cTomcat\u7684Logo\u517c\u5409\u7965\u7269\u4e5f\u88ab\u8bbe\u8ba1\u4e3a\u4e00\u53ea\u516c\u732b\u3002<\/p>\n<h5>Tomcat \u4ecb\u7ecd<\/h5>\n<p>Tomcat \u670d\u52a1\u5668\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u7684 Web \u5e94\u7528\u670d\u52a1\u5668&#xff0c;\u5c5e\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u670d\u52a1\u5668&#xff0c;\u5728\u4e2d\u5c0f\u578b\u7cfb\u7edf\u548c\u7528\u6237\u5e76\u53d1\u8bbf\u95ee\u4e0d\u591a\u7684\u573a\u5408\u4e0b\u4f7f\u7528&#xff0c;\u662f\u5f00\u53d1\u548c\u8c03\u8bd5JSP \u7a0b\u5e8f\u7684\u9996\u9009\u3002\u56e0\u4e3aTomcat\u6280\u672f\u5148\u8fdb\u3001\u6027\u80fd\u7a33\u5b9a\u800c\u4e14\u514d\u8d39&#xff0c;\u56e0\u800c\u6df1\u53d7Java\u7231\u597d\u8005\u7684\u559c\u7231\u5e76\u5f97\u5230\u4e86\u90e8\u5206\u8f6f\u4ef6\u5f00\u53d1\u5546\u7684\u8ba4\u53ef&#xff0c;\u6210\u4e3a\u76ee\u524d\u6bd4\u8f83\u6d41\u884c\u7684Web\u5e94\u7528\u670d\u52a1\u5668\u3002<\/p>\n<p>Tomcat \u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2aJava\u5bb9\u5668&#xff0c;\u540c\u65f6\u4e5f\u5177\u6709\u4f20\u7edf\u7684Web\u670d\u52a1\u5668\u7684\u529f\u80fd&#xff1a;\u5904\u7406HTML\u9875\u9762&#xff0c;\u4f46\u662f\u4e0eApache\/Nginx \u76f8\u6bd4&#xff0c;\u5176\u5904\u7406\u9759\u6001HTML\u7684\u80fd\u529b\u4e0d\u5982Apache\/Nginx\u3002\u901a\u5e38\u5c06Tomcat\u548cApache\/Nginx\u96c6\u6210\u5230\u4e00\u8d77&#xff0c;\u8ba9Apache\/Nginx\u5904\u7406\u9759\u6001HTML&#xff0c;\u8ba9Tomcat\u5904\u7406JSP\u548cJava\u3002<\/p>\n<p>JSP\u5168\u540d\u4e3aJava Server Pages&#xff0c;\u4e2d\u6587\u540d\u53ebjava\u670d\u52a1\u5668\u9875\u9762&#xff0c;\u662f\u4e00\u4e2a\u7b80\u5316\u7684Servlet\u8bbe\u8ba1&#xff0c;\u7531Sun Microsystems\u516c\u53f8\u5021\u5bfc\u3001\u8bb8\u591a\u516c\u53f8\u53c2\u4e0e\u4e00\u8d77\u5efa\u7acb\u7684\u4e00\u79cd\u52a8\u6001\u7f51\u9875\u6280\u672f\u6807\u51c6\u3002JSP\u6280\u672f\u6709\u70b9\u7c7b\u4f3cASP\u6280\u672f&#xff0c;\u5b83\u662f\u5728\u4f20\u7edf\u7684\u7f51\u9875HTML&#xff08;\u6807\u51c6\u901a\u7528\u6807\u8bb0\u8bed\u8a00\u7684\u5b50\u96c6&#xff09;\u6587\u4ef6(.htm,.html)\u4e2d\u63d2\u5165Java\u7a0b\u5e8f\u6bb5(Scriptlet)\u548cJSP\u6807\u8bb0(tag)&#xff0c;\u4ece\u800c\u5f62\u6210JSP\u6587\u4ef6&#xff0c;\u540e\u7f00\u540d\u4e3a(.jsp)\u3002  \u7528JSP\u5f00\u53d1\u7684Web\u5e94\u7528\u662f\u8de8\u5e73\u53f0\u7684&#xff0c;\u65e2\u80fd\u5728Linux\u4e0b\u8fd0\u884c&#xff0c;\u4e5f\u80fd\u5728\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u5b98\u65b9\u7f51\u7ad9&#xff1a;http:\/\/tomcat.apache.org\/<\/p>\n<p>Tomcat \u867d\u7136\u53ef\u4ee5\u8dd1 jsp \u7f51\u9875&#xff0c;\u901a\u5e38\u4e0d\u4f1a\u4f7f\u7528\u5b83\u4f5c\u4e3aweb\u670d\u52a1\u5668&#xff0c;\u800c\u662f\u4f5c\u4e3a\u4e2d\u95f4\u4ef6\u3002<\/p>\n<h5>Tomcat \u90e8\u7f72<\/h5>\n<p><span class=\"token comment\"># \u5b89\u88c5tomcat&#xff0c;\u4f1a\u81ea\u52a8\u5b89\u88c5java-1.8.0-openjdk-headless<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y tomcat<\/span><\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u7248\u672c<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># java -version<\/span><br \/>\nopenjdk version <span class=\"token string\">&#034;1.8.0_412&#034;<\/span><br \/>\nOpenJDK Runtime Environment <span class=\"token punctuation\">(<\/span>build <span class=\"token number\">1.8<\/span>.0_412-b08<span class=\"token punctuation\">)<\/span><br \/>\nOpenJDK <span class=\"token number\">64<\/span>-Bit Server VM <span class=\"token punctuation\">(<\/span>build <span class=\"token number\">25.412<\/span>-b08, mixed mode<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8tomcat<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable &#8211;now tomcat.service<\/span><\/p>\n<p><span class=\"token comment\"># tomcat \u9ed8\u8ba4\u53d1\u5e03\u76ee\u5f55\u662f \/var\/lib\/tomcats\/webapps<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># grep ^TOMCATS_BASE \/etc\/tomcat\/tomcat.conf<\/span><br \/>\n<span class=\"token assign-left variable\">TOMCATS_BASE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/var\/lib\/tomcats\/&#034;<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># grep appBase \/etc\/tomcat\/server.xml <\/span><br \/>\n      <span class=\"token operator\">&lt;<\/span>Host <span class=\"token assign-left variable\">name<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;localhost&#034;<\/span>  <span class=\"token assign-left variable\">appBase<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;webapps&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u51c6\u5907\u6d4b\u8bd5\u9875\u9762<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># cd \/var\/lib\/tomcat\/webapps\/<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;www webapps<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir test<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;www webapps<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim test\/index.jsp<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>html<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>head<span class=\"token operator\">&gt;<\/span><br \/>\n           <span class=\"token operator\">&lt;<\/span>title<span class=\"token operator\">&gt;<\/span>\u7b2c\u4e00\u4e2a JSP \u7a0b\u5e8f<span class=\"token operator\">&lt;<\/span>\/title<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>\/head<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>body<span class=\"token operator\">&gt;<\/span><br \/>\n           <span class=\"token operator\">&lt;<\/span>%<br \/>\n                  out.println<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Hello World!&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n           %<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>\/body<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/html<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\"># \u6d4b\u8bd5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># curl http:\/\/www.furongwang.cloud:8080\/test\/index.jsp<\/span><\/p>\n<h5>\u7ba1\u7406\u754c\u9762<\/h5>\n<p><span class=\"token comment\"># \u5b89\u88c5\u7ba1\u7406\u9875\u9762<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y tomcat-webapps tomcat-admin-webapps<\/span><\/p>\n<p><span class=\"token comment\"># \u5b89\u88c5\u5728\u7ebf\u6587\u6863&#8211;\u53ef\u9009<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y tomcat-docs-webapp<\/span><\/p>\n<p>\u5982\u679c\u670d\u52a1\u5668\u6ca1\u6709\u56fe\u5f62\u5316&#xff0c;\u5219\u5b89\u88c5\u4ee5\u4e0b\u8f6f\u4ef6\u5305<\/p>\n<p>yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> mesa-dri-drivers libglvnd-glx xorg-x11-xauth firefox<\/p>\n<p><span class=\"token comment\"># \u6dfb\u52a0 root \u7528\u6237<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;server ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/tomcat\/tomcat-users.xml <\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>?xml <span class=\"token assign-left variable\">version<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;1.0&#039;<\/span> <span class=\"token assign-left variable\">encoding<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;utf-8&#039;<\/span>?<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>role <span class=\"token assign-left variable\">rolename<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;manager-gui&#034;<\/span>\/<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>role <span class=\"token assign-left variable\">rolename<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;admin-gui&#034;<\/span>\/<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>user <span class=\"token assign-left variable\">username<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;root&#034;<\/span> <span class=\"token assign-left variable\">password<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;root&#034;<\/span> <span class=\"token assign-left variable\">roles<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;manager-gui,admin-gui&#034;<\/span>\/<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\/tomcat-users<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\"># \u91cd\u542ftomcat\u670d\u52a1\u5668<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;www tomcat<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart tomcat<\/span><\/p>\n<p>\u8fdb\u5165\u7ba1\u7406\u754c\u9762<\/p>\n<p>\u7ba1\u7406\u754c\u9762\u9ed8\u8ba4\u53ea\u80fd\u4ecetomcat\u672c\u5730\u8bbf\u95ee http:\/\/localhost:8080<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815003957-689e81dda8c5e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815003958-689e81dee8066.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815004000-689e81e056443.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb766\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf21\u6b21\u3002WEB\u4e5f\u79f0\u4e3aWWW(WORLD WIDE WEB)\uff0c\u4e2d\u6587\u540d\u5b57\u4e3a\u4e07\u7ef4\u7f51\u3001\u5168\u7403\u4fe1\u606f\u7f51\u7b49\uff0c\u4e3b\u8981\u529f\u80fd\u662f\u63d0\u4f9b\u7f51\u4e0a\u4fe1\u606f\u6d4f\u89c8\u670d\u52a1\u3002Web\u670d\u52a1\u5668\u53ef\u4ee5\u4e3aInternet\u4e0a\u7684\u7528\u6237\u63d0\u4f9bWWW\u3001Email\u548cFTP\u7b49\u5404\u79cdInternet\u670d\u52a1\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecdNginx\u670d\u52a1\u5668\u548cTomcat\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e0e\u5e94\u7528\u3002<\/p>\n","protected":false},"author":2,"featured_media":57176,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,78,44],"topic":[],"class_list":["post-57180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-78","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/57180.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb766\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf21\u6b21\u3002WEB\u4e5f\u79f0\u4e3aWWW(WORLD WIDE WEB)\uff0c\u4e2d\u6587\u540d\u5b57\u4e3a\u4e07\u7ef4\u7f51\u3001\u5168\u7403\u4fe1\u606f\u7f51\u7b49\uff0c\u4e3b\u8981\u529f\u80fd\u662f\u63d0\u4f9b\u7f51\u4e0a\u4fe1\u606f\u6d4f\u89c8\u670d\u52a1\u3002Web\u670d\u52a1\u5668\u53ef\u4ee5\u4e3aInternet\u4e0a\u7684\u7528\u6237\u63d0\u4f9bWWW\u3001Email\u548cFTP\u7b49\u5404\u79cdInternet\u670d\u52a1\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecdNginx\u670d\u52a1\u5668\u548cTomcat\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e0e\u5e94\u7528\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/57180.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T00:40:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815003955-689e81db13c20.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57180.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/57180.html\",\"name\":\"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T00:40:02+00:00\",\"dateModified\":\"2025-08-15T00:40:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/57180.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/57180.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57180.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/57180.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb766\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf21\u6b21\u3002WEB\u4e5f\u79f0\u4e3aWWW(WORLD WIDE WEB)\uff0c\u4e2d\u6587\u540d\u5b57\u4e3a\u4e07\u7ef4\u7f51\u3001\u5168\u7403\u4fe1\u606f\u7f51\u7b49\uff0c\u4e3b\u8981\u529f\u80fd\u662f\u63d0\u4f9b\u7f51\u4e0a\u4fe1\u606f\u6d4f\u89c8\u670d\u52a1\u3002Web\u670d\u52a1\u5668\u53ef\u4ee5\u4e3aInternet\u4e0a\u7684\u7528\u6237\u63d0\u4f9bWWW\u3001Email\u548cFTP\u7b49\u5404\u79cdInternet\u670d\u52a1\u3002\u672c\u6587\u4e3b\u8981\u4ecb\u7ecdNginx\u670d\u52a1\u5668\u548cTomcat\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e0e\u5e94\u7528\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/57180.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T00:40:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815003955-689e81db13c20.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/57180.html","url":"https:\/\/www.wsisp.com\/helps\/57180.html","name":"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T00:40:02+00:00","dateModified":"2025-08-15T00:40:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/57180.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/57180.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/57180.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u7f51\u7edc\u8fd0\u7ef4\u3011Linux\uff1a\u5e38\u89c1 Web \u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=57180"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57180\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/57176"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=57180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=57180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=57180"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=57180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}