Can you undeploy applications from JETTY? - jetty

I cant seem to find a way to undeploy or turn off an application whilst JETTY is running. Is the only way to kill JETTY and all other apps running?

You can do that in a few ways.
If you have the deploy module enabled, just move the {appname}.war (or {appname}.xml) out of your ${jetty.base}/webapps/ directory, that will undeploy that webapp.
Another choice is to have JMX enabled and just .stop() the webapp in question.

Related

How do I enable multiple contexts in cloud foundry?

We'd like to set up a development environment using cloud foundry. Unfortunately, our architecture packages a few different wars into one webapp, each war running under its own context. Furthermore, we have a bunch of absolute URIs with the context in it, too many to rename all of them to relative URIs.
CF apparently deploys a war to the root context. Is there any way to get around this? I tried faking it by editing the web.xml in tomcat/conf/ but when I did a whole other application folder was created on my machine.
Thank you
When you push a Java web app to CloudFoundry, the platform installs and configures the Tomcat instance(s) for you, and you have limited control over the configuration. It is possible to configure your own Tomcat (or other application container) and push it along with your application instead of letting the platform do it for you.
There is a good blog post about using this bring-your-own-container approach with Tomcat 7: https://www.cloudfoundry.org/blog/deploying-tomcat-7-using-the-standalone-framework-2/.
I suggest using this approach to configure a Tomcat 6 or 7 distribution in a way that works for your application, zip up the customized Tomcat distribution along with your war files, and push that bundle as a stand-alone app on CloudFoundry.

Is it possible to debug locally WebService on Google App Engine

I am new on web services development and I will be using the app engine.
I would like to know if it is possible to debug locally a web service (at localhost:8888/) and debug at the same time the web app that will be using the service.
The App Engine SDK ships with a local server implementation that you typically debug on. You'd debug the web app in your browser.
http://code.google.com/appengine/docs/python/tools/devserver.html
Yes, you can debug both client and server.
However I assume that client and server are separate code bases - in this case you would have two IDE projects open each running it's own debug session.
Since you are new to GAE, I would advice to use one of rich IDE's available out there. For example, I can mention Eclipse or IntelliJ which make it very easy to debug and find issues in GAE apps.
Here are some links:
Intellij GAE support
Eclypse GAE plugin

Is there an Application Management Console for Jetty?

I've fairly recently started working with Java (most of my recent experience is in .NET). As part of that effort, I have been doing some comparison between Jetty and Tomcat.
One feature of Tomcat that I think would be useful in our environment is the built in management console that allows an administrator to deploy/undeploy/restart/etc the various applications deployed to the server.
Is there a similar capability available for Jetty? If not, is there a preferred way to manage application servers?
Thanks for your input.
Any JMX console should work, including JConsole and JVisualVM.

Need a lightweight, standalone web server for Django

I have a Django web application which should be easy to install on Linux systems. The app does not need much performance. It is just a simple web GUI for some services. So a full-blown deployment with Apache is not needed. I am looking for a lightweight web server that has little or no configuration; just like the Django development server.
It should be possible to run it as daemon, though.
Any suggestions?
You can use Quick and dirty multi-threaded Django dev server.
But, configuring apache or fastcgi to server django applications is not a hard thing, so you should really do that.
I would use Green Unicorn with nginx, very light weight and fast. It does has some configuration unfortunately, so it might not be ideal for you, but worth checking out.
http://gunicorn.org
http://wiki.nginx.org/
Here is a blog post that explains how to set it up with supervisord.
http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/

Using Django's built in web server in a production environment

I'm going to setup a simple Django app running in a production environment on a Linux box. The app will have very little traffic - less that 100 page loads per day. Is it okay to use the builtin Django webserver for this or should I install Apache and mod_wsgi? If so, what are the reasons for this? Security perhaps?
UPDATE
OK it is clear I shouldn't be using the builtin server. Some of the alternatives to Apache look interesting. Is there one that is more popular/more frequently used with Django perhaps?
Is it okay to use the builtin Django webserver for this
No.
Should I install Apache and mod_wsgi?
Yes.
If so, what are the reasons for this? Security perhaps?
Partly.
More importantly, the little toy Django server is single-threaded and any hangup in your code hangs the server. This means that when two users click almost at the same time, user one's query must go all the way through Django before user two's query can even starts.
And this will have to include the insanely slow download speed to the desktop.
Apache (like all the alternatives, lighttpd or nginx) is multi-threaded. The slowest part of the transaction is the download from Apache to the desktop. You don't want Python code (and Django) handling this in a single-threaded manner. Even for just a few users.
Also, you don't what Django serving static media (i.e., CSS and JS library files.)
A single slow spot in your application won't effect the overall system throughput if Apache and mod_wsgi are in place. One request 's output page can be slowly downloading to a PC desktop in parallel with another user's output.
DO NOT USE THIS (the builtin Django webserver) SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests.
http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port
But you don't have use Apache if you don't want to. You could directly use Spawning, Gunicorn etc.
Cherokee is also easy to setup.
Use nginx + gunicorn.
Nginx: five lines of configuration. Gunicorn: two lines of configuration. That's easy and efficient. For better control you can spawn the gunicorn process using supervisord.
Both gunicorn and supervisord are available to install with pip, and nginx is available in almost any distribution in the default package pool.
The built in Django server was not built for production. There are many reasons why, mainly security and efficiency.
The recommended way is to use mod_wsgi which is covered in the docs here