zoukankan      html  css  js  c++  java
  • tomcat访问控制及站点部署

    访问控制:

    在访问tomcat服务器状态时,出现403错误。


    解决方法:

    [root@localhost ~]# vim /usr/local/tomcat8/conf/tomcat-users.xml

    44 <role rolename="manager-gui"/>

      45 <role rolename="admin-gui"/>

      46 <user username="tomcat" password="12345" roles="manager-gui,admin-gui"/>

    [root@localhost ~]# vim /usr/local/tomcat8/webapps/manager/META-INF/context.xml

    18 <Context antiResourceLocking="false" privileged="true" >

      19 <!--  <Valve className="org.apache.catalina.valves.RemoteAddrValve"

      20          allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1" /> -->

    [root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh

    [root@localhost ~]# /usr/local/tomcat8/bin/startup.sh

     

    站点部署:

    使用开发工具将程序打包成war包,上传到tomcatwebapps目录下,站点主动解压部署。

    [root@localhost ~]# mv jpress-web-newest.war /usr/local/tomcat8/webapps/

    [root@localhost ~]# ls /usr/local/tomcat8/webapps/

    docs      host-manager       jpress-web-newest.war  memtest

    examples  jpress-web-newest  manager                ROOT

     

    访问http://192.168.200.111:8080/jpress-web-newest/install即可


    [root@localhost ~]# yum -y install mariadb mariadb-server

    [root@localhost ~]# systemctl start mariadb

    [root@localhost ~]# mysql

    MariaDB [(none)]> create database jpress;

    MariaDB [(none)]> grant all on jpress.* to admin@'localhost' identified by '12345';

    MariaDB [(none)]> flush privileges;

    MariaDB [(none)]> exit

    jpress完全安装完之后,

    再重新启动tomcat即可。

  • 相关阅读:
    数据库查询(二)
    数据库插入操作
    java关键字查询数据库
    登录页面设计
    获取下拉列表的值
    Linux下tomcat 8安装与配置
    CentOS7下防火墙的设置
    centos 7 下nginx的安装
    vmware14下centos 7的安装和配置
    Linux中JDK的安装以及配置
  • 原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11641808.html
Copyright © 2011-2022 走看看