文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Tomcat 配置域名

Tomcat 配置域名

时间:2010-08-27  来源:枣阳人在深圳

 

1. 根据以下路径打到 hosts 文件,并修改。

  (1)路径: C:\Windows\System32\drivers\etc

  (2)hots 文件内容及修改

# Copyright (c) 1993-2009 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

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

在最后新增一行,IP和域名之间以空格隔开:

127.0.0.1 http://www.top117.com/

 

2. 修改tomcat 中server.xml文件,两处改动如下:

(1)修改端口,将端口改为80:

    <Connector port="80" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100" />

 

(2)将主机名改为自己的域名,如下:

        <Host name="http://www.top117.com/" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
           <Context docBase="D:/workspace/top117/WebRoot" path="" reloadable="true"/>
      </Host>

      docBase="" 指向自己项目的WebRoot目录

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. 在MyEclipse 下启动tomcat, 在IE中输入自己配置的域名访问一下,即可看到自己的项目。

 

 

 

 

 

 

 

排行榜 更多 +
下载oe

下载oe

金融理财 下载
易欧app官方下载安装

易欧app官方下载安装

金融理财 下载
易欧app官方免费下载

易欧app官方免费下载

金融理财 下载