WINDOWS环境TOMCAT部署

1、下载与安装

apache-tomcat-8.0.49-windows-x64.zip

jjdk-8u161-windows-x64.rar

尽量使用TOMCAT8+JAVA1.8

 

2、配置环境变量

变量名:JRE_HOME

变量值:C:\Program Files\Java\jdk1.8.0_161

变量名:TOMCAT_HOME

变量值:C:\apache-tomcat-8.0.49

变量名:CATALINA_HOME

变量值:C:\apache-tomcat-8.0.49

PATH变量增加以下变量值:

%TOMCAT_HOME%\bin;%CATALINA_HOME%\lib;C:\mysql5.6.41\bin;

 

3、配置TOMCAT

(1)修改端口,多个端口访问

修改server.xml配置文件

C:\apache-tomcat-8.0.49\conf\server.xml

想要让用户直接输入网址或者IP不加端口直接访问,也可以让开发人员通过9090端口进行一些二次开发工作

    80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
   9090" protocol="HTTP/1.1"
   connectionTimeout="20000"
   redirectPort="8443" address="0.0.0.0"/>

 

(2)域名访问,多个域名访问,同时也可以通过IP访问

 192.168.100.111"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
                        prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />
        C:\apache-tomcat-8.0.49\webapps\test"  reloadable="true"/>
      
       
      www.test.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
                       prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />
        C:\apache-tomcat-8.0.49\webapps\test"  reloadable="true"/>
     

      test.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
                       prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />
        C:\apache-tomcat-8.0.49\webapps\test"  reloadable="true"/>
     

4、配置hosts文件

192.168.100.111  www.test.com

192.168.100.111  test.com

 

5、TOMCAT启动停止

C:\apache-tomcat-8.0.49\bin\startup.bat

C:\apache-tomcat-8.0.49\bin\shutdown.bat

注意启动停止TOMCAT服务最好都使用脚本来进行

 

6、安装MYSQL

mysql-5.6.41-winx64.zip

下载安装后

修改my.ini 文件,在[mysqld]下添加一行skip-grant-tables

启动MYSQL

net start mysql

use mysql;

update user set authentication_string=password("F_7nKQ4B") where user="root";

flush privileges;

net stop mysql

删除my.ini文件把之前添加的skip-grant-tables

net start mysql

update mysql.user set host = '%' where user = 'root' limit 1;

update user set Password = password('F_7nKQ4B') where User='root';

flush privileges;

 

 

mysql -uroot -pF_7nKQ4B

create user  xajz@'%'  identified  by 'G_4wEmN7' ;

GRANT ALL PRIVILEGES ON *.* TO 'xajz'@'%' IDENTIFIED BY 'G_4wEmN7' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON xajzdb.* TO xajz@"localhost" IDENTIFIED BY "G_4wEmN7";

update user set Password = password('G_4wEmN7') where User='xajz';

update user set Password = password('F_7nKQ4B') where User='root';

flush privileges;

 

你可能感兴趣的:(tomcat)