@@ -423,4 +423,96 @@ $(selector).load(URL,data,callbacck)
423423
424424#### Node.js
425425
426- + Node.js是 JavaScript 语言在服务器端的运行环境(平台)。
426+ + Node.js是 JavaScript 语言在服务器端的运行环境(平台)。
427+
428+
429+ #### 安装服务器的坑呀
430+
431+ 第一次安装服务器,在安装过程中没有出现大众出现过的问题。<br >
432+ 首先是在开机时的提示进入bios模式用U盘启动;<br >
433+ 然后是按照网上教程开始进行安装,安装完成后重启再次进入bios使用磁盘启动;安装完成<br >
434+ 之后配置网络设置,使用内网 <br >
435+ 首先找到一台电脑,将其IP、子网掩码、网关、DNS全部配置到服务器网卡。然后自己的电脑要连接网线,将服务器和自己电脑的IP出于同一网段。<br >
436+ ``` js
437+
438+ // 服务器ip
439+ ip: 202.75 .0 .62
440+ // 本机ip
441+ ip: 202.75 .0 .61
442+
443+ // 可以访问外网
444+
445+ apple@appledeMacBook- Air ~ % ping www .baidu .com
446+ PING www .a .shifen .com (14.215 .177 .38 ): 56 data bytes
447+ 64 bytes from 14.215 .177 .38 : icmp_seq= 0 ttl= 55 time= 47.200 ms
448+ 64 bytes from 14.215 .177 .38 : icmp_seq= 1 ttl= 55 time= 64.543 ms
449+ 64 bytes from 14.215 .177 .38 : icmp_seq= 2 ttl= 55 time= 203.717 ms
450+ 64 bytes from 14.215 .177 .38 : icmp_seq= 3 ttl= 55 time= 195.129 ms
451+ 64 bytes from 14.215 .177 .38 : icmp_seq= 4 ttl= 55 time= 84.772 ms
452+ 64 bytes from 14.215 .177 .38 : icmp_seq= 5 ttl= 55 time= 141.229 ms
453+ 64 bytes from 14.215 .177 .38 : icmp_seq= 6 ttl= 55 time= 168.642 ms
454+ ^ C
455+ -- - www .a .shifen .com ping statistics -- -
456+ 7 packets transmitted, 7 packets received, 0.0 % packet loss
457+ round- trip min/ avg/ max/ stddev = 47.200 / 129.319 / 203.717 / 59.134 ms
458+
459+ ```
460+
461+ #### 后台部署上服务器
462+
463+ ``` js
464+
465+ nohup java - jar xx .jar &
466+
467+ ps - ef | grep java
468+
469+ ```
470+ 首先是将后台打包,注意` application.yml ` 的变化,然后将打包后的文件上传至服务器。<br >
471+
472+ ``` js
473+ // 3306是mysql端口,为了防止被攻击将其改变
474+ url: jdbc: mysql: // 127.0.0.1:3306/micronaut_tz?serverTimezone=GMT%2B8
475+ // 服务器mysql名称和密码
476+ username: root
477+ password: qaz123
478+
479+ ```
480+
481+ 如果服务器运行报错,记得查看mysql端口` show global variables like 'port'; ` 和java进程是否被占用` ps -ef |grep java ` ,关闭进程` kill -9 PID号 ` 。<br >
482+
483+ ``` js
484+ // mysql
485+ apple@appledeMacBook- Air ~ % mysql - u root - p
486+ Enter password:
487+ Welcome to the MySQL monitor . Commands end with ; or \g.
488+ Your MySQL connection id is 851
489+ Server version: 8.0 .21 MySQL Community Server - GPL
490+
491+ Copyright (c) 2000 , 2020 , Oracle and/ or its affiliates . All rights reserved.
492+
493+ Oracle is a registered trademark of Oracle Corporation and/ or its
494+ affiliates . Other names may be trademarks of their respective
495+ owners.
496+
497+ Type ' help;' or ' \h ' for help . Type ' \c ' to clear the current input statement.
498+
499+ mysql> show global variables like ' port' ;
500+ + -------------- -+ ------ -+
501+ | Variable_name | Value |
502+ + -------------- -+ ------ -+
503+ | port | 3306 |
504+ + -------------- -+ ------ -+
505+ 1 row in set (0.03 sec)
506+
507+ mysql>
508+
509+ // 进程占用
510+ apple@appledeMacBook- Air ~ % ps - ef| grep java
511+ 501 69630 69280 0 10 : 01 上午 ?? 0 : 47.64 / Library/ Java/ JavaVirtualMachines/ jdk1.8 .0_102 .jdk / Contents/ Home/ bin/ java - XX : MaxMetaspaceSize= 256m - XX : + HeapDumpOnOutOfMemoryError - Xms256m - Xmx512m - Dfile .encoding = UTF - 8 - Duser .country = CN - Duser .language = zh - Duser .variant - cp / Users/ apple/ .gradle / wrapper/ dists/ gradle- 6.1 - all/ d7p1d05fks2n0h6nqsj2ogyq5/ gradle- 6.1 / lib/ gradle- launcher- 6.1 .jar org .gradle .launcher .daemon .bootstrap .GradleDaemon 6.1
512+ 501 69946 69043 0 10 : 08 上午 ttys004 0 : 00 .00 grep java
513+ apple@appledeMacBook- Air ~ %
514+
515+ ```
516+
517+
518+
0 commit comments