how to install Lamp on Linux Machine

Steps and necessary commands to install Lamp on Linux Machine.
Mkdir   /extracted
Mkdir  /extracted/http
Mkdir  /extracted/mysql
Mkdir  /extracted/php
Mkdir  /lamp
Mkdir  /lamp/http
Mkdir  /lamp/mysql
Mkdir  /lamp/php
Yum install gcc* libxml2* ncurses-devel* cmake* 
Cd  /extracted/http
Tar  –xzvf  httpd-2.2.15tar.gz
Cd  httpd-2.2.15
./configure      --prefix=/lamp/http   --enable-so  --enable-proxy=shared
Make install
/lamp/http/bin/apachaectl    start
Cd   /extracted/mysql
Tar  -xzvf   mysql-5.1.44.tar.gz
Cd   mysql-5.1.44
Groupadd   –r   mysql
Useradd   –r  -g  mysql  -d  /tmp  -s  /sbin/nologin
Cmake  .  –DCMAKE_INSTALL_PREFIX= /lamp/mysql 
Make install
Chown   –R  mysql   /lamp/mysql 
Chgrp  -R  mysql   /lamp/mysql 
Cd   /scripts
Mysql_install_db    --user=mysql
Support-files   /mysql.server    start
ln   /var/lib/mysql/mysql.sock    /tmp
/lamp/mysql/bin/mysqladmin   -u   root  password   “redhat”
Mysql   -u  root  -p
Mysql> show   databases;
Mysql> create database  ambu;
Mysql>  use ambu;
Mysql> create   table  demo;
Insert   into  demo(id,name)  values(1,”Vishnu”);
Select * from   demo;
Show  tables;
drop   table  demo;
drop   database ambu;
---before install php stop  the service of both mysql& apache
Cp  /lamp/http/bin/apachaetl   /etc/init.d/myserver
Cp   /lamp/mysql/support-files/mysql.server     /etc/init.d/mysql
Support-files   /mysql.server    stop
stop mysql    also
Cd   /extracted/php
Tar  -xzvf  /xxxx/php.x.x.tar.gz
Cd  php.x.x
./configure   --prefix=/lamp/php     --with-apxs2=/lamp/http/bin/apxs   --with-mysql=/lamp/mysql
Make install
Cp   php.ini-development     /usr/local/php.ini
Vim   /lamp/http/conf/httpd.conf
LoadModulephps_module   modules/
AddType application   /x-httpd-php   .php
line 176  directory index    index.php
Support-files   /mysql.server    start
Also  start  mysql    also

1 comment:


    Its nice post. I do not know everything.........
    plz give more information.............