简体   繁体   English

无法通过使用IP地址而不是localhost访问Web应用程序

[英]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.

相关问题 如何使用域名而不是localhost / IP地址访问本地Web应用程序? - How to access the local web application with domain name instead of localhost/IP address? 如何在IP地址而不是localhost上托管Web应用程序 - How to host web application on IP address instead of localhost 如何使用公共IP地址而不是localhost访问我的webapp? - How to access my webapp using public IP address instead of localhost? ActiveMQ Web控制台-如何指向主机名或IP地址而不是本地主机? - ActiveMQ web console - how to point to a hostname or IP address instead of localhost? 使用Cloud Endpoint Framework中的IP地址访问App Engine本地主机 - Access App Engine localhost using IP address in Cloud Endpoint Framework 使用WAN IP代替localhost的RESTful Web应用程序 - RESTful web applications using WAN IP instead of localhost Tomcat在端口8080上运行,但无法使用IP地址远程访问? - Tomcat is running on port 8080, but unable to access remotely using IP address? Tomcat运行在8080端口但是无法使用ip地址远程访问? - Tomcat is running on 8080 port but unable to access remotely using ip address? 无法使用Windows Server静态IP访问Java Web应用程序 - Unable to access java web application with windows server static ip 使用ip地址访问本地应用程序时出现404错误,但在localhost下可以正常工作吗? - Getting 404 error when access local application with ip address but works fine with localhost?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM