Project

General

Profile

Setting Up NeatRack Server

User documentation
12/30/2021

  • Last Updated: 01/03/2022

Setting Up

Before we get started on setting up our server, we need to get some equipment together. You'll need to get the following items and connect them to the server:

-A monitor

-A keyboard

-A power cable

-A network cable

Note: The network cable will need to plug into a switch that will allow the server to get an IP address. Ask a network engineer for help on where to plug your network cable.

Downloading Debian and Getting USB Drive Ready

1.) Go to debian.org to download Debian 11 Bullseye

2.) Now go to https://rufus.ie/ to download Rufus, which is used to format your USB so that it'll be bootable.

3.) Once Rufus is downloaded, double-click on executable rufus-3.4.exe (or something similar) file

4.) Now, you'll need to insert a USB drive into your computer/laptop

5.) On the Rufus Program, under the Device section, select your USB drive.

6.) Under the Boot selection section, hit Select and choose your Debian ISO image.

7.) At the bottom of the Rufus Program, select Start to format your USB to be bootable.

8.) Once Rufus is done formatting your USB and before you eject the USB drive, be sure to look at the size of the USB drive. You can do this by going to your desktop's file explorer and selecting the USB drive.

9.) Eject the USB drive from your computer by going to your computer's file explorer and selecting the Eject/Unmount option This will make sure that any files are closed so that when you unplug the USB drive from your computer, your files won't corrupt or go missing.

Installing Debian on NeatRack Server

1.) Plug the USB drive into the server and power on the server

2.) As the server is powering go into the boot options menu. Depending on your setup, there are a few ways to get to the boot menu.

  • HP PC: F9
  • HP server: F11
  • Dell PC: F8/F11/F12
  • Dell server: F11/F12

3.) Use the arrow keys to go to the Boot menu.

4.) Use the arrow keys to select your USB drive and press Enter to boot from that USB drive.

5.) Once, you've selected to boot from your USB drive, press the F10 key to save your changes and exit out of the BIOS.

Basic Setup

1.) Once the Debian installer pops up, select Install, which should be the second option in the list of installation options

2.) Select English as your language

3.) Select United States as your location

4.) Use the American English keyboard

5.) Configure the hostname to be srv-neatrack (srv stands for server it is a naming convention that Richweb uses in order to keep track of devices).

6.) Skip the domain name section, or you can name it something else like the example <neatrack.local>

7.) Set the root password to be 15.learner and reenter the password to verify

8.) Set the new user name to be sysadmin and keep sysadmin for the username

9.) Set the password for sysadmin as 15.learner and reenter it to verify

10.) Configure the clock for Eastern

Partitioning the Server

1.) On the Partition disks section select Manual for the Partitioning method

Note: There may be two or more hard drives listed on the partitioning section, one of these is your USB drive that you are using to put Debian onto your server.

Note: You should know the size of your USB drive, for it should be significantly smaller than other hard drives.

Note: It may be listed as Specific Storage Device or something similar. You DO NOT want to partition your USB drive.

2.) If there are already partitions on the HD, select the partition and select Delete the partition

3.) Do this for each existing partition

4.) Once the partitions are deleted, you should see one partition listed as FREE SPACE

5.) Now, select the FREE SPACE partition and select Create a new partition

6.) Set the new partition size to be 60 GB and hit Continue

7.) Select Logical for the partition type and put the partition at the End

8.) In the Partition settings, set the mount point to be /data by selecting Enter manually and typing data after the forward slash (/), then hit Continue

9.) Then select Done setting up the partition to finish setting up your first partition

10.) Select the free space again, and Select Create a new partition

11.) On the partition size section, leave the default amount and select continue

12.) Set this partition type to be Primary and the mount point should be set at default to root ( which is /)

13.) Select Done setting up the partition

14.) Now select Finish partitioning and write changes to disk

15.) You will get an error saying that you have not set a partition for swap and will be asked to make a swap partition. When it asks if you want to return to the partitioning menu, select No

16.) Now you should see a screen with a line at the bottom saying Write changes to disks? You want to select Yes

Finishing the Install

1.) Now you should see an install occurring, this will take a while to finish

2.) Once the install is complete, you should see a Configure the Package Manager section, you want to select United States and then select the default, which should be deb.debian.org

3.) If you see that you need a HTTP proxy, leave this section blank and select Continue

4.) Now, it should be installing the software. If you see a message about participating in a package usage survey, select No.

5.) Once that is finish, you should see a software selection. Deselect the Debian desktop environment, and GNOME options. Instead select the SSH server option, so only the SSH server and standard system utilities are selected. Then select Continue

6.) If you see an Install the Grub boot loader message and are asked to install the GRUB boot loader to the primary drive, you want to select Yes, because that is where Debian is booted from and without it, you might not be able to boot.

7.) To select the device the boot loader will be installed on, make sure it is NOT your USB. You should be putting GRUB on your partitioned hard drive.

8.) Once the installation is finished, you should see a prompt to remove the installation media (USB) from the server. Remove the USB and select Continue.

9.) Once the server is booted back up into Debian, you should be prompted to log in. Use root as the username and 15.learner for the password, like you set up in step seven of Basic Setup.

Before Installing Packages

Once you've logged into your server, there are a few more things to do before our server is finished.

In order to be able to install packages, you'll need to have a network connection. Run the command "ip a" to see what network interface you may have, it could be something like eth0, ens1, or enp2s0.

You'll need to identify what interface has an network connection, by looking for an interface with a State of UP. This is a sample of what the command "ip a" should look like:

When you find that interface, edit the /etc/network/interfaces file using nano (nano /etc/network/interfaces) and configure or verify that the interface is configured to receive a DHCP address similar to the example below.

#The primary network interface 

allow-hotplug enp3s0 

iface enp3s0 inet dhcp

Once, you've done that, use Ctrl + O to Write to the File and hit Enter to make sure changes. Then use Ctrl + X to Exit out of editing our file.

In order for our changes to take effect, we'll need to restart the networking service, so our interface will be able to get an IP address. To do this, run:

service networking restart

Run the ip a command again. You should see that your interface now has an IP address. If it doesn't make sure that the cables are hooked up properly and that you've configured the correct interface.

Before we can start installing packages, we need to make sure we have Internet connectivity. An easy way to do this, is to use the ping command. This simply tries to reach out to an IP address to make sure it's up.

Let's ping Google's DNS server's IP address to make sure we can get there with the following command:

ping 8.8.8.8

Some of our packages also require DNS resolution in order to install. DNS stands for Domain Name Resolution and it maps a domain name (richweb.com) to an IP address (10.10.10.10). To check DNS resolution, we'll try to ping to google.com with the following command:

ping google.com

If you were able to ping both 8.8.8.8 and google.com, you're all set to install packages!

Installing Packages

1.) Change repositories in /etc/apt/sources.list

In order to get any more packages, we need to add the repositories that we'll need so that we can get to those packages. To do this edit the /etc/apt/sources.list file using nano (nano /etc/apt/source.list) and edit the repositories to include contrib non-free at the end of each line

example:

change this

deb http://deb.debian.org/debian bullseye main

to this

deb http://deb.debian.org/debian bullseye main contrib non-free

Once, you've added those, save the file and exit out of the file.

2.) Now you need to update and upgrade the server:

apt update && apt upgrade -y

These are two separate commands added onto the same line using &&, the second command will not be run if the first isn't successful. apt update updates any of the packages that have been installed on the server and apt upgrade upgrades any packages that have been installed. The -y indicates that instead of being prompted to continue with the update/upgrade, the Yes option will be filled automatically.

3.) Now, you'll need to install some tools by runnning the following command:

apt install -y ncftp bash-completion vim-tiny subversion

One of the tools you installed was subversion. Subversion is software used to keep up with documentation when many people have access to it. This ensures that documentation keeps up to date when new changes are made or when documentation is added. Subversion is needed to checkout all of the scripts that you'll need for your server. You'll do this with the following command:

svn co https://svn.globalweb.net:2396/svnpub/rwtrainer/kvm_shared/ /opt/shared

What the command above does is checkout the repository from the URL (https://svn.globalweb.net:2396/svnpub/rwtrainer/kvm_shared/) and put it in the /opt/shared directory.

You'll be prompted to type in a username and password in order to checkout the NeatRack repository.

  • username: rwtrainer
  • password: 15.learner

It is ok to save password in plain-text if prompted

4.) Now that you've checked out the NeatRack repository, you'll need to setup some additional tools that Richweb uses to make troubleshooting easier. You can do this by issuing the following commands one at a time:

/opt/shared/scripts/setup_perl_env.pl
/opt/shared/scripts/install_packages
/opt/shared/scripts/build_bash_env.pl

Richweb uses aliases to decrease the amount of typing one does by matching a script or command to a word that can be used to run that script or command. There are a few that you'll have to use in NeatRack. To make sure that the aliases work, run each of the commands:

. /etc/bashrc
alias cl
cd /etc/; cl

This simply restarts the bash file containing the aliases in the first command. The second command shows what the alias cl is suppose to represent as shown:

alias cl='/opt/shared/scripts/clean_file_cruft.sh'

Then, the last command first changes the directory (cd) to /etc and second runs the alias cl.

5.) In order to be able to access the server from your computer/laptop via Serial/Console cable, you'll need to set GRUB up for serial access and then update GRUB.

/bin/cp -f /opt/shared/etc/jessie/grub /etc/default/grub

This command copies the configuration in the /opt/shared/etc/jessie/grub file and pastes it in the /etc/default/grub file.

Then you can update grub so that it'll use the new configuration.

update-grub

6.) You'll probably want to be able to access the server remotely, so you'll need to enable SSH (Secure Shell) access to the server.

nano /etc/ssh/sshd_config

Then change the line

"#PermitRootLogin no-password" 

to

"PermitRootLogin yes" 

This will allow you to log into the server with root. Save and exit the file.

Now you'll need to restart SSH for the change to take effect using this command:

/etc/init.d/ssh restart

After you've restarted ssh, try to remotely log into the server using the IP address you should have gotten from DHCP earlier.

Lastly, there are a few packages that are needed in order to create virtual machines that you'll be using in later labs. You'll need to install them using the following command:

apt install -y bridge-utils libvirt-daemon-system libvirt-dev libvirt-clients

And that's it! Now you should have a fully functional server for your NeatRack.

Files

ip_a.png (89.2 KB) ip_a.png Chloe Martin, 01/03/2022 03:23 PM