{"id":784,"date":"2025-01-07T16:45:20","date_gmt":"2025-01-07T08:45:20","guid":{"rendered":"http:\/\/192.168.5.24\/?p=784"},"modified":"2025-01-08T11:32:42","modified_gmt":"2025-01-08T03:32:42","slug":"ruoyi-vue%e5%89%8d%e5%90%8e%e7%ab%af%e5%88%86%e7%a6%bb%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/bigvip.dpdns.org\/?p=784","title":{"rendered":"RuoYi-Vue\u524d\u540e\u7aef\u5206\u79bb\u90e8\u7f72"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u4ecb\u7ecd <\/h2>\n\n\n\n<p>           <strong>RuoYi-Vue<\/strong>&nbsp;\u662f\u4e00\u4e2a Java EE \u4f01\u4e1a\u7ea7\u5feb\u901f\u5f00\u53d1\u5e73\u53f0\uff0c\u57fa\u4e8eSpringBoot\u3001Spring Security\u3001Jwt\u3001Vue\u7684\u524d\u540e\u7aef\u5206\u79bb\u7684\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\uff0c\u5185\u7f6e\u6a21\u5757\u5982\uff1a\u90e8\u95e8\u7ba1\u7406\u3001\u89d2\u8272\u7528\u6237\u3001\u83dc\u5355\u53ca\u6309\u94ae\u6388\u6743\u3001\u6570\u636e\u6743\u9650\u3001\u7cfb\u7edf\u53c2\u6570\u3001\u65e5\u5fd7\u7ba1\u7406\u3001\u4ee3\u7801\u751f\u6210\u7b49\u3002\u5728\u7ebf\u5b9a\u65f6\u4efb\u52a1\u914d\u7f6e\uff1b\u652f\u6301\u96c6\u7fa4\uff0c\u652f\u6301\u591a\u6570\u636e\u6e90\uff0c\u652f\u6301\u5206\u5e03\u5f0f\u4e8b\u52a1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u90e8\u7f72\u73af\u5883<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u4e3b\u673a<\/td><td>IP<\/td><\/tr><tr><td>\u524d\u7aefNginx<\/td><td>192.168.168.101<\/td><\/tr><tr><td>\u540e\u7aefJava<\/td><td>192.168.168.102<\/td><\/tr><tr><td>\u6570\u636e\u5e93DBserver<\/td><td>192.168.168.103<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">\u670d\u52a1\u5668\u5206\u914d\u8868<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u670d\u52a1\u5668\u90e8\u7f72<\/h2>\n\n\n\n<p>\u6570\u636e\u5e93DBserver\u7684\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\uff081\uff09\u5b89\u88c5\u6570\u636e\u5e93\uff1a\nyum -y install mysql-community-server\nyum -y install redis\nvi \/etc\/redis.conf\nbind 0.0.0.0\ndaemonize yes\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014end\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\nsystemctl enable --now redis\nsystemctl enable --now mysqld\n\uff082\uff09\u67e5\u8be2mysql\u9ed8\u8ba4\u5bc6\u7801\uff1a\ngrep -i \"password\" \/var\/log\/mysqld.log\n\uff083\uff09\u914d\u7f6emysql\u7684\u5b89\u5168\u8bbe\u7f6e\uff1a\nmysql_secure_installation\n\uff084\uff09\u8bbe\u7f6emysql\u7684\u5b89\u5168\u7ea7\u522b\uff1a\nmysql -uroot -p -e \"set global validate_password.policy=LOW;\"\n\uff085\uff09\u8bbe\u7f6emysql\u7684\u5bc6\u7801\u957f\u5ea6\u8981\u6c42\uff1a\nmysql -uroot -p -e \"set global validate_password.length=4;\"\n\uff086\uff09\u521b\u5efa\u8fdc\u7a0b\u767b\u5f55\u8d26\u53f7\uff1a\nmysql -uroot -p -e \"create user 'root'@'%' IDENTIFIED BY '1234';\"\nmysql -uroot -p -e \"GRANT all privileges ON *.* TO 'root'@'%';\"\nmysql -uroot -p -e \"flush privileges;\"<\/code><\/pre>\n\n\n\n<p>\u540e\u7aefJava\u670d\u52a1\u5668\u7684\u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\uff081\uff09\u5b89\u88c5\u540e\u7aef\u670d\u52a1\u5668\u73af\u5883\uff1a\nyum -y install jdk1.8  nodejs  maven npm\n\n\uff082\uff09\u4e0b\u8f7dRuoYi\u6e90\u4ee3\u7801\uff1a\ngit clone https:\/\/gitee.com\/y_project\/RuoYi-Vue.git\n\uff083\uff09\u4eceruoyi\u540e\u7aef\u4ee3\u7801sql\u76ee\u5f55\u4e2d\u5bfc\u5165\u6570\u636e\u5e93\uff1a\nmysql -h192.168.168.103 -uroot -p -e \"create database ruoyi character set utf8 collate  utf8_general_ci;\"\nmysql -h192.168.168.103 -uroot -p ruoyi &lt; quartz.sql\nmysql -h192.168.168.103 -uroot -p ruoyi &lt; ry_20240629.sql\n\uff084\uff09\u524d\u7aef\u4ee3\u7801\u6253\u5305\uff1a\ncd RuoYi-Vue\/ruoyi-ui\n&#91;root@Java ruoyi-ui]# npm install --registry=https:\/\/registry.npmmirror.com\n&#91;root@Java ruoyi-ui]# npm run build:prod\n\uff085\uff09\u4fee\u6539\u540e\u7aef\u914d\u7f6e\u6587\u4ef6\uff1a\ncd ..\n&#91;root@java RuoYi-Vue]# vi ruoyi-admin\/src\/main\/resources\/application.yml\n\u2026\u2026 \n redis:\n    # \u5730\u5740\n    host: <strong>192.168.168.103<\/strong>\n    # \u7aef\u53e3\uff0c\u9ed8\u8ba4\u4e3a6379\n    port: 6379\n    # \u6570\u636e\u5e93\u7d22\u5f15\n    database: 0\n    # \u5bc6\u7801\n   <strong> password:<\/strong>\n\u2026\u2026\n\n&#91;root@java RuoYi-Vue]# vi ruoyi-admin\/src\/main\/resources\/application-druid.yml\n        driverClassName: com.mysql.cj.jdbc.Driver\n        druid:\n            # \u4e3b\u5e93\u6570\u636e\u6e90\n            master:\n                url: jdbc:mysql:\/\/<strong>192.168.168.103:3306\/ruoyi<\/strong>?useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=true&amp;serverTimezone=GMT%2B8\n                username: <strong>root<\/strong>\n                password: <strong>123456<\/strong>\n\u2026\u2026\n\n\uff086\uff09\u540e\u7aef\u9879\u76ee\u6253\u5305:\n&#91;root@Java RuoYi-Vue]# mvn package\n\uff087\uff09\u540e\u7aef\u9879\u76ee\u4e0a\u7ebf\n&#91;root@java RuoYi-Vue]# java -jar -server -Xmx1024m -Xms1024m ruoyi-admin\/target\/ruoyi-admin.jar<\/code><\/pre>\n\n\n\n<p>\u524d\u7aefNginx\u670d\u52a1\u5668\u7684\u90e8\u7f72\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum -y install nginx\n<strong>\uff081\uff09\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6<\/strong>\nvi \/etc\/nginx\/conf.d\/ruoyi.conf\nupstream rs {\n    server 192.168.168.102:8080;\n}\nserver {\n    listen       80;\n    server_name  localhost;\n\n    access_log  \/var\/log\/nginx\/host.access.log  main;\n\n    location \/ {\n        root   \/usr\/share\/nginx\/html;\n        try_files $uri $uri\/ \/index.html;\n        index  index.html index.htm;\n    }\n\n    location \/prod-api\/ {\n      proxy_pass http:\/\/rs\/;\n      proxy_set_header Host $http_host;\n      proxy_set_header X-Real-IP $remote_addr;\n      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n   }\n\n    error_page   500 502 503 504  \/50x.html;\n    location = \/50x.html {\n        root   \/usr\/share\/nginx\/html;\n    }\n}\n\uff082\uff09\u628a\u6253\u5305\u597d\u7684\u524d\u7aef\u4ee3\u7801\u62f7\u8d1d\u5230nginx\uff1a\nscp -r  root@192.168.168.102:\/root\/RuoYi-Vue\/ruoyi-ui\/dist\/* \/usr\/share\/nginx\/html\/\n\uff083\uff09\u5f00\u542fnginx\nsystemctl enable --now nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u6d4b\u8bd5<\/h2>\n\n\n\n<p>\u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95eenginx\u7684\u6240\u5728IP<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"481\" src=\"http:\/\/192.168.5.24\/wp-content\/uploads\/2025\/01\/image-8.png\" alt=\"\" class=\"wp-image-800\" srcset=\"https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-8.png 692w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-8-300x209.png 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<p>\u9ed8\u8ba4\u7528\u6237\u5bc6\u7801\uff1aadmin\/admin123<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"http:\/\/192.168.5.24\/wp-content\/uploads\/2025\/01\/image-9-1024x594.png\" alt=\"\" class=\"wp-image-801\" srcset=\"https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-9-1024x594.png 1024w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-9-300x174.png 300w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-9-768x445.png 768w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-9-816x473.png 816w, https:\/\/bigvip.dpdns.org\/wp-content\/uploads\/2025\/01\/image-9.png 1028w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4ecb\u7ecd RuoYi-Vue&nbsp;\u662f\u4e00\u4e2a Java EE \u4f01\u4e1a\u7ea7\u5feb\u901f\u5f00\u53d1\u5e73\u53f0\uff0c\u57fa\u4e8eSpringBoot\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[20,31,35],"tags":[106,107,105],"class_list":["post-784","post","type-post","status-publish","format-aside","hentry","category-linux","category-web","category-35","tag-maven","tag-npm","tag-vue","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=784"}],"version-history":[{"count":22,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions"}],"predecessor-version":[{"id":810,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions\/810"}],"wp:attachment":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}