美文网首页
配置Tomcat监听80端口、配置Tomcat的虚拟主机、Tom

配置Tomcat监听80端口、配置Tomcat的虚拟主机、Tom

作者: 强出头 | 来源:发表于2018-05-14 23:43 被阅读0次

配置Tomcat的虚拟主机

配置Tomcat的虚拟主机
配置Tomcat的虚拟主机
[root@izbp1e0xboek6oow616aoiz webapps]# vim /usr/local/tomcat/conf/server.xml
#在</Host>后面添加下面的配置
#war包未解压的放在appBase,war解压后的可以放在docBase中

    <Host name="www.123.cn" appBase=""
              unpackWARs= "true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="/data/wwwroot/123.cn/" debug="0" reloadable="true" crossContext="true"/>
     </Host>

[root@izbp1e0xboek6oow616aoiz src]# cd /usr/local/src/
[root@izbp1e0xboek6oow616aoiz src]# wget http://dl.zrlog.com/release/zrlog-1.9.1-cd87f93-release.war
[root@izbp1e0xboek6oow616aoiz src]# cp zrlog-1.9.1-cd87f93-release.war /usr/local/tomcat/webapps/
[root@izbp1e0xboek6oow616aoiz src]# ls /usr/local/tomcat/webapps/
docs          manager                      zrlog-1.9.1-cd87f93-release.war
examples      ROOT
host-manager  zrlog-1.9.1-cd87f93-release
[root@izbp1e0xboek6oow616aoiz src]# mv /usr/local/tomcat/webapps/zrlog-1.9.1-cd87f93-release /usr/local/tomcat/webapps/zrlog

#浏览器访问 ip:8080/zrlog/install/

[root@izbp1e0xboek6oow616aoiz src]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database zrlog;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on 'zrlog'.* to 'zrlog'@127.0.0.1 identified by '123456';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''zrlog'.* to 'zrlog'@127.0.0.1 identified by '123456'' at line 1
mysql> grant all on zrlog.* to 'zrlog'@127.0.0.1 identified by '123456';
Query OK, 0 rows affected (0.00 sec)


[root@izbp1e0xboek6oow616aoiz src]# mysql -uzrlog -h127.0.0.1 -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
| zrlog              |
+--------------------+
3 rows in set (0.00 sec)

[root@izbp1e0xboek6oow616aoiz ~]# mkdir /data/wwwroot/123.cn/
[root@izbp1e0xboek6oow616aoiz ~]# mv /usr/local/tomcat/webapps/zrlog/* /data/wwwroot/123.cn/
[root@izbp1e0xboek6oow616aoiz ~]# /usr/local/tomcat/bin/shutdown.sh
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk1.8
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[root@izbp1e0xboek6oow616aoiz ~]# /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/local/jdk1.8
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

#8005端口起来后网站才会生效

image.png

Tomcat日志

Tomcat日志
Tomcat日志
扩展
邱李的tomcat文档 https://www.linuser.com/forum.php?mod=forumdisplay&fid=37
JAR、WAR包区别 http://blog.csdn.net/lishehe/article/details/41607725
tomcat常见配置汇总 http://blog.sina.com.cn/s/blog_4ab26bdd0100gwpk.html
resin安装 http://fangniuwa.blog.51cto.com/10209030/1763488/
1 tomcat 单机多实例
http://www.ttlsa.com/tomcat/config-multi-tomcat-instance/
2 tomcat的jvm设置和连接数设置
http://www.cnblogs.com/bluestorm/archive/2013/04/23/3037392.html
3 jmx监控tomcat
http://blog.csdn.net/l1028386804/article/details/51547408
4 jvm性能调优监控工具jps/jstack/jmap[表情]at/jstat
http://blog.csdn.net/wisgood/article/details/25343845
http://guafei.iteye.com/blog/1815222
5 gvm gc 相关
http://www.cnblogs.com/Mandylover/p/5208055.html
http://blog.csdn.net/yohoph/article/details/42041729

相关文章

网友评论

      本文标题:配置Tomcat监听80端口、配置Tomcat的虚拟主机、Tom

      本文链接:https://www.haomeiwen.com/subject/mpmsdftx.html