顺风车刷分软件哪个好:tomcat部署多个项目,公网通过域名解析访问
来源:百度文库 编辑:中财网 时间:2024/04/29 08:50:16
例如:域名:www.bbb.com, www.aaa.com等等。
解析到一个公网IP地址:210.34.120.110.
2.需要对tomcat下的conf下的"server.xml"进行配置
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
redirectPort="8443" URIEncoding="gbk" />
xmlValidation="false" xmlNamespaceAware="false">
xmlValidation="false" xmlNamespaceAware="false">
xmlValidation="false" xmlNamespaceAware="false">
这样,就可以访问多个项目,通过不同的域名进行。
附:如果进行本地测试。则需加如下配置:
C:\Windows\System32\drivers\etc\hosts(Vista系统下路径,其他操作系统可能不一样)
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 www.aaa.com
127.0.0.1 www.bbb.com
127.0.0.1 localhost