开发者

Cannot access Tomcat from Eclipse in Ubuntu

I am having a problem accessing Tomcat from the browser if it was invoked from Eclipse, but it works fine if invoked from command prompt. I have configured Eclipse to start Tomcat 5.5.23. It starts fine. If I try to connect to it at least to see the admin page using http://localhost:8081/ I get 404 error "The requested resource (/) is not available".

No logs are emitted in the logs folder which is very strange. If I invoke it from comman dprompt 9using startup.sh) I do get log files in logs. This is a new fresh install of Tomact from tomcat.apache.org. The console on Eclipse doesn't show any activity when attempting to access Tomcat, just the normal start up or Tomcat.

I didn't have problem using and connecting to To开发者_如何学Pythonmcat in Eclipse on Windows platform before but I have absolutely no clue why it is failing to do so on Linux?

Any help will be appreciated.


In your eclipse Run Configurations of your server instance catalina.base will not be same as your actual catalina home. Set it to your catalina.home and it should work fine.


Are you sure Eclipse is configured to start the tomcat installation you currently starting manually?

There might be 2 installations, one shipped with eclipse and one other installed seperatly.

If so, it would be no wonder the admin-interface isn't accessable since -iirc- the admin-panel has to be installed afterwards.


If I try to connect to it at least to see the admin page using http://localhost:8081/ I get 404 error "The requested resource (/) is not available".

I don't know if this is the problem but 1. that's not the path of the admin application 2. it is actually not bundled with Tomcat 5.5. From the FAQ:

How do I install the Administration web app?

If you install Tomcat 5.5 binaries, the Administration web app is not bundled with it; this describes how to add the Administration web app to your Tomcat 5.5 installation. (Tomcat 4.1 comes with the Administration web app as part of the binary).

The following refers to a Tomcat 5.5 set up on Windows 2000, so your path names will be different on *nix platforms. In this example, Tomcat 5.5.17 in installed in c:\Program Files\Apache Software Foundation\Tomcat 5.5 (this is my CATALINA_HOME).

  1. Unzip or untar (be careful to use GNU tar) the file containing the administration web app files (eg. apache-tomcat-5.5.17-admin.zip) to a temporary directory, eg. c:\temp.

  2. Copy c:\temp\apache-tomcat-5.5.17\conf\Catalina\localhost\admin.xml to the directory c:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost.

  3. Copy the entire directory tree c:\temp\apache-tomcat-5.5.17\server\webapps\admin

to the directory c:\Program Files\Apache Software Foundation\Tomcat 5.5\server\webapps. This is an overlay, so \server\webapps is just pointing you to the \server\webapps, and the admin directory with its contents will be the only thing you see added there.

  1. Add a line to your c:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml file so that you have a user who has admin role. For example, add this line just before the last line (containing </tomcat-users>) of the file:

    <user username="admin" password="makesomethingup" roles="admin,manager"/> 
    
  2. Restart Tomcat.

  3. Now when you visit http://localhost:8080/admin you should see a page that asks for a user name and password. If you still see the "no longer loaded" error message in your browser, you must either force a full reload of the web page (in Firefox, hold down Shift key while clicking on the Reload button) or just restart your browser completely.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜