Files
weiyu/deploy/server/docs/assets/js/b4cf3f2a.20102c28.js

1 line
20 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4646],{4992:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"deploy/depend/nginx","title":"Nginx","description":"- Operating System: Ubuntu 20.04 LTS","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/deploy/depend/nginx.md","sourceDirName":"deploy/depend","slug":"/deploy/depend/nginx","permalink":"/docs/docs/deploy/depend/nginx","draft":false,"unlisted":false,"editUrl":"https://github.com/bytedesk/bytedesk/docs/deploy/depend/nginx.md","tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"sidebar_label":"Nginx","sidebar_position":4},"sidebar":"tutorialSidebar","previous":{"title":"SSL Certificate","permalink":"/docs/docs/deploy/depend/letsencrypt"},"next":{"title":"MySQL","permalink":"/docs/docs/deploy/depend/mysql"}}');var s=i(5723),t=i(6246);const a={sidebar_label:"Nginx",sidebar_position:4},o="Nginx",l={},d=[{value:"Installation",id:"installation",level:2},{value:"Preparation",id:"preparation",level:2},{value:"Example Using IP",id:"example-using-ip",level:2},{value:"nginx.conf",id:"nginxconf",level:2},{value:"sites-available",id:"sites-available",level:2},{value:"weiyuai_cn_80.conf",id:"weiyuai_cn_80conf",level:3},{value:"weiyuai_cn_443.conf",id:"weiyuai_cn_443conf",level:3},{value:"weiyuai_cn_api_80.conf",id:"weiyuai_cn_api_80conf",level:3},{value:"weiyuai_cn_api_443.conf",id:"weiyuai_cn_api_443conf",level:3},{value:"Create Symbolic Links",id:"create-symbolic-links",level:2},{value:"Apply Configuration",id:"apply-configuration",level:2},{value:"Open Ports",id:"open-ports",level:2},{value:"Modify TCP Connections (Optional)",id:"modify-tcp-connections-optional",level:2},{value:"Common Issues",id:"common-issues",level:2},{value:"References",id:"references",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"nginx",children:"Nginx"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Operating System: Ubuntu 20.04 LTS"}),"\n",(0,s.jsx)(n.li,{children:"Server minimum requirements: 2 CPU cores, 4GB RAM. Recommended: 4 CPU cores, 8GB RAM."}),"\n"]})}),"\n",(0,s.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"sudo apt update\nsudo apt install nginx\n# Check if installation successful\nnetstat -ntlp\n# If port 80 starts normally, installation is successful\n# Stop nginx\n# service nginx stop\n# Start nginx\n# service nginx start\n# Restart nginx:\n# service nginx restart\n# systemctl restart nginx\n# Reload:\n# service nginx force-reload\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'# Check if stream module is installed\nnginx -V | grep stream # Note: capital V\n# Output indicates it\'s installed\nnginx version: nginx/1.18.0 (Ubuntu)\n# ...\n# You can see parameter: --with-stream=dynamic, indicating stream module is installed\n# For error: unknown directive "stream" in /etc/nginx/nginx.conf, need to insert at first line of nginx.conf:\nload_module /usr/lib/nginx/modules/ngx_stream_module.so;\n# Create cache directory, used in nginx.conf\nmkdir -p /var/www/html/nginx/cache/webserver\n# Reload configuration\nnginx -s reload\n# Or restart nginx\nservice nginx restart\n'})}),"\n",(0,s.jsx)(n.h2,{id:"preparation",children:"Preparation"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Download and extract ",(0,s.jsx)(n.a,{href:"https://www.weiyuai.cn/download/weiyu-server.zip",children:"server"})," file, the extracted structure is as follows:"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"(base) server % tree -L 1\n.\n\u251c\u2500\u2500 admin\n\u251c\u2500\u2500 agent\n\u251c\u2