我想爲Tomcat 6.0設置一個DNS名稱。我通過編輯Tomcat 6.0中的server.xml文件來嘗試它。我的要求是一個有效的域名,而不是本地主機。通常,http://localhost:8080
用於訪問tomcat管理器頁面。我試圖改變它,但我不能。請幫我設置一個域名。tomcat的域名
3
A
回答
4
如果tomcat的主機沒有公共域名,則應該編輯主機文件。如果您的操作系統是unix系列(即Linux,MacOSX等),您可以在/etc/hosts
中看到主機文件。 您可以添加以下行:
127.0.0.1 your.host.name
如果你的操作系統是Windows,你可以找到你的主機在
C:\Windows\System32\drivers\etc\hosts
文件編輯後的hosts文件,重新啓動Tomcat。然後,您可以在瀏覽器的地址欄中輸入http://your.host.name:8080
來訪問您的tomcat。
2
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
...........................................................
相關問題
- 1. tomcat域名問題
- 2. Depoly的Tomcat與域名
- 3. 域名+ nginx + tomcat設置
- 4. 將域名指向Tomcat
- 5. tomcat中的領域名稱(web.xml)
- 6. Apache Tomcat IP映射到域名
- 7. 通配符子域名apache + tomcat
- 8. tomcat安全領域是否有tomcat匿名角色或用戶?
- 9. oauth2的Tomcat領域?
- 10. Tomcat和子域
- 11. 在Tomcat的域中創建子域
- 12. Tomcat中的Geoserver跨域
- 13. 跨子域的Tomcat SSO
- 14. Tomcat - 沒有領域的SSO?
- 15. 如何配置多個域的Tomcat; www映射到錯誤的域名
- 16. 關於在網絡域名的tomcat端口
- 17. Apache下的子域名代理到Tomcat中
- 18. 域名重定向域名/域名
- 19. Tomcat子域重定向
- 20. Tomcat和多域/應用
- 21. 將域名映射到Tomcat應用程序
- 22. 使用嵌入式tomcat在Spring Boot App中設置域名
- 23. 通過域名訪問tomcat應用程序
- 24. 允許在Uri的域名/子域名
- 25. 從無域名的域名重定向
- 26. 域名中的Cookie衝突 - 子域名
- 27. 無Cookie域名的Cookie和子域名
- 28. NGINX:node.js + PHP的域名+子域名
- 29. 有目錄或新域名的域名?
- 30. Tomcat中的System.setProperty的作用域
非常感謝您的幫助.....成功完成。 –