标签:.com 主机 目录 als form out net images cat
16.4 配置Tomcat监听80端口[root@taoyun src]# vim /usr/local/tomcat/conf/server.xml
#可以修改成80端口
[root@taoyun src]# /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@taoyun src]# /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.
[root@taoyun src]# netstat -lntp |grep java
tcp6 0 0 :::80 :::* LISTEN 1752/java
[root@taoyun src]# vim /usr/local/tomcat/conf/server.xml
可以搜索 <Host ,找到如下图所示
#参数说明
<Host name="localhost" appBase="webapps"
#域名 网站打包文件存放点
unpackWARs="true" autoDeploy="true">
#设定为自动解压模式
#也可以单独指定存放的文件
<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>
#appBase 和 docBase 必须定义其中一个
appBase 为应用存放目录,通常是需要把war包直接放到该目录下面,它会自动解压成一个程序目录
下载安装
[root@taoyun src]# wget http://dl.zrlog.com/release/zrlog-1.8.0-d1f36bc-release.war
#默认的appBase 目录
[root@taoyun src]# ls /usr/local/tomcat/webapps/
docs examples host-manager manager ROOT
[root@taoyun src]# cp zrlog-1.8.0-d1f36bc-release.war /usr/local/tomcat/webapps/
[root@taoyun src]# !ls
ls /usr/local/tomcat/webapps/
docs examples host-manager manager ROOT zrlog-1.8.0-d1f36bc-release.war
[root@taoyun src]# !ls
ls /usr/local/tomcat/webapps/
docs examples host-manager manager ROOT zrlog-1.8.0-d1f36bc-release zrlog-1.8.0-d1f36bc-release.war
#自动解压
#修改目录名称
[root@taoyun webapps]# mv zrlog-1.8.0-d1f36bc-release zrlog
#使用zrlog部署
部署
直接网页部署
#创建数据库
[root@taoyun webapps]# mysql -uroot
mysql> create database zrlog;
Query OK, 1 row affected (0.02 sec)
mysql> grant all on zrlog.* to ‘zrlog‘@127.0.0.1 identified by ‘taoyuan‘;
Query OK, 0 rows affected (0.00 sec)
[root@taoyun webapps]# mysql -uzrlog -h127.0.0.1 -ptaoyuan
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
| zrlog |
+--------------------+
3 rows in set (0.02 sec)
填写网站信息
结果
#修改目录
[root@taoyun webapps]# mkdir /data/wwwroot/123.cn
[root@taoyun webapps]# mv /usr/local/tomcat/webapps/zrlog/* /data/wwwroot/123.cn/
[root@taoyun webapps]# /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@taoyun webapps]# /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.
标签:.com 主机 目录 als form out net images cat
原文地址:http://blog.51cto.com/3622288/2063776