LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 01-19-2011, 02:29 PM   #1
doahh
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Multiple virtual machines hosting websites - advice please


Hello,

I am thinking of using VirtualBox to create a couple of vms to host webistes. The best setup I can work out at the moment is as follows:

1) User request comes into port 80 or 443 at the router;
2) Router forwards to host machine;
3) Host machine is running apache, which picks up the request, and proxies it out to the vm;
4) Vm is responsible for the SSL.

My main problem seems to lie in the fact that the router can only forward to one machine, that would then need to forward to the correct VM based upon the request.

Are there going to be any problems if the vm handles the SSl after the proxy request?

My other concern is, how to back up the vm's. With VirtualBox the vm needs to be stopped in order to perform the backup. Is there a better solution - maybe not using VirtualBox?

Is there a better way of doing it all-together? My way seems a little convoluted, and I can't help thinking that I am missing something.

Thanks for any tips.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-19-2011, 03:34 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 248Reputation: 248Reputation: 248
Greetingz!

That does seem a lil odd that you would want to use a router to redirect requests, when that's the sort of thing DNS could help you out with.

Here's how I would suggest going about it;

Prerequisites:
You manage you're own DNS. Be it an /etc/hosts file, or a BIND instance somewhere, or your router's a WRT54G that has a full-blown DNS service built in.

1) Build a "main" VM to handle all requests on Port 80 or 443 via apache.
2) Setup redirects in the httpd.conf for the URLS and have them point to certain VMs. Be sure to setup a rewrite rule that redirects them to 443
(Because I'm assuming you want all VMs to just do SSL traffic)
3) Setup a VM per URL that hosts the page via SSL.
4) If you're going to use VirtualBox for the VMs, setup LVM and snapshot the logical volumes the VMs live on.
(You might wanna go one-VM-per-logical-volume if you do this)

Good Luck!
(If this solves your question, please use "Thread Tools" to mark the thread as solved.)
 
2 members found this post helpful.
Old 01-24-2011, 10:00 AM   #3
tenmei08
LQ Newbie
 
Registered: Jan 2011
Location: Roatan Honduras
Distribution: Debian Lenny, Squeeze, Ubuntu Various
Posts: 13

Rep: Reputation: 4
Reverse Proxy?

I have been pursuing the same goal, and I've been leaning toward a Debian host reverse proxy for VirtualBox VM servers. It seems like a good direction but this is at least the second time I've heard people recommending a DNS solution. Can we elaborate on the pro's and con's?
Thanks!
 
Old 01-24-2011, 10:58 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,524
Blog Entries: 27

Rep: Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175
What's wrong with a single OS running Apache running Virtual Hosts? Same external IP, same port forwarding, Apache displays the site associated with the DNS name included in the HTTP request ...
 
1 members found this post helpful.
Old 01-24-2011, 11:14 AM   #5
tenmei08
LQ Newbie
 
Registered: Jan 2011
Location: Roatan Honduras
Distribution: Debian Lenny, Squeeze, Ubuntu Various
Posts: 13

Rep: Reputation: 4
I need a 'virtual machine' approach. I use Debian for local hosting. Years ago I created a ColdFusion (Windows) website and I need it online again. I don't have time available to translate it to LAMP. My goal is a Win2K VM for anything requiring Windows, while the host or other vm's handle my other needs. I've been reading about reverse proxy as a solution.

I could just throw additional hardware at the problem, but I am on an island with unreliable power - things blow up or burn out frequently.
 
2 members found this post helpful.
Old 01-24-2011, 11:21 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,524
Blog Entries: 27

Rep: Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175
Quote:
Originally Posted by doahh View Post
My other concern is, how to back up the vm's. With VirtualBox the vm needs to be stopped in order to perform the backup.
You could use the OS etc. running in the VM back up the the contents of the VM, for example to a networked file system, a USB HDD ...

EDIT: and you can back up the VM definition on the host.
 
Old 01-25-2011, 03:54 AM   #7
doahh
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
What's wrong with a single OS running Apache running Virtual Hosts? Same external IP, same port forwarding, Apache displays the site associated with the DNS name included in the HTTP request ...
In the end, this is the way I am going to go.

For me, the reason to look at a VM, was that it would be easier to re-configure the box is it had a hardware failure such as main hard drive or motherboard. If the VM could be backed up, then all you need to do is copy the .ovf file back into a new install of VirtualBox and all the servers are restored. VM's should also improve the security of the box as well. However, with VirtualBox it doesn't appear possible to backup up a running VM (it needs to be shut down first, which takes the servers offline). I could only backup up the necessary files (/boot, /etc, /var/www , /opt etc.) which is just the same as not using a VM. Therefore using a VM doesn't make things any easier for me. I think Apache 2.12 and OpenSSL's, Server Name Identification functionality will handle the multiple SSL hosts OK, so that makes it the easiest solution.

Thanks for the advice so far, it has been useful to get clarification that there isn't a better way to go. Although I haven't really looked at QUMU, VMWare etc - maybe another day.

Last edited by doahh; 01-25-2011 at 03:55 AM.
 
Old 01-25-2011, 03:02 PM   #8
jefro
Guru
 
Registered: Mar 2008
Posts: 11,000

Rep: Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356
Might look into host headers to route your sites.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help/advice needed for gateway for multiple websites w/ email servers zogthegreat Linux - Networking 2 04-22-2010 05:36 AM
Advice: Best practices for multiple small website hosting. checkmate3001 Linux - Server 2 08-17-2009 03:24 AM
Hosting websites at home - dns & virtual machines jeradj Linux - Networking 5 07-12-2009 02:50 PM
Apache 2 webserver, hosting multiple websites atomiccomp Linux - Newbie 1 12-08-2008 12:53 AM
How-to setup on Apache some Multiple Namebased Virtual Websites with cgi-bin FunkFlex Linux - Newbie 0 02-08-2002 08:37 AM


All times are GMT -5. The time now is 01:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration