FreeBSD14.2_en

FreeBSD14.2_en

FreeBSD14.2 ; OS Install

FreeBSDFreeBSD is UNIX-like open source OS software. In particular, its performance as a network operating system exceeds that of Linux-based systems, and it maintains stable performance even under high loads.FreeBSD is designed to be robust and sturdy with an emphasis on practicality, making it suitable for operating FTP, WWW, and e-mail servers for major companies and services.In this project, we will install FreeBSD 14.2, released on December 3, 2024, and build the server.FeaturesHigh-speed, high-performance multi-platform capable of withstanding high workloadsAdopted by many major companiesNetwork security measures can be applied by restricting accessCapable of operating small to large serversMore than 33,000 dedicated software applications from commercial to personal use
FreeBSD14.2_en

FreeBSD14.2 ; Initial setting (Update binaries, Packages and Ports Collection)

After installing FreeBSD, we will start building the server, but it is difficult to work on the console screen, so we will change the SSH connection settings for now in order to operate the server from Windows using TeraTerm or other software.The OpenSSH server allows password authentication login by default.If the service is enabled, you can log in remotely.Confirm validity of sshd service
FreeBSD14.2_en

FreeBSD14.2 ; Initial setup (Vim , SSH , Firewall, NTP server)

1. Vim InstallInstall Vim, which you are familiar with as an editor, as follows# pkg install -y vimEdit the ".shrc" to make Vim available as the standard editor, and log in again to reflect the change.FreeBSD14 has sh as default shell.You can check the current SHELL with the following command2. Use of locate databaseOn FreeBSD, I get the following error when using updatedb3. SSH Connection Security Measures3.1 SSH port changed, root user login disabled
FreeBSD14.2_en

FreeBSD14.2 ; WEB Server(Apache2) , MySQL8

1. Apache21.1 Install# cd /usr/ports/www/apache24# make configThere are many options, but we will proceed wit1. Apache21.1 Install# cd /usr/ports/www/apache24# make configThere are many options, but we will proceed wit
FreeBSD14.2_en

FreeBSD14.2 ; FTP Server , Samba Fileserver

1. FTP(Vsftpd)1.1 advance preparation①Private Key Creation# cd /etc/ssl# openssl genrsa -des3 -out server.key 2048Enter PEM pass phrase:Verifying - Enter PEM pass phrase:➁Passphrase Deletion2. File Server with SambaUse Samba to build a file server for Windows and Mac file sharing2.1 Samba Install# cd /usr/ports/net/samba416/# make configRemove the active directory relationships for ADS and AD_DC, as they will not be used this time.LDAP is also removed because account management is not done through LDAP.By default, Zeroconf Support is checked for AVAHI, but change it to MDNSRESPONDER
FreeBSD14.2_en

FreeBSD14.2 ; Mail Server(Postfix,Dovecot),SSL/TLS

1. Obtaining a certificate for the mail serverObtain a certificate for the mail server to convert the mail server to SSL/TLS.Use the certbot that was used when the web server was converted to SSL.Stop the web server and execute the following command
FreeBSD14.2_en

FreeBSD14.2 ; Web Server SSL、Webmin

1. Web server (Apache) SSL conversionThe ports can be further updated with FreeBSD's periodic job settings.Install certbot via pkg, and include a plugin for apache to update in webroot mode.1.1 Installing the Certbot tool for Let's EncryptRun the following command to install the Certbot package and the Apache HTTP plug-in
FreeBSD14.2_en

FreeBSD14.2 ; Postfix ClamAV + Amavis + SpamassAssin

Install ClamAV on FreeBSD 14.1 and link it with Amavis against Postfix.ClamAV is anti-virus software.We will proceed on the assumption that you have already implemented Postfix.Before proceeding, update the Ports Collection.1. ClamAV1.1 Install# cd /usr/ports/security/clamav# make install cleanEach option is installed by default for nowclamav version check
FreeBSD14.2_en

FreeBSD14.2 ; Jail Install

JailIt is a mechanism that allows multiple virtual FreeBSD environments to be created on a FreeBSD environment.A jail is an extension of chroot, and a jail environment (called a prisoners) built on a host ring (called a jailer) behaves as a FreeBSD machine running separately from the host environment.The prisoner cannot directly attach to the jailer or another parallel prisoner.Features of JAIL・High speed operation because it is not emulation.・Each prisoner can be assigned an IP address different from that of the jailer.・Since the same file system is used for a jailer and a prisoner, it is necessary to be careful about the assignment of UID/GID.This time, build two prisoners (prisoner1 and prisoner2) in jailer (FreeBSD14.2)Building Jail1.Creation of PRISONER base directoryCreate a directory (jail) that will be the root directory for prisoner1 and prisoner2. In this case, we will create them in /home, but you can create them anywhere you like.