Install LAMP on Ubuntu 6.06

From TekPedia

Jump to: navigation, search

Contents

[edit] System Repository Expansion

From the first SSH into a fresh Ubuntu 6.06 install (as root user!).

$ cp /etc/apt/sources.list /etc/apt/sources.list.original
$ vi /etc/apt/sources.list

you'll be in vi on the line

deb http://archive.ubuntulinux.org/ubuntu dapper main

Type two 'd's (that's 'dd'). That will delete the only line in the file.

Type 'i' to enter insert mode.

Copy the following text, and paste (shift-ctrl-v) it into the terminal so you'll be using a standard server configuration with the universe, multiverse, and restricted repositories activated.

## Add comments (##) in front of any line to remove it from being checked.    
## Use the following sources.list at your own risk.  

deb http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse

## MAJOR BUG FIX UPDATES produced after the final release
deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse

## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse

## BACKPORTS REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse

Type esc to exit insert mode.

Type ':wq' to write the file and quit.

Locales are improperly setup so run:

$ locale-gen en_US
$ locale-gen en_US.UTF-8

Update and upgrade your server.

$ apt-get update
$ apt-get upgrade

The repository indexes will be downloaded, and if you're asked if you want to install packages just hit enter or type 'y' and hit enter. Your system is now up to date (and slightly less secure, but hey, security's just a practice). 955762835314353742708539

[edit] LAMP Installation

[edit] Install the Software

Paste this into your terminal as one line. You may not want phpMyAdmin, and you certainly don't need it, but isn't it handy.

apt-get install mysql-server mysql-admin apache2 php5 libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql phpmyadmin

Type enter or 'y' and enter.

[edit] Setup MySQL

Only allow connections from localhost, especially for the root user.

$ mysqladmin -u root password your-new-password
$ sudo /etc/init.d/mysql restart

Restart Apache

/etc/init.d/apache2 restart

[edit] Check the Installation

Make a php file to test the server:

$ vi /var/www/testphp.php

Type 'i' to enter insert mode and then paste (shift-ctrl-v) the folowing text.

<?php 
  phpinfo(); 
?>

Type esc and then ':wq' to save the file.

Go to http://example.com/ You should see

Index of /

Icon  Name                    Last modified      Size  Description[DIR] apache2-default/        26-Jul-2006 17:50    -   
[DIR] phpmyadmin/             08-May-2006 11:57    -   
[   ] testphp.php             18-Aug-2006 13:03   24   

Apache/2.0.55 (Ubuntu) PHP/5.1.2 Server at example.com Port 80

Go to testphp.php . You should see a whole slew of information about your PHP settings.

Go to http://example.com/phpmyadmin/

Log into phpMyAdmin as the root user!

If everything is working...it's working.

[edit] Installing Postfix

Personal tools