Still the system is almost minimum. Configure the base system and install basic tools.
APT will search only for the Debian basic software. Adding “contrib” and “non-free” is a must after installing.
# vi /etc/apt/sources.list
Delete unnecessary “cdrom” lines and add “contrib” and “non-free” to each line. “deb-src” can be commented out unless you plan to download the source code.
deb http://ftp.jp.debian.org/debian/ buster main contrib non-free #deb-src http://ftp.jp.debian.org/debian/ buster main contrib non-free deb http://security.debian.org/debian-security buster/updates main contrib non-free #deb-src http://security.debian.org/debian-security buster/updates main contrib non-free # buster-updates, previously known as 'volatile' deb http://ftp.jp.debian.org/debian/ buster-updates main contrib non-free #deb-src http://ftp.jp.debian.org/debian/ buster-updates main contrib non-free
In fact, you only need 3 lines. After editing the apt-line, check if the update completes without errors.
# apt update # apt upgrade
If you have any errors, check the apt-line.
Install basic utilities. The lineup may change according to your server usage. Here is my case.
# apt install dnsutils man-db net-tools nkf rsync telnet tmux wget
Install major programming language execution environments.
# apt install ruby ruby-dev python3 php php7.3-fpm perl
For PHP, the timezone has to be set to php.ini. There are 2 php.ini files, for CLI:/etc/php/7.3/cli/php.ini and FPM:/etc/php/7.3/fpm/php.ini.
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "Asia/Tokyo"
Since I need to display Japanese characters, ja_JP locale has to be added.
# dpkg-reconfigure locales
Then select “ja_JP.UTF-8” to add locales. If you need to use more languages, please select them.
The default locale is recommended to be kept English as described at the Debian installation.
Vi IMproved. If you feel vi is OK to use, please install this to enhance the simple vi editor. If you don’t, you have another choice “Emacs”. I don’t know which is better for you, please have a chance to use both and use whichever you like.
# apt install vim # vi /etc/vim/vimrc
Now you can see the colored config file since the command “vi” now calls “vim”. Here is my case of configuration.
" Vim5 and later versions support syntax highlighting. Uncommenting the next " line enables syntax highlighting by default. syntax on " If using a dark background within the editing area and syntax highlighting " turn on this option as well set background=dark * snip * " Uncomment the following to have Vim load indentation rules and plugins " according to the detected filetype. filetype plugin indent on " The following are commented out as they cause vim to behave a lot " differently from regular Vi. They are highly recommended though. "set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. "set ignorecase " Do case insensitive matching "set smartcase " Do smart case matching set incsearch " Incremental search "set autowrite " Automatically save before commands like :next and :make "set hidden " Hide buffers when they are abandoned "set mouse=a " Enable mouse usage (all modes) * snip * " Additional configuration for me set number set ambiwidth=double
“ntp” will keep the server clock accurate. If the clock is not accurate, the mail timestamps will be affected and communication between AWS S3 will fail.
# apt install ntp
By default, ntp will refer to debian pool servers. Please find your service provider’s nearer ntp server to sync. The configuration file is /etc/ntp.conf. In my case, the VPS provider gave me a template.
# You do need to talk to an NTP server or two (or three). server ntp1.example.jp * snip * * All pools servers are commented out * snip * restrict default ignore restrict -6 default ignore restrict ntp1.example.jp kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict ::1
To apply the changes, restart ntp.
# systemctl restart ntp
If your server has (should have) IPv6 address, configure /etc/network/interfaces to enable it. At the installation, only IPv4 is set up and IPv6 is disabled.
In my case, the network adapter was “ens3”. You can find the information in the configuration file with IPv4 setting lines.
# IPv6 allow-hotplug ens3 iface ens3 inet6 static address 2401:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx gateway xxxx::1 netmask 64 dns-nameservers 2401:xxxx::1
To apply the configuration, restart the server. There should be some process to restart networks, but I just don’t know the proper way…
After reboot, reconnect the server and check if IP addresses are set.
# ip address