Sym 访问路径去掉 symphony 项目名称步骤
在本地 IDEA 设置无项目名部署到 tomcat 服务上
将 ROOT 目录下的文件修改配置打包
上传到服务器的 tomcat 的 ROOT 目录下
[root@VM_48_15_centos tomcat]# unzip ROOT.zip
[root@VM_48_15_centos webapps]# rm -rf ROOT.zip
启动服务器 tomcat
修改 nginx 访问路径
[root@VM_48_15_centos tomcat]# cd /usr/local/nginx/conf
[root@VM_48_15_centos conf]# ls
fastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utf
fastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default
[root@VM_48_15_centos conf]# vim nginx.conf
user root;
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location /mnt/{
root /;
autoindex on;
}
location / {
proxy_pass http://localhost:8080/;
proxy_redirect default;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name 51job.top;
location /mnt/{
root /;
autoindex on;
}
location / {
proxy_pass http://localhost:8080/;
proxy_redirect default;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
重启 nginx
验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
重新加载:/usr/local/nginx/sbin/nginx -s reload
访问
修改历史数据
部分自引用的文章路径中包含 symphony,需要全部去掉
修改文章中引用的文章地址
update symphony_revision set revisionData=REPLACE(revisionData, 'https://qiankunpingtai.cn/symphony/article','https://qiankunpingtai.cn/article');
update symphony_user set userAvatarURL=REPLACE(userAvatarURL, 'https://qiankunpingtai.cn/symphony/article','https://qiankunpingtai.cn/article');
update symphony_article set articleContent=REPLACE(articleContent, 'https://qiankunpingtai.cn/symphony/article','https://qiankunpingtai.cn/article');
update symphony_article set articleImg1URL=REPLACE(articleImg1URL, 'https://qiankunpingtai.cn/symphony/article','https://qiankunpingtai.cn/article');
update symphony_link set linkAddr=REPLACE(linkAddr,'https://qiankunpingtai.cn/symphony/article','https://qiankunpingtai.cn/article');
修改不成功数据回滚
update symphony_revision set revisionData=REPLACE(revisionData, 'https://qiankunpingtai.cn/article','https://qiankunpingtai.cn/symphony/article');
update symphony_user set userAvatarURL=REPLACE(userAvatarURL, 'https://qiankunpingtai.cn/article','https://qiankunpingtai.cn/symphony/article');
update symphony_article set articleContent=REPLACE(articleContent, 'https://qiankunpingtai.cn/article','https://qiankunpingtai.cn/symphony/article');
update symphony_article set articleImg1URL=REPLACE(articleImg1URL, 'https://qiankunpingtai.cn/article','https://qiankunpingtai.cn/symphony/article');
update symphony_link set linkAddr=REPLACE(linkAddr,'https://qiankunpingtai.cn/article','https://qiankunpingtai.cn/symphony/article');