日期:2014-05-17  浏览次数:20746 次

域名访问
通过IIS与tomcat的整合,可以通过“域名/项目名”访问,如何设置可以直接通过域名访问?在运行中输入drivers,更改ect中hosts的内容,发现访问时网页无法显示,这是怎么回事呢?求高人指点!!!在线等!!!

------解决方案--------------------
把你修改的hosts文件内容贴出来看看
------解决方案--------------------
不用改host吧,除非你的域名在外网有存在。。域名是在tomcat的conf目录里的server.xml里改的,
XML code

<Server port="8007" shutdown="SHUTDOWN">

    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

    <GlobalNamingResources>

        <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

        <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase"
            description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
            pathname="conf/tomcat-users.xml" />

    </GlobalNamingResources>

    <Service name="Catalina">

        <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>

        <Connector port="8011" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

        <Engine name="Catalina" defaultHost="域名.com">

            <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

            <Host name="域名.com" appBase="工程位置"
                unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

                <Context path="" docBase="工程位置"/>

            </Host>

        </Engine>

    </Service>

</Server>