I have made a website in java and struts2 ,now I want to host it live but I am unable to host it. I tried by uploading WAR file and extracting it in cpanel but still not working. I have account on hostbudget.com and I have bought their server.
Can anyone help me how can I upload my Java project since its my first time, I took suggestions from many friends of mine but none of them has clear idea of this.
cpanel doesn't support java by default. It only supports PHP by default.
See this link. How to deploy java web application (WAR) through my GoDaddy's cPanel?
WHM cpanel https://documentation.cpanel.net/display/EA/Introduction+to+Tomcat
Steps to deploy java web application in cpanel:
Select your public_html directory.
Click Upload.
Click Choose File
Browse your WAR file.
Change the file extension from .war to .zip
Select the .zip file and click Extract.
Before that you must install servlets in WHM cpanel. If you need any help to install then the server vendors will guide you.
Some of them told me that enter the following text in .htaccess file inside your public_html directory
SetHandler jakarta-servlet
SetEnv JK_WORKER_NAME ajp13
It's not needed. Since without this my app working.
Related
I am developing an application in android which communicates with tomcat to make use of rest api.
I also need to donwload some files to the android application (client) from server. These files are stored in a folder located outside tomcat directory on the server.To dowload the files I'm configuring my tomcat simply using :
<Context docBase="C:\Images" path="/Images" />
I don't think I can make use of servlets to upload download files since my front-end is the android application. Please let me know if anyone has any suggestions.
my application is running in eclipse but i want to run it on tomcat .i want to run my spring application in tomcat server and don't want to use eclipse or any other tool, so how can i do that and where do i put my various files basically the directory of it, and the complete procedure to do that.
main problem is in the directory structure and the path to be put in the tomcat server to run that application. i tried but it gives the 404 error file not found ,as i am new to the spring framework explain in detail
You are asking a very broad question. But, in an attempt to point you in the right direction please see this article. The link given provides insight into the directory structure of your application.
Now as far as running "outside of eclipse" you should be able to export your project from the "File" menu as a "Web Application Archive" or "WAR" file. This file can then be placed under ${CATALINA_BASE}/webapps and be launched when you start your container.
If you are using a stock configuration and you have an archive named "myapp.war", you can access it on
http://localhost:8080/myapp
I hope this information helps you get to where you need to go.
First export the war file using eclipse as you are using eclipse.
Then follow the procedure
How to deploy a war file in Tomcat 7
During my college time i have developed a java website in red hat 5 ,
On tomcat server with mysql as DB.
I havent use any IDE (Eclipse,NetBeans etc) for it.
I have developed it using notepad.
I have no clue of deploying any java website.
I tried importing my java website in the eclipse but it was giving lots of errors.
If anyone can help me that will be great !!
Please get my project folder on below link:
https://jumpshare.com/b/ppGP9oibkrTvVLtw9YxW
I had this directory in my Tomcat folder.
Please help.
If you just want to run the web app on your local server :
Install Tomacat.
Copy the ty154 folder to the web app folder
Start tomcat. If your code was working, then it will show up at something like the following url
http://localhost:8080/ty154/
If you just want to run the web app on a tomcat hosted server by uploading your web app folder :
Copy the ty154 folder to the web app folder.
Assuming that your hosting url is
http://neer.hosting.com/
then goto the following url
http://neer.hosting.com/ty154/
For some of the hostings you might have to restart your tomcat server.
Deploying using war files :
Also some of the hostings have some special ways to deploy. They might ask you to upload your WAR file. Here are the commands for generating the WAR file.
cd /to/your/folder/location
jar -cvf my_web_app.war *
Mostly uploading the WAR file to the web app folder on the remote hosting should suffice. Only thing is that you might have to restart your tomcat server.
NOTE : Some of the free hosting have their own steps for deployment. Refer to their deployment help documents. It will help you better.
I use this http://code.google.com/p/gwtupload/ to upload files to my app. But I have problem when I want save file out of my app in other folder in Tomcat. (for example my app's name is MyApp but I want save files in folder Data on the same Tomcat server). Can someone know why I can't do that ?
Is it what you are looking for ??
Tomcat home directory or Catalina directory is stored at the Java System Property environment. If the Java web application is deployed into Tomcat web server, we can get the Tomcat directory with the following command
System.getProperty("catalina.base");
Google Chrome does not launch JNLP file automatically, so I recommend for our users this solution. It works but the downloaded JNLP file remains in download folder. Deleting them manually is troublesome.
I want to add a function to our Java application:
Google Chrome downloads a JNLP file and open it.
The JNLP file starts our Java application.
The Java application deletes the JNLP file (<= I want this function!)
Can I get the file path of the downloaded JNLP file which started the Java application?
Of cause, our Java application jar is signed and can access local resources.
There is nothing in the Java WebStart paper that describes such a mechanism, hence you are in "vendor-specific" territory, and I do not think that there is an API letting your application know where the JNLP file is.
You can, however, provide a replacement for javaws which invoke the original javaws with -wait and delete the JNLP file afterwards. This must be installed by the user.