views:

66

answers:

4

I have just ordered a VPS from my provider.

I have some Q however... My website uses Solr, which requires the following according to their website:

"Solr requires Java 1.5 and an Application server (such as Tomcat) which supports the Servlet 2.4 standard"

I also need php 5, MySql, and the usual javascript etc... The OS is Ubuntu 9.10

1- So what do I need to install then?

2- What is a servlet container?

3- The solr I have downloaded came with Jetty. Is Jetty a Servlet container?

Thanks

+1  A: 

A Servlet container is basically a web server for Java Servlets and JSP pages.

Tomcast and Jetty are both Servlet containers.

In the phrase you quoted, it is using the phrase "Application server" interchangeably with "Servlet container". While Solr may only require a Servlet container, it shouldn't use the terms interchangeably.

The Servlet container is only part of a J2EE application server. Some other application servers (that also include Servlet containers) are JBoss and Apache Geronimo; Geronimo uses either Tomcat or Jetty depending on which set you install.

If you also need PHP, a Servlet Container won't be enough... you'll also need a normal webserver.

Installing the libapache2-mod-php5 module from the Ubuntu repository should install both PHP5 and Apache 2.2 for you. To install MySQL, install the mysql-server and php5-mysql packages.

Assuming you only have command-line access, installing packages on Ubuntu is done using the aptitude or apt-get programs; aptitude is preferred.

Before you install new programs, you should always run aptitude update, which updates the local index of which programs are available. Afterwards, you can upgrade existing packages with aptitude safe-upgrade and install new packages with aptitude install <packagename> (without the <>)

Ubuntu is usually pretty good about keeping the available package list up to date, and will periodically tell you on login that some packages have available upgrades. Since upgrades are almost always security updates, it is a good idea to check for them.

R. Bemrose
Could you define the last part of your answer? How does that work?
Camran
@Camran: I've updated my answer a bit, including defining the difference between an App Server and Servlet Container. Also, add some instructions on Apache/PHP/MySQL.
R. Bemrose
In server side java, all the application servers I'm aware of include a servlet container, plus more. The 2 I'm readily aware of that are ONLY servlet containers are Jetty and Tomcat. Glassfish and Geronimo are open source application servers that add an EJB container, Java messaging service and more. I haven't worked with Jetty a lot beyond local testing, but I think Tomcat might scale up better.
mezmo
@mezmo: Whoops, I didn't mean to imply that there were app servers that didn't include servlet containers. Rephrased it a bit.
R. Bemrose
Added more notes on using `aptitude` to upgrade/install packages.
R. Bemrose
+1  A: 

3- The solr I have downloaded came with Jetty. Is Jetty a Servlet container?

Yes, Jetty is a Web server and Servlet container. A servlet container is a web server that interacts with servlets, and you need one of those to host your servlets, execute them, etc.

An application server typically hosts many other facilities, such as security, authentication, Java Mail, EJB container, and many others.

Cesar
What do I need to install then? I am guessing Apache? or is there any install package which comes with MySql, Php and all necessary apps?
Camran
Since you are on Ubuntu, check out the Ubuntu server guide. What you describe is a LAMP stack (Linux, Apache, MySQL, PHP) and there is good documentation on installing such a stack https://help.ubuntu.com/9.10/serverguide/C/index.html
Cesar
A: 

PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.

Servlets are Java programming language objects that dynamically process requests and construct responses. Jetty is the simplest/smallest servlet container that could be run easily in a cross platform way. That does not imply that Solr runs better under Jetty, or that Jetty is only good enough for demos, it's just that Jetty makes demo setup easier.

Users should decide for themselves which Servlet Container they consider the easiest/best for their use cases based on their needs/experience. For high traffic scenarios, investing time for tuning the servlet container can often make a big difference.

Mr.Expert
+1  A: 

I also need php 5, MySql, and the usual javascript etc... The OS is Ubuntu 9.10

1- So what do I need to install then?

Use Apache HTTPD server for PHP, use Apache Tomcat for JSP/Servlet, use mod_jk to let HTTPD play proxy for Tomcat so that you can run PHP and JSP at one same site.

Since JavaScript is a client side language, you don't need to worry about it at the server side.

2- What is a servlet container?

A webserver with a JSP/Servlet API implementation. An application server is usually more than that. JSP/Servlet is only a little part of the huge Java EE API. A fullfledged application server implements pretty much all of Java EE API.

3- The solr I have downloaded came with Jetty. Is Jetty a Servlet container?

Yes, it is. It however doesn't support PHP. You need Apache HTTPD for PHP. However I am not aware of ways to connect Jetty with HTTPD.

BalusC
It would really be good if I could use jetty, because I have no knowledge of servlet containers, so tomcat is probably difficult for me to install and make solr work on... Have you managed to adapt solr to Tomcat? Does it take time? Difficulty?
Camran
It's basically easy if you **know** the stuff. Here's a Solr-Tomcat guide http://wiki.apache.org/solr/SolrTomcat
BalusC