tomcat localhost catches all domains and still sets cgi.http_host
correctly, which is what I'm doing. It's possible to have multiple
engine XML records on different ports. Then apache or nginx could
proxy to the other port to achieve multiple catch-all localhosts with
tomcat. I considered doing this, but it wasn't necessary. Just user
1 context.
Perhaps jetty also has the ability to configure multiple listeners on
different ports and then you could use an * for the virtual host field
and then you don't need to write code to configure jetty at all.
It does say multiple listeners are possible here:
http://account.pacip.com/jetty/tut/HttpServer.html
On apache, you proxy it like this:
RewriteRule ^/(.*)$ ajp://
www.domain.com:8009/$1 [L,P,QSA]
so your other context would be like this:
RewriteRule ^/(.*)$ ajp://
www.domain2.com:8010/$1 [L,P,QSA]
You said you had a stability issue on the other thread. I found railo
+ windows to have more bugs then linux. I'm not sure if windows is
getting the same level of support as unix based systems because
Michael wasn't able to reproduce the issues I encountered. After
seeing linux didn't have my problems, I did the work of switching OS.
I was considering using nginx, but I was already using .htaccess
mod_rewrite rules on the 100 web sites, so I would have had to convert
them to another format. I actually ended up having to converting
them for apache mod_proxy anyway later. I found apache logging and
using .htaccess files instead of conf to be the main performance
problems. I compared it to gwan because that one is very light and I
found the speed difference to be like 1ms in fake tests, not as
important as other optimizations. If you put the whole configuration
in the conf file and disable logs, apache is closer to the performance
of other fast web servers. Apache was mostly convenient since railo
and php just instantly work with it.
If your developers are the only people who can access the server, you
could secure the other sites fairly well by restricting the intranet
to your ip addresses in the application.cfc/cfm or the web server. I
use putty with ssh port forwarding to hide mysql and railo admin from
the public.
The shared resource might not need any extra security since hopefully
your scripts are enforcing the site id consistently enough so that
it's impossible to get into the wrong folders/data. The user
shouldn't be able to modify the request to gain access. I built a
ssh chroot jail on linux so that ssh users can't go above their home
directory. I don't even have FTP installed for security reasons. I
use fail2ban to limit the number of SSH login failures, plus the
firewall limits access as well. I didn't know much about linux
before last year, but I learned how to do it from scratch over a
couple months because I think cpanel and plesk make linux too hard to
reconfigure without breaking it. Keep in mind that apache or nginx
is going to require the same linux user to have access to every web
site, so the OS security would still let someone who hacked your web
site to read or write from the other web sites folders potentially.
You'd have to be running multiple java servers to have different users
on everything and probably separate virtual machines if it is that
important to have security isolation. I didn't find the difference
in security between single and multiple context useful unless you are
trying to do sharing hosting environment where SSH or FTP access is
given to strangers. You also have to disable java code execution and
cfexecute and more to isolate the sites entirely, which reduces the
power of cfml. I plan on only sharing SSH access to static files
and preventing scripts from executing in those folders similar to how
adobe's business catalyst service works. They have a pretty nice
system if you haven't seen it.
On Feb 9, 10:34 pm, Lyle Karstensen <
l...@realistiq.com> wrote:
> Bruce,
> I am actually only using 3 context 1 for the public web sites, 1 for the
> intranet sites and a third that is a shard resource for all sites. I can
> NOT use tomcat due to its lack of wildcard host support. I also really
> like jetty with nginx as the proxy. Currently I am not proxying with
> anything due to running on windows. We are in the process of converting to
> linux will allow me to use nginx as my proxy. The reason I want to do the
> the rail-context virtualHost is due to locking it down to a specific
> domain ONLY.
>