# [FreeBSD - JavaEE] web application / jails / and more ... could you help me ?



## ohyes (Dec 8, 2012)

hello BsdWorld 
This post is for discussion around playing with a FreeBSD server (system) and webapps (java).
Sorry it's a long post.

*First the story :*
_Since six years I've done a java web application. Not a big one. 
Actually around one hundred users (max was 350 users / around 50 at the same time during hot moments)
When I built this application I tried to learn system design and specially FreeBSD (was not my speciality).
I quit Linux in the same time; And since that day my desktop, like my dev environnement, is FreeBSD (was version 6.1).
My desk is actually in 9.0 release, my server 7.x (actual uptime 1550 days)._
*End of the story *


*The FreeBSD server situation :*
On actual server this is what I've done (underline) for web applications:
* 2 jails : 2 webservers (Apache, Nginx, ...)
* 1 jail : 1 appserver (Tomcat, Php, ...)
* 1 jail : 1 DB (PostgreSQL, MySQL, ...)

Jails were created with ezjails.
Network is by PF. Sticky load-balancing between the two webservers jails (to the same app jail and, then, to the db jail).

*Next - Future*
Soon i will change the server, and I need help.
I'm looking for best pratices and for best playing with FreeBSD system.


*And then a lot of questions...* (sorry for my low knowledges in system/network) :
 - is it a good idea for separating all level app in separated jail (webserver, appserver, db) ?
 - is it a good idea for having 2 balanced webservers in 2 jails ? Sure yes, but with one machine ?
 - if the past two answers are 'yes', does PF is the best solution for network ?
 - EzJails was a solution with FreeBSD 7, with 9.x is the best solution for admin jails ? Warden ?


In this post, I forgot a lot of admin things.
This post is done for that.
Best practices and discuss.

Please help.
What I want is publish a good building doc. I can't do it only by myself.


----------

