nta*_*lbs 10
如果tomcat的主机没有公共域名,则应编辑主机文件.如果您的操作系统是unix-family(即Linux,MacOSX等),您可以在其中看到主机文件/etc/hosts.您可以添加以下行:
127.0.0.1 your.host.name
Run Code Online (Sandbox Code Playgroud)
如果您的操作系统是Windows,则可以在其中找到您的主机文件
C:\Windows\System32\drivers\etc\hosts
Run Code Online (Sandbox Code Playgroud)
编辑hosts文件后,重启tomcat.然后,您可以通过输入http://your.host.name:8080浏览器的地址字段来访问您的tomcat .
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
...........................................................
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23111 次 |
| 最近记录: |