Install Ubuntu/Debian LAMP Server Published: Feb 13, 2008
  • Rating

    3/5

Setup instructions for a Ubuntu/Debiain server, PHP, MySQL and all the good stuff to get your own server running.

Let us prepare a system that has a minimum requirement of Debian/Ubuntu version of linux with atleast 256MB of RAM available. Anything less than this minimum ram will cause lot of problems since we are running a server along especially mysql and webmin requires lot of RAM to run properly.

    * Apache 2 - Linux Web server
    * MySQL 5 - MySQL Database Server
    * PHP4/5 - PHP Scripting Language
    * phpMyAdmin - Web-based database admin software.

    Linux + Apache + MySQL + PHP/Perl together commonly known as LAMP Server.

1. Installing Apache + PHP

Apache is one of the most famous web server which runs on most linux based servers. With just few commands you can configure apache to run with PHP 4 or PHP 5.

If you want to install PHP 4, just apt-get

    apt-get install apache2 php4 libapache2-mod-php4

To install PHP5, just run the following on linux shell. Note that if you dont specify packages with '4', PHP5 will be automatically installed.

    apt-get install apache2 php5 libapache2-mod-php5

Apache configuration file is located at: /etc/apache2/apache2.conf and your web folder is /var/www

To check whether php is installed and running properly, just create a test.php in your /var/www folder with phpinfo() function exactly as shown below.

    nano /var/www/test.php

    # test.php

    <?php phpinfo(); ?>

Point your browser to http://ip.address/test.php or http://domain/test.php and this should show all your php configuration and default settings.

You can edit necessary values or setup virtual domains using apache configuration file.
Enabling GD Library with PHP

If you want to use CAPTCHA or for dynamic image generation with php scripts for image verification to stop SPAM or automated robots, then it is absolutely necessary to get php gd library installed with php. Here is the command

    apt-get install php5-gd

Thats it!! Point your browser to http://domain/test.php and the php configuration settings will show GD library will be enabled for PNG, GIF, JPG etc.
Enabling Mod Rewrite with .htaccess

Do you use mod-rewrite from apache to rewrite friendly URLs ?? This must be absolutely necessary for the rewrite module to get enabled in your apache, especially if your blog, forum script uses rewriting engine to generate friendly URLs in your site. Note that default apache2 installation does not come with mod-rewrite. Here is how you enable it. Issue the following command

    # a2enmod rewrite

Once you run this command, apache will tell you that this rewrite module is enabled. You can find mod_rewrite enabled and show up in your test.php file.

2. Installing MySQL Database Server

Installing mysql database server is always necessary if you are running a database driven ecommerce site. Remember running mysql server to a fair extend requires atleast 256mb of RAM in your server. So unless you are running database driven sites you dont absolutely need mysql. The following commands will install mysql 5 server and mysql 5 client.

    apt-get install mysql-server mysql-client php5-mysql

Note: If you have already installed php4, you should make a slight change like this.

    apt-get install mysql-server mysql-client php4-mysql

The configuration file of mysql is located at: /etc/mysql/my.cnf
Creating users to use MySQL and Changing Root Password

By default mysql creates user as root and runs with no passport. You might need to change the root password.

To change Root Password

    mysql> USE mysql;
    mysql> UPDATE user SET Password=PASSWORD('new-password') WHERE user='root';
    mysql> FLUSH PRIVILEGES;

To Create User

You must never use root password, so you might need to create a user to connect to mysql database for a PHP script. Alternatively you can add users to mysql database by using a control panel like webmin or phpMyAdmin to easily create or assign database permission to users. We will install Webmin and phpmyadmin during later once we complete basic mail LAMP installation.
PhpMyAdmin Installation

PhpMyAdmin is a nice web based database management and administration software and easy to install and configure under apache. Managing databases with tables couldnt be much simpler by using phpmyadmin.

All you need to do is:

    apt-get install phpmyadmin

The phpmyadmin configuration file is located at: /etc/phpmyadmin folder.

To setup under apache all you need to do is include the following line in /etc/apache2/apache2.conf

    Include /etc/phpmyadmin/apache.conf

Now restart apache: /etc/init.d/apache2 restart

Point your browser to: http://domain/phpmyadmin

Thats it!! MySQL and phpMyAdmin is Ready !!! Login with your mysql root password and create users to connect to database from your php script.


This article was written by Mr.Balakrishnan who currently owns Webmasterpals.com. He has also written several linux articles in mysql-apache-php.com website which he owns. Permission is hereby granted to freely publish or reproduce this article with reference given to authors website.

  • Rating

    3/5

Related Articles

Comments (5)

  • Gravatar - inckie
    inckie 12:59, July 26, 2009
    i wrote a small hosting panel for LAMP servers http://projekter.decoit.dk/shpweb
  • Gravatar - Jamie
    Jamie 20:43, January 24, 2010
    If you are having problems installing phpmyadmin you need to make sure that the universal repository is included and uncommented in your /etc/apt/sources.list file
  • Gravatar - aahaviatey
    aahaviatey 03:57, May 30, 2011
    <a href=http://www.flickr.com/people/63458481@N02/ > buy soma from mexico online Bombardier </a> <a href=http://labs.divx.com/node/17399 > how to order tramadol online inventors </a> <a href=http://dev.wurflpro.com/redmine/issues/236 > generic viagra overnight shipping Garciatinker </a> <a href=http://labs.divx.com/node/17403 > viagra no prescription overnight Semik </a> <a href=http://profiles.friendster.com/124493479 > buy tramadol saturday delivery exert </a> <a href=http://labs.divx.com/node/17400 > tramadol and canines 08008800 </a> <a href=http://www.flickr.com/people/63444040@N07/ > buying viagra accidentally </a> <a href=http://profiles.friendster.com/124503743 > Cheap Generic Viagra shipped Fedex OverNight severo </a> <a href=http://dev.wurflpro.com/redmine/issues/238 > cialis testimonials Requestor </a> <a href=http://dev.wurflpro.com/redmine/issues/239 > buy cod day next Prednisone serverPort </a> <a href=http://www.flickr.com/people/63484533@N06/ > buy Prednisone money order science </a> <a href=http://labs.divx.com/node/17407 > Prednisone delivered cod fedex bypassing </a> <a href=http://labs.divx.com/node/17405 > after effects of cialis normally </a> <a href=http://labs.divx.com/node/17406 > soma online pharmacy World </a> <a href=http://people.bakersfield.com/home/User/stevalker > cheap viagra Amherst </a> <a href=http://labs.divx.com/node/17404 > cod shipped ultram formal </a> <a href=http://profiles.friendster.com/124503708 > cheap prescription soma leaving </a> <a href=http://dev.wurflpro.com/redmine/issues/234 > pharmacy salary tech tramadol HttpServletRequest </a> <a href=http://dev.wurflpro.com/redmine/issues/237 > nextday ultram Excellent </a> <a href=http://www.flickr.com/people/63372895@N05/ > no prescription cod tramadol RenderPengenalan </a> <a href=http://dev.wurflpro.com/redmine/issues/235 > soma bay crushedmedia </a> <a href=http://labs.divx.com/node/17401 > buy xanax online prescription Knopf </a> <a href=http://labs.divx.com/node/17402 > soma no rx fed ex adventurers </a> <a href=http://people.bakersfield.com/home/User/sewtuker > tramadol same day EMILIO </a> <a href=http://profiles.friendster.com/124503782 > can you buy Accutane cash on delivery fa </a> <a href=http://people.bakersfield.com/home/User/laserdel > online sales Accutane Valdezcen </a> <a href=http://people.bakersfield.com/home/User/astrolreff > soma with no prescription jeanemiller1 </a> <a href=http://people.bakersfield.com/home/User/nukaswel > buy xanax 25 mg fragement </a> <a href=http://profiles.friendster.com/124503806 > buy cheap Trazodone without prescription Marian </a> <a href=http://labs.divx.com/node/17398 > buy tramadol without perscription sorts </a>
  • Gravatar - aahaviatey
    aahaviatey 03:58, May 30, 2011
    <a href=http://www.flickr.com/people/63458481@N02/ > buy soma from mexico online Bombardier </a> <a href=http://labs.divx.com/node/17399 > how to order tramadol online inventors </a> <a href=http://dev.wurflpro.com/redmine/issues/236 > generic viagra overnight shipping Garciatinker </a> <a href=http://labs.divx.com/node/17403 > viagra no prescription overnight Semik </a> <a href=http://profiles.friendster.com/124493479 > buy tramadol saturday delivery exert </a> <a href=http://labs.divx.com/node/17400 > tramadol and canines 08008800 </a> <a href=http://www.flickr.com/people/63444040@N07/ > buying viagra accidentally </a> <a href=http://profiles.friendster.com/124503743 > Cheap Generic Viagra shipped Fedex OverNight severo </a> <a href=http://dev.wurflpro.com/redmine/issues/238 > cialis testimonials Requestor </a> <a href=http://dev.wurflpro.com/redmine/issues/239 > buy cod day next Prednisone serverPort </a> <a href=http://www.flickr.com/people/63484533@N06/ > buy Prednisone money order science </a> <a href=http://labs.divx.com/node/17407 > Prednisone delivered cod fedex bypassing </a> <a href=http://labs.divx.com/node/17405 > after effects of cialis normally </a> <a href=http://labs.divx.com/node/17406 > soma online pharmacy World </a> <a href=http://people.bakersfield.com/home/User/stevalker > cheap viagra Amherst </a> <a href=http://labs.divx.com/node/17404 > cod shipped ultram formal </a> <a href=http://profiles.friendster.com/124503708 > cheap prescription soma leaving </a> <a href=http://dev.wurflpro.com/redmine/issues/234 > pharmacy salary tech tramadol HttpServletRequest </a> <a href=http://dev.wurflpro.com/redmine/issues/237 > nextday ultram Excellent </a> <a href=http://www.flickr.com/people/63372895@N05/ > no prescription cod tramadol RenderPengenalan </a> <a href=http://dev.wurflpro.com/redmine/issues/235 > soma bay crushedmedia </a> <a href=http://labs.divx.com/node/17401 > buy xanax online prescription Knopf </a> <a href=http://labs.divx.com/node/17402 > soma no rx fed ex adventurers </a> <a href=http://people.bakersfield.com/home/User/sewtuker > tramadol same day EMILIO </a> <a href=http://profiles.friendster.com/124503782 > can you buy Accutane cash on delivery fa </a> <a href=http://people.bakersfield.com/home/User/laserdel > online sales Accutane Valdezcen </a> <a href=http://people.bakersfield.com/home/User/astrolreff > soma with no prescription jeanemiller1 </a> <a href=http://people.bakersfield.com/home/User/nukaswel > buy xanax 25 mg fragement </a> <a href=http://profiles.friendster.com/124503806 > buy cheap Trazodone without prescription Marian </a> <a href=http://labs.divx.com/node/17398 > buy tramadol without perscription sorts </a>
  • Gravatar - aahaviatey
    aahaviatey 03:58, May 30, 2011
    <a href=http://www.flickr.com/people/63458481@N02/ > buy soma from mexico online Bombardier </a> <a href=http://labs.divx.com/node/17399 > how to order tramadol online inventors </a> <a href=http://dev.wurflpro.com/redmine/issues/236 > generic viagra overnight shipping Garciatinker </a> <a href=http://labs.divx.com/node/17403 > viagra no prescription overnight Semik </a> <a href=http://profiles.friendster.com/124493479 > buy tramadol saturday delivery exert </a> <a href=http://labs.divx.com/node/17400 > tramadol and canines 08008800 </a> <a href=http://www.flickr.com/people/63444040@N07/ > buying viagra accidentally </a> <a href=http://profiles.friendster.com/124503743 > Cheap Generic Viagra shipped Fedex OverNight severo </a> <a href=http://dev.wurflpro.com/redmine/issues/238 > cialis testimonials Requestor </a> <a href=http://dev.wurflpro.com/redmine/issues/239 > buy cod day next Prednisone serverPort </a> <a href=http://www.flickr.com/people/63484533@N06/ > buy Prednisone money order science </a> <a href=http://labs.divx.com/node/17407 > Prednisone delivered cod fedex bypassing </a> <a href=http://labs.divx.com/node/17405 > after effects of cialis normally </a> <a href=http://labs.divx.com/node/17406 > soma online pharmacy World </a> <a href=http://people.bakersfield.com/home/User/stevalker > cheap viagra Amherst </a> <a href=http://labs.divx.com/node/17404 > cod shipped ultram formal </a> <a href=http://profiles.friendster.com/124503708 > cheap prescription soma leaving </a> <a href=http://dev.wurflpro.com/redmine/issues/234 > pharmacy salary tech tramadol HttpServletRequest </a> <a href=http://dev.wurflpro.com/redmine/issues/237 > nextday ultram Excellent </a> <a href=http://www.flickr.com/people/63372895@N05/ > no prescription cod tramadol RenderPengenalan </a> <a href=http://dev.wurflpro.com/redmine/issues/235 > soma bay crushedmedia </a> <a href=http://labs.divx.com/node/17401 > buy xanax online prescription Knopf </a> <a href=http://labs.divx.com/node/17402 > soma no rx fed ex adventurers </a> <a href=http://people.bakersfield.com/home/User/sewtuker > tramadol same day EMILIO </a> <a href=http://profiles.friendster.com/124503782 > can you buy Accutane cash on delivery fa </a> <a href=http://people.bakersfield.com/home/User/laserdel > online sales Accutane Valdezcen </a> <a href=http://people.bakersfield.com/home/User/astrolreff > soma with no prescription jeanemiller1 </a> <a href=http://people.bakersfield.com/home/User/nukaswel > buy xanax 25 mg fragement </a> <a href=http://profiles.friendster.com/124503806 > buy cheap Trazodone without prescription Marian </a> <a href=http://labs.divx.com/node/17398 > buy tramadol without perscription sorts </a>

Add Your Thoughts

WebHostGear.com is a hosting directory, not a web host.

Copyright © 1998-2024 WebHostGear.com