使用tomcat web 服务搭建jspgou

单机单实例配置

基础环境:
	1.关闭防火墙:systemctl stop firewalld
	2.关闭selinux:setenforce 0
	3.安装包;jdk-8u91-linux-x64.tar.gz;apache-tomcat-7.0.34.tar.gz;jspgouV6-ROOT.zip
部署JAVA环境
	1.解压jdk包:tar xf jdk-8u91-linux-x64.tar.gz -C /usr/local
	2.重命名:mv /usr/local/jdk1.8.0_91  /usr/local/java
修改环境变量
1.vim /etc/profile
	JAVA_HOME=/usr/local/java
		PATH=$JAVA_HOME/bin:$PATH
		export JAVA_HOME PATH
2.使环境变量生效
	source /etc/profile
测试Java环境
	1.env | grep JAVA
			JAVA_HOME=/usr/local/java
	2.java -version
			java version "1.8.0_91"
			Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
			Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
安装启动 tomcat
		1.tar xf apache-tomcat-7.0.34.tar.gz -C /usr/local/
		2.ln -s /usr/local/apache-tomcat-7.0.34 /usr/local/tomcat
修改环境变量
	1.修改环境变量:
		# vim /etc/profile	
			CATALINA_HOME=/usr/local/tomcat			
			export CATALINA_HOME
	    # source /etc/profile
启动Tomcat:
	# /usr/local/tomcat/bin/startup.sh 	
			Using CATALINA_BASE:   /usr/local/tomcat
			Using CATALINA_HOME:   /usr/local/tomcat
			Using CATALINA_TMPDIR: /usr/local/tomcat/temp
			Using JRE_HOME:        /usr/java/jdk1.7.0_11
			Using CLASSPATH:       		/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
查看java端口(8080,8009,8005)
		# netstat -tnlp |grep java
		tcp        0      0 ::ffff:127.0.0.1:8005       :::*                   LISTEN      6191/java          
		tcp        0      0 :::8009                     :::*                        LISTEN      6191/java           
		tcp        0      0 :::8080                     :::*                        LISTEN      6191/java  
访问测试 tomcat
		http:192.168.122.83:8080
安装 mysql
		yum install mariadb  mariadb-server -y
		systemctl start mariadb
部署 jspgou
		获取到jspgouV6-ROOT.zip
		# ls /usr/local/tomcat/webapps/			        # 默认网站的基目录base
			docs  examples  host-manager  manager  ROOT
		# ls /usr/local/tomcat/webapps/ROOT	    # 默认网站的主目录
创建数据库:
mysql
		MariaDB [(none)]> use mysql;
		MariaDB [(none)]> UPDATE user SET password=password('123') WHERE user='root';
		MariaDB [(none)]> create database jspgou CHARACTER SET = utf8;
		MariaDB [(none)]> flush privileges;
更改数据库链接并导入数据:
	#unzip jspgouV6-ROOT.zip		
	# vim ROOT/WEB-INF/config/jdbc.properties 
		jdbc.driverClassName=com.mysql.jdbc.Driver	
		jdbc.url=jdbc:mysql://127.0.0.1:3306/jspgou?characterEncoding=UTF-8
		jdbc.username=root                          # 生产环境中必须用普通用户
		jdbc.password=123
	# mysql -uroot -p123 -D jspgou < jspgou.sql
部署网站:
	将程序解压后的ROOT文件夹拷贝到tomcat安装目录下的webapps文件夹下(删除原有ROOT目录)
	系统管理后台登录:http://localhost:8080/jeeadmin/jspgou/index.do
	用户名:admin  密 码:123456
	# cp -r ROOT/   /usr/local/tomcat/webapps/
注意
	重启服务
		systemctl restart mysql
		防火墙关掉

你可能感兴趣的:(使用tomcat web 服务搭建jspgou)