• ruoyi 若依 前端vue npm install 运行vue前端


    1. 安装jdk

    ​​​​​​​https://blog.csdn.net/torpidcat/article/details/90549551

    2. nginx

    https://blog.csdn.net/torpidcat/article/details/97934302

    3. mysql

    https://blog.csdn.net/torpidcat/article/details/110265490

    4. redis

    https://blog.csdn.net/torpidcat/article/details/123021796

    ===================================

    首次导入,需要先执行 npm install

    #进入到前端模块目录下

    cd ruoyi-ui

    # 安装

    npm install

    启动后端项目

    运行前端项目:运行成功后,会浏览器自动加载到前端首页(或者 浏览器访问打印的两个地址)

    # 本地运行

    npm run dev

    部署打包:

    #打包生成dist目录

    cd ruoyi-ui

    npm run build:prod

    运行后 ruoyi-ui 目录下会创建一个dist目录,将dist目录压缩上传到服务器

    服务器运行dist:

    服务器安装nginx,nginx.conf 配置中server下新增location 指向到 dist目录,如下

    1. #user nobody;
    2. worker_processes 1;
    3. #error_log logs/error.log;
    4. #error_log logs/error.log notice;
    5. #error_log logs/error.log info;
    6. #pid logs/nginx.pid;
    7. events {
    8. worker_connections 1024;
    9. }
    10. http {
    11. include mime.types;
    12. default_type application/octet-stream;
    13. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    14. # '$status $body_bytes_sent "$http_referer" '
    15. # '"$http_user_agent" "$http_x_forwarded_for"';
    16. #access_log logs/access.log main;
    17. sendfile on;
    18. #tcp_nopush on;
    19. #keepalive_timeout 0;
    20. keepalive_timeout 65;
    21. #gzip on;
    22. server {
    23. # 原80端口改为使用81
    24. listen 81;
    25. server_name localhost;
    26. #charset koi8-r;
    27. #access_log logs/host.access.log main;
    28. location / {
    29. root html;
    30. index index.html index.htm;
    31. }
    32. # ==========================================
    33. #微服务后台 前端VUE http://test.com/ 域名根目录访问项目
    34. location /{
    35. add_header Access-Control-Allow-Origin '*' always; # 解决跨域访问问题
    36. alias /home/ruoyi/dist;#项目前端文件所在目录
    37. try_files $uri $uri/ /index.html;#自动寻找路径 找不到则默认访问index.html
    38. index index.html index.htm;
    39. }
    40. #微服务后台 前端VUE http://test.com/admin/ 域名下项目目录访问项目
    41. #location /admin {
    42. # add_header Access-Control-Allow-Origin '*' always; # 解决跨域访问问题
    43. # alias /home/ruoyi/dist;#项目前端文件所在目录
    44. # try_files $uri $uri/ /index.html;#自动寻找路径 找不到则默认访问index.html
    45. # index index.html index.htm;
    46. #}
    47. #微服务 通过前端访问接口
    48. location /prod-api/ {
    49. proxy_set_header Host $http_host;
    50. proxy_set_header X-Real-IP $remote_addr;
    51. proxy_set_header REMOTE-HOST $remote_addr;
    52. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    53. proxy_pass http://localhost:8080/;
    54. }
    55. #微服务后台 后端接口
    56. location /api/ {
    57. proxy_set_header Host $http_host;
    58. proxy_set_header X-Real-IP $remote_addr;
    59. proxy_set_header REMOTE-HOST $remote_addr;
    60. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    61. proxy_pass http://localhost:8080/;
    62. }
    63. # ==========================================
    64. #error_page 404 /404.html;
    65. # redirect server error pages to the static page /50x.html
    66. #
    67. error_page 500 502 503 504 /50x.html;
    68. location = /50x.html {
    69. root html;
    70. }
    71. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    72. #
    73. #location ~ \.php$ {
    74. # proxy_pass http://127.0.0.1;
    75. #}
    76. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    77. #
    78. #location ~ \.php$ {
    79. # root html;
    80. # fastcgi_pass 127.0.0.1:9000;
    81. # fastcgi_index index.php;
    82. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    83. # include fastcgi_params;
    84. #}
    85. # deny access to .htaccess files, if Apache's document root
    86. # concurs with nginx's one
    87. #
    88. #location ~ /\.ht {
    89. # deny all;
    90. #}
    91. }
    92. # another virtual host using mix of IP-, name-, and port-based configuration
    93. #
    94. #server {
    95. # listen 8000;
    96. # listen somename:8080;
    97. # server_name somename alias another.alias;
    98. # location / {
    99. # root html;
    100. # index index.html index.htm;
    101. # }
    102. #}
    103. # HTTPS server
    104. #
    105. #server {
    106. # listen 443 ssl;
    107. # server_name localhost;
    108. # ssl_certificate cert.pem;
    109. # ssl_certificate_key cert.key;
    110. # ssl_session_cache shared:SSL:1m;
    111. # ssl_session_timeout 5m;
    112. # ssl_ciphers HIGH:!aNULL:!MD5;
    113. # ssl_prefer_server_ciphers on;
    114. # location / {
    115. # root html;
    116. # index index.html index.htm;
    117. # }
    118. #}
    119. }

    ===================

    编辑 application.yml

    #修改线上、本地文件上传目录
    profile: /home/ruoyi/uploadPath

    服务器创建文件上传目录

    #根据application.yml 文件 profile 参数值,创建对应目录

    cd /home

    mkdir ruoyi

    cd /home/ruoyi

    mkdir uploadPath

    src/views/login.vue default的loginForm参数 username、password初始密码账号清空

    重置系统原账号及密码

    -- 数据库执行命令 重置两个用户的user_name

    update sys_user set user_name = 'testadmin' where user_id = 1;
    update sys_user set user_name = 'test' where user_id = 2;

    admin 超管账号个人中心修改自己的密码、系统管理 - 用户管理 修改非超管用户的密码:

    左侧菜单:隐藏停用非必要的菜单

    左侧菜单:系统管理 - 参数设置 更改参数值,设置 登录页的注册入口开启和关闭、登录页验证码的开启和关闭

    ===================

    安装jdk java

    #进入opt目录

    cd /opt

    #创建java目录

    mkdir java

    一、 上传jdk文件到服务器/opt/java目录下

    1. mac 终端命令方式上传本地文件到服务器指定目录下

    参考 https://blog.csdn.net/torpidcat/article/details/106520954 

    scp -p 22 /Users/lizhen/Desktop/linux/jdk-8u211-linux-x64.tar.gz root@61.171.97.214://opt/java

    输入服务器密码 ​​​​​​​

    2. mac 系统 ShellCraft  的SFTP

    二、解压 安装jdk

    参考 https://blog.csdn.net/torpidcat/article/details/90549551

    依次执行命令:

    三. 安装nginx

    https://blog.csdn.net/torpidcat/article/details/97934302

    云主机安全组新增80端口的访问

    四. mysql

    https://blog.csdn.net/torpidcat/article/details/110265490

    五. redis

    https://blog.csdn.net/torpidcat/article/details/123021796

  • 相关阅读:
    Qt开源 自绘时钟
    [蓝桥杯 2022 省 B] 刷题统计
    stm32_标准库_中断_按键点灯|蜂鸣器
    多服务器云探针源码(服务器云监控)/多服务器多节点_云监控程序python源码
    区间DP(基础+提高)
    JavaScript自我学习
    刷题笔记day14-二叉树01
    数据结构与算法 | 深搜(DFS)与广搜(BFS)
    stm32使用串口打印
    HTML5期末考核大作业——学生网页设计作业源码HTML+CSS+JavaScript 中华美德6页面带音乐文化
  • 原文地址:https://blog.csdn.net/torpidcat/article/details/133743775