[英]Unable to access web application by using ip address instead of localhost
I have created a web application using Eclipse. 我已经使用Eclipse创建了一个Web应用程序。
While creating the project I have added Tomcat server. 在创建项目时,我添加了Tomcat服务器。 Then I ran my application and it worked.
然后我运行了我的应用程序,它开始工作了。
Afterwards I installed Apache Tomcat service by executing the service.bat file through the command line and in the properties I have set startup type to automatic. 之后,我通过命令行执行service.bat文件并在属性中将启动类型设置为自动,从而安装了Apache Tomcat服务。
Now I can see the Tomcat in services tab but when I tried to access my web page by using my IP address ( http://192.168.xx:8080/myroom/ ) I am unable to access it. 现在,我可以在“服务”选项卡中看到Tomcat,但是当我尝试通过使用IP地址( http://192.168.xx:8080 / myroom / )访问网页时,无法访问它。
I am getting the following error: http:status:404 error - The requested resource is not available 我收到以下错误: http:status:404错误-请求的资源不可用
But when I stop the service in task manager, open Eclipse and run my application on server I'm able to access my web page. 但是,当我在任务管理器中停止服务时,打开Eclipse并在服务器上运行我的应用程序,就可以访问我的网页。
Why am I unable to access my web page by starting the service in task manager and then by using IP address? 为什么通过在任务管理器中启动服务然后使用IP地址无法访问我的网页?
您的eclipse tomcat与Web应用程序文件夹位置中的独立tomcat不同,从eclipse运行时,它是.workspace / eclipse wstd core等...,从独立运行时,它通常位于Tomcat文件夹中的某个位置
Eclipse uses a different deployment directory. Eclipse使用其他部署目录。
You have to deploy your web application in Tomcat server. 您必须在Tomcat服务器中部署Web应用程序。 Just copy your .war file to TOMCAT_HOME/webapps.
只需将.war文件复制到TOMCAT_HOME / webapps。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.