Multiple websites on on server possible with lift?

60 views
Skip to first unread message

DoomPirate

unread,
Mar 28, 2015, 10:09:25 PM3/28/15
to lif...@googlegroups.com
Hi.
I am currently using lift, ec2, ubuntu, AWS to host a website for a client. I might need to create/host additional different websites with different domain names for clients.
I want to conserve resources and use as little AWS as possible, and at the same time, make sure the sites are still fast.
1. Is it possible to have multiple lift websites using a single instance?
2. Do I need multiple lift apps running on an instance to support multiple websites?

I appreciate any feedback and advice.

Thanks

Richard Dallaway

unread,
Mar 30, 2015, 4:20:05 AM3/30/15
to lif...@googlegroups.com
On Sun, 29 Mar 2015 at 03:09 DoomPirate <nguyen....@gmail.com> wrote:
Hi.

Hi!
 
1. Is it possible to have multiple lift websites using a single instance?

A single EC2 instance? Yes. 

2. Do I need multiple lift apps running on an instance to support multiple websites?

You mean, multiple JVMs and Tomcat/Jetty instances running? That's one way. I can think of at least two plausible ways:

1. Running multiple copies of Tomcat or Jetty, and you get a different JVM instance for each site. Lots of isolation.

2. Use virtual hosts inside Tomcat (and I presume Jetty).  If you're not worried about sharing a JVM between apps, this is maybe the way I'd go.  For Tomcat, you have a <Host> block for each WAR file you have. If you have Nginx/Apache in front, you'll also need to proxy (with the host name) to Tomcat.

Hope that helps
Richard

Matt Farmer

unread,
Mar 30, 2015, 8:29:29 AM3/30/15
to lif...@googlegroups.com
I'm pretty sure that sharing a JVM between two full Lift apps would cause bad things to happen due to our use of Singletons for things like LiftRules and SiteMap. We had an issue at Elemica where we tried to do that. Didn't go so well. :/

There may be some hacking you could do on SiteMap to make them appear to be separate sites. Not sure it would be worth the effort in the long run though. 


Matt Farmer Blog | Twitter
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Dallaway

unread,
Mar 30, 2015, 8:41:04 AM3/30/15
to lif...@googlegroups.com
Good point!  It'll depend... singletons loaded under different classloaders (and not the parent one!) should be separate. Should :-) But that's me making quite a few assumptions about how the app is being deployed.

DoomPirate

unread,
Mar 30, 2015, 9:50:06 AM3/30/15
to lif...@googlegroups.com
Lets say I have two domain names,

And the contents of the following paths have diffferent styles and different html/

Is it possible to achieve this using one liftweb app on one EC2 instance?

Thank you for the input, I want to see what my options are.

DoomPirate

unread,
Mar 31, 2015, 9:44:26 AM3/31/15
to lif...@googlegroups.com
Thank you for the reply.

My websites are mainly low traffic sites with 100 hits a day.   PittsburghPhysMed.com is an example.
Concerning this " Running multiple copies of Tomcat or Jetty, and you get a different JVM instance for each site. Lots of isolation."
For these low traffic sites, How many websites do you think I can run simultaneously on an EC2 micro instance? Small instance? Medium Instance? Large Instance? (Ball Park numbers is fine)
And I don't want to degrade responsiveness of the sites either.

Richard Dallaway

unread,
Apr 1, 2015, 3:59:01 AM4/1/15
to lif...@googlegroups.com
I don't know.  What I'd do is look at the current CPU and memory usage, and extrapolate forward from that.


Reply all
Reply to author
Forward
0 new messages