I running a CentOS remotely now I want to install PHP/Mysql/apache into it. Can you guys please help me in doing so I'm newbie.


  • 2
    Just to be devils advocate: A total newbie wanting help installing LAMP is probably trying to learn web programming and probably not administering a server :) Commented Nov 12, 2009 at 7:39

5 Answers 5


If you're more concerned with Web development than server administration, I'd either use a preconfigured LAMP stack (as recommended in another answer), or use Yum. E.g.

yum install httpd
yum install mysql
yum install php

See also: How to install LAMP using Yum


You can install them using yum. Here is a tutorial:


[Pardon the lack of proper links; I don't have enough reputation, apparently.]

As others have pointed out, a command like the following should get you a working install:

yum install httpd mysql-server mysql php php-mysql

You suggest that you're running this on a remote server though; if so, this is just the beginning.

If you're going to be running a LAMP stack on a box that's permanently connected to the internet, you need to make sure it's secured.

At this point, I had some links for you, but the spam system here is determined that I shall not post them, since I don't have enough reputation. Google for each of these topics:

  • Securing Apache
  • Securing PHP
  • Securing MySQL

and read the various articles you'll find that make suggestions about how to keep your install secure.

I'm going to use the one link I'm allowed to suggest you read this excellent guide to securing CentOS itself: http://wiki.centos.org/HowTos/OS_Protection

The important thing in all of this is that you understand all the commands you're running, and the reasoning behind them, so you end up with something secure that meets your requirements. Then, you need to stay on top of patches - it's not enough to simply go "that's secured now", dust off your hands, and move on. Your server will get hacked.

One other thing: A lot of guides suggest installing from source. I'd suggest you ignore them to start with. Install using yum, then subscribe to CentOS announce list (google "centos announce") to hear about security upgrades you need to apply. You don't want to have to track all the Apache/PHP/MyWql mailing lists and recompile from scratch every time there's a patch that needs applying - that's what package managers are for.

Of course, if the server you're installing onto isn't actually internet facing, you can ignore everything past the point where you get the working LAMP stack =)


This is a nice 6 part article that will show you how to build the perfect CENTOS.

CentOS Setup


the easy way is using yum like this:

sudo yum install httpd mysql php php-mysql --enablerepo=centosplus

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .