鼎鼎知识库
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

2021.4.23局域网Ubuntu搭建环境.md 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. 文件目录结构
  2. ```
  3. /home/lenovo
  4. znzm
  5. tools
  6. mysql
  7. redis
  8. tdengine
  9. apps
  10. main
  11. open
  12. scheduler
  13. ```
  14. 开始创建
  15. ```
  16. 确定当前目录:pwd (当前目录为/home/lenovo)
  17. 创建智能照明目录:mkdir znzm
  18. 进入智能照明目录:cd znzm
  19. 创建工具目录用来放数据库的执行文件:mkdir tools
  20. 创建应用程序目录用来放应用程序发布文件:mkdir apps
  21. 创建MySQL目录:mkdir tools/mysql
  22. 创建Redis目录:mkdir tools/redis
  23. 创建TDEngine目录:mkdir tools/tdengine
  24. 创建智能照明主程序目录:mkdir apps/main
  25. 创建开放平台目录:mkdir apps/open
  26. 创建调度平台目录:mkdir apps/scheduler
  27. ```
  28. # 测试服务器`MySQL`离线安装失败记录
  29. 以下没有成功,忽略。
  30. ```
  31. 确认当前目录:pwd (目前在root目录)
  32. 创建目录:mkdir downloads
  33. 进入目录:cd downloads
  34. 下载压缩文件:wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
  35. 查看组:cat /etc/group
  36. 查看用户:cat /etc/passwd
  37. 创建mysql用户组:groupadd mysql
  38. 创建mysql用户:useradd -g mysql mysql
  39. 创建mysql安装目录:mkdir /usr/local/mysql
  40. 把压缩包解压到mysql安装目录tar -xzf /root/downloads/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz -C /usr/local/mysql (mysql下包括mysql-5.6.36-linux-glibc2.5-x86_64目录)
  41. 把mysql下包括mysql-5.6.36-linux-glibc2.5-x86_64目录拷贝到上一级:sudo cp -R -t /usr/local/mysql /usr/local/mysql/mysql-5.6.36-linux-glibc2.5-x86_64/*
  42. 删除把mysql下包括mysql-5.6.36-linux-glibc2.5-x86_64目录:sudo rm -rf /usr/local/mysql/mysql-5.6.36-linux-glibc2.5-x86_64
  43. 创建配置文件:touch /etc/my.cnf
  44. 编辑my.cnf文件:nano /etc/my.cnf
  45. [mysql]
  46. # 设置mysql客户端默认字符集
  47. default-character-set=utf8
  48. socket=/var/lib/mysql/mysql.sock
  49. [mysqld]
  50. skip-name-resolve
  51. # 设置端口
  52. port=3306
  53. socket=/var/lib/mysql/mysql.sock
  54. # 设置mysql的安装目录
  55. basedir=/usr/local/mysql
  56. # 设置mysql数据库的存放目录
  57. datadir=/usr/local/mysql/data/mysql
  58. # 允许最大连接数
  59. max_connections=200
  60. # 服务端使用的字符集
  61. character-set-server=utf8
  62. # 创建表默认引擎
  63. default-storage-engine=INNODB
  64. lower_case_table_names=1
  65. max_allowed_packet=16M
  66. 创建以上my.cnf文件中定义的目录:
  67. mkdir /var/lib/mysql
  68. mkdir /var/lib/mysql/mysql
  69. chown -R mysql:mysql /var/lib/mysql
  70. chown -R mysql:mysql /var/lib/mysql/mysql
  71. 修改/usr/local/mysql目录的拥有者:sudo chown -R mysql:mysql /usr/local/mysql
  72. 进入mysql目录:cd /usr/local/mysql
  73. --以下忽略
  74. 安装数据库:
  75. sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
  76. ./scripts/mysql_install_db --user=mysql
  77. 报错Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
  78. sudo apt install libaio
  79. --以上忽略
  80. 创建数据存储目录:mkdir data/mysql
  81. ```
  82. # 公司局域网安装`MySQL`失败记录
  83. 以下没有成功。忽略。
  84. ```
  85. 确认当前所在目录:pwd (当前目录为:/home/lenovo/znzm)
  86. 进入MySQL所在目录:cd tools/mysql
  87. 确认Ubuntu内核:arch (x86_64=AMD64)
  88. 开始下载:wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
  89. 确定解压文件所在目录: /home/lenovo/znzm/tools/mysql/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
  90. ```
  91. 脚本文件
  92. ```
  93. 创建脚本文件:nano start.sh
  94. #!/bin/bash
  95. # 安装MySQL
  96. SOURCE_GZ_FILE="/home/lenovo/znzm/tools/mysql/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz"
  97. INSTALL_DIR="/usr/local/mysql"
  98. # 判断MySQL是否安装
  99. echo "检查MySQL是否安装"
  100. mysql -version > /dev/null 2>&1
  101. if [ $? -eq 127 ];then
  102. echo "暂未安装MySQL"
  103. # 如果INSTALL_DIR目录已经存在,则删除
  104. if [ -d ${INSTALL_DIR} ];then
  105. echo "安装目录已存在,正在删除${INSTALL_DIR}"
  106. sudo rm -rf ${INSTALL_DIR}
  107. fi
  108. echo "创建安装目录${INSTALL_DIR}"
  109. sudo mkdir ${INSTALL_DIR}
  110. echo "解压${SOURCE_GZ_FILE}到安装目录${INSTALL_DIR}..."
  111. sudo tar -xzf ${SOURCE_GZ_FILE} -C ${INSTALL_DIR}
  112. TEMP=`ls ${INSTALL_DIR}`
  113. sudo cp -R -t ${INSTALL_DIR} ${INSTALL_DIR}/${TEMP}/*
  114. sudo rm -f ${INSTALDIR}/{TEMP}
  115. echo "解压完毕"
  116. echo "添加MySQL用户组和用户"
  117. sudo groupadd mysql
  118. sudo useradd -g mysql mysql
  119. echo "开始安装"
  120. cd ${INSTALL_DIR} && pwd
  121. sudo mkdir data/mysql
  122. sudo chown -R mysql:mysql ${INSTALL_DIR}
  123. sudo ./scripts/mysql_install_db --user=mysql --basedir=${INSTALL_DIR} --datadir=${INSTALL_DIR}/data/mysql
  124. sudo cp support-files/mysql.server /etc/init.d/mysql
  125. sudo chmod 755 /etc/init.d/mysql
  126. sudo cp support-files/my-default.cnf /etc/my.cnf
  127. echo "请求修改/etc/init.d/mysql文件"
  128. echo "basedir=${INSTALL_DIR/}"
  129. echo "datadir=${INSTALL_DIR}/data/mysql"
  130. echo "按Enter确认"
  131. read -n 1
  132. sudo nano /etc/init.d/mysql
  133. echo "请修改/etc/profile文件,添加mysql环境变量"
  134. echo '文件末尾追加export PATH=${PATH}:'${INSTALL_DIR}/bin
  135. echo "按Enter确认"
  136. read -n 1
  137. sudo nano /etc/profile
  138. source /etc/profile
  139. sudo echo "安装成功!启动mysql服务"
  140. sudo systemctl enable mysql
  141. sudo service mysql start
  142. echo "请修改mysql -> root密码"
  143. echo "请输入密码:"
  144. read mysql_pwd
  145. sudo mysqladmin -u root password ${mysql_pwd}
  146. else
  147. echo "MySQL已安装"
  148. mysql -version
  149. fi
  150. 赋予权限:chmod +x start.sh
  151. 执行脚本文件:bash start.sh
  152. TecheDdGo123
  153. 报错:Installing MySQL system tables.../usr/local/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
  154. sudo /etc/init.d/apparmor stop
  155. sudo /etc/init.d/apparmor teardown
  156. sudo update-rc.d -f apparmor remove
  157. sudo apt-get purge apparmor
  158. 创建脚本:nano pre.sh
  159. #!/bin/bash
  160. sudo /etc/init.d/apparmor stop
  161. sudo /etc/init.d/apparmor teardown
  162. sudo update-rc.d -f apparmor remove
  163. sudo apt-get purge apparmor
  164. 赋予权限:chmod +x pre.sh
  165. 执行脚本:bash pre.sh
  166. 再次执行脚本:bash start.sh
  167. 输入密码:TechedDdGo123
  168. 报错:mysql.service is not a native service, redirecting to systemd-sysv-install.
  169. Executing: /lib/systemd/systemd-sysv-install enable mysql
  170. Job for mysql.service failed because the control process exited with error code.
  171. See "systemctl status mysql.service" and "journalctl -xe" for details.
  172. ```
  173. 开始清除
  174. ```
  175. 确定需要删除的文件:
  176. SOURCE_GZ_FILE="/home/lenovo/znzm/tools/mysql/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz"
  177. INSTALL_DIR="/usr/local/mysql"
  178. /etc/init.d/mysql
  179. /etc/my.cnf
  180. /etc/profile
  181. 删除/home/lenovo/znzm/tools/mysql目录:rm -rf /home/lenovo/znzm/tools/mysql
  182. 添加/home/lenovo/znzm/tools/mysql目录: mkdir /home/lenovo/znzm/tools/mysql
  183. 再次确认:ls -l /home/lenovo/znzm/tools
  184. 确认profile: ls -l /etc 确认存在
  185. 查看profile: sudo nano /etc/profile
  186. 删除export PATH="$PATH:/usr/local/mysql/bin"
  187. 确认my.cnf: sudo nano /etc/my.cnf 忽略
  188. 确认/etc/init.d/mysql: sudo nano /etc/init.d/mysql 确认存在
  189. 删除:sudo rm -rf /etc/init.d/mysql
  190. 确认/usr/local/mysql目录: ls -l /usr/local/mysql 确认存在
  191. 删除:sudo rm -rf /usr/local/mysql
  192. ```
  193. # 测试服务器安装`MySQL`成功
  194. `setup-mysql.sh`
  195. ```
  196. #!/bin/bash
  197. export DEBIAN_FRONTEND="noninteractive"
  198. sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw"
  199. sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw"
  200. sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
  201. cat <<- EOF > /etc/apt/sources.list.d/mysql.list
  202. deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7
  203. EOF
  204. sudo apt-get update
  205. sudo apt-get install -y mysql-server-5.7
  206. ```
  207. 查看版本
  208. ```
  209. mysqld --version
  210. ```
  211. 登录,并授权给`root`
  212. ```
  213. mysql -u root -p
  214. rootpw
  215. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rootpw' WITH GRANT OPTION;
  216. FLUSH PRIVILEGES;
  217. sudo systemctl restart mysql
  218. ```
  219. 配置文件
  220. ```
  221. sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
  222. bind-address = 0.0.0.0
  223. sudo systemctl status mysql
  224. sudo systemctl restart mysql
  225. ```
  226. # 公司服务器安装`MySQL`成功
  227. ```
  228. 创建文件`setup-mysql.sh`: sudo nano /home/lenovo/znzm/tools/mysql/setup-mysql.sh
  229. #!/bin/bash
  230. export DEBIAN_FRONTEND="noninteractive"
  231. sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw"
  232. sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw"
  233. sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
  234. cat <<- EOF > /etc/apt/sources.list.d/mysql.list
  235. deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7
  236. EOF
  237. sudo apt-get update
  238. sudo apt-get install -y mysql-server-5.7
  239. 赋予权限:sudo chmod +x /home/lenovo/znzm/tools/mysql/setup-mysql.sh
  240. 运行脚本:sudo bash /home/lenovo/znzm/tools/mysql/setup-mysql.sh
  241. 运行失败。原因是安装禅道时已经安装。
  242. 尝试登录:/opt/zbox/bin/mysql -u root -P 3306 -p
  243. 显示版本:10.5.5-MariaDB
  244. ```
  245. 设置`MariaDB`
  246. ```
  247. 确认配置文件路径:sudo nano /opt/zbox/etc/mysql/my.cnf
  248. 确认启动开启zbox:/opt/zbox/zbox stop /opt/zbox/zbox start
  249. 修改配置文件:sudo nano /opt/zbox/etc/mysql/my.cnf
  250. bind-address = 0.0.0.0
  251. 关闭zobx: sudo /opt/zbox/zbox stop
  252. 开启zbox: sudo /opt/zbox/zbox start
  253. Start Mysql fail. You can see the log /opt/zbox/logs/mysql_error.log
  254. cat /opt/zbox/logs/mysql_error.log
  255. Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use,Do you already have another mysqld server running on port: 3306
  256. 再次查看配置文件:sudo nano /opt/zbox/etc/mysql/my.cnf
  257. socket = /opt/zbox/tmp/mysql/mysql.sock
  258. basedir = /opt/zbox/run/mysql
  259. 查看/opt/zox下的tmp权限:ls -l /opt/zbox
  260. 重启sudo reboot
  261. 查看mysql进程:ps -aux|grep mysql
  262. 查看mariadb进程:ps -aux|grep mariadb
  263. 查看端口进程:sudo netstat -tunpl|grep 3306 确定进程ID是681
  264. 查看进程详情: ps -ef|grep 681
  265. 杀死进程:sudo kill 681
  266. 关闭zobx: sudo /opt/zbox/zbox stop
  267. 开启zbox: sudo /opt/zbox/zbox start
  268. Navicat连接报错:lost connection to MySQL server at reading initial communication packet
  269. sudo ufw allow 3306 还是不行
  270. 尝试登录:/opt/zbox/bin/mysql -u root -P 3306 -p
  271. 输入密码:
  272. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
  273. FLUSH PRIVILEGES;
  274. exit;
  275. 关闭zobx: sudo /opt/zbox/zbox stop
  276. 开启zbox: sudo /opt/zbox/zbox start
  277. 局域网MySQL:
  278. 192.168.8.141
  279. 端口:3306
  280. 用户名:root
  281. 密码:123456
  282. ```
  283. # 公司服务器安装`Redis`成功
  284. ```
  285. 确定地址:https://download.redis.io/releases/redis-6.2.2.tar.gz
  286. 确定当前目录:pwd
  287. 创建目录:mkdir redis
  288. 进入创建目录:cd redis
  289. 下载压缩文件:wget https://download.redis.io/releases/redis-6.2.2.tar.gz
  290. 记录压缩文件的位置:/home/lenovo/redis/redis-6.2.2.tar.gz
  291. 回到根目录:cd /
  292. 解压缩到/user/local下: sudo tar -zxvf /root/redis/redis-6.2.2.tar.gz -C /usr/local
  293. 来到local目录下:cd /usr/local redis-6.2.2目录也在其下
  294. 更改redis-6.2.2的名称:sudo mv ./redis-6.2.2 ./redis
  295. 创建redis用户组:sudo groupadd redis
  296. 查看用户组:cat /etc/group
  297. 创建redis用户:sudo useradd -g redis redis
  298. 查看用户:cat /etc/passwd
  299. 把用户组和用户权限分配到刚才的redis目录:sudo chown -R redis:redis ./redis
  300. 进入redis目录:cd redis
  301. 安装gcc: sudo apt-get install gcc
  302. 查看gcc版本:gcc -v
  303. 安装make: sudo apt-get install make
  304. 执行命令:sudo make
  305. 执行安装命令:sudo make install
  306. 打开服务端:./src/redis-server
  307. 在另一个终端打开客户端进入redis目录: cd /usr/local/redis
  308. 在另一个终端打开客户端:./src/redis-cli
  309. 在另一个终端输入:ping
  310. 再打开一个终端,查看redis进程:ps -ef|grep redis
  311. 在redis客户端终端关闭:shutdown
  312. 在redis客户端终端退出:exit
  313. 确认redis.conf所在目录:ls -l /usr/local/redis
  314. 在etc目录下创建redis目录:sudo mkdir /etc/redis
  315. 把redis.conf文件拷贝到/etc/redis下:sudo cp /usr/local/redis/redis.conf /etc/redis
  316. 确认是否拷贝成功:ls -l /etc/redis
  317. 打开/etc/redis下的配置文件:sudo nano /etc/redis/redis.conf
  318. port 6000
  319. protected-mode no
  320. bind * -::*
  321. dir /var/lib/redis
  322. 创建服务文件:sudo nano /etc/systemd/system/redis.service
  323. [Unit]
  324. Description=Redis In-Memory Data Store
  325. After=network.target
  326. [Service]
  327. User=redis
  328. Group=redis
  329. ExecStart=/usr/local/redis/src/redis-server /etc/redis/redis.conf
  330. ExecStop=/usr/local/redis/src/redis-cli shutdown
  331. Restart=always
  332. [Install]
  333. WantedBy=multi-user.target
  334. 创建目录:sudo mkdir /var/lib/redis
  335. 赋予权限: sudo chown redis:redis /var/lib/redis
  336. 其他人没有权限:sudo chmod 770 /var/lib/redis
  337. 启动redis: sudo systemctl start redis
  338. 查看redis状态:sudo systemctl status redis
  339. 本地可以连接但是远程不可以连接。
  340. --sudo ufw allow 6379
  341. 局域网Redis:192.168.8.141:6000
  342. 密码:无
  343. 版本呢:6.2.2
  344. ```
  345. # 局域网安装`Redis`成功
  346. ```
  347. 确定地址:https://download.redis.io/releases/redis-6.2.2.tar.gz
  348. 确定当前目录:pwd
  349. 创建目录:mkdir redis
  350. 进入创建目录:cd redis
  351. 下载压缩文件:wget https://download.redis.io/releases/redis-6.2.2.tar.gz
  352. 记录压缩文件的位置:/root/redis/redis-6.2.2.tar.gz
  353. 回到根目录:cd /
  354. 解压缩到/user/local下: sudo tar -zxvf /root/redis/redis-6.2.2.tar.gz -C /usr/local
  355. 来到local目录下:cd /usr/local redis-6.2.2目录也在其下
  356. 更改redis-6.2.2的名称:mv ./redis-6.2.2 ./redis
  357. 创建redis用户组:groupadd redis
  358. 查看用户组:cat /etc/group
  359. 创建redis用户:useradd -g redis redis
  360. 查看用户:cat /etc/passwd
  361. 把用户组和用户权限分配到刚才的redis目录:sudo chown -R redis:redis ./redis
  362. 进入redis目录:cd redis
  363. 安装gcc: sudo apt-get install gcc
  364. 查看gcc版本:gcc -v
  365. 安装make: sudo apt-get install make
  366. 执行命令:make
  367. 执行安装命令:make install
  368. 打开服务端:./src/redis-server
  369. 在另一个终端打开客户端进入redis目录: cd /usr/local/redis
  370. 在另一个终端打开客户端:./src/redis-cli
  371. 在另一个终端输入:ping
  372. 再打开一个终端,查看redis进程:ps -ef|grep redis
  373. 在redis客户端终端关闭:shutdown
  374. 在redis客户端终端退出:exit
  375. 确认redis.conf所在目录:/usr/local/redis
  376. 在etc目录下创建redis目录:mkdir /etc/redis
  377. 把redis.conf文件拷贝到/etc/redis下:sudo cp /usr/local/redis/redis.conf /etc/redis
  378. 确认是否拷贝成功:ls /etc/redis
  379. 打开/etc/redis下的配置文件:nano /etc/redis/redis.conf
  380. port 6000
  381. protected-mode no
  382. bind * -::*
  383. dir /var/lib/redis
  384. 创建服务文件:nano /etc/systemd/system/redis.service
  385. [Unit]
  386. Description=Redis In-Memory Data Store
  387. After=network.target
  388. [Service]
  389. User=redis
  390. Group=redis
  391. ExecStart=/usr/local/redis/src/redis-server /etc/redis/redis.conf
  392. ExecStop=/usr/local/redis/src/redis-cli shutdown
  393. Restart=always
  394. [Install]
  395. WantedBy=multi-user.target
  396. 创建目录:sudo mkkir /var/lib/redis
  397. 赋予权限: sudo chown redis:redis /var/lib/redis
  398. 其他人没有权限:sudo chmod 770 /var/lib/redis
  399. 启动redis: sudo systemctl start redis
  400. 查看redis状态:sudo systemctl status redis
  401. 本地可以连接但是远程不可以连接。
  402. --sudo ufw allow 6379
  403. ```
  404. # 安装`TDengine`成功
  405. ```
  406. --准备邮箱
  407. https://exmail.qq.com/login
  408. darren@ddingsafe.com
  409. --准备TDEngine官网
  410. https://www.taosdata.com/
  411. --查看本地客户端版本:
  412. ./taos.exe -h 116.63.236.99 -u -p
  413. 2.0.20.0
  414. --登录服务器:192.168.8.141
  415. --下载:TDengine-server-2.1.1.0-Linux-x64.deb
  416. --安装:sudo dpkg -i TDengine-server-2.1.1.0-Linux-x64.deb
  417. --启动:sudo systemctl start taosd
  418. --检查:sudo systemctl status taosd
  419. --登录:taos (默认用户名:root, 默认密码:taosdata)
  420. --显示数据库:show databases
  421. --确认接口地址:http://192.168.8.141:6041/rest/sql
  422. ```
  423. # 部署智能照明网站
  424. ```
  425. --登录服务器:192.168.8.141
  426. --来到根目录:cd /
  427. --查看:ls var
  428. --sudo mkdir /var/www
  429. --sudo mkdir /var/www/znzm
  430. --使用FileZilla传网站文件
  431. permission denied
  432. sudo chmod -R 777 /var/www/znzm
  433. --安装SDK
  434. sudo apt-get update
  435. sudo apt-get install apt-transport-https
  436. cd /tmp
  437. wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
  438. sudo dpkg -i packages-microsoft-prod.deb
  439. sudo apt-get update
  440. sudo apt install dotnet-sdk-3.1
  441. dotnet --list-sdks
  442. --启动网站,来到/var/www/znzm
  443. dotnet DD.Api.dll
  444. http://192.168.8.141:5008/swagger/index.html
  445. ```
  446. # 部署模拟设备网站
  447. ```
  448. cd /var/www
  449. ls
  450. sudo mkdir mock
  451. sudo chmod -R 777 mock
  452. ```
  453. # 部署开放平台网站
  454. ```
  455. sudo mdkir mock
  456. sudo chmod -R 777 open
  457. ```