mirror of
https://github.com/mindskip/xzs-mysql.git
synced 2026-09-21 13:20:30 +08:00
28 lines
25 KiB
HTML
28 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<link rel="icon" href="https://www.mindskip.net/style/images/favicon.png"><title>项目部署 | 学之思教程</title><meta name="description" content="学之思开发部署教程"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="VuePress 2.0.0-beta.21">
|
|
<link rel="preload" href="/xzs-mysql/assets/js/runtime~app.b727955f.js" as="script"><link rel="preload" href="/xzs-mysql/assets/css/styles.6b1997da.css" as="style"><link rel="preload" href="/xzs-mysql/assets/js/640.3d7f201c.js" as="script"><link rel="preload" href="/xzs-mysql/assets/js/app.3babd7c9.js" as="script">
|
|
<link rel="stylesheet" href="/xzs-mysql/assets/css/styles.6b1997da.css">
|
|
</head>
|
|
<body>
|
|
<div id="app"><!--[--><div class="theme-container"><header class="navbar"><div class="toggle-sidebar-button"><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><span><a href="/xzs-mysql/" class=""><img class="logo" src="/xzs-mysql/images/logo/logo.png" alt="学之思教程"><span class="site-name can-hide">学之思教程</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net" rel="noopener noreferrer" target="_blank" aria-label="官网"><!--[--><!--]--> 官网 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/sdd.html" rel="noopener noreferrer" target="_blank" aria-label="思多多"><!--[--><!--]--> 思多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/wdd.html" rel="noopener noreferrer" target="_blank" aria-label="维多多"><!--[--><!--]--> 维多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xdd.html" rel="noopener noreferrer" target="_blank" aria-label="学多多"><!--[--><!--]--> 学多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xzs.html" rel="noopener noreferrer" target="_blank" aria-label="学之思"><!--[--><!--]--> 学之思 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/buy.html" rel="noopener noreferrer" target="_blank" aria-label="商业购买"><!--[--><!--]--> 商业购买 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><div class="sidebar-mask"></div><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net" rel="noopener noreferrer" target="_blank" aria-label="官网"><!--[--><!--]--> 官网 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/sdd.html" rel="noopener noreferrer" target="_blank" aria-label="思多多"><!--[--><!--]--> 思多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/wdd.html" rel="noopener noreferrer" target="_blank" aria-label="维多多"><!--[--><!--]--> 维多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xdd.html" rel="noopener noreferrer" target="_blank" aria-label="学多多"><!--[--><!--]--> 学多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xzs.html" rel="noopener noreferrer" target="_blank" aria-label="学之思"><!--[--><!--]--> 学之思 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/buy.html" rel="noopener noreferrer" target="_blank" aria-label="商业购买"><!--[--><!--]--> 商业购买 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><a href="/xzs-mysql/guide/feature.html" class="nav-link sidebar-heading sidebar-item" aria-label="功能列表"><!--[--><!--]--> 功能列表 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/xzs-mysql/guide/skill.html" class="nav-link sidebar-heading sidebar-item" aria-label="技术栈"><!--[--><!--]--> 技术栈 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/xzs-mysql/guide/database.html" class="nav-link sidebar-heading sidebar-item" aria-label="数据库设计"><!--[--><!--]--> 数据库设计 <!--[--><!--]--></a><!----><!--]--><!--[--><p class="sidebar-heading sidebar-item">接口文档</p><ul class=""><li><!--[--><a href="/xzs-mysql/guide/student.html" class="nav-link sidebar-item" aria-label="1. 学生端"><!--[--><!--]--> 1. 学生端 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/xzs-mysql/guide/wx.html" class="nav-link sidebar-item" aria-label="2. 微信小程序端"><!--[--><!--]--> 2. 微信小程序端 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/xzs-mysql/guide/admin.html" class="nav-link sidebar-item" aria-label="3. 管理端"><!--[--><!--]--> 3. 管理端 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/xzs-mysql/guide/develop.html" class="nav-link sidebar-heading sidebar-item" aria-label="项目开发"><!--[--><!--]--> 项目开发 <!--[--><!--]--></a><!----><!--]--><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-heading sidebar-item active" aria-label="项目部署"><!--[--><!--]--> 项目部署 <!--[--><!--]--></a><ul class=""><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#方式一-集成部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="方式一:集成部署"><!--[--><!--]--> 方式一:集成部署 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#方式二-前后端分离部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="方式二:前后端分离部署"><!--[--><!--]--> 方式二:前后端分离部署 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#方式三-docker部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="方式三:docker部署"><!--[--><!--]--> 方式三:docker部署 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/xzs-mysql/guide/video.html" class="nav-link sidebar-heading sidebar-item" aria-label="视频教程"><!--[--><!--]--> 视频教程 <!--[--><!--]--></a><!----><!--]--><!--]--></ul><!--[--><!--]--></aside><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="项目部署" tabindex="-1"><a class="header-anchor" href="#项目部署" aria-hidden="true">#</a> 项目部署</h1><h3 id="方式一-集成部署" tabindex="-1"><a class="header-anchor" href="#方式一-集成部署" aria-hidden="true">#</a> 方式一:集成部署</h3><ul><li>分别在\source\vue\xzs-student目录和source\vue\xzs-admin目录,执行前端打包命令</li></ul><div class="language-npm ext-npm line-numbers-mode"><pre class="language-npm"><code>npm run build
|
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><ul><li>打包后的目录为student和admin</li><li>将文件放到\source\xzs\src\main\resources\static下,然后将java程序打包成jar包</li><li>修改application-prod.yml中的datasource和redis地址</li><li>学生端访问地址为:<a href="http://ip:8000/student" target="_blank" rel="noopener noreferrer">http://ip:8000/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8000/admin" target="_blank" rel="noopener noreferrer">http://ip:8000/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>执行下列命令,运行程序</li></ul><div class="language-java ext-java line-numbers-mode"><pre class="language-java"><code>nohup java <span class="token operator">-</span><span class="token class-name">Duser</span><span class="token punctuation">.</span>timezone<span class="token operator">=</span><span class="token class-name">Asia</span><span class="token operator">/</span><span class="token class-name">Shanghai</span> <span class="token operator">-</span>jar <span class="token operator">-</span><span class="token class-name">Dspring</span><span class="token punctuation">.</span>profiles<span class="token punctuation">.</span>active<span class="token operator">=</span>prod xzs<span class="token operator">-</span><span class="token number">3.3</span><span class="token number">.0</span><span class="token punctuation">.</span>jar <span class="token operator">></span> start1<span class="token punctuation">.</span>log <span class="token number">2</span><span class="token operator">></span><span class="token operator">&</span><span class="token number">1</span> <span class="token operator">&</span>
|
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="方式二-前后端分离部署" tabindex="-1"><a class="header-anchor" href="#方式二-前后端分离部署" aria-hidden="true">#</a> 方式二:前后端分离部署</h3><ul><li>采用前后端分离方式部署,后端启动和部署方式1一样</li><li>前端采用nginx来装载静态页面,先创建/usr/local/xzs/web/目录,然后将打包后的student、admin放到此目录下</li><li>页面访问端口为8001,注意检查防火墙端口是否打开</li><li>学生端访问地址为:<a href="http://ip:8001/student" target="_blank" rel="noopener noreferrer">http://ip:8001/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8001/admin" target="_blank" rel="noopener noreferrer">http://ip:8001/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>nginx配置如下:</li></ul><div class="language-nginx ext-nginx line-numbers-mode"><pre class="language-nginx"><code><span class="token directive"><span class="token keyword">server</span></span> <span class="token punctuation">{</span>
|
|
<span class="token directive"><span class="token keyword">listen</span> <span class="token number">8001</span></span><span class="token punctuation">;</span>
|
|
<span class="token directive"><span class="token keyword">server_name</span> xzs</span><span class="token punctuation">;</span>
|
|
<span class="token directive"><span class="token keyword">location</span> /</span> <span class="token punctuation">{</span>
|
|
<span class="token directive"><span class="token keyword">root</span> /usr/local/xzs/web/</span><span class="token punctuation">;</span>
|
|
<span class="token directive"><span class="token keyword">index</span> index.html</span><span class="token punctuation">;</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token directive"><span class="token keyword">location</span> /api/</span> <span class="token punctuation">{</span>
|
|
<span class="token directive"><span class="token keyword">proxy_pass</span> http://localhost:8000</span><span class="token punctuation">;</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h3 id="方式三-docker部署" tabindex="-1"><a class="header-anchor" href="#方式三-docker部署" aria-hidden="true">#</a> 方式三:docker部署</h3><ul><li>准备好centos服务器</li><li>先检查服务器端口、ip转发的是否配置正确,否则无法访问到docker内部</li><li>docker内部镜像已经安装了java、mysql、redis、nginx,均已配置好,无需其他操作</li><li>执行下列docker命令,拉取镜像,启动容器</li><li>学生端访问地址为:<a href="http://ip:8001/student" target="_blank" rel="noopener noreferrer">http://ip:8001/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8001/admin" target="_blank" rel="noopener noreferrer">http://ip:8001/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li></ul><div class="language-docker ext-docker line-numbers-mode"><pre class="language-docker"><code>docker pull registry.cn-hangzhou.aliyuncs.com/mindskip/xzs:v3.3.0
|
|
docker run -d --name xzs --privileged -it -d -p 8001:8001 -v /etc/localtime:/etc/localtime:ro registry.cn-hangzhou.aliyuncs.com/mindskip/xzs:v3.3.0 /usr/sbin/init
|
|
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><span class="meta-item-info">2021-6-24 22:57:11</span></div><div class="meta-item contributors"><span class="meta-item-label">贡献者: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: mindskip@qq.com">mindskip</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><span class="prev"> ← <a href="/xzs-mysql/guide/develop.html" class="nav-link" aria-label="项目开发"><!--[--><!--]--> 项目开发 <!--[--><!--]--></a></span><span class="next"><a href="/xzs-mysql/guide/video.html" class="nav-link" aria-label="视频教程"><!--[--><!--]--> 视频教程 <!--[--><!--]--></a> → </span></p></nav><!--[--><!--]--></main></div><!----><!--]--></div>
|
|
<script src="/xzs-mysql/assets/js/runtime~app.b727955f.js" defer></script><script src="/xzs-mysql/assets/js/640.3d7f201c.js" defer></script><script src="/xzs-mysql/assets/js/app.3babd7c9.js" defer></script>
|
|
</body>
|
|
</html>
|