In Linux environment, when I keep my Java web-application's war file into webapps directory and start the server, it strangely gets extracted to 2 different applications (with 2nd one unwanted application with first letter removed).
More specifically, I have application war file as configurator.war, I'm copying it to webapps directory of tomcat and starting server with ./startup.sh in Linux environment. But this extracts 2 folders configurator & onfigurator (don't know how).
Can anybody please suggest what wrong I might have done?
Related
I am trying to deploy a web application to Tomcat v.6.0. I know I need to be able to deploy a single file--the WAR file. The problem is, the command that the Play documentation instructs to run, produces a directory, and not a single file.
The command:
play war myapp -o myapp.war
produces a directory called myapp.war with another directory WEB-INF which contains the directories of application, classes, framework, lib, etc.,
I am trying to deploy this to my private JVM instance of my web server. I have tried compressing the myapp.war directory, uploading that, unpacking it, etc,. but that does not do anything. I get a blank screen when I check my site.
I've heard I can run Play as a stand alone server like I do locally but I have Java and Play installed. My remote host may likely not have this installed on whatever instance is serving up pages from the public_html directory. If I were to put my application directly into the public_html directory, how can I terminal into and issue the "Play run" command to get it started?
This is the first time I've deployed a web application to a web server.
With this command Play produces an exploded .war file, so you don't have to zip/unzip it.
Check what Tomcat documentation says here about the deployment of an exploded .war files.
Also, a blank screen may be the sign of some problems with your application startup, so you have to check Tomcat logfiles like catalina.out or localhost.log to see if there are some exceptions.
I have created an application in Java EE, I have learned how to deploy it in the tomcat server using the manager app or by copying the war file to the webapps folder. Now I can start the tomcat server only from the Netbeans IDE.
I want to know how to start the apache tomcat server without using the IDE and run my web application from the war file deployed. If I'm headed in the wrong direction please correct me. I'm asking this to gain knowledge of how to deploy the .war file in another server system without using the IDE only the tomcat server.
The shell scripts located in "CATALINA_HOME/bin" are the most bare-bones way of getting Tomcat up and running. The two scripts capable of starting Tomcat in this directory are named "catalina" and "startup", with extensions that vary by platform.
In your tomcat installation directory, there would be a startup.bat/sh file which will start the server for you. Moreover you can see the conf folder as well if you want to change any configurations. Whatever war you copy to the webapps folder will be automatically deployed
My team and I originally had a server running through Eclipse (Java EE), but wanted to switch it to running on the Tomcat 7.0 service found in Windows 2008 R2. We are completely clueless on what files to put where in the Tomcat folders found in program files. The entire server has gone down and we can't go back to the original setup. Any help is appreciated. All we're asking is where do we put our JSP/ROOT ect folders in the Tomcat program files.
Copying JSP files are not good idea rather you can package your jsp file into an archive file called WAR file. You can export your project from Eclipse IDE as a WAR file.
After creating the WAR file (.war), you need to find out tomcat installation directory and its called tomcat HOME. Now you just need to copy the WAR file into the following folder:
{TOMCAT HOME}/webapps/<project>.war
I'll add to the answer.
If you have folders of running applications from before you can put 'em under
{TOMCAT HOME}/webapps/
war file will un-zip after you start the service.
once the war is un-zipped, you can delete it, but only after you stop the service for the first time after war deployment.
I was starting on JAVA web development today and encountered some problems, I installed my tomcat7 on my ubuntu machine. Now when I browse to //localhost:8080, I get the default welcome page saying:
This is the default Tomcat home page. It can be found on the local filesystem at: /var/lib/tomcat7/webapps/ROOT/index.html
Tomcat7 veterans might be pleased to learn that this system instance of Tomcat is installed with CATALINA_HOME in /usr/share/tomcat7 and CATALINA_BASE in /var/lib/tomcat7, following the rules from /usr/share/doc/tomcat7-common/RUNNING.txt.gz.
But strangely when I try echo $CATALINA_HOME nothing shows up.
Also I can not copy/create anything in the default /var/lib/tomcat7/ROOT though it's just a matter of providing few permissions but I was wondering whether it is the right way to do it?,
What I would like to do is create a separate directory in my home where I can put my web application and tomcat can read hem from there. Is there a way to do it? In apache I can do it by changing the document-root and directory but I don't know how to do it for tomcat
But strangely when I try echo $CATALINA_HOME nothing shows up.
This is because the packaged version sets CATALINA_HOME just prior to launching Tomcat, after reading it from a configuration file (typically somewhere in /etc).
Also I can not copy/create anything in the default
/var/lib/tomcat7/ROOT though it's just a matter of providing few
permissions but I was wondering whether it is the right way to do it?
The permissions problem has to do with you not being root (or the Tomcat user). Most packaged Tomcat installations (deb or RPM) tend to install with a specific user in mind, and copying stuff in as a different sometimes won't work.
/usr/share/tomcat7 is your CATALINA_HOME directory, and it has links to the other directories, such as /var/lib/tomcat7/webapps, /etc/tomcat7, etc. You shouldn't copy directly into a web application, you should package the web application into a WAR file and "deploy" it. The advantages are numerous.
What I would like to do is create a separate directory in my home
where I can put my web application and tomcat can read hem from there.
Is there a way to do it?
Yes, one is created when "deploying a web app". Look to the standard Tomcat7 documentation, and consider installing the "manager" web application if you like a non-command line interface. Now that you know what "installation" of a web app is called, it will likely be an easier task.
In apache I can do it by changing the document-root and directory but
I don't know how to do it for tomcat
Tomcat has a different, slightly more restrictive set of requirements for a document-root. You need to learn it, and just come to terms with the idea that it's never going to be the same. Basically under the "webapps" directory, is a WAR file or a expanded directory that came from a WAR file. Editing in-place is not a good idea for Tomcat, as the CGI-equivalents are not read from disk each time they are ran, they are linked into the memory of Tomcat. This means that a change in the directory might not affect your web application, which is good enough reason to not bother changing the on-disk files for a deployed web application.
Modify the web application, repackage it, and update the deployment. It's really the "right" way to go with Tomcat.
Give permission 777 to the webroot folder
sudo chmod -R 777 Webroot
After moving to the tomcat folder
I have multiple (8) WAR files and 1 EAR file that I want to deploy to Glassfish without having to redeploy each application through the Admin Console.
Previously in Tomcat the WAR files could just be dropped into the webapps directory, is there something similar for Glassfish? Using the asadmin command to grab a bunch of apps to dpeloy? Preferably for WAR and EAR files?
Yep - take a look at /domains/domain1/autodeply - you can drop things straight in there.
(substitute domain1 with your domain if you're working in a custom environment)
(sorry if the folder is off - it's coming from memory at this point)