码迷,mamicode.com
首页 > 数据库 > 详细

基于nginx+tomcat部署商城系统并连接数据库

时间:2019-10-09 15:39:43      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:idle   nginx   ati   sys   ini   init   服务器   inf   grant   

需三台服务器
nginx 192.168.200.111
tomcat 192.168.200.112
tomcat 192.168.200.113

192.168.200.111
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# iptables -F
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
32 upstream tomcat_server {
33 ip_hash;
34 server 192.168.200.112:8080 weight=1;
35 server 192.168.200.113:8080 weight=1;
36 }
47 location / {
48 root html;
49 index index.html index.htm;
50 proxy_pass http://tomcat_server;
51 proxy_set_header Host $http_host;
52 }
[root@localhost ~]# killall -1 nginx
[root@localhost ~]# yum -y install mariadb mariadb-server
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# mysql
MariaDB [(none)]> grant all on slsaledb.* to admin@‘%‘ identified by ‘123456‘;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
[root@localhost ~]# mysql -uroot < slsaledb-2014-4-10.sql
[root@localhost ~]# systemctl restart mariadb

tomcat 192.168.200.112 / tomcat 192.168.200.113

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# iptables -F
[root@localhost ~]# mkdir /web/webapp -pv
[root@localhost ~]# tar fx SLSaleSystem.tar.gz -C /web/webapp
[root@localhost ~]# vim /usr/local/tomcat8/conf/server.xml
150 <Context docBase="/web/webapp/SLSaleSystem" path="" reloadable="flase"></Context>
[root@localhost ~]# vim /web/webapp/SLSaleSystem/WEB-INF/classes/jdbc.properties
driverClassName=com.mysql.jdbc.Driver
url=jdbc\:mysql\://192.168.200.111\:3306/slsaledb?useUnicode\=true&characterEncoding\=UTF-8
uname=admin
password=123456
minIdle=10
maxIdle=50
initialSize=5
maxActive=100
maxWait=100
removeAbandonedTimeout=180
removeAbandoned=true
[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh

 

基于nginx+tomcat部署商城系统并连接数据库

标签:idle   nginx   ati   sys   ini   init   服务器   inf   grant   

原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11641784.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!