Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Scala files on a web server

Tags:

eclipse

scala

ftp

This could be either an incredibly easy or horrifically complicated question; but I've started writing code in Scala, and want to run said code on a web server.

There's a few questions that I need answering really, and I apologise for my complete lack of knowledge on the subject, web servers scare me (I'm a PHP developer so all I need to do there is upload to any linux apache server):

  • How to save and upload files (I know how to use ftp software, do I need to do anything from Eclipse?)
  • What to do to my server to run the files (at the moment I just have a linux apache server from fasthosts, is that enough?)

Any other advice would be so greatly appreciated; and the less jargon the better - the whole thing blags me a little.

UPDATE: To put the sort of work I'm doing into context, I'm making a rather large, social-media style site that'll have a very large amount of small, regular posts/updates. Also thanks for the answers so far!

Seems like i need to do all of the following:

  • Learn Scala (I can write in PHP and Java so should be okay)
  • Install Apache tomcat on my server somehow
  • Install Lift (and then either Maven or the SBT)
  • Upload the whole thing?

What do I do about databases?! I need something really serious, with MySQL be okay? Urgh this goes on and on...

like image 953
Alex Avatar asked May 28 '11 18:05

Alex


1 Answers

Here are the most important points. I'm afraid you will not get this done without lots of reading, but at least you'll know where to start.

  • You need your own servlet container, e.g. Jetty or Tomcat. Those can be used as stand alone servers or together with apache.
  • You need to package your web application as a .war file. That is basically a zip file with all the classes and some meta information. Then you upload the .war file to the server.
  • You should have a look at a web framework for scala, such as Lift.
  • It also helps to be on good terms with one of the major build tools, sbt or maven.
like image 84
Kim Stebel Avatar answered Oct 10 '22 00:10

Kim Stebel