Wednesday, 24 October 2007

Ubuntu 7.10 (Gutsy Gibbon) LAMP Server Setup

In around 15 minutes, the time it takes to install Ubuntu Server Edition, you can have a LAMP (Linux, Apache, MySQL and PHP) server up and ready to go. This feature, exclusive to Ubuntu Server Edition, is available at the time of installation.


The LAMP option means you don't have to install and integrate each of the four separate LAMP components, a process which can take hours and requires someone who is skilled in the installation and configuration of the individual applications. Instead, you get increased security, reduced time-to-install, and reduced risk of misconfiguration, all of which results in a lower cost of ownership.New pre-configured installation options have been added to the Ubuntu Server. Mail Server, File Server, Print Server, and Database Server options join existing LAMP and DNS options for pre-configured installations, easing the deployment of common server configurations.

Ubuntu LAMP server Install the following Versions

Ubuntu Gutsy Gibbon 7.10
Apache 2.2.4
Mysql 5.0.45
PHP 5.2.3

First you need to download server version of Ubuntu version from here after that you create a CD and start booting with the CD Once it starts booting you should see the following screen in this you need to select second option "Install to the Hard disk Option" and press enter



Choose you language and press enter you can see we have selected english in the follwoing screen

Choose your location and press enter you can see we have have selected United Kingdom in the follwoing screen

If you want to try to have your keyboard layout detected by pressing a series of keys you need to select yes option and if you don't want that and you want to choose from a list click no in this example we have selected no and press enter

Select Origin of keyboard and press enter

Select keyboard layout and press enter

Detecting hardware to find CD-ROM Drivers in progress

Scanning CD-ROM in Progress

Loading additional components progress bar


Configures the network with DHCP if there is a DHCP server in the network

Enter the Hostname of the system so in this example i enter here as ubuntulamp


Detecting Disks and Hardware in progress

Startingup the partitioner in progress

you have to partition your hard disk in this example i have selected use entire disk option if you want to edit manually you can choose manual and press enter



Warning message about data lost on your hard disk



Creating partitions in your harddisk

Write the changes to disk option here you need to select yes and press enter



Creating ext3 filesystem in progress

Configuring the clock option here if you want to leave UTC Select yes otherwise no and press enter

You need enter the Full name of the user you want to create for your server in this example i have created administrator user select continue and press enter



username for your account in this i have entered test select continue and press enter



Entered the password for test user select continue and press enter

Confirm the password for test user select continue and press enter

Installing the base system in progress

Configuring package mirror this will be related to your country option

Now it will start Installing software and here you need to select the server options here i have selected as LAMP for our LAMP server installation



Software Installation in Progress

At the time of software installation it will prompt for mysql server root password enter root password of your choice and select continue

Installing GRUB Boot loader in progress

Installation complete message here you need to remove your CD select continue and press enter it will reboot your server

After rebooting you can see the following screen prompt for username


This will complete the Ubuntu LAMP Server Installation and your server is ready for installing applications which supports apache,mysql and php.

Configuring Static ip address in Ubuntu server

Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):

sudo vi /etc/network/interfaces

and enter the following save the file and exit

# The primary network interface

auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1

Now you need to restart your network services using the following command

sudo /etc/init.d/networking restart

You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.

sudo vi /etc/resolv.conf

You need to add look something like this

search domain.com

nameserver xxx.xxx.xxx.xxx

Install SSH Server

If you want to access your server remotely through SSH you need to install SSH server for this you need to run the following command

sudo apt-get install ssh openssh-server

You will be prompted to insert the installation CD again and this will complete SSH server in your Gutsy lamp server.This is really simple and easy server installation for new users and who wants a quick server.

GUI Installation for Ubuntu LAMP Server

Option1

If you are a new user and not familiar with command prompt you can install GUI for your ubuntu LAMP server for this you need to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file once you have enable you need to use the following command to install GUI

sudo apt-get update

sudo apt-get install ubuntu-desktop

The above command will install GNOME desktop if you want to install KDE desktop use the following command

sudo apt-get install kubuntu-desktop

Optio2

Installing Webmin in Ubuntu Gutsy Gibbon

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.

You can install webmin for your server web interface to configure apache,mysql servers.Now we will see how to install webmin in Ubuntu 7.10

Preparing your system

First you need to install the following packages

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

Now download the latest webmin using the following command

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.370_all.deb

Now we have webmin_1.370_all.deb package install this package using the following command

sudo dpkg -i webmin_1.370_all.deb

This will complete the installation.

Ubuntu in particular don't allow logins by the root user by default. However, the user created at system installation time can use sudo to switch to root. Webmin will allow any user who has this sudo capability to login with full root privileges.

Now you need to open your web browser and enter the following

https://your-server-ip:10000/

Now you should see similar to the following Screen

Once you enter into the webmin you should see similar to the following screen

If you want to configure Apache,Mysql server you need to click on Servers on your lefthand side you should many servers are ready to configure

This is very Easy to configure most of the servers and Enjoy your new Ubuntu Gutsy Gibbon LAMP Server

14 comments:

Eamo said...

Clear. Concise. Straight forward.
Thank you for taking the time to do this.

Eamon.

Rob said...

Thank you for posting this. A very big time saver!

Ethernomad said...

Nice!

I walked through the "Perfect Gutsy Server" How-To which installs mySQL, Apache, PHP, Postfix, Bind, ProFTPD, Courier-POP3/Courier-IMAP, Webalizer, ISPConfig, etc. Despite several attempts, I could never get ISPConfig to work.

I'm going to try this right away! I think the other way was overkill for what I'm trying to accomplish anyway...

Ethernomad said...

Works like a champ!

Tõnu said...

By default the server firewall is not configured. Adding a few paragraphs here about configuring the basic firewall would be a plus.

Thanks for sharing your guide!

blingham said...

I agree, excellent howto and walkthrough. Helped me with my server!

Cheers!

Jay

TheFlyingNematode said...

Great destructions. I tried installing the webmin package but fell at the first hurdle.
$ sudo apt-get install libnet-ssleay-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libnet-ssleay-perl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libnet-ssleay-perl has no installation candidate
I am using Gutsy Gibbon so I'm not sure what to do next.

Andy said...

you probably worked it out how to
I had the same prob being a Noob.
sudo nano /etc/apt/sources.list

uncomment or remove # to enable deb packages downloaded to your server in repository or sources.list

For example under this header
##N.B. software from this repository is ENTIRELY UNSUPPORTED ...
#Line commented out by installer because ...
#deb http://au.archive.ubuntu.com/ubuntu ...
--->
deb http://au.archive.ubuntu.com/ubuntu

sudo apt-get update
sudo apt-get install upgrade

try
sudo apt-get install libnet-perl
again or whatever dependencies you are missing.

Great! I got this server up and running now but dunno what to do with it! I am trying to set up a wiki and opensource groupware/project-open to handle company diary, file sharing and wiki.

Any hints?

Nerd for the first time!

jonhd said...

Followed guide to the letter...
Get "Access Denied" page from my (local) proxy server, when I https://192.168.0.2:10000/ to the server from any other machine on the network. A quick port scan of the machine shows that only ports 25 & 110 are open (so I can't even Telnet/SSH into the machine!)
This is obviously something fairly basic(...), as I assume installing each bit of software (ssh, webmin, etc.) should result in the appropriate ports being opened as a part of the installation process? The guide certainly doesn't mention having to open ports manually.

Can anyone put me out of misery?

MetalPSI said...

Hey john....goto portforward.com and forward your ports, you can open them up to use....

jonhd said...
This post has been removed by the author.
jonhd said...

Thanks metalpsi, but that doesn't really help me (enough!). Having looked through the site, it appears to tell me how to config specific hardware routers/firewalls (plus a few software firewalls - doesn't list "Linux", "IpTables", or anything like that).
I'm merely trying to make my LAMP server 'remotely' accessible within my local LAN. So there's no router/firewall involved (other than what is obviously preventing access on the LAMP server itself).
Since posting, I did a "sudo /etc/init.d/ssh start", and can now see Port 22 listed as "LISTEN" when I run netsat -a (on the LAMP server). And, since rebooting the LAMP server, am now able to SSH into it from another machine.
However, trying https://192.168.2.2:10000/ still returns "Access Denied"
netstat -a --numeric-ports shows:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN

So, port 10000 appears to be open & listening...

jonhd said...

Only me (again).
Problem sorta solved. Browsers (IE & Firefox) on my network machines all have Proxy Server settings, setup to point at my IPCop Router/Firewall. Disabling the proxy server settings in the browser lets me connect to the LAMP server with webmin. Really not quite sure why this should be so - e.g. I have another Linux box on my network that runs Slimserver (http://www.slimdevices.com), and I can connect to it's web server interface (which is on port 9000) with the proxy settings enabled...
I guess the long-term answer would be to setup some iptables rules on IPCop, but I don't understand why this should be necessary when all machines are on the same network.

Brian said...

Thank you very much for this. This was so easy to read and follow. Thanks again.