Who's Online

We have 4 guests online
How to setup a complete web server (LAMP) in Ubuntu Jaunty (Ubuntu 9.04)? PDF Print E-mail
Written by Deepak K.C.   
Thursday, 21 May 2009 17:40


Follow the following steps: (To be more clear you can watch the video of this tutorial as well )

Step 1 : Install Lamp server . Go to terminal and type

sudo tasksel install lamp-server

Type your password when asked . The installation begins.



You are asked to enter password for the MYSQL "root " user.

enter the password and  press enter

re-enter the password and press enter

We have setup the lamp server. Lets check if everything went fine.

Go to your browser and type localhost

If it displays "it works" that means you have successfully installed apache,mysql and php.

Now lets check if php is correctly installed or not. Sometimes the browser asks to download instead of displaying result of the php codes.

 

 Your root folder is /var/www

Now lets create a simple php file

<?php
phpinfo();
?>
and save it as test.php

Go to your browser and check to see if it works or not.

http://localhost/test.php

As i said you can see its asking to save file.

To solve this problem follow the following steps:

Enable php modules

sudo a2enmod php5

It says module php5 already enabled .Disable it and re-enable the php5 module.

Restart your server :

sudo /etc/init.d/apache2 restart


Let us re-enable php5 module

sudo a2enmod php5
 
and restart the server

sudo /etc/init.d/apache2 restart

Now go to browser and recheck

http://localhost/test.php

This time as you can see it did not ask to save php files which means php too is correctly installed now.

Finally i prefer to use phpmyadmin. So if you like you too can install it .

sudo apt-get install phpmyadmin



You will be asked to choose the webserver that should be automatically configured to run phpmyadmin select apache2.
You can select it by pressing space bar and then press enter.


Lets save this text "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                         [ OK ]
"
This is not a real error. You wont have any problem at all. But if you don't want this error message to come then you can create a file

sudo nano /etc/apache2/conf.d/fqdn

and type

ServerName localhost

Restart the server this time you won't get any error message like you got in the beginning.

That's it. You have installed Apache,MYSQL and PHP successfully.


 

Comments
Add New Search
Thanks
stat (119.42.85.xxx) 2009-06-06 15:11:43

Great job with this. Easy to follow and to the po int. Thank you for taking th
e time to write it up .
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Sunday, 31 May 2009 02:34