LAMP installation from source code ( tarball) on linux
Tested with ubuntu 12.04 LTS with mysql version 5.1.71, php 5.3.25 and apache 2.2.25
bellow packages must be installed on ubuntu
sudo apt-get install zlib1g-dev libncurses5-dev
sudo apt-get install g++
sudo apt-get install libgdbm-dev
sudo apt-get install libxml2-dev
Installing
MySQL 5.1Download MySQL source tarballs Open a terminal and login Extract the source to some folder(say ‘/usr/src/mysql’).
$ sudo mkdir /usr/src/mysql
$ sudo cp mysql-VERSION.tar.gz /usr/src/mysql
$ cd /usr/src/mysql
$ tar -xvf mysql-VERSION.tar.gz
$ cd mysql-VERSION
For added security we will create a new user called ‘mysql’ and use this user while running MySQL.
$
sudo groupadd mysql$
sudo useradd -g mysql mysqlLets
compile$
./configure --prefix=/usr/local/mysql
$
make$
make installconfigure MySQL
.$
cp support-files/my-medium.cnf /etc/my.cnf$
cd /usr/local/mysql$
sudo mkdir /usr/local/mysql/var$
bin/mysql_install_db --user=mysql$
chown -R root.mysql .$
chown -R mysql libStart MySQL
$
bin/mysqld_safe --user=mysql &For
testing the installation give command$/usr/local/mysql/bin/mysqlThis
will bring mysql prompt mysql>quitInstalling
Apache 2.2download
the source extract to /usr/src/httpd.$
mkdir /usr/src/httpd$
cp httpd-VERSION.tar.gz /usr/src/httpd$
cd /usr/src/httpd$
tar -xvf httpd-VERSION.tar.gz$
cd httpd-VERSIONLets
compile it
$
./configure --prefix=/usr/local/apache2 --enable-mime-magic
--enable-expires \--enable-headers
--enable-ssl --enable-http --enable-info --enable-dir \--enable-rewrite
–enable-so$ make
$
make installRun
apache service
Installing
PHP 5download PHP 5, extract to /usr/src/php5
.$
mkdir /usr/src/php5$
cp php-VERSION.tar.gz /usr/src/php5$
cd /usr/src/php5$
tar -xvf php-VERSION.tar.gz$
cd php-VERSIONLets
configure
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mcrypt --with-mhash--with-curl --with-curlwrappers --disable-cgi --enable-mbstring=all --with-gd --enable-gd-native-ttf --with-ttf --with-jpeg-dir=/usr/lib --enable-magic-quotes
cp
php.ini-dist /usr/local/php5/libConfiguring
Apache for phpBy
default the document root folder is /usr/local/apache2/htdocsyou
can change it
open
the configuration file /usr/local/apache2/conf/httpd.conf
change
values
DocumentRoot
"/usr/local/apache2/htdocs"With
DocumentRoot
"/var/www/htdocs"AllowOverride
Noneto
AllowOverride
AllDirectoryIndex
index.html index.html.varto
DirectoryIndex
index.php index.html index.html.varfind
a commented line AddHandler type-map varuncomment
the line and add belloe line bellow to above lineAddHandler
php5-script phpAddType
application/x-httpd-php .phpStart
Apache/usr/local/apache2/bin/apachectl
starttest
phpcreate
a new file in document root folder named index.php and insert bellow
lines inside that file<?phpphpinfo();?>save
it. And open browser give url as http://localhostphp
configuration page should be opened
Now
your LAMP installed and configured
Comments
Post a Comment