Sunday, August 23, 2009

Install LAMP on Ubuntu

first time on linux? and choosing ubuntu is the best conversion machine from windows because of it's near XP appearance, but we will be dealing with the unix environment so expect it to be hard!.

ok lets start installing LAMP.

1.) open the terminal, at APPLICATIONS>ACCESORIES>TERMINAL

2.) type this line to gain the root access level,

sudo su
it will make you the root.

3.)lets install APACHE2,

on the console type:
sudo apt-get install apache2
then it will install, if asked (Y,N)? Y then enter

4.)after installing, try to start and stop apache by typing
start:
/etc/init.d/apache start
stop:
/etc/init.d/apache stop
check the status
/etc/init.d/apache status

you will be making most of you php application in the /var/www/ directory


5.)lets install PHP
type:
sudo apt-get install php5 libapache2-mod-php5
go to /var/www/

type






cd /var/www/ going to www folder
mv index.html index.phprenaming index.html to index.php
vim index.phpedit the index.php using vim,

put this to index.php to try if php is running. because it will show the necessary settings in php


6.)install mysql

sudo apt-get install mysql-server

then if there is an error on php and mysql, if you cant query on php to mysql, try this install,

sudo apt-get install php5-mysql mysql-client

then edit php.ini on /etc/php5/apache2/

enable ;extension=mysql.so

by removing the ";"

7.) the last step is install the phpmyadmin'
type this
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin


then restart apache2,
check this on your browser:
http://localhost/phpmyadmin
but if phpmyadmin has an error or wont work

sudo apt-get install phpmyadmin
then edit the apache2.conf at /etc/apache2/
by typing this in the last line inside the apache2.conf

Include /etc/phpmyadmin/apache.conf

No comments:

Post a Comment