Installing Debian 9 (Stretch) Minimum Server (page 2)

botond published 2018/12/21, p - 23:09 time

2. page content

 

Continuation

You started on the first page of the description Debian 9 (Stretch) Minimum Server Installation Guide as a continuation of this page we will complete the rest of the installation and configure the basic software so that the system is ready for use.

 

 

Installation

Configure Popularity-contest

The installer asks if we would like to participate in a statistic that sends anonymous packet information:

Install Debian 9 (Stretch) Minimum Server - Configure Popularity-contest

Here, let us decide at our discretion.

Software choice

Here we have to choose the main software and services we require to start the system:

Installing Debian 9 (Stretch) Minimum Server - Software Selection

Extract all the markings from the above sections, with only the bottom two marked. Later, we will install all the necessary packages and services ourselves.

The installer starts and puts the packages of the selected parts:

Installing Debian 9 (Stretch) Minimum Server - Software Selection and Installation

Installing a Grub Boot Loader

You can choose which partition to put in GRUB:

Installing Debian 9 (Stretch) Minimum Server - Installing Grub Bootloader

Here we decide according to our situation. If you have a different operating system on your machine, you can choose to use GRUB to choose which system to boot when you start your machine. But if this is the only system on the machine, then definitely master boot recordinto your computer.

Installing Debian 9 (Stretch) Minimum Server - Configuring a Grub Bootloader

Here, select the hard disk on which GRUB should be physically located. Here, only one device is now connected to the virtual machine.

Finish installation

We have reached the end of the installation process:

Installing Debian 9 (Stretch) Minimum Server - Complete Installation

Remove the installation tool (bootable flash drive, installation DVD, etc.) to stop the machine from starting.

The installer will then reboot the machine.

 

 

Boot System

Installing Debian 9 (Stretch) Minimum Server - Boot System, Grub Menu

When you get started, the standard GRUB menu will appear, select your newly installed system here.

After that comes the access section, and log in here as root, because this is the way to do the rest.

Installing Debian 9 (Stretch) Minimum Server - Login as root

 

Install and configure basic programs

Here we have a simpler thing to do than Install Debian 8 (Jessie) Minimum Server , because more are now included in the base package, so we need to install less.

What we need from the very beginning is dwarf and one SSH server. Both are already part of the core system, so we can see him getting started.

Set Sudo

Command line tasks usually log in as the default user, and we only gain root privileges when needed. This feature is a sudo command. Also, when using remotely (via SSH), root login is disabled anyway, so you can only gain root privileges with sudo. Therefore, you must configure this command.

Sudo is not part of our base system, so we need to install it APT with the package manager:

apt-get install sudo

 

Sudo users are a / Etc / sudoers files, but we never edit this directly, because if we save it incorrectly, we can exclude ourselves from sudo users. For this purpose a visudo we use the command sudoers, which opens the sudoers file in our default editor in the same way, except that visudo also performs a syntax check when saving, before actually saving the editor's temporary contents to the sudoers file. This way we can't save it by mistake, thus excluding ourselves from the sudo list.

 

So run the visudo command:

visudo

add the appropriate base user to the list of sudo users:

[...]
# User privilege specification
root    ALL=(ALL:ALL) ALL
linuxportal  ALL=(ALL:ALL) ALL
[...]

Of course, everyone inserts their own username according to the green line.

Then, if necessary, we can manage the server remotely using the sudo command via SSH, because we can only log in directly from the console as root.

If you want to use the sudo command without a password, you can find out more here.

Set up a network

Install the Network Tools Pack a net-tools package:

apt-get install net-tools

(This package includes, but is not limited to, ifconfig command, which will be useful for example when verifying our IP address.)

The basic installation DHCPwith IP addresses, so the address of the machine can change at any time. Since this is a server installation, it should be set to static so that it always gets the same address.

Edit the following file:

nano /etc/network/interfaces

Original DHCP setup included during installation:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp0s3
iface enp0s3 inet dhcp

Let's do this as follows:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug enp0s3
#iface enp0s3 inet dhcp
auto enp0s3 
iface enp0s3 inet static
	address 192.168.1.120
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1


Obviously, the red lines are commented on or removed, and the green lines contain a static setting that needs to be set.

 

Pay attention to the identifier of the network device as well! In my case it's "enp0s3" But if it's not exactly the same elsewhere, we use the one in the original file! This name is assigned by Debian 9 to the VirtualBoxbased on PCI hardware detected in , so this may differ depending on the individual settings of the network cards.

 

I have thickened the IP address (192.168.1.120) to indicate that I am setting up the virtual machine for this, as before for the Debian 8 base system installation. Here, instead of 120, you can enter anything from 1-255, which address is more sympathetic, or which is free, and so on.

You may also want to set an Address reservation in the router based on the MAC address of the machine or virtual machine, and then DHCP will not allow another device to the same address.

Once you're done, let's restart networking:

service networking restart

Then edit the / etc / hosts file:

nano /etc/hosts

It should look like this:

127.0.0.1       localhost
192.168.1.120   debian9.linuxportal.vm  debian9

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Here's the second line: The statically configured IP address is followed by the hostname of the server with the domain name you specified during installation, and then only the hostname again.

Then look at the / etc / hostname file:

nano /etc/hostname

Here, only the hostname should be a domain name without:

debian9

If the domain name is included, remove it.

Finally, restart your entire machine to take effect on your network settings:

reboot

 

 

Upgrading and upgrading Debian repositories

Finally, we expand the repositories to get the latest packages and the ones that we wouldn't get through the basic settings we need for future server installations.

Open the list of luggage containers:

nano /etc/apt/sources.list

After my recent installation, the original file looks like this:

# 

# deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main

#deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main

deb http://ftp.hu.debian.org/debian/ stretch main
deb-src http://ftp.hu.debian.org/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://ftp.hu.debian.org/debian/ stretch-updates main
deb-src http://ftp.hu.debian.org/debian/ stretch-updates main

Let's expand this so that a contrib and the non-free containers should also be enabled:

# 

# deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main

#deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main

deb http://ftp.hu.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.hu.debian.org/debian/ stretch main contrib non-free

deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free

# stretch-updates, previously known as 'volatile'
deb http://ftp.hu.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.hu.debian.org/debian/ stretch-updates main contrib non-free

Save and then run the repositories and packages upgrade to apt-get commands:

apt-get update
apt-get upgrade

 

Installing VirtualBox Guest Additions

Finally, if you have installed the system in VirtualBox, consider a installation of guest integration services, which is optional, but provides greater hardware compatibility for our installed system, resulting in more stable performance.

 

Conclusion

This is how we built our base system on the Debian 9 (Stretch) line, and we will install many more later to build it into an efficient, fully functional, full-featured shared web server.

 

What's next?

This minimal server can be an excellent basis for example Debian 9 (Stretch) Perfect server to build a stable shared hosting web server that includes many additional features. However, if you want to set up a simpler server configuration, then the Installing Debian 9 (Stretch) LAMP Server v1.0 is.

 

 

The finished server's VirtualBox image file can be downloaded on this page.

 

Navigation

This description consists of several pages: