Ubuntu Server Guide

Transcription

Welcome to the Ubuntu Server Guide!Changes, Errors, and BugsThis is the preliminary and in development for Ubuntu 20.04 LTS, Focal Fossa. Contents may have errorsand omissions. Ubuntu serverguides for previous LTS versions: 18.04 (PDF), 16.04 (PDF).If you find any errors or have suggestions for improvements to pages, please use the link at the bottom ofeach topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourseforum for the specific page you are viewing. There you can share your comments or let us know about bugswith each page.OfflineDownload this guide as a PDFSupportThere are a couple of different ways that Ubuntu Server Edition is supported: commercial support andcommunity support. The main commercial support (and development funding) is available from Canonical,Ltd. They supply reasonably- priced support contracts on a per desktop or per server basis. For moreinformation see the Ubuntu Advantage page.Community support is also provided by dedicated individuals and companies that wish to make Ubuntu thebest distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs,wikis, etc. The large amount of information available can be overwhelming, but a good search engine querycan usually provide an answer to your questions. See the Ubuntu Support page for more information.Welcome to the Ubuntu Server Guide!Changes, Errors, and BugsThis is the preliminary and in development for Ubuntu 20.04 LTS, Focal Fossa. Contents may have errorsand omissions. Ubuntu serverguides for previous LTS versions: 18.04 (PDF), 16.04 (PDF).If you find any errors or have suggestions for improvements to pages, please use the link at the bottom ofeach topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourseforum for the specific page you are viewing. There you can share your comments or let us know about bugswith each page.OfflineDownload this guide as a PDFSupportThere are a couple of different ways that Ubuntu Server Edition is supported: commercial support andcommunity support. The main commercial support (and development funding) is available from Canonical,Ltd. They supply reasonably- priced support contracts on a per desktop or per server basis. For moreinformation see the Ubuntu Advantage page.1

Community support is also provided by dedicated individuals and companies that wish to make Ubuntu thebest distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs,wikis, etc. The large amount of information available can be overwhelming, but a good search engine querycan usually provide an answer to your questions. See the Ubuntu Support page for more information.Navigation IntroductionInstall InstallationInstallation - AdvancedInstallation - iSCSIPackage ManagementKernel Crash DumpReporting BugsUpgrade - IntroductionStorage onfigurationSetupUsage & DebugNetwork DKSecurity leVirtualization Introductionqemulibvirtmultipass2

uvt virt toolsContainers lxd lxcServices Databases - IntroductionDatabases - MysqlDatabases - PostgreSQLSamba - IntroductionSamba - Active DirectorySamba - Domain ControllerSamba - File ServerSamba - Print ServerSamba - SecuringSamba - OpenLDAP BackendService - CUPSService - Domain Name Service (DNS)Service - FTPService - iSCSIService - KerberosService - Kerberos with OpenLDAP backendService - LDAPService - LDAP Access ControlService - LDAP ReplicationService - LDAP UsageService - LDAP with TLSService - NFSService - OpenSSHService - OpenVPNService - gitoliteVPN ClientsService - SSSDMail - IntroductionMail - DovecotMail - Exim4Mail - PostfixProxy Servers - SquidWeb Servers - IntroductionWeb Servers - ApacheUbuntu High Availability HAHAHAHAHA-IntroductionCorosyncPacemakerPacemaker - Resource AgentsPacemaker - Fence Agents3

HA - DRBDTools logwatchbyobuetckeepermuninnagiospam motdPuppetMonitoringrsnapshotProgramming PHP Ruby on RailsBackups IntroductionArchive RotationBaculaShell ScriptsLAMP LAMP ApplicationsURLs[details Mapping table] Topic Path – – https://discourse.ubuntu.com/t/installation/11322 /server/docs/introduction https://discourse.ubuntu.com/t/installation/11320 /server/docs/installation ed/11577 /server/docs/installationadvanced 11321 /server/docs/installation-iscsi 11908 /server/docs/package-management 1575 /server/docs/kernel-crash-dump 8 /server/docs/reporting-bugs 576 /server/docs/upgrade-introduction athing-introduction/11316 on pathing-configuration/11569 on pathingsetup/11568 /server/docs/device-mapper-multipathing-setup athing-usage-debug/11317 g n/11875 /server/docs/network-introduction on/11876 /server/docs/network-configuration https://discourse.ubuntu.com/t/network-dhcp/11877 /server/docs/network-dhcp https://discourse.ubuntu.com/t/networntp/11878 /server/docs/network-ntp https://discourse.ubuntu.com/t/network-dpdk/11879 4

/server/docs/network-dpdk 085 /server/docs/openvswitchdpdk on/11887 /server/docs/security-introduction 1 /server/docs/security-users 84 /server/docs/security-apparmor 1883 /server/docs/security-firewall es/11885 /server/docs/securitycertificates 882 /server/docs/security-console 1886 /server/docs/security-ecryptfs https://discourse.ubuntu.com/t/vintroduction/11521 /server/docs/virtualization-introduction pass/11983 /server/docs/virtualization-multipass 11523 /server/docs/virtualization-qemu rt/11522 /server/docs/virtualization-libvirt 1524 /server/docs/virtualization-uvt tools/13436 /server/docs/virtualization-virt-tools https://discourse.ubuntu.com/t/containerslxd/11525 /server/docs/containers-lxd 6 /server/docs/containers-lxc ion/11315 /server/docs/databasesintroduction 15 /server/docs/databases-mysql l/11516 /server/docs/databases-postgresql ory/11893 /server/docs/samba-active-directory ller/11892 /server/docs/samba-domaincontroller 1889 /server/docs/samba-file-server 11888 /server/docs/samba-introduction 11890 /server/docs/samba-print-server 1 /server/docs/samba-securing /15698 /server/docs/samba-openldap-backend https://discourse.ubuntu.com/t/servicecups/11573 /server/docs/service-cups -servicedns/11318 /server/docs/service-domain-name-service-dns https://discourse.ubuntu.com/t/serviceftp/11319 /server/docs/service-ftp n/11570 /server/docs/service-introduction https://discourse.ubuntu.com/t/service-iscsi/11572 /server/docs/serviceiscsi 331 /server/docs/service-kerberos 356 /server/docs/service-kerberos-with-openldapbackend https://discourse.ubuntu.com/t/service-ldap/11329 /server/docs/service-ldap /15583 /server/docs/service-ldap-access-control tion/15508 /server/docs/service-ldap-replication 1330 /server/docs/service-ldap-usage s/11578 /server/docs/service-ldap-with-tls https://discourse.ubuntu.com/t/service-nfs/11571 /server/docs/service-nfs 96 /server/docs/serviceopenssh 94 /server/docs/service-openvpn 900 /server/docs/service-gitolite https://discourse.ubuntu.com/t/vpnclients/11895 /server/docs/vpn-clients https://discourse.ubuntu.com/t/service-sssd/11579 /server/docs/service-sssd 66 /server/docs/chatirc-server https://discourse.ubuntu.com/t/mail-dovecot/11880 /server/docs/mail-dovecot https://discourse.ubuntu.com/t/mail-exim4/11530 /server/docs/mail-exim4 324 /server/docs/mail-introduction https://discourse.ubuntu.com/t/mail-mailman/11531 /server/docs/mail-mailman https://discourse.ubuntu.com/t/mail-postfix/11325 /server/docs/mailpostfix /11511 /server/docs/proxy-servers-squid 11510 /server/docs/web-servers-apache tomcat/11512 /server/docs/web-servers-apachetomcat ction/11509 /server/docs/web-serversintroduction ion/15813 /server/docs/ubuntu-haintroduction -resource-agents-supportability/15729 upportability fence-agents-supportability/15768 rtability 4 /server/docs/ubuntu-ha-drbd https://discourse.ubuntu.com/t/tools-byobu/11907 /server/docs/tools-byobu https://discourse.ubuntu.com/t/tools5

etckeeper/11906 /server/docs/tools-etckeeper https://discourse.ubuntu.com/t/tools-munin/11904 /server/docs/tools-munin https://discourse.ubuntu.com/t/tools-nagios/11903 /server/docs/tools-nagios 5 /server/docs/pam-motd https://discourse.ubuntu.com/t/toolspuppet/11897 /server/docs/tools-puppet https://discourse.ubuntu.com/t/tools-zentyal/11898 /server/docs/tools-zentyal tion/11326 /server/docs/monitoringintroduction 36 /server/docs/tools-rsnapshot 14 /server/docs/programming-php -rails/11513 /server/docs/programming-ruby-onrails n/11312 /server/docs/backups-introduction ation/11519 /server/docs/backups-archiverotation 0 /server/docs/backups-bacula ts/11518 /server/docs/backups-shell-scripts https://discourse.ubuntu.com/t/workload-lamp/11323 /server/docs/workload-lamp 902 /server/docs/lamp-applications [/details]Redirects[details Mapping table] Path Location – – [/details]InstallationThis chapter provides a quick overview of installing Ubuntu 20.04 Server Edition. For more detailed instructions, please refer to the Ubuntu Installation Guide.Preparing to InstallThis section explains various aspects to consider before starting the installation.System RequirementsUbuntu 20.04 Server Edition provides a common, minimalist base for a variety of server applications, suchas file/print services, web hosting, email hosting, etc. This edition supports five (5) major architectures:AMD64, ARM, POWER9, LinuxONE and z Systems, and introduces initial support for RISC-V.The “live server” installer (sometimes called “Ubiquity for Servers” or simply “Subiquity”) provides a userfriendly and fast installation experience.The table below lists the recommended minimum hardware specifications. Depending on your needs, youmight manage with less than this, but it is not generally recommended.Install TypeCPURAMHard Drive SpaceServer (Standard)live serverServer (Minimal)1 gigahertz1 gigahertz (amd64 only)300 megahertz512 megabytes1 gigabyte384 megabytes1.5 gigabyte1.5 gigabyte1.5 gigabytes62.5 gigabytesn/a2.5 gigabytes

Server and Desktop DifferencesThe Ubuntu Server Edition and the Ubuntu Desktop Edition use the same apt repositories, making it justas easy to install a server application on the Desktop Edition as on the Server Edition.One major difference is that the graphical environment used for the Desktop Edition is not installed forthe Server. This includes the graphics server itself, the graphical utilities and applications, and the varioususer-supporting services needed by desktop users.The Server Edition’s kernel used to be tuned differently from Desktop, but currently, both rely on the sameLinux configuration.Backing Up Before installing Ubuntu Server Edition you should make sure all data on the system is backed up.If this is not the first time an operating system has been installed on your computer, it is likely youwill need to re-partition your disk to make room for Ubuntu.Any time you partition your disk, you should be prepared to lose everything on the disk should youmake a mistake or something goes wrong during partitioning. The programs used in installation arequite reliable, most have seen years of use, but they also perform destructive actions.Installing using the live server installerThe basic steps to install Ubuntu Server Edition are the same as those for installing any operating system.Unlike the Desktop Edition, the Server Edition does not include a graphical installation program. The LiveServer installer uses a text-based console interface which runs on the default virtual console. The interfacecan be entirely driven by the enter, up and down arrow keys (with some occasional typing).During the installation, you can switch to a different console (by pressing Ctrl-Alt-F n or Ctrl-Alt-Right)to get access to a shell, if needed. Up to the point where the installation begins, you can use the “back”button to go back to previous screens and choose different options. Download the appropriate ISO file from the Ubuntu Server Download Page. Boot the system from media (e.g. USB key) containing the ISO file. At the boot prompt you will be asked to select a language. From the main boot menu there are some additional options to install Ubuntu Server Edition. Youcan install a basic Ubuntu Server, check the installation media for defects, check the system’s RAM,or boot from first hard disk. The rest of this section will cover the basic Ubuntu Server install. After booting into the installer, it will ask you which language to use. Next, the installation process begins by asking for your keyboard layout. You can ask the installer toattempt auto-detecting it, or you can select it manually from a list. Later stages of the installationwill require you to type ASCII characters, so if the layout you select does not allow that, you will beprompted for a key combination to switch between a layout that does and the one you select. Thedefault keystroke for this is Alt Shift. Next, the installer offers the choice to install the system as a vanilla Ubuntu server, a MAAS bare-metalcloud rack controller or a MAAS region controller. If you select one of the MAAS options you will beasked for some details.7

The installer configures the network to run DHCP on each network interface. If this is not sufficientto get access to the internet you should configure at least one interface manually. Select an interfaceto configure it. If the Ubuntu archive can only be accessed via a proxy in your environment, it can be entered on thenext screen. Leave the field blank if it is not required. You can then choose to let the installer use an entire disk or configure the partitioning manually. Thefirst disk you create a partition on will be selected as the boot disk and have an extra partition createdon it to contain the bootloader; you can move the boot partition to a different drive with the “Selectas boot disk” button.Once you move on from this screen, the installation progress will begin. It will not be possible to moveback to this or previous screens and any data on the disks you have configured the installer to use willbe lost. The next screen configures the initial user for the system. You can import SSH keys from Launchpador Github but a password is still required to be set, as this user will have root access through the sudoutility. The final screen shows the progress of the installer. Once the installation has completed, you will beprompted to reboot into your newly installed system.Advanced InstallationSoftware RAIDRedundant Array of Independent Disks “RAID” is a method of using multiple disks to provide differentbalances of increasing data reliability and/or increasing input/output performance, depending on the RAIDlevel being used. RAID is implemented in either software (where the operating system knows about bothdrives and actively maintains both of them) or hardware (where a special controller makes the OS thinkthere’s only one drive and maintains the drives ‘invisibly’).The RAID software included with current versions of Linux (and Ubuntu) is based on the ‘mdadm’ driverand works very well, better even than many so-called ‘hardware’ RAID controllers. This section will guideyou through installing Ubuntu Server Edition using two RAID1 partitions on two physical hard drives, onefor / and another for swap.RAID ConfigurationFollow the installation steps until you get to the Guided storage configuration step, then:Select Custom storage layout.Create the /boot partition in a local disk. So select one of the devices listed in available devices and AddGPT Partition. Next, enter the partition size, then choose the desired Format (ext4) and /boot as mountpoint. And finally, select Create.Now to create the RAID device select Create soft

Welcome to the Ubuntu Server Guide! Changes, Errors, and Bugs This is the preliminary and in development for Ubuntu 20.04 LTS, Focal Fossa. Contents may have errors and omissions. Ubuntu servergu