Read IT Engineer's Blog in your own language
English flagKorean flagChinese (Simplified) flagPortuguese flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flagAlbanian flagEstonian flagGalician flagMaltese flagThai flagTurkish flagHungarian flag  
By N2H
Apr
14th

How to Install Apache, MySQL and PHP (LAMP) on Centos

Files under Linux, Operating System, Software, Webmastering | Posted by calvyn

Recently my laptop was having some issue, and send to hewlett packet service center for repair. Due to no computer use, and kinda free at office, I decide to continue setup a linux base web server which is in my wish list long time ago. (As mention on free antivirus for linux operating system).

Centos Operating System

I have download Centos 5.2 (www.centos.org) few month ago, also try to install it and experience it, but not much time to really put my self in study on Linux base operating system. After install centos linux base operation system, now I require web server script, Apache, web programming script, PHP, and a database script, MySql. So how to install all this script? I found a easy way to install Linux Apache MySql PHP (LAMP) using Yum command. Just simple 5 step to fully setup your own web server.

How to install Apache using Yum command:
install apache using Yam

Open Terminal, type in ” yum install httpd “, the command will instruct the centos to download apache web server and install it into the server.

How to install MySql using Yum command:
install mysql using yum

After install Apache Web Server, now we require to install MySql database. Type in ” yum install mysql-server mysql “, this command will download MySql dabatase into the server and install it.

How to install PHP using Yum command:
install php using yum

Once finish install MySql server script, lastly, we need to install PHP programming script by type in ” yum install php ” it will download php script and install into the linux server.

After finish install Apache, MySql and PHP, now we require to start the Apache Web Server service and MySql database service.

Optional Method: You can install Apache, MySql and PHP into centos together with using ” yum install httpd php mysql-server mysql ” command, after hit enter, you can sit a side wait for all this 3 script install into your Linux Web Server.

How to start Apache web server:
start apache

Simply type in ” service httpd start ” in the terminal, and the service will be activated.

How to start MySql database service:

To start the MySql server, type in ” service mysqld start ” in the terminal, and MySql service is ready to use. You can create a database, create table, and create record using MySql command line at the terminal.

How to test the Web Server and ensure it is running?
After both Apache Web server and MySql database is start running, now we open a internet explorer, access “http://localhost/” or “http://127.0.0.1” and you will see a welcome page!

centos welcome page

The root directory for the web server will be located at ” var/www/html “, you can try to create an index.html, save it at ” var/www/html “, you will saw this webpage when you access “ http://localhost/ ” or “ http://127.0.0.1/

How to test the Web Server and ensure it is running on the network?
If you are in the network environment, you can use the other computer within the network, and access the web server IP address. For example, the web server local IP address is 192.168.1.5, you can use other computer within the network to access ” http://192.168.1.5 “, you will see the welcome page or the index.html you create in ” var/www/html ” at the web server.

Ok, is time for me to play around the web server, will keep you guys posted if I found any special during my hand on experience. :D


9 Responses to “How to Install Apache, MySQL and PHP (LAMP) on Centos”

  1. By hyperX on Apr 14, 2009 | Reply

    Nice tips! But for lazy people like me who uses Windows OS, I usually use easyPHP or WAMP.

  2. By calvyn on Apr 16, 2009 | Reply

    EasyPhp and WAMP got Linux version?

  3. By susetips on Apr 16, 2009 | Reply

    Nice tips. Will try to find out the linux version

  4. By CrumX on Apr 17, 2009 | Reply

    You can download LxAdmin and install it on your CentOS its come with everything u need ^^

  5. By Neo on Apr 17, 2009 | Reply

    Can I type yum install sexy-girls?

  6. By calvyn on Apr 19, 2009 | Reply

    CrumX >
    Thank for the information, I shall try this LxAdmin too ;)

    Neo >
    Lol.. I wish to hav this command too…

  7. By Ah Hong on Apr 20, 2009 | Reply

    I tried before Centos LAMP, quite stable…

  8. By Dan on Jun 22, 2009 | Reply

    Once the LAMP stack is installed, it is recommended to secure all applications (Apache, PHP, MySQL).

    You can find the steps about security here:
    http ://www.sysadmin.md/install-and-secure-lamp-on-centos.html

  9. By sohag on Sep 7, 2009 | Reply

    i want get free ppt

Post a Comment

<