I'm trying to make a java project run on a remote server. I've used Maven and the project uses a Mongo database. I've got access to a home directory on a remote web server. MongoDB, Tomcat and java are installed so the only thing I have to do is to transfer my Mongo Database and my project and making this all work and run.
However, I'm new to all this and I've got no clue in how to do this. I also can't find anything online on how to archieve this.
How would I go about doing this via SSH?
My project includes:
- .js files
- .java files
- .html files
1 main java class which should run constantly
Best How To :
Actually if you are new for this kind of development, (actually it is more about deployment so popular tag DEVOPS anyway...) take it easy so use your application server and database in the same machine(which is not a suggested way for large systems).
it will ask a password enter the password which is given by you when creating the SSH key.
Step 3 Install Mongo DB, Maven, Tomcat, Java to your remote machine.
Step 4 Copy your war to under remote machine webapps
Secure Copy war to remote machine
scp -vC ~/.m2/repository/com/foo/Example/foo.war [email protected]:/home/Development/tomcat/webapps echo "Copy to server"
Step 5 Run tomcat server Go to tomcat/bin directory run startup.sh