How To: Set Up Ubuntu Linux 6.06 LTS LAMP Server - Part 4

Ubuntu LogoThis is part 4 in a series of 4:

- Overview
- Part 1: Preparing For Installation
- Part 2: Boot-Up and Configuration
- Part 3: Partitioning Your Drives
- Part 4: Completing the Installation
-
Extra 1: Installation Video

Part 4: Completing the Installation

Now that you’re done partitioning, it’s time to complete the installation!

Setting Up the Timezone

Select the timezone that best fits you and continue. If you are prompted to use UTC, hit Yes.- The installer will ask you what timezone you’re in. Select the one that best fits you and continue. I’ll choose Eastern. If you are prompted to use UTC, hit Yes (unless you have a reason not to).

Users and Passwords

The first dialog after having entered the timezone asks you for your real name, not the alias you want to log in with.- The first dialog after having entered the timezone asks you for your real name, not the alias you want to log in with.



Enter your desired username. The username should start with a lower-case letter, which can be followed by any combination of numbers and letters. The installer suggests patrick. I’ll go with that.- Now I’m asked for my desired username. The username should start with a lower-case letter, which can be followed by any combination of numbers and letters. The installer suggests patrick. I’ll go with that.


Enter the password you’d like to associate with your account. This password will also be the password you use to perform actions that require ‘root’ access.- Enter the password you’d like to associate with your account. This password will also be the password you use to perform actions that require ‘root’ access. In the next window, confirm the password by typing it again.


Sit back and relax as the installer finalizes the installation.Sit back and relax as the installer completes installing Ubuntu Server on your computer. Let the installation process finish, eject the CD, and reboot your system. Congratulations, installation is done!



Linux should now initialize and prompt you for your username and password. If your screen looks something like this, all went well.Linux should now initialize and prompt you for your username and password. If your screen looks something like this, all went well. Feel free to log in.

Setting up LAMP

It works!Wouldn’t it be great if our LAMP server just worked now, without us having to do anything? Well, it does! Try browsing to your servers IP in a browser, in my case http://192.168.0.6. Woot!


It’s time to do a few changes to our LAMP server. Normally, this would be a 3/4-hour process of manually editing config files and testing. Thanks to Ubuntu though, the installer does it all — better too. All we need to do is choose how we want our LAMP server to work.

By default, Apache2 uses /var/www/ as its document root. We’ll want to change this to our home folder in order to reap the space we’ve allocated.

- Log in, in case you haven’t. Type the exact command mkdir www - This will create the folder /home/patrick/www/ which we will be using as the document root of our server.

Type the exact command: sudo nano -w /etc/apache2/sites-available/default and hit Enter. This will open a text editor with our site’s config file (see screenshot).- Type the exact command: sudo nano -w /etc/apache2/sites-available/default and hit Enter. You will be prompted for your password. Enter it, and a text editor with our site’s config file will open (see screenshot to the right).


Feel free to set the administrator e-mail to your own. Replace all occurrences of /var/www/ to /home/patrick/www/ , where patrick is the username you chose during installation.- Feel free to set the administrator e-mail to your own. Now, go through the document and replace all occurrences of /var/www/ to /home/patrick/www/, where ‘patrick’ is the username you chose during the installation. Navigate around with the arrow buttons. When done, hit CTRL+X then type Y and Enter to save the changes.


- Time to restart Apache to apply the changes. Type sudo /etc/init.d/apache2 restart

- Now, let’s see if this really works! Assuming you’re in your home folder (type cd to make sure), type cd www followed by ls. You should see.. nothing. Good.

nano -w index.php - Make the index.php file so we can test if our server works.- Type nano -w index.php
We’ll create a sample PHP script to test if the server and PHP is working. <?php echo "It's working!" ?> will suffice. Again, hit CTRL + X followed by Y and Enter to save the contents.


Navigate to your server in a browser. It works!- Navigate to your server, e.g. http://192.168.0.5 — it works!

You’re done! Your server is working perfectly!

If you’re uncomfortable with the command-line interface, I recommend you look into guides for installing Webmin and phpMyAdmin for Ubuntu. Also, if you would like to administer your server from your own computer, you can install SSH with the command: sudo apt-get install ssh
You can access it with applications like PuTTY.

In order to install phpMyAdmin (and more) with sudo apt-get install, you will first need to enable the Universe repository. There’s a nice guide on how to do that from the CLI here.

If something went wrong, feel free to ask for guidance in a comment to this article. The Ubuntu Forums has hands-down the best support community you will ever find. If you have any questions or problems, I highly recommend them as well.

Look out for more how to’s on how to use your server for great things.


Related Posts