Post to Google Buzz
Bookmark this on Yahoo Bookmark
Bookmark this on Digg
Share on reddit
Share on StumbleUpon


LAMP is short for Linux, Apache, MySQL, PHP.
Follow the steps below to setup an an Apache2 webserver on an Ubuntu 11.10 server with PHP5 support (mod_php) and MySQL support.

1. Login as root:

sudo su

2 Installing MySQL 5
First we will install MySQL 5:

apt-get install mysql-server mysql-client

You will be asked to provide a password for the MySQL root user.

3.  Installing Apache2
Now install Apache2, it is also available as an Ubuntu package:

apt-get install apache2

Now direct your browser to http://localhost, and you should see the Apache2 placeholder page (It works!).

localhost_apache2

Apache’s default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the /etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d.

4.  Installing PHP5
We can install PHP5 and the Apache PHP5 module as follows:

apt-get install php5 libapache2-mod-php5

We must restart Apache afterthat:

/etc/init.d/apache2 restart

The document root of the default web site is /var/www. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/info.php

Now we call that file in a browser (e.g. http://localhost/info.php):

php_info

If you scroll further down, you will see all modules that are already enabled in PHP5.

6.  Getting MySQL Support In PHP5
To get MySQL support in PHP, we can install the php5-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

apt-cache search php5

Below is the list i suggest you to install:

apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Now restart Apache2:

/etc/init.d/apache2 restart

Its all setup now.
Start Working……….

Tagged with:  

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...