1

I've a software, which is to be installed from it's source code using ./configure-make-make install cycle. Is it possible to "virtualize" this software so that different installations of the software could be done (with different options) and used?

For example, in one instance I might wish to use terrible.cc in Makefile and compile. While in the other case I might exclude that file and include some other file. And there could be several such modules. Essentially, this means having multiple instances of the same software running, but each of them have been installed with different configurations.

Moreover, these installations would not be done "statically". To illustrate this, consider multiple users telnet-ing to a Linux machine, compiling multiple instances of Apache, and running them. So, user John's Apache is transparent from user Adam's, although both Apache are being executed on the same physical server. However, I don't know how many users would login at any given time. (But may be I could fix a upper limit.)

Is this practically possible to achieve? I would highly appreciate a detailed response with possible URLs.

Barun
  • 289
  • 1
  • 4
  • 13
  • Using Apache as an example, you would use exactly the method as I described it, but would have to make sure everyone is listening on another port (>1024). If you like, you could use virtual machines for this of course, but that would require different IP's per machine. – Sven Sep 27 '11 at 11:52
  • 1
    And really: `telnet` for remote login? It's 2011, not 1995 anymore. – Sven Sep 27 '11 at 11:53
  • Sure, I agree. But then, `telnet` (or, `ssh`, `VNC`) is secondary for me. – Barun Sep 27 '11 at 13:20

2 Answers2

2

It's impossible to tell what might be the best way to achieve your goal, as this is very much dependent on the software you want to use and the flexibility of it's built environment.

In a general case though, what I would first try to do is to check if you can use ./configure to create installation prefixes for your various versions. Something like

--prefix /opt/yoursoft/var1 

which would then put the compiled binaries into /opt/yoursoft/var1/bin or something similar.

Dependent on what makes a complete build of your software, you might need complete lib, etc, bin etc. folders under the various var* folders.

When doing this right, you can start your software variants from their respective directories.

Using virtualization is a lot more involved, as you have to maintain several copies of your complete operating system and install the variants of the software on each of them. You could do this with several variants, including desktop style types like VirtualBox or the server style approach with Xen or KVM (see this Ubuntu guide).

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Thanks, Sven! However, these installations are not supposed to be static. I'm further updating my post -- I think I had left it unclear. – Barun Sep 27 '11 at 11:13
1

If what you want is for your users and machine to behave as if they have full access (or nearly full access) to resources on the computer without actually having full access, you need to either use virtualization to create multiple VM for your users (and each VM would have it's own IP for your application, if it's offering a service requiring a port) or you would need to look at some kind of sandboxing mechanism like jails (and that would still lead to some network contention issues if running some kind of application that is "duplicated" but wants a same port to use).

Otherwise they'd be able to compile and run applications installed right to their home directories, as was done in the "old days" of Unix. Sounds like you're describing installing applications to the system and local machine directories, which is a sysadmin task. You'd need to confine them to their home directories or give them virtual machines to run amok in.

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87
  • That sounds helpful, Bart. My primary objective is to let users play with software installation and then use it. My scope is not just Apache -- in general any software in Linux coming as source code. Could you please give some hints on how to create the virtual machines, and how many of them? – Barun Sep 27 '11 at 13:24
  • 1
    That's a subject in itself. If you have the hardware available (or google white box servers) you can install VMWare ESXi for free and create as many machines as your hardware will support. – Bart Silverstrim Sep 27 '11 at 14:56