-1

I was asked by my boss to make a bash script that could install Apache, PHP and MySQL (AMP) binaries in a Linux box (just some common linux flavors).

Compile and install all by the sources unfortunately is not an option.

So, I have to do this. I thinked one possible solution: try to grep uname -a trying to find something that identifies the distro, and so, run apt-get, yum or another similar command, but it's complicated, since I need to install these distros and try it one by one.

Could you tell me if this is a good idea or if there's a better idea?

Sven
  • 98,649
  • 14
  • 180
  • 226
LucasBr
  • 180
  • 3
  • 9
  • So he basically asked you to re-invent [xampp](http://www.apachefriends.org/en/xampp.html)? – Zoredache May 18 '12 at 00:07
  • No. Instead I would like to install xampp-like software agnostically regarding the distro. – LucasBr May 18 '12 at 23:35
  • Sorry, but I really don't understand why this is downvoted. If I write a script that installs XAMPP, for instance, this script should know at least which command it will need to run in order to install xampp. It will need to know if will run apt-get, or yum, or another package installation tool. Any clarification about this downvote is appreciated, because at least I could improve my questions next time. Thank you. – LucasBr Nov 07 '12 at 13:56

1 Answers1

3

Use something like Puppet or Chef instead, it's what they do: Knowing how to install stuff on various systems and make it easy do the same thing for different environments.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • 100% Agreed. You do **not** want to try and do this yourself. Puppet and Chef excel at this sort of thing, and putting a set of recipes/manifests together to do what you're looking for would be a trivial task. – EEAA May 17 '12 at 23:22
  • Thank you! I think Chef overfits my needs, but I'll give a serious look to future and bigger projects. Thank you! – LucasBr May 18 '12 at 23:39