Your Ad Here

Ubuntu LAMP Server - Setup Guide with Desktop GUI

Ubuntu LogoUbuntu (for those of you who have been living under a rock) is fast becoming the free Linux distribution of choice for home computing. Dell has even begun to ship machines with Ubuntu pre-loaded instead of Windows or Red Hat. But Ubuntu is not just for desktops. It’s also available as a super easy to install “Server Edition” that comes complete with DNS server and LAMP (Linux, Apache, MySQL, PHP) server components. Unfortunately, the “Server Edition” does not install with the pretty GUI and the bells and whistles (like OpenOffice and Firefox) that come standard with the “Desktop Edition”. But you can have the best of both worlds. Here is how you set up a Ubuntu LAMP server on your local area network and customized the installation to include the Ubuntu Desktop GUI.



Step 1: Install Ubuntu Server Edition with LAMP server components.

Download the disk image (*iso) for Ubuntu Server Edition (currently version 8.04 Hardy Heron) and burn it to a CD. Ensure that your BIOS is configured to boot from the CD-ROM drive. Restart with the Ubuntu disk in the drive and the machine should boot into the Ubuntu installation shell. If you would like to configure a static IP address, select F6 - Other Options and enter

netcfg/disable_dhcp=true

at the end of the options string, and the install script will prompt you for network information during the installation. Otherwise, the static IP must be configured post installation as per the second part of step 2 below, and your network will be automatically configured using DHCP (as long as DHCP is enabled on your router). In either scenario, you must enter a hostname when prompted.
As you work through the installation (most of which is self explanatory), you will also be prompted to select a partitioning method. The most straightforward method is “use entire disk”, which will format a drive of your choice before installing system files to it. Finally, you will be prompted to enter a full name and a short name for a non-administrator account (separate from root). After a few more trivial questions (like “What is your time zone?”), and a plethora of file copying, the install shell will ask you to select optional software to install. Select LAMP (using the arrow keys and spacebar). If you wish to install a name server as well, you may select DNS and follow the instructions of this post. You may also elect to install an OpenSSH server at this point and bypass the first component of step 3 below. After making selections, continue the installation by pressing enter. At some point, you will be prompted to enter a mysql root user password. If you wish, this password can be left blank for now.

Step 2: Enable root access and configure a static IP address.

After installation finishes and the system reboots, log in using the non-administrator account created during installation. (Note: my system hung after reboot and I had to press enter to get the login prompt.) The first thing you will probably want to do once you log in is set the root password (by default the password is left blank). To do so, type the following at the command prompt.

sudo passwd root

Since you are planning to use the machine as a web server, you will also need to specify a static IP address (if not already configured during the installation). To do so, you must edit the interfaces configuration file (use your favorite text editor; I use vi here).

sudo vi /etc/network/interfaces

If DHCP was enabled during installation, a chunk of this file should look like the following:

auto eth0
iface eth0 inet dhcp

Change dhcp to static and add the lines shown below. Of course you need to use your IP address, netmask, and gateway instead of mine.

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

You also need to specify the DNS server(s) in the resolv.conf file.

sudo vi /etc/resolv.conf

Replace the xxx.xxx.xxx.xxx in the nameserver xxx.xxx.xxx.xxx line with the address of your DNS server. You can add multiple DNS servers if you like by duplicating this line using other DNS server addresses. Now restart your network components.

sudo /etc/init.d/networking restart

Ping www.zaphu.com (or some weblog of lesser quality) to make sure your network configuration is working.

Step 3: Install OpenSSH and Ubuntu Desktop components.

If you didn’t do so during the installation, you will probably want to install an SSH server at this point so you can login to your new LAMP server from other machines on your local area network. Installing packages is a snap with Ubuntu using the built in aptitude package management software. The first step is to update the packages database by typing

sudo aptitude update

Then install the openssh-server package.

sudo aptitude install openssh-server

You need to insert the Ubuntu Server installation disk to complete the installation. Installation of the Ubuntu desktop environment (and all of the goodies that go with it) is also a snap using aptitude. Type

sudo aptitude update
sudo aptitude install ubuntu-desktop

Because a significant number of files need to be downloaded, the Ubuntu GUI installation may take some time. Near the middle of the installation you will be asked to configure the Postfix mail transfer agent. Since my machine is not going to be a mail server I selected ‘no configuration’ and continued, but you may want to configure Postfix differently. Check out Ubuntu Forums for information on configuring Postfix. When the Ubuntu desktop installation finishes, fire up the GUI.

sudo /etc/init.d/gdm start

Congratulations, you now have a fully operational Ubuntu LAMP server with the niceties of the Ubuntu desktop environment. In a follow-up post, I walk you through the setup of a website on your new server and the installation of phpMyAdmin to help manage all of those mySQL databases you will be creating.

If this guide leaves you scratching your head, check out the related posts on these weblogs: Debian Admin, spoffle

If you liked this guide, show support by leaving comments and visiting our sponsors.



Update, Aug. 13, 2007: Dell has announced that they will start to ship Ubuntu-equipped machines internationally. Perhaps Microsoft’s days are numbered. Read about it here.

Update, Aug. 23, 2007: Here is a first hand account of a Ubuntu Dell by someone who bought one.

Update, Aug. 30, 2007: The next version (8.04) of Ubuntu (Hardy Heron) has been announced for release in Q2 2008.

Update, Oct. 24, 2007: Ubuntu 7.10 has been released and is receiving great reviews.

Update, Apr. 27, 2008: I updated this post for Ubuntu 8.04 Hardy Heron.




Have something to add? Send me a message on twitter or leave a comment below.

Viewing 74 Comments

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus

© Copyright Zaphu 2007. All rights reserved. -- Valid XHTML

Sitemap XML Sitemap XHTML