我想为Tomcat 6.0设置一个DNS名称。我尝试过在Tomcat6.0中编辑server.xml文件。我的要求是一个有效的域名,而不是本地主机。通常,http://localhost:8080用于访问tomcat管理器页面。我试着改了,但是改不了。请帮我设置一个域名。
发布于 2012-11-23 18:16:48
如果tomcat的host没有公有域名,则需要编辑host文件。如果你的操作系统是unix系列的(例如Linux、MacOSX等),你可以在/etc/hosts中看到主机文件。您可以添加以下行:
127.0.0.1 your.host.name如果您的操作系统是windows,您可以在以下位置找到hosts文件
C:\Windows\System32\drivers\etc\hosts编辑hosts文件后,重新启动tomcat。然后,您可以通过在浏览器的地址字段中输入http://your.host.name:8080来访问tomcat。
发布于 2014-11-13 02:48:25
step1>open notepad as administrator
step2>in notepad open C:\Windows\System32\drivers\etc and select hosts file.
step3>replace # 127.0.0.1 localhost to 127.0.0.1 www.yourdomain.com and save the file.
note: not click on save as. don't forget to remove #
step4>add your application to webapp folder
step5>open tomcat and search server.xml and open it. and then change http port no to 80
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
step6>under <Engine> tag add the following
<Host name="www.yourdomain.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="your project name"/>
</Host>
adn save the file.
note: Make Sure that you have welcome file config.. in web.xml
step7>now restart tomcat server
step8>open browser and type www.yourdomain.com
...........................................................https://stackoverflow.com/questions/13526903
复制相似问题