Apache Tomcat 无法在 Windows7 32 位中安装的每个 Web 浏览器中运行
我正在 JSP 中开发一个 Web 应用程序,我的 Web 容器是 Apache Tomcat 7.0.2 (其可移植跨平台版本)。由于我广泛使用了 HTML5-CSS3 并且我的目标浏览器是 Google Chrome,因此我只能在 Opera Web 浏览器中运行 Apache 服务器,其余安装的浏览器都不能运行它。
以下是我在 Windows 7 计算机中启动服务器所遵循的步骤。
-从 apache-tomcat-7.0.2/bin/service.bat 在 Windows 中安装 Apache Tomcat 服务
-使用 tomcat7w.exe 启动该服务
-由于我的默认端口是 8080,因此我打开“http://localhost:8080/”在各种网络浏览器中,我只能在 Opera Web 浏览器(11.01)中看到具有相同地址的 Apache Server 主页,安装的其他浏览器都无法打开它(Chrome 9、Firefox 4 Beta 11 或 IE8)并显示标准页面未找到消息。
-我还尝试了其他端口号,但没有一个起作用。
我该怎么做才能让 Apache 在我计算机上安装的每个浏览器中运行?
我的计算机使用 Windows 7 和 Ubuntu 10.10 双启动,在 Ubuntu 中,安装的每个 Web 浏览器在启动后都可以运行 Apache,但在 Windows 中却不起作用。
更新:
我也尝试过 apache 的 Windows-only 安装程序版本 7.0.8 并在安装过程中更改了端口号,但我仍然无法在 Opera 以外的任何其他浏览器上运行它...
任何帮助将不胜感激... ………… 谢谢。
I'm working on a web application in JSP and my web container is Apache Tomcat 7.0.2 (Its portable cross-platform version). As I've made extensive use of HTML5-CSS3 and my target browser is Google Chrome, I'm able to run the the Apache server only in Opera web browser, neither of the remaining installed browser run it.
Here's the steps I have followed to start the server in my Windows 7 machine.
-Installed the Apache Tomcat service in Windows from apache-tomcat-7.0.2/bin/service.bat
-Started the service with tomcat7w.exe
-As my default port is 8080, I open 'http://localhost:8080/' in various web browsers, and I could see Apache Server Homepage with same address only in Opera Web Browser (11.01), neither of other browsers installed can open it (Chrome 9, Firefox 4 Beta 11 or IE8) and show standard page not found message.
-I also tried other port numbers, but none of them worked.
What can I do to make Apache run in every browser installed in my computer?
I have my computer dual boot with Windows 7 and Ubuntu 10.10, and in Ubuntu, every web browser installed can run Apache once I start it, but same is not working in Windows.
Update:
I have also tried apache's windows-only installer of version 7.0.8 and changed the port number during installation, but still I can't run it on any other browser expect for Opera...
Any help will be appreciated............
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 C:\Windows\system32\drivers\etc\hosts 下的主机文件,确保
127.0.0.1 localhost
的条目完好无损。另请注意,如果您位于代理服务器后面,则设置允许绕过 localhost。
Check your hosts file under C:\Windows\system32\drivers\etc\hosts to make sure that the entry for
127.0.0.1 localhost
is intact. Also see that if you are behind a proxy server, the settings allow for localhost to be bypassed.
刚果!!终于完成了,它使用 127.0.0.1(无论如何都是 localhost)而不是 localhost
因此,那些面临类似问题的人,按照 adarshr 的建议,检查主机文件以查看 localhost 是否正确寻址到127.0.0.1,或者如果您不想编辑该文件,您仍然可以通过简单地使用 http: //127.0.0.1:8080/ 而不是 http://localhost:8080/。请确保您使用的端口号,在我的例子中是 8080,它可能会根据您的配置方式而有所不同。
Congo!! finally got it done, instead of localhost, it works with 127.0.0.1 (which is localhost anyway)
So those who are facing similar issues, as suggested by adarshr, go through your hosts file to see if localhost is correctly addressed to 127.0.0.1, or if you don't want to edit that file, you can still get it done by simply using http://127.0.0.1:8080/ instead of http://localhost:8080/. Please be sure about port number you are using, in my case it was 8080, it might vary depending on how you've configured.