Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
So he basically asked you to re-invent xampp? –  Zoredache May 18 '12 at 0: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 7 '12 at 13:56

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.