11-11 tomcat 部署 & 搭建
配置 mysql
首先确保环境中 mysql 正常运行
创建数据库,导入数据
这里使用 navicat,通过远程登陆的方式导入
1 2 3 4 5 6 # 可选 修改默认的 mysql 密码 SET PASSWORD FOR root@localhost = '密码' ;# 配置远程登陆 grant all privileges on * .* to 'root' @'%' identified by 'root' ;flush privileges; set password for "root"@"%" = '密码' ;
关闭防火墙
1 sudo systemctl stop firewalld.service
创建数据库
数据库名: ruoyi
字符集: uft8
排序规则:留空即可
导入数据
右键 创建好的数据库,选择 运行 SQL 文件… ,分别选择两个 sql 文件执行即可。
配置 tomcat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 tar -zxvf apache-tomcat.gz ln -s apache-tomcat-9.0.68 tomcatvim /etc/profile export CAT_HOME=/root/11-11/tomcatexport PATH=$PATH :$CAT_HOME :binsource /etc/profilecp ruoyi-admin.war /tomcat/webapps/./startup.sh
配置 nginx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 tar -zxvf tar.gz cd pcre-8.40/./configure make yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel tar -zxvf nginx.tar.gz cd nginx/./configure make && make install
配置 nginx
配置文件 /usr/local/nginx/conf 中,名为 nginx.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 server { listen 80; #server_name localhost; # 修改为 8080 server_name 127.0.0.1:8080; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; # 配置转发 proxy_pass http://127.0.0.1:8080; }
启动 ng
1 2 cd /usr/local/nginx/sbin./nginx