PDA

View Full Version : [ubuntu] How to install the Ubuntu Server Edition



Luis Cisneros Jr
October 31st, 2008, 10:09 PM
Reposted from IYCC.org (http://www.iycc.org/node/107)

This is a how-to on installing Ubuntu Server Edition on a computer that is not used anymore. If you have an old computer with Internet connecting capabilities that has, as least, a Pentium II processor, you can use that computer to run as a web server, believe it or not.

For this how-to, you will need the latest version of Ubuntu Server (not Desktop) Edition on a CD, a monitor, keyboard, router, network cable, two passwords in mind, a system name, username, and the computer you want to run as a web server. Before reading any further, be aware that you must backup any data you need or want from the old computer because the following instructions will partition the entire disk and all data will be erased. The first section will be on preparing the computer for the installation, the second is the installation itself and third is how to run the updates and upgrades.

First, prepare the computer for the installation by connecting the power cords, a monitor, keyboard, and a network cable connected to a router or connected directly to the Internet by a modem. With everything connected, power up the monitor and computer and place the CD in the tray. During the boot up process, look for a message saying to hit a certain key to enter the setup or BIOS. It will be either the ‘Delete’ or ‘Del’ key, ‘F8’, ‘Esc’ or any other key. The reason there are different keys to enter the BIOS is due to manufacturer specifications; there is no ‘standard’ for which key to be use to enter the BIOS. Once successful in BIOS, locate around the menu for the boot up sequence. If there is no such label, use the descriptions, if shown, to assist you. Make sure the CD-ROM is the first boot sequence, and then the hard drive once in the boot sequence menu. Skip this important step and the computer will load the hard drive before the CD-ROM; you will be wondering why will not the computer run the CD. Save and exit the BIOS menu with the necessary changes and the computer should restart automatically and begins to run off the CD. The next image you should see on the monitor is the Ubuntu logo and a list of choices. If you are sure the software on the CD is genuine, select ‘Install Ubuntu Server’ at the top of the menu. Next, select English, if you know English, when you will be asked to choose a language. The CD installation will be asking you lots of questions. Typically, you will be using a ‘QWERTY’ American style keyboard, during the installation process so you can select ‘No’ when asked to detect the keyboard layout and select 'USA” as the origin of the keyboard. You may not know which American keyboard layout you use, but you can answer you do not know when asked. Answering does not know will not affect the keyboard input throughout the installation. It is okay to answer on this particular question does not know. Automatic detection of the hardware and scanning of the CD-ROM begins followed by the loading of additional components. The process takes less than three minutes altogether. The detection of network hardware follows; it is here why the computer must be connected to the Internet whether through a router or directly because if it is not, a message prompts saying the network configuration with DHCP failed or ‘DHCP server may be slow.’ If this happens, be certain the computer is connected to a router or to the Internet then retry the network auto configuration. Do not continue until the network auto configuration is achieved because the installation will be incomplete. You might find to start again from the beginning. Once the network auto configuration is successful, you will be asked to enter a system name. The purpose of the system name is to identify your computer to a network. Select the time zone you reside in: Eastern, Central, Mountain, Pacific. Now, we will start the partition and hopefully you backed up the data you need from the computer. There are four methods to partition the hard drive: use entire disk, use entire disk and setup LVM, use entire disk and setup encrypted LVM, or Manual. LVM, stands for Logical Volume Manager, manages disk drives for the Linux kernel, resizes logical volumes, and creates snapshots of logical volumes. It may come in handy in the future to use LVMs but for now select ‘Use entire disk’ and next comes the point of no return. A warning will prompt you that ‘all data on the disk will erased.’ After you select the hard drive to begin the partition, depending on the hard drive, you may received another prompt stating ‘the selected device already contains logical volumes and/or volume groups from a previous LVM installation’ and continues to say ‘this will also permanently erase any data currently on the logical volumes.’ Select yes to continue the installation and select yes again to write the changes to hard drive. The partitioning starts up followed by the installation of the base system. For a long while, you see on the monitor files being validated, received, installed, unpacked, configured, and prepared. Next is a prompt asking for personal information, your username, and password that needs to be entered twice. Be sure the password has letters and numbers and is several characters long. This is way it will absolutely difficult for someone else or a computer to find your password. The configuration of apt starts but if it does not show the ‘Configure the package manager’ window, something is wrong. It may be the computer failed during the network auto configuration process. Start the installation again from the beginning should you find yourself in this situation and redo the preceding steps. The package manager configuration prompt states ‘if you need to use a HTTP proxy to access the outside world, enter the proxy information here. Otherwise, leave this blank.’ Since, in this case, the computer is connected to a router or the Internet directly and not through another desktop computer (a proxy server), do leave the information blank unless the computer is connected through a proxy server then do enter the information.

Next, the selection of software for the web server includes a mail server, DNS server, LAMP, OpenSSH, Samba server, PostgreSQL server, and printer server. Mail and printer servers are self-explanatory. The DNS server, without getting too technical, translates from an IP address (209.85.165.103) to a domain name (www.google.com) and back again. LAMP, a software bundle, stands for Linux, Apache, MySQL, and PHP. Linux is referring to the operating system, Apache is a Web server, MySQL is a database server and PHP is a programming language. Learn more about Apache, MySQL and PHP by visiting httpd.apache.org, www.mysql.com, and www.php.net respectively. OpenSSH allows a user to connect to their computer over the Internet via a secure tunnel; it is very handy when you are away from a computer and need to do some work. According to their website, www.samba.org, Samba provides “file and print services to all manner of SMB/CIFS clients, including the numerous versions of Microsoft Windows operating systems.” Finally, PostgreSQL is another database system as MySQL is. To select software, do not hit the ‘Enter’ key; use the spacebar to make the selections. Hitting the ‘Enter’ key before selecting the software will start the next step. For the purpose of this exercise, select only LAMP, OpenSSH and DNS server then hit ‘Enter.’ The CD installs the selected software starts, which a prompt opens on configuring the MySQL server. All it is asking is a password for the database. The password (must be different than the username’s password) for the database must consist of letters and numbers as the username’s password to ensure security. Again, the password must be entered twice. The background color turns red when the password was not entered twice correctly. Lastly, the CD installs the GRUB (GRand Unified Bootloader) and finishes the installation. Remove the CD when the computer ejects the CD tray then select ‘Continue.’ The computer reboots, loads and ends with a login command. The installation is complete however updates must be performed because the latest version of Ubuntu Desktop and Server Edition (8.04) was released in April 2008. Many changes have taken place between the release of version 8.04 to the installation on your computer.

At the login screen, type the username and password used during the installation. With your username and password entered correctly, you should see the username, the @ symbol, and the system name: for example, username@systemname. Next, type ‘sudo –s’ in the command line and again enter the same username password. This is to allow permission to the root directory of the operating system. Skip the ‘sudo –s’ step and will not be able to update the system. When the password is entered correctly, the username is switch to root: for example, root@systemname. Type ‘aptitude’ in the command line after you successfully becoming root. Aptitude is front-end program listing software packages (available, in development, virtual state, for example) a user can download, update, or remove in their computer. Aptitude is used quite often for downloading software in Linux. With the aptitude program opened, there are should be a ‘Security Updates’ and ‘Upgradeable Packages’ on the menu. Using the up and down arrow keys, move to ‘Security Updates’ and hit the plus key then do the same to ‘Upgradeable Packages.’ If look to the blue section of aptitude toward the right half of the screen, there is ‘u’ for upgrade and ‘g’ for download/install/remove pkgs (packages). With the security updates and upgradeable package selected with the plus sign, hit the ‘g’ key and aptitude lists packages that will be installed. Feel free to view what packages will be installed. Hit the ‘g’ key again to start the download; it will take about 90 seconds. The downloaded packages will be unpacked and prepared which will take about five minutes to complete after which a prompt opens. The OpenSSH configuration places a warning that vulnerable host keys will be regenerated. Do not worry about the vulnerabilities; the problem will be fixed later. Aptitude is once again on the screen and the ‘Security Updates’ and ‘Upgradeable Packages’ should be missing the men, which is good thing. The web server is up to now date and ready to serve.

Turning an old computer into a web server is quite easy to do once you understand the processes and the software involved during the installation. With a 'white box' computer as an up-to-date web server, a user can start hosting web sites, have a server-side database, use as a backup of large files, or all of the above and more. It only takes about less than two hours of time and no extra equipment needed just a Pentium II or higher computer will do the job.