Sei sulla pagina 1di 4

Ubuntu Server Guide Ubuntu Server Guide Copyright 2014 Contributors to the document Abstract

Welcome to the Ubuntu Server Guide! It contains information on how to install and configure various
server applications on your Ubuntu system to fit your needs. It is a step-by-step, task-oriented guide for
configuring and customizing your system. Credits and License This document is maintained by the
Ubuntu documentation team (https://wiki.ubuntu.com/DocumentationTeam). A list of contributors is
below. This document is made available under the Creative Commons ShareAlike 3.0 License (CC-BYSA). You are free to modify, extend, and improve the Ubuntu documentation source code under the
terms of this license. All derivative works must be released under this license. This documentation is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE AS
DESCRIBED IN THE DISCLAIMER. A copy of the license is available here: Creative Commons
ShareAlike License1 . Contributors to this document are: Members of the Ubuntu Documentation
Project2 Members of the Ubuntu Server Team3 Contributors to the Community Help Wiki4 Other
contributors can be found in the revision history of the serverguide5 and ubuntu-docs6 bzr branches
available on Launchpad. 1 http://creativecommons.org/licenses/by-sa/3.0/ 2
https://launchpad.net/~ubuntu-core-doc 3 https://launchpad.net/~ubuntu-server 4
https://help.ubuntu.com/community/ 5 https://bazaar.launchpad.net/~ubuntu-coredoc/serverguide/trunk/changes 6 https://bazaar.launchpad.net/~ubuntu-core-doc/ubuntudocs/trunk/changes iii Table of Contents 1.
Introduction ............................................................................................................................ 1 1. Support
........................................................................................................................... 2 2.
Installation .............................................................................................................................. 3 1.
Preparing to Install ......................................................................................................... 4 2. Installing
from CD .......................................................................................................... 6 3.
Upgrading ....................................................................................................................... 9 4. Advanced
Installation .................................................................................................... 10 5. Kernel Crash
Dump ...................................................................................................... 17 3. Package
Management ............................................................................................................ 20 1.
Introduction .................................................................................................................. 21 2.
dpkg ............................................................................................................................. 22 3. AptGet ........................................................................................................................ 23 4.
Aptitude ........................................................................................................................ 25 5. Automatic
Updates ........................................................................................................ 27 6.
Configuration ................................................................................................................ 29 7.
References .................................................................................................................... 31 4.
Networking ........................................................................................................................... 32 1.
Network Configuration .................................................................................................. 33 2.
TCP/IP ......................................................................................................................... 42 3. Dynamic
Host Configuration Protocol (DHCP) .............................................................. 46 4. Time
Synchronisation with NTP .................................................................................... 49 5. DMMultipath ....................................................................................................................... 51 1. Device
Mapper Multipathing ......................................................................................... 52 2. Multipath
Devices ......................................................................................................... 55 3. Setting up DMMultipath Overview ............................................................................... 58 4. The DM-Multipath
Configuration File ........................................................................... 62 5. DM-Multipath Administration
and Troubleshooting ........................................................ 74 6. Remote
Administration .......................................................................................................... 79 1. OpenSSH
Server ........................................................................................................... 80 2.
Puppet .......................................................................................................................... 83 3.

Zentyal ......................................................................................................................... 86 7. Network


Authentication ......................................................................................................... 90 1. OpenLDAP
Server ........................................................................................................ 91 2. Samba and
LDAP ....................................................................................................... 117 3.
Kerberos ..................................................................................................................... 123 4. Kerberos and
LDAP .................................................................................................... 131 5. SSSD and Active
Directory ......................................................................................... 138 8. Domain Name Service (DNS)
.............................................................................................. 143 1.
Installation .................................................................................................................. 144 2.
Configuration .............................................................................................................. 145 Ubuntu Server
Guide iv 3. Troubleshooting .......................................................................................................... 151 4.
References .................................................................................................................. 155 9.
Security .............................................................................................................................. 156 1. User
Management ....................................................................................................... 157 2. Console
Security ......................................................................................................... 163 3.
Firewall ...................................................................................................................... 164 4.
AppArmor .................................................................................................................. 171 5.
Certificates .................................................................................................................. 175 6.
eCryptfs ...................................................................................................................... 180 10.
Monitoring ........................................................................................................................ 182 1.
Overview .................................................................................................................... 183 2.
Nagios ........................................................................................................................ 184 3.
Munin ......................................................................................................................... 188 11. Web
Servers ...................................................................................................................... 190 1. HTTPD Apache2 Web Server ................................................................................... 191 2. PHP5 - Scripting
Language ......................................................................................... 199 3. Squid - Proxy
Server ................................................................................................... 201 4. Ruby on
Rails ............................................................................................................. 203 5. Apache
Tomcat ........................................................................................................... 205 12.
Databases .......................................................................................................................... 209 1.
MySQL ....................................................................................................................... 210 2.
PostgreSQL ................................................................................................................. 215 13. LAMP
Applications ........................................................................................................... 218 1.
Overview .................................................................................................................... 219 2. Moin
Moin ................................................................................................................. 220 3.
MediaWiki .................................................................................................................. 222 4.
phpMyAdmin .............................................................................................................. 224 5.
WordPress .................................................................................................................. 226 14. File Servers
....................................................................................................................... 229 1. FTP
Server ................................................................................................................. 230 2. Network File
System (NFS) ........................................................................................ 234 3. iSCSI
Initiator ............................................................................................................. 236 4. CUPS - Print
Server .................................................................................................... 239 15. Email
Services .................................................................................................................. 242 1.
Postfix ........................................................................................................................ 243 2.
Exim4 ......................................................................................................................... 251 3. Dovecot
Server ........................................................................................................... 254 4.
Mailman ..................................................................................................................... 256 5. Mail
Filtering .............................................................................................................. 262 16. Chat

Applications .............................................................................................................. 269 1.


Overview .................................................................................................................... 270 2. IRC
Server .................................................................................................................. 271 Ubuntu Server
Guide v 3. Jabber Instant Messaging Server .................................................................................. 273 17.
Version Control System ..................................................................................................... 275 1.
Bazaar ........................................................................................................................ 276 2.
Git .............................................................................................................................. 277 3.
Subversion .................................................................................................................. 280 4.
References .................................................................................................................. 285 18.
Samba ............................................................................................................................... 286 1.
Introduction ................................................................................................................ 287 2. File
Server .................................................................................................................. 288 3. Print
Server ................................................................................................................. 291 4. Securing File and
Print Server ..................................................................................... 293 5. As a Domain
Controller .............................................................................................. 298 6. Active Directory
Integration ........................................................................................ 302 19.
Backups ............................................................................................................................ 304 1. Shell
Scripts ................................................................................................................ 305 2. Archive
Rotation ......................................................................................................... 309 3.
Bacula ........................................................................................................................ 312 20.
Virtualization .................................................................................................................... 317 1.
libvirt .......................................................................................................................... 318 2. Cloud
images and uvtool ............................................................................................. 323 3. Ubuntu
Cloud ............................................................................................................. 327 4.
LXC ........................................................................................................................... 328 21. Control
Groups ................................................................................................................. 343 1.
Overview .................................................................................................................... 344 2.
Filesystem ................................................................................................................... 345 3.
Delegation .................................................................................................................. 346 4.
Manager ..................................................................................................................... 347 5.
Resources ................................................................................................................... 348 22.
Clustering ......................................................................................................................... 349 1.
DRBD ........................................................................................................................ 350 23.
VPN ................................................................................................................................. 353 1.
OpenVPN ................................................................................................................... 354 24. Other
Useful Applications ................................................................................................. 367 1.
pam_motd ................................................................................................................... 368 2.
etckeeper .................................................................................................................... 370 3.
Byobu ......................................................................................................................... 373 A.
Appendix ........................................................................................................................... 375 1.
Reporting Bugs in Ubuntu Server Edition ..................................................................... 376 vi List of
Tables 2.1. Recommended Minimum Requirements ................................................................................
4 5.1. Priority Checker Conversion ............................................................................................... 52 5.2.
DM-Multipath Components ................................................................................................ 53 5.3.
Multipath Configuration Defaults ........................................................................................ 66 5.4.
Multipath Attributes ........................................................................................................... 70 5.5. Device
Attributes ............................................................................................................... 72 5.6. Useful
multipath Command Options ................................................................................... 77 17.1. Access
Methods .............................................................................................................. 281 1 Chapter 1.

Introduction Welcome to the Ubuntu Server Guide! Here you can find information on how to install
and configure various server applications. It is a stepby-step, task-oriented guide for configuring and
customizing your system. This guide assumes you have a basic understanding of your Ubuntu system.
Some installation details are covered in Chapter 2, Installation [p. 3], but if you need detailed
instructions installing Ubuntu please refer to the Ubuntu Installation Guide1 . A HTML version of the
manual is available online at the Ubuntu Documentation website2 . 1
https://help.ubuntu.com/14.04/installation-guide/ 2 https://help.ubuntu.com Introduction 2 1. Support
There are a couple of different ways that Ubuntu Server Edition is supported, commercial support and
community 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 more information see the Canonical Services3 page. Community support is also provided by
dedicated individuals, and companies, that wish to make Ubuntu the best 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 query can usually provide an
answer to your questions. See the Ubuntu Support4 page for more information. 3
http://www.canonical.com/services/support 4 http://www.ubuntu.com/support 3 Chapter 2. Installation
This chapter provides a quick overview of installing Ubuntu 14.04 LTS Server Edition. For more
detailed instructions, please refer to the Ubuntu Installation Guide1 . 1
https://help.ubuntu.com/14.04/installation-guide/ Installation 4 1. Preparing to Install This section
explains various aspects to consider before starting the installation. 1.1. System Requirements Ubuntu
14.04 LTS Server Edition supports three (3) major architectures: Intel x86, AMD64 and ARM. The
table below lists recommended hardware specifications. Depending on your needs, you might manage
with less than this. However, most users risk being frustrated if they ignore these suggestions. Table
2.1. Recommended Minimum Requirements Hard Drive Space Install Type CPU RAM Base System
All Tasks Installed Server (Standard) 1 gigahertz 512 megabytes 1 gigabyte 1.75 gigabytes Server
(Minimal) 300 megahertz 192 megabytes 700 megabytes 1.4 gigabytes The Server Edition provides a
common base for all sorts of server applications. It is a minimalist design providing a platform for the
desired services, such as file/print services, web hosting, email hosting, etc. 1.2. Server and Desktop
Differences There are a few differences between the Ubuntu Server Edition and the Ubuntu Desktop
Edition. It should be noted that both editions use the same apt repositories, making it just as easy to
install a server application on the Desktop Edition as it is on the Server Edition. The differences
between the two editions are the lack of an X window environment in the Server Edition and the
installation process. 1.2.1. Kernel Differences: Ubuntu version 10.10 and prior, actually had different
kernels for the server and desktop editions. Ubuntu no longer has separate -server and -generic kernel
flavors. These have been merged into a single -generic kernel flavor to help reduce the maintenance
burden over the life of the release. When running a 64-bit version of Ubuntu on 64-bit processors you
are not limited by memory addressing space. To see all kernel configuration options you can look
through /boot/config-3.13.0-server. Also, Linux Kernel in a Nutshell2 is a great resource on the options
available. 2 http://www.kroah.com/lkn/ Installation 5 1.3. Backing Up Before installing Ubuntu
Server Edition you should make sure all data on the system is backed up. See Chapter 19, Backups [p.
304] for backup options. If this is not the first time an operating system has been installed on your
computer, it is likely you will 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 you make a mistake or
something goes wrong during partitioning. The programs used in installation are quite reliable, most
have seen years of use, but they also perform destructive actions. Installation 6 2. Installing from CD
The basic steps to install Ubuntu Server Edition from CD are the same as those for installing any
operating system from CD. Unlike the Desktop Edition, the Server Edition does not include a graphical
installation program. The Server Edition uses a console menu based process instead. First, download
and burn the appropriate ISO file from the Ubuntu web site3 . Boot the system from the CD-ROM

Potrebbero piacerti anche