Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Running multiple web development environments on one machine



What I would like to do is simultaneously run different versions of
MySQL/PHP on my home system so that I can simulate as closely as
possible the web hosting conditions for each site I develop.

Installation of MySQL/PHP on my home system was handled automatically
when I installed Ubuntu. So the particulars of where it is and how it is
handled are opaque to me.


I think it was said before but let me rephrase in simpler words and
illustrate with our own setup:

1.

Using VMware Server Beta is a good idea if you have enough diskspace.
For the setup described by you, perhaps 40gig per Virtual machine may
be a good value.  You can VMware either on your development PC if it
has enough power, or make one extra PC your development server.  The
VMWare console  or webinterface makes it easy to start the environment
you are working on at the moment.

2.

Don't use packages for these core applications. As someone else
suggested remove those packages first and instead install the
compilers and tools.  It is often very very difficult to figure out
how exactly packages were designed, and how to make them do what you
want.  Often an important feature wants you to update the version of
this critical software but the distro merely adds security patches to
the existing version.

Instead you should compile the software your self.  In my company we
compile apache, mysql and php ourself as this is the stuff we care
most about.  When you compile you can specify special compile time
options, such as where the data files, and where the executables
should be stored.  Sometimes you can also set options like port
numbers in a configuration file.

3.

Most people use php as a module in apache and not as cgi. Using two
different versions of php modules in apache at the same time will not
work.  The solution is therefore to run two instances of apache on
different ports. Eg. Instance 1 uses port 80, instance 2 uses port
8080. If the apache version and options does not matter to you, can
can use the same binary but launch it with a different configuration
file.  If not you can compile apache but specify a different install
directory: instance 1 : /usr/local/apache2 and instance 2 :
/usr/local/apache2inst2.

Use the same principle for your php compilation, ie. specify seperate
target directories at compile time.

For MYSQL the same approach could be realised. Maybe search the very
good MySQL documentation for "running two instances of mysql". Basic
point is to install files such as binaries and stores into different
directories, and start them up with differnet listening ports.

Sometimes perhaps mysql requires a different system library (like
glibc). In this case DON'T mess about unless you have good linux
knowledge and a taste for adventure.  Instead buy hardware and use
vmware to create a new VM with the required version.

Hope this helps

--
Patrick Niessen


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links