当前位置: 首页 > news >正文

windows微服务部署

windows部署

    • 一.nginx部署
      • 1.nginx 官网下载
      • 2. 配置nginx
      • 3.配置nigix 防止nigix刷新404不生效
    • 二.配置redis部署成服务
      • 1.在系统配置中 配置为系统变量
      • 2.打开快捷登录服务管理
    • #3. 开启redis
    • 三.windows部署jar包

一.nginx部署

1.nginx 官网下载

地址 官网地址
安装 windows版本 可安装稳定版
在这里插入图片描述
下载后将zip文件进行解压

2. 配置nginx

编辑nginx.conf文件 (备注:千万不要用记事本编辑 会产生bom,nginx会报错 ,可以用写字板打开)
具体配置文件如下:


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
		
    }
server {
        listen       18455;   -----配置访问端口
        server_name  192.168.1.1;  -------配置访问ip

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   E:\ylksProject\fornt\dist;
            index  index.html index.htm;
try_files $uri $uri/ /index.html;    ------特别重要,防止刷新后nginx 404
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
		
    }

 
    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

3.配置nigix 防止nigix刷新404不生效

解决 :windows查看nginx 原来服务是否关闭
查看 所有进程的命令
关闭对应进程的命令

tasklist
taskkill -f -pid 端口号

二.配置redis部署成服务

redis安装之后 点击启动redis-server.exe文件进行启动 程序连接有时会挂掉,需要部署成服务

1.在系统配置中 配置为系统变量

在这里插入图片描述

名称 redis 变量值为redis 的路径

2.打开快捷登录服务管理

win+r 输入 services.msc

#3. 开启redis

在这里插入图片描述

三.windows部署jar包

报错 原因 编码错误
在这里插入图片描述
解决方式 ;

启动命令  
nacos:      java -jar -Dfile.encoding=utf-8 jeecg-cloud-nacos-2.4.0.jar > D:\digital\log\nacosServer.log 2>&1 &
gateway:  java -jar -Dfile.encoding=utf-8 jeecg-cloud-gateway-2.4.0.jar > D:\digital\log\gatewayServer.log 2>&1 &
systemStart: java -jar -Dfile.encoding=utf-8 jeecg-cloud-system-start-2.4.0.jar > D:\digital\log\systemServer.log 2>&1 &
digital:java -jar -Dfile.encoding=utf-8 cjwsjy-cloud-digital-delivery-2.4.0.jar > D:\digital\log\deliveryServer.log 2>&1 &


java -jar 启动报错 就在 -jar 后面加上下面这个
-Dfile.encoding=utf-8

相关文章:

  • 深入了解JVM:Java程序背后的核心原理
  • 【新星计划2023】SQL SERVER (01) -- 基础知识
  • 【Node.js】身份认证,Cookie和Session的认证机制,express中使用session认证和JWT认证
  • 算法基础-回溯算法
  • SpringBoot整合Flink(施耐德PLC物联网信息采集)
  • vue3 组件篇 Message
  • clip精读
  • 超级实用,解密云原生监控技术,使用prometheus轻松搞定redis监控
  • MyBatis高频面试题
  • C++中那些你不知道的未定义行为
  • 电容在微分、积分电路中的本质以及应用
  • 【系统学习】环境土壤物理模型HYDRUS1D/2D/3D
  • 解决Xshell无法连接Kali Linux 2020.1(2019.3)版本
  • python 基础系列篇:四、编写两个简单的小游戏(猜数字及2048)
  • async与await异步编程
  • 【译】JS基础算法脚本:字符串结尾
  • 4月23日世界读书日 网络营销论坛推荐《正在爆发的营销革命》
  • Android开发 - 掌握ConstraintLayout(四)创建基本约束
  • CSS3 聊天气泡框以及 inherit、currentColor 关键字
  • docker-consul
  • Git同步原始仓库到Fork仓库中
  • HTTP--网络协议分层,http历史(二)
  • Java 内存分配及垃圾回收机制初探
  • java概述
  • js数组之filter
  • MySQL Access denied for user 'root'@'localhost' 解决方法
  • mysql innodb 索引使用指南
  • 三分钟教你同步 Visual Studio Code 设置
  • 山寨一个 Promise
  • 十年未变!安全,谁之责?(下)
  • 思否第一天
  • 推荐一款sublime text 3 支持JSX和es201x 代码格式化的插件
  • 一起来学SpringBoot | 第十篇:使用Spring Cache集成Redis
  • 06-01 点餐小程序前台界面搭建
  • Java性能优化之JVM GC(垃圾回收机制)
  • 大数据全解:定义、价值及挑战
  • 翻译 | The Principles of OOD 面向对象设计原则
  • ​LeetCode解法汇总2696. 删除子串后的字符串最小长度
  • ​VRRP 虚拟路由冗余协议(华为)
  • #HarmonyOS:Web组件的使用
  • %check_box% in rails :coditions={:has_many , :through}
  • ( 用例图)定义了系统的功能需求,它是从系统的外部看系统功能,并不描述系统内部对功能的具体实现
  • (1)Nginx简介和安装教程
  • (8)Linux使用C语言读取proc/stat等cpu使用数据
  • (附源码)计算机毕业设计SSM疫情社区管理系统
  • (理论篇)httpmoudle和httphandler一览
  • (利用IDEA+Maven)定制属于自己的jar包
  • (七)理解angular中的module和injector,即依赖注入
  • (算法)Game
  • (万字长文)Spring的核心知识尽揽其中
  • (一)Java算法:二分查找
  • (转) Android中ViewStub组件使用
  • (转)视频码率,帧率和分辨率的联系与区别
  • (转载)利用webkit抓取动态网页和链接
  • .describe() python_Python-Win32com-Excel