域名xxxx.com默认是指向另一个默认网站,是在iis中配置的。我是想在tomcat中增加一个java版的虚拟主机。
解决方案 »
- ant与findbugs的使用,
- hibernate 更新多条数据疑问
- spring 不会注入了 Class<Person> type 如何注入Person
- hibernate级联更新偶尔锁表的问题
- ★★★WebLogic7发布ear包报错了★★
- acegi怎样匹配/user.ejf?cmd=list这样的URL
- J2EE1.4 安装求助
- spring security前台登录如何传递多个参数要后台验证
- 如何在Struts下的Control模块下使用JspSmartUpload?
- 看了springmvc初级教程 不知道如何把数据传递给视图页面 请各位指点下 不知道各位实际开发中怎么做的
- tomcat下如何设置使访问时不需要在URL中输入8080的端口号?
- 四个J2EE讨论群,都升级为256M高级群,分别讨论STRUTS EJB Servlet XML/JSP邀请各位豪杰加入,一起共享代码和教程
域名xxxx.com默认是指向另一个默认网站,是在iis中配置的。我是想在tomcat中增加一个java版的虚拟主机。
×××××××××××××××××××××××
那看看 阀 Valve 是否限制了 外部主机的访问, 地址阀可以限制远程 IP 地址。<Engine>
<Valve class="" />
<Host />
</Engine>
在Tomcat中使用虚拟主机,你需要设置DNS或主机数据。为了测试,为本地IP设置一个IP别名就足够了,接下来,你需要在server.xml中添加几行内容,如下:<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Standalone">
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"/>
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0" scheme="https" secure="true"/>
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
<Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- This Host is the default Host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="ROOT" debug="0"/>
<Context path="/orders" docBase="/home/ian/orders" debug="0"
reloadable="true" crossContext="true">
</Context>
</Host><!-- This Host is the first "Virtual Host": www.example.com -->
<Host name="www.example.com" appBase="/home/example/webapp">
<Context path="" docBase="."/>
</Host></Engine>
</Service>
</Server>Tomcat的server.xml文件,在初始状态下,只包括一个虚拟主机,但是它容易被扩充到支持多个虚拟主机。在前面的例子中展示的是一个简单的server.xml版本,其中粗体部分就是用于添加一个虚拟主机。每一个Host元素必须包括一个或多个context元素,所包含的context元素中必须有一个是默认的context,这个默认的context的显示路径应该为空(例如,path=””)。
二是在要访问的机器上的HOST文件中直接指定,这时每个访问的机器都要设置才能访问。
你选吧,我看你还是老实的买下这个域名,让别人用你的DNS不现实。