SERVER : Installing UBUNTU server
Thursday, 4. January 2007, 14:47:47
So, after a few tries, I've finally managed to install Ubuntu Server.
Just in case somebody needs this information (or I have to reinstall the server
) I've decided to write down the steps I've taken in order to install it correctly.
First of all, i should draw a schematic of how my network looks like this :
Download the image
So, first things first, download and burn the Ubuntu Server ISO image. I've used the Ubuntu Edgy Eft 6.10 version, You can get it from the Ubuntu Download server.
Install the LAMP server
When you boot from the CD you have just have to press ENTER to continue the instalation (you'll select the LAMP (Linux, Apache, MySQL and PHP) a little bit later.
You can view a detailed LAMP Server Installation with Screenshots at this site
I will only include the main steps to get LAMP installed.
So first of all select your language, i used English. After that, it asks you where are you from (the window title is "Choose Language" but it should actually be "Choose Location"), I selected Other and then Romania (since I'm from Romania
)
Then it asks if you want to let the installer detect your keyboard, you better choose NO and then select your keyboard layout (I've used U.S. English).
After a few windows where it detects your hardware and network you wnd up at the Configure the network window, where you have to enter the server name, i've used Merlin, but you can use any name you like. After you press Continue, the partition editor will come up.
The partition editor has 2 options, one is to auto partition and format the disk for you, the other lets you manually edit your partitions. I've chose the first one since it's faster, and i didn't have anything on the HDD. So i chose "Erase entire disk : EDIE (0,0,0) (hda) ...".
It then asks if i really want to write the changes to the disk, i chose Yes.
After a while (after finishing the partitioning and formatting of the partitions), it asks if your computer's time is in UTC (Universal Time) or in local time. Most users have it set as UTC so i chose that.
Now we get to the interesting part, the installer asks you to create a user that will be the administrator of the computer. You can enter any name you like, but make shore you set the password to something hard enough to be hard to crack, but still easy enough so you don't forget it, since all configuration will be done with this user's account.
After you finish creating the user, you finally get to the window where you can select to install LAMP.
Select it and press continue (you should probably leave the DNS server unchecked).
After a while the installation finishes and a window appears informing you about that. After you press "Continue" the CD is ejected and the system reboots.
NOTE since I have PPPoe Internet connection, the installation takes a very long time, since after finishing installing the programs it tries to connect to the net to get some updates, and until that gets a timeout the installer just sits helplessly. I have no idea how to get around this as it can take up to 10 minutes before it finally realises it doesn't have a connection and gives up
.
Configure after reboot
After rebooting (I hope you entered in BIOS and modified it to boot from HDD only) you'll get to a window similar to this :
Enter the name and password you entered for the admin user and you should be logged in without problems.
Enable root user
You can enable the root user, but it's not recommended for security options.
If you DO want to enable the root user, write this :
From now on, to become root just enter the following command
Modify network configuration
Now, we must modify the network interfaces, so other computers can connect to it from the internal (GREEN) network.
So, execute this line :
Of course, you'll have to modify the eth0 and eth1 to your network cards, in my case the eth0 is the internal and eth1 is the external network.
After that we must restart the network daemon, so enter execute this line
Install DHCP server
Now we want to install the DHCP server, so the computers on the internal (GREEN) network can connect without having to have a fixed IP. For that, execute this line
Edit the DHCP config file by executing this line :
you should modify it to look like this :
Of course, the domain-name should be your server name (the one you choose at installation).
After saving the file, execute this line :
If you get any error, check the dhcpd.conf file, and make shore you put the ; sign after each line (that's the most common mistake).
Install the SSH server (SSH is Secure Shell)
Now it's time to install the SSH server, so we can configure the server remotely. For that, execute the following line :
From now on, you should be able to configure the server remotely.
Configure PPPoe connection
It's now time to configure the PPPoe connection, so lets do that with
). After it detects that card that's connected to PPPoe it will ask for your user name and password used to connect trough PPPoe. Note the name and password will both be visible while you enter them !. After a few more questions you'll end up back to the prompt.
Now if everything went well you can use the following commands :
to initialize a connection use this :
to kill a connection use this :
if you get an error that more than one connection is active, use this instead :
to check the connection status, use this :
Update and Upgrade your installation
All software installation is done using the apt-get and aptitude commands.
First of all, we need to configure Aptitude to use the Internet sources to find packages, for that execute the following command :
You should end up with something similar to this :
After this we must get Aptitude to update the package list by running this :
Just in case somebody needs this information (or I have to reinstall the server
First of all, i should draw a schematic of how my network looks like this :
Download the image
So, first things first, download and burn the Ubuntu Server ISO image. I've used the Ubuntu Edgy Eft 6.10 version, You can get it from the Ubuntu Download server.
Install the LAMP server
When you boot from the CD you have just have to press ENTER to continue the instalation (you'll select the LAMP (Linux, Apache, MySQL and PHP) a little bit later.
You can view a detailed LAMP Server Installation with Screenshots at this site
I will only include the main steps to get LAMP installed.
So first of all select your language, i used English. After that, it asks you where are you from (the window title is "Choose Language" but it should actually be "Choose Location"), I selected Other and then Romania (since I'm from Romania
Then it asks if you want to let the installer detect your keyboard, you better choose NO and then select your keyboard layout (I've used U.S. English).
After a few windows where it detects your hardware and network you wnd up at the Configure the network window, where you have to enter the server name, i've used Merlin, but you can use any name you like. After you press Continue, the partition editor will come up.
The partition editor has 2 options, one is to auto partition and format the disk for you, the other lets you manually edit your partitions. I've chose the first one since it's faster, and i didn't have anything on the HDD. So i chose "Erase entire disk : EDIE (0,0,0) (hda) ...".
It then asks if i really want to write the changes to the disk, i chose Yes.
After a while (after finishing the partitioning and formatting of the partitions), it asks if your computer's time is in UTC (Universal Time) or in local time. Most users have it set as UTC so i chose that.
Now we get to the interesting part, the installer asks you to create a user that will be the administrator of the computer. You can enter any name you like, but make shore you set the password to something hard enough to be hard to crack, but still easy enough so you don't forget it, since all configuration will be done with this user's account.
After you finish creating the user, you finally get to the window where you can select to install LAMP.
Select it and press continue (you should probably leave the DNS server unchecked).
After a while the installation finishes and a window appears informing you about that. After you press "Continue" the CD is ejected and the system reboots.
NOTE since I have PPPoe Internet connection, the installation takes a very long time, since after finishing installing the programs it tries to connect to the net to get some updates, and until that gets a timeout the installer just sits helplessly. I have no idea how to get around this as it can take up to 10 minutes before it finally realises it doesn't have a connection and gives up
Configure after reboot
After rebooting (I hope you entered in BIOS and modified it to boot from HDD only) you'll get to a window similar to this :
Enter the name and password you entered for the admin user and you should be logged in without problems.
Enable root user
You can enable the root user, but it's not recommended for security options.
If you DO want to enable the root user, write this :
sudo passwd rootenter the admin user's password and then enter the password you want for the root user (you'll have to enter it twice).
From now on, to become root just enter the following command
su
Modify network configuration
Now, we must modify the network interfaces, so other computers can connect to it from the internal (GREEN) network.
So, execute this line :
sudo editor /etc/network/interfacesand then modify the file to look like this :
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
####################################
# RED (outside)
# The primary network interface
auto eth1
iface eth1 inet dhcp
##################################
# GREEN (inside)
#
auto eth0
iface eth0 inet static
network 192.168.1.0
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1
broadcast 192.168.1.255
Of course, you'll have to modify the eth0 and eth1 to your network cards, in my case the eth0 is the internal and eth1 is the external network.
After that we must restart the network daemon, so enter execute this line
sudo /etc/init.d/networking restartIf you get any error than you'll have to look at the interfaces file, maybe you made a mistake.
Install DHCP server
Now we want to install the DHCP server, so the computers on the internal (GREEN) network can connect without having to have a fixed IP. For that, execute this line
sudo apt-get install dhcp3-serverDon't worry if it shows you an error, it's normal since the DHCP server doesn't have any configuration yet.
Edit the DHCP config file by executing this line :
sudo editor /etc/dhcp3/dhcpd.conf
you should modify it to look like this :
# option definitions common to all supported networks...
option domain-name "merlin";
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.30;
}
Of course, the domain-name should be your server name (the one you choose at installation).
After saving the file, execute this line :
sudo /etc/init.d/dhcp3-server restart
If you get any error, check the dhcpd.conf file, and make shore you put the ; sign after each line (that's the most common mistake).
Install the SSH server (SSH is Secure Shell)
Now it's time to install the SSH server, so we can configure the server remotely. For that, execute the following line :
sudo install openssh-server
From now on, you should be able to configure the server remotely.
Configure PPPoe connection
It's now time to configure the PPPoe connection, so lets do that with
sudo pppoeconf. The program will show you the network cards that it detected and ask you if all of them are visible. If they are, press yes and let it detect which card is connected to a PPPoe server. (I shore hope you've connected the cable to the card , otherwise you won't be able to finish this step
Now if everything went well you can use the following commands :
to initialize a connection use this :
sudo pon dsl-provider
to kill a connection use this :
sudo poff
if you get an error that more than one connection is active, use this instead :
sudo poff -a
to check the connection status, use this :
plogIf plog doesn't show anything it doesn't mean you don't have a connection, only that PPPoe didn't write any log messages in the last few minutes. You can use the next command to see what was the last error or if you're connected :
cat /var/log/syslog |grep pppd
Update and Upgrade your installation
All software installation is done using the apt-get and aptitude commands.
First of all, we need to configure Aptitude to use the Internet sources to find packages, for that execute the following command :
sudo editor /etc/apt/sources.listand uncomment all the deb http://... and deb-src http://... lines, and don't forget to comment the deb cdrom ... line so it doesn't ask for a CD anymore.
You should end up with something similar to this :
# # deb cdrom:[Ubuntu-Server 6.10 _Edgy Eft_ - Release i386 (20061025.1)]/ edgy main restricted #deb cdrom:[Ubuntu-Server 6.10 _Edgy Eft_ - Release i386 (20061025.1)]/ edgy main restricted deb http://ro.archive.ubuntu.com/ubuntu/ edgy main restricted deb-src http://ro.archive.ubuntu.com/ubuntu/ edgy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://ro.archive.ubuntu.com/ubuntu/ edgy-updates main restricted deb-src http://ro.archive.ubuntu.com/ubuntu/ edgy-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://ro.archive.ubuntu.com/ubuntu/ edgy universe deb-src http://ro.archive.ubuntu.com/ubuntu/ edgy universe ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://ro.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse deb-src http://ro.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu edgy-security main restricted deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted deb http://security.ubuntu.com/ubuntu edgy-security universe deb-src http://security.ubuntu.com/ubuntu edgy-security universe
After this we must get Aptitude to update the package list by running this :
sudo aptitude updateAfter this has finished, lets update the instalation by executing
sudo aptitude upgradeThis might take a while (it takes about 10-15 minutes for me) so be patient.














yorkton # 11. April 2007, 19:17
I came across your site as I am looking for information regards Ubuntu server, and your tutorials are just nice and so good explained.
As I tried my first install as a total newbie to Linux, I would like to ask some questions. I know there is the ubuntu forum too, but it's just more personal here. Is this possible ? If so, just write me a mail to ubuntu at yorktondigital dot ca
Thank you for your great site and info.