0

I am trying to set up Tomcat server & trying to run a .war file. I unfortunately am struggling to get it running. My problem is that after starting the server I am able to access the localhost:8080 page but the war file is not getting deployed when I do localhost:8080/Amazon where Amazon.war is my war file that I have kept in my webapps folder.

How to deploy a war file in Tomcat 7

I am following the instructions in the above link. So I tried to use the GUI manager instead. I believe tomcat needs to be configured to GUI. So I tried following the instructions that I got on my web browser.

Error message on browser:

Begin:

You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.

END:

However this also does not seem to work. I restarted the server. What wrong am I doing?

Edit :

my tomcat-user.xml files contents are as follows :

<tomcat-users>
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
</tomcat-users>

the rest of the contents are comments.

Community
  • 1
  • 1
rockstar
  • 3,512
  • 6
  • 40
  • 63
  • for starters, you might want to change the name of the war:D:D – Ashish Gupta Oct 08 '12 at 17:06
  • When you try to deploy the webapp, do you see any error in Tomcat's log files (catalina.out and/or localhost..log) ? As for the GUI manager issue, could you include the content of your tomcat-users.xml in your question ? – David Levesque Oct 08 '12 at 18:16
  • @DavidLevesque : there does not seem to be any log files under the log directory . Does tomcat not perform any logging by default or should i have to make some config changes to enable logging ? Strange . – rockstar Oct 09 '12 at 01:54
  • Logging should be enabled by default in a standard Tomcat installation. How did you install Tomcat ? How do you launch it ? – David Levesque Oct 09 '12 at 02:30
  • @DavidLevesque Well i am starting the Tomcat from the command line using startup.bat batch file . If i attempt to run it by right clicking on tomcat7.exe or tomcat7w.exe i get an error " The specified service does not exist as an installed device " . Hence i started from the command line . I get the page at localhost:8080 . Do you suggest redoing the installation ? – rockstar Oct 09 '12 at 02:55
  • I find it strange that there is no log file. Make sure that the OS user running Tomcat has write access to the Tomcat installation directory (at least the "logs" and "webapps" dir). Other than that, you can try reinstalling, I don't see what else could be wrong, sorry. – David Levesque Oct 09 '12 at 03:24

1 Answers1

0

I finally got it working ! I could not figure out what the problem was . I had to reinstall the Tomcat . This time i selected 32-bit/64-bit Windows Service Installer that specifically installed Tomcat as the service .

Thanks @david !

rockstar
  • 3,512
  • 6
  • 40
  • 63