1
# Dutch translation for ubuntu-docs
2
# Copyright (c) (c) 2006 Canonical Ltd, and Rosetta Contributors 2006
3
# This file is distributed under the same license as the ubuntu-docs package.
4
# FIRST AUTHOR <EMAIL@ADDRESS>, 2006.
8
"Project-Id-Version: ubuntu-docs\n"
9
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10
"POT-Creation-Date: 2009-04-09 23:58+0100\n"
11
"PO-Revision-Date: 2009-04-10 06:58+0000\n"
12
"Last-Translator: Launchpad Translations Administrators "
13
"<rosetta@launchpad.net>\n"
14
"Language-Team: Dutch <nl@li.org>\n"
16
"Content-Type: text/plain; charset=UTF-8\n"
17
"Content-Transfer-Encoding: 8bit\n"
18
"X-Launchpad-Export-Date: 2009-07-13 07:26+0000\n"
19
"X-Generator: Launchpad (build Unknown)\n"
21
#: serverguide/C/serverguide-C.omf:6(creator) serverguide/C/serverguide-C.omf:7(maintainer)
22
msgid "ubuntu-doc@lists.ubuntu.com (Ubuntu Documentation Project)"
24
"ubuntu-doc@lists.ubuntu.com (Ubuntu-documentatieproject, Engelstalig)"
26
#: serverguide/C/serverguide-C.omf:8(title) serverguide/C/serverguide-C.omf:11(description) serverguide/C/serverguide.xml:14(title) serverguide/C/bookinfo.xml:13(title)
27
msgid "Ubuntu Server Guide"
30
#: serverguide/C/serverguide-C.omf:9(date)
34
#: serverguide/C/windows-networking.xml:13(title)
35
msgid "Windows Networking"
38
#: serverguide/C/windows-networking.xml:15(para)
40
"Computer networks are often comprised of diverse systems, and while "
41
"operating a network made up entirely of Ubuntu desktop and server computers "
42
"would certainly be fun, some network environments must consist of both "
43
"Ubuntu and <trademark class=\"registered\">Microsoft</trademark><trademark "
44
"class=\"registered\">Windows</trademark> systems working together in "
45
"harmony. This section of the <phrase>Ubuntu</phrase> Server Guide introduces "
46
"principles and tools used in configuring your Ubuntu Server for sharing "
47
"network resources with Windows computers."
50
#: serverguide/C/windows-networking.xml:25(title) serverguide/C/virtualization.xml:397(title) serverguide/C/security.xml:412(title) serverguide/C/remote-administration.xml:22(title) serverguide/C/package-management.xml:20(title) serverguide/C/jeos.xml:16(title) serverguide/C/introduction.xml:13(title)
54
#: serverguide/C/windows-networking.xml:27(para)
56
"Successfully networking your Ubuntu system with Windows clients involves "
57
"providing and integrating with services common to Windows environments. Such "
58
"services assist the sharing of data and information about the computers and "
59
"users involved in the network, and may be classified under three major "
60
"categories of functionality:"
63
#: serverguide/C/windows-networking.xml:35(para)
65
"<emphasis role=\"bold\">File and Printer Sharing Services</emphasis>. Using "
66
"the Server Message Block (SMB) protocol to facilitate the sharing of files, "
67
"folders, volumes, and the sharing of printers throughout the network."
70
#: serverguide/C/windows-networking.xml:41(para)
72
"<emphasis role=\"bold\">Directory Services</emphasis>. Sharing vital "
73
"information about the computers and users of the network with such "
74
"technologies as the Lightweight Directory Access Protocol (LDAP) and "
75
"Microsoft <trademark class=\"registered\">Active Directory</trademark>."
78
#: serverguide/C/windows-networking.xml:48(para)
80
"<emphasis role=\"bold\">Authentication and Access</emphasis>. Establishing "
81
"the identity of a computer or user of the network and determining the "
82
"information the computer or user is authorized to access using such "
83
"principles and technologies as file permissions, group policies, and the "
84
"Kerberos authentication service."
87
#: serverguide/C/windows-networking.xml:56(para)
89
"Fortunately, your Ubuntu system may provide all such facilities to Windows "
90
"clients and share network resources among them. One of the principal pieces "
91
"of software your Ubuntu system includes for Windows networking is the Samba "
92
"suite of SMB server applications and tools."
95
#: serverguide/C/windows-networking.xml:62(para)
97
"This section of the <phrase>Ubuntu</phrase> Server Guide will introduce some "
98
"of the common Samba use cases, and how to install and configure the "
99
"necessary packages. Additional detailed documentation and information on "
100
"Samba can be found on the <ulink url=\"http://www.samba.org\">Samba "
104
#: serverguide/C/windows-networking.xml:70(title)
105
msgid "Samba File Server"
108
#: serverguide/C/windows-networking.xml:72(para)
110
"One of the most common ways to network Ubuntu and Windows computers is to "
111
"configure Samba as a File Server. This section covers setting up a "
112
"<application>Samba</application> server to share files with Windows clients."
115
#: serverguide/C/windows-networking.xml:77(para)
117
"The server will be configured to share files with any client on the network "
118
"without prompting for a password. If your environment requires stricter "
119
"Access Controls see <xref linkend=\"samba-fileprint-security\"/>"
122
#: serverguide/C/windows-networking.xml:83(title) serverguide/C/windows-networking.xml:282(title) serverguide/C/windows-networking.xml:1279(title) serverguide/C/web-servers.xml:41(title) serverguide/C/web-servers.xml:669(title) serverguide/C/web-servers.xml:804(title) serverguide/C/web-servers.xml:925(title) serverguide/C/virtualization.xml:62(title) serverguide/C/virtualization.xml:1341(title) serverguide/C/vcs.xml:28(title) serverguide/C/vcs.xml:86(title) serverguide/C/vcs.xml:400(title) serverguide/C/remote-administration.xml:52(title) serverguide/C/remote-administration.xml:220(title) serverguide/C/network-config.xml:625(title) serverguide/C/network-auth.xml:52(title) serverguide/C/network-auth.xml:1230(title) serverguide/C/network-auth.xml:1736(title) serverguide/C/network-auth.xml:2127(title) serverguide/C/mail.xml:33(title) serverguide/C/mail.xml:297(title) serverguide/C/mail.xml:470(title) serverguide/C/mail.xml:614(title) serverguide/C/mail.xml:1103(title) serverguide/C/lamp-applications.xml:108(title) serverguide/C/lamp-applications.xml:275(title) serverguide/C/lamp-applications.xml:391(title) serverguide/C/installation.xml:13(title) serverguide/C/installation.xml:907(title) serverguide/C/file-server.xml:342(title) serverguide/C/file-server.xml:454(title) serverguide/C/dns.xml:23(title) serverguide/C/databases.xml:40(title) serverguide/C/databases.xml:159(title) serverguide/C/chat.xml:37(title) serverguide/C/chat.xml:134(title) serverguide/C/backups.xml:593(title)
126
#: serverguide/C/windows-networking.xml:85(para)
128
"The first step is to install the <application>samba</application> package. "
129
"From a terminal prompt enter:"
132
#: serverguide/C/windows-networking.xml:90(command) serverguide/C/windows-networking.xml:294(command)
133
msgid "sudo apt-get install samba"
136
#: serverguide/C/windows-networking.xml:93(para)
138
"That's all there is to it; you are now ready to configure Samba to share "
142
#: serverguide/C/windows-networking.xml:99(title) serverguide/C/windows-networking.xml:299(title) serverguide/C/web-servers.xml:61(title) serverguide/C/web-servers.xml:720(title) serverguide/C/web-servers.xml:815(title) serverguide/C/web-servers.xml:952(title) serverguide/C/web-servers.xml:1046(title) serverguide/C/virtualization.xml:1226(title) serverguide/C/virtualization.xml:1415(title) serverguide/C/vcs.xml:39(title) serverguide/C/vcs.xml:418(title) serverguide/C/remote-administration.xml:74(title) serverguide/C/remote-administration.xml:245(title) serverguide/C/package-management.xml:365(title) serverguide/C/network-config.xml:647(title) serverguide/C/network-auth.xml:88(title) serverguide/C/network-auth.xml:1775(title) serverguide/C/network-auth.xml:2148(title) serverguide/C/mail.xml:306(title) serverguide/C/mail.xml:480(title) serverguide/C/mail.xml:699(title) serverguide/C/mail.xml:1128(title) serverguide/C/lamp-applications.xml:128(title) serverguide/C/lamp-applications.xml:302(title) serverguide/C/lamp-applications.xml:421(title) serverguide/C/file-server.xml:355(title) serverguide/C/file-server.xml:480(title) serverguide/C/dns.xml:39(title) serverguide/C/databases.xml:84(title) serverguide/C/databases.xml:178(title) serverguide/C/clustering.xml:39(title) serverguide/C/chat.xml:57(title) serverguide/C/chat.xml:142(title) serverguide/C/backups.xml:616(title)
143
msgid "Configuration"
146
#: serverguide/C/windows-networking.xml:101(para)
148
"The main Samba configuration file is located in "
149
"<filename>/etc/samba/smb.conf</filename>. The default configuration file has "
150
"a significant amount of comments in order to document various configuration "
154
#: serverguide/C/windows-networking.xml:106(para)
156
"Not all the available options are included in the default configuration "
157
"file. See the <filename>smb.conf</filename><application>man</application> "
158
"page or the <ulink url=\"http://samba.org/samba/docs/man/Samba-HOWTO-"
159
"Collection/\">Samba HOWTO Collection</ulink> for more details."
162
#: serverguide/C/windows-networking.xml:116(para)
164
"First, edit the following key/value pairs in the "
165
"<emphasis>[global]</emphasis> section of "
166
"<filename>/etc/samba/smb.conf</filename>:"
169
#: serverguide/C/windows-networking.xml:121(programlisting) serverguide/C/windows-networking.xml:306(programlisting) serverguide/C/windows-networking.xml:975(programlisting)
173
" workgroup = EXAMPLE\n"
178
#: serverguide/C/windows-networking.xml:127(para)
180
"The <emphasis>security</emphasis> parameter is farther down in the [global] "
181
"section, and is commented by default. Also, change "
182
"<emphasis>EXAMPLE</emphasis> to better match your environment."
185
#: serverguide/C/windows-networking.xml:135(para)
187
"Create a new section at the bottom of the file, or uncomment one of the "
188
"examples, for the directory to be shared:"
191
#: serverguide/C/windows-networking.xml:139(programlisting)
196
" comment = Ubuntu File Server Share\n"
197
" path = /srv/samba/share\n"
201
" create mask = 0755\n"
204
#: serverguide/C/windows-networking.xml:151(para)
206
"<emphasis>comment:</emphasis> a short description of the share. Adjust to "
210
#: serverguide/C/windows-networking.xml:156(para)
211
msgid "<emphasis>path:</emphasis> the path to the directory to share."
214
#: serverguide/C/windows-networking.xml:159(para)
216
"This example uses <filename>/srv/samba/sharename</filename> because, "
217
"according to the <emphasis>Filesystem Hierarchy Standard (FHS)</emphasis>, "
218
"<ulink url=\"http://www.pathname.com/fhs/pub/fhs-"
219
"2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM\">/srv</ulink> is where site-"
220
"specific data should be served. Technically Samba shares can be placed "
221
"anywhere on the filesystem as long as the permissions are correct, but "
222
"adhering to standards is recommended."
225
#: serverguide/C/windows-networking.xml:168(para)
227
"<emphasis>browsable:</emphasis> enables Windows clients to browse the shared "
228
"directory using <application>Windows Explorer</application>."
231
#: serverguide/C/windows-networking.xml:174(para)
233
"<emphasis>guest ok:</emphasis> allows clients to connect to the share "
234
"without supplying a password."
237
#: serverguide/C/windows-networking.xml:179(para)
239
"<emphasis>read only:</emphasis> gives write access to the shared directory."
242
#: serverguide/C/windows-networking.xml:184(para)
244
"<emphasis>create mask:</emphasis> determines the permissions new files will "
248
#: serverguide/C/windows-networking.xml:193(para)
250
"Now that <application>Samba</application> is configured, the directory needs "
251
"to be created and the permissions changed. From a terminal enter:"
254
#: serverguide/C/windows-networking.xml:199(command)
255
msgid "sudo mkdir -p /srv/samba/share"
258
#: serverguide/C/windows-networking.xml:200(command)
259
msgid "sudo chown nobody.nogroup /srv/samba/share/"
262
#: serverguide/C/windows-networking.xml:204(para)
264
"The <emphasis>-p</emphasis> switch tells mkdir to create the entire "
265
"directory tree if it doesn't exist. Change the share name to fit your "
269
#: serverguide/C/windows-networking.xml:213(para)
271
"Finally, restart the <application>samba</application> services to enable the "
275
#: serverguide/C/windows-networking.xml:218(command) serverguide/C/windows-networking.xml:326(command) serverguide/C/windows-networking.xml:458(command) serverguide/C/windows-networking.xml:557(command) serverguide/C/windows-networking.xml:922(command) serverguide/C/windows-networking.xml:1032(command) serverguide/C/windows-networking.xml:1142(command) serverguide/C/network-auth.xml:1510(command)
276
msgid "sudo /etc/init.d/samba restart"
277
msgstr "sudo /etc/init.d/samba restart"
279
#: serverguide/C/windows-networking.xml:225(para)
281
"Once again, the above configuration gives all access to any client on the "
282
"local network. For a more secure configuration see <xref linkend=\"samba-"
283
"fileprint-security\"/>."
286
#: serverguide/C/windows-networking.xml:231(para)
288
"From a Windows client you should now be able to browse to the Ubuntu file "
289
"server and see the shared directory. To check that everything is working try "
290
"creating a directory from Windows."
293
#: serverguide/C/windows-networking.xml:236(para)
295
"To create additional shares simply create new <emphasis>[dir]</emphasis> "
296
"sections in <filename>/etc/samba/smb.conf</filename>, and restart "
297
"<emphasis>Samba</emphasis>. Just make sure that the directory you want to "
298
"share actually exists and the permissions are correct."
301
#: serverguide/C/windows-networking.xml:243(title) serverguide/C/windows-networking.xml:336(title) serverguide/C/windows-networking.xml:686(title) serverguide/C/windows-networking.xml:1051(title) serverguide/C/windows-networking.xml:1253(title) serverguide/C/virtualization.xml:366(title) serverguide/C/virtualization.xml:1163(title) serverguide/C/remote-administration.xml:478(title) serverguide/C/network-config.xml:269(title) serverguide/C/network-config.xml:512(title) serverguide/C/network-auth.xml:1186(title) serverguide/C/network-auth.xml:1625(title) serverguide/C/network-auth.xml:2223(title) serverguide/C/network-auth.xml:2727(title) serverguide/C/jeos.xml:782(title) serverguide/C/installation.xml:847(title) serverguide/C/installation.xml:1123(title) serverguide/C/databases.xml:122(title) serverguide/C/databases.xml:268(title) serverguide/C/backups.xml:855(title)
305
#: serverguide/C/windows-networking.xml:247(para) serverguide/C/windows-networking.xml:340(para) serverguide/C/windows-networking.xml:690(para) serverguide/C/windows-networking.xml:1055(para)
307
"For in depth Samba configurations see the <ulink "
308
"url=\"http://samba.org/samba/docs/man/Samba-HOWTO-Collection/\">Samba HOWTO "
312
#: serverguide/C/windows-networking.xml:253(para) serverguide/C/windows-networking.xml:346(para) serverguide/C/windows-networking.xml:696(para) serverguide/C/windows-networking.xml:1061(para)
314
"The guide is also available in <ulink "
315
"url=\"http://www.amazon.com/exec/obidos/tg/detail/-/0131882228\">printed "
319
#: serverguide/C/windows-networking.xml:259(para) serverguide/C/windows-networking.xml:352(para)
322
"url=\"http://www.oreilly.com/catalog/9780596007690/\">Using Samba</ulink> is "
323
"another good reference."
326
#: serverguide/C/windows-networking.xml:269(title)
327
msgid "Samba Print Server"
330
#: serverguide/C/windows-networking.xml:271(para)
332
"Another common use of Samba is to configure it to share printers installed, "
333
"either locally or over the network, on an Ubuntu server. Similar to <xref "
334
"linkend=\"samba-fileserver\"/> this section will configure Samba to allow "
335
"any client on the local network to use the installed printers without "
336
"prompting for a username and password."
339
#: serverguide/C/windows-networking.xml:277(para)
341
"For a more secure configuration see <xref linkend=\"samba-fileprint-"
345
#: serverguide/C/windows-networking.xml:284(para)
347
"Before installing and configuring Samba it is best to already have a working "
348
"<application>CUPS</application> installation. See <xref linkend=\"cups\"/> "
352
#: serverguide/C/windows-networking.xml:289(para)
354
"To install the <application>samba</application> package, from a terminal "
358
#: serverguide/C/windows-networking.xml:300(para)
360
"After installing samba edit <filename>/etc/samba/smb.conf</filename>. Change "
361
"the <emphasis>workgroup</emphasis> attribute to what is appropriate for your "
362
"network, and change <emphasis>security</emphasis> to <emphasis "
363
"role=\"italic\">share</emphasis>:"
366
#: serverguide/C/windows-networking.xml:312(para)
368
"In the <emphasis>[printers]</emphasis> section change the <emphasis>guest "
369
"ok</emphasis> option to <emphasis role=\"italic\">yes</emphasis>:"
372
#: serverguide/C/windows-networking.xml:316(programlisting)
380
#: serverguide/C/windows-networking.xml:321(para)
381
msgid "After editing <filename>smb.conf</filename> restart Samba:"
384
#: serverguide/C/windows-networking.xml:329(para)
386
"The default Samba configuration will automatically share any printers "
387
"installed. Simply install the printer locally on your Windows clients."
390
#: serverguide/C/windows-networking.xml:358(para)
392
"Also, see the <ulink url=\"http://www.cups.org/\">CUPS Website</ulink> for "
393
"more information on configuring CUPS."
396
#: serverguide/C/windows-networking.xml:367(title)
397
msgid "Securing a Samba File and Print Server"
400
#: serverguide/C/windows-networking.xml:370(title)
401
msgid "Samba Security Modes"
404
#: serverguide/C/windows-networking.xml:372(para)
406
"There are two security levels available to the Common Internet Filesystem "
407
"(CIFS) network protocol <emphasis>user-level</emphasis> and <emphasis>share-"
408
"level</emphasis>. Samba's <emphasis>security mode</emphasis> implementation "
409
"allows more flexibility, providing four ways of implementing user-level "
410
"security and one way to implement share-level:"
413
#: serverguide/C/windows-networking.xml:381(para)
415
"<emphasis>security = user:</emphasis> requires clients to supply a username "
416
"and password to connect to shares. Samba user accounts are separate from "
417
"system accounts, but the <application>libpam-smbpass</application> package "
418
"will sync system users and passwords with the Samba user database."
421
#: serverguide/C/windows-networking.xml:388(para)
423
"<emphasis>security = domain:</emphasis> this mode allows the Samba server to "
424
"appear to Windows clients as a Primary Domain Controller (PDC), Backup "
425
"Domain Controller (BDC), or a Domain Member Server (DMS). See <xref "
426
"linkend=\"samba-dc\"/> for further information."
429
#: serverguide/C/windows-networking.xml:395(para)
431
"<emphasis>security = ADS:</emphasis> allows the Samba server to join an "
432
"Active Directory domain as a native member. See <xref linkend=\"samba-ad-"
433
"integration\"/> for details."
436
#: serverguide/C/windows-networking.xml:401(para)
438
"<emphasis>security = server:</emphasis> this mode is left over from before "
439
"Samba could become a member server, and due to some security issues should "
440
"not be used. See the <ulink url=\"http://samba.org/samba/docs/man/Samba-"
441
"HOWTO-Collection/ServerType.html#id349531\">Server Security</ulink> section "
442
"of the Samba guide for more details."
445
#: serverguide/C/windows-networking.xml:409(para)
447
"<emphasis>security = share:</emphasis> allows clients to connect to shares "
448
"without supplying a username and password."
451
#: serverguide/C/windows-networking.xml:416(para)
453
"The security mode you choose will depend on your environment and what you "
454
"need the Samba server to accomplish."
457
#: serverguide/C/windows-networking.xml:422(title)
458
msgid "Security = User"
461
#: serverguide/C/windows-networking.xml:424(para)
463
"This section will reconfigure the Samba file and print server, from <xref "
464
"linkend=\"samba-fileserver\"/> and <xref linkend=\"samba-printserver\"/>, to "
465
"require authentication."
468
#: serverguide/C/windows-networking.xml:429(para)
470
"First, install the <application>libpam-smbpass</application> package which "
471
"will sync the system users to the Samba user database:"
474
#: serverguide/C/windows-networking.xml:435(command)
475
msgid "sudo apt-get install libpam-smbpass"
478
#: serverguide/C/windows-networking.xml:439(para)
480
"If you chose the <emphasis>Samba Server</emphasis> task during installation "
481
"<application>libpam-smbpass</application> is already installed."
484
#: serverguide/C/windows-networking.xml:445(para)
486
"Edit <filename>/etc/samba/smb.conf</filename>, and in the "
487
"<emphasis>[share]</emphasis> section change:"
490
#: serverguide/C/windows-networking.xml:449(programlisting)
497
#: serverguide/C/windows-networking.xml:453(para)
498
msgid "Finally, restart Samba for the new settings to take effect:"
501
#: serverguide/C/windows-networking.xml:461(para)
503
"Now when connecting to the shared directories or printers you should be "
504
"prompted for a username and password."
507
#: serverguide/C/windows-networking.xml:466(para)
509
"If you choose to map a network drive to the share you can check the "
510
"<quote>Reconnect at Logon</quote> check box, which will require you to only "
511
"enter the username and password once, at least until the password changes."
514
#: serverguide/C/windows-networking.xml:474(title)
515
msgid "Share Security"
518
#: serverguide/C/windows-networking.xml:476(para)
520
"There are several options available to increase the security for each "
521
"individual shared directory. Using the <emphasis>[share]</emphasis> example, "
522
"this section will cover some common options."
525
#: serverguide/C/windows-networking.xml:482(title)
529
#: serverguide/C/windows-networking.xml:484(para)
531
"Groups define a collection of computers or users which have a common level "
532
"of access to particular network resources and offer a level of granularity "
533
"in controlling access to such resources. For example, if a group <emphasis "
534
"role=\"italic\">qa</emphasis> is defined and contains the users <emphasis "
535
"role=\"italic\">freda</emphasis>, <emphasis "
536
"role=\"italic\">danika</emphasis>, and <emphasis "
537
"role=\"italic\">rob</emphasis> and a second group <emphasis "
538
"role=\"italic\">support</emphasis> is defined and consists of users "
539
"<emphasis role=\"italic\">danika</emphasis>, <emphasis "
540
"role=\"italic\">jeremy</emphasis>, and <emphasis "
541
"role=\"italic\">vincent</emphasis> then certain network resources configured "
542
"to allow access by the <emphasis role=\"italic\">qa</emphasis> group will "
543
"subsequently enable access by freda, danika, and rob, but not jeremy or "
544
"vincent. Since the user <emphasis role=\"italic\">danika</emphasis> belongs "
545
"to both the <emphasis role=\"italic\">qa</emphasis> and <emphasis "
546
"role=\"italic\">support</emphasis> groups, she will be able to access "
547
"resources configured for access by both groups, whereas all other users will "
548
"have only access to resources explicitly allowing the group they are part of."
551
#: serverguide/C/windows-networking.xml:498(para)
553
"By default Samba looks for the local system groups defined in "
554
"<filename>/etc/group</filename> to determine which users belong to which "
555
"groups. For more information on adding and removing users from groups see "
556
"<xref linkend=\"adding-deleting-users\"/>."
559
#: serverguide/C/windows-networking.xml:504(para)
561
"When defining groups in the Samba configuration file, "
562
"<filename>/etc/samba/smb.conf</filename>, the recognized syntax is to "
563
"preface the group name with an \"@\" symbol. For example, if you wished to "
564
"define a group named <emphasis role=\"italic\">sysadmin</emphasis> in a "
565
"certain section of the <filename>/etc/samba/smb.conf</filename>, you would "
566
"do so by entering the group name as <emphasis "
567
"role=\"bold\">@sysadmin</emphasis>."
570
#: serverguide/C/windows-networking.xml:513(title)
571
msgid "File Permissions"
574
#: serverguide/C/windows-networking.xml:515(para)
576
"File Permissions define the explicit rights a computer or user has to a "
577
"particular directory, file, or set of files. Such permissions may be defined "
578
"by editing the <filename>/etc/samba/smb.conf</filename> file and specifying "
579
"the explicit permissions of a defined file share."
582
#: serverguide/C/windows-networking.xml:521(para)
584
"For example, if you have defined a Samba share called "
585
"<emphasis>share</emphasis> and wish to give <emphasis role=\"italic\">read-"
586
"only</emphasis> permissions to the group of users known as <emphasis "
587
"role=\"italic\">qa</emphasis>, but wanted to allow writing to the share by "
588
"the group called <emphasis role=\"italic\">sysadmin</emphasis> and the user "
589
"named <emphasis role=\"italic\">vincent</emphasis>, then you could edit the "
590
"<filename>/etc/samba/smb.conf</filename> file, and add the following entries "
591
"under the <emphasis>[share]</emphasis> entry:"
594
#: serverguide/C/windows-networking.xml:530(programlisting)
599
" write list = @sysadmin, vincent\n"
602
#: serverguide/C/windows-networking.xml:535(para)
604
"Another possible Samba permission is to declare "
605
"<emphasis>administrative</emphasis> permissions to a particular shared "
606
"resource. Users having administrative permissions may read, write, or modify "
607
"any information contained in the resource the user has been given explicit "
608
"administrative permissions to."
611
#: serverguide/C/windows-networking.xml:541(para)
613
"For example, if you wanted to give the user <emphasis "
614
"role=\"italic\">melissa</emphasis> administrative permissions to the "
615
"<emphasis role=\"italic\">share</emphasis> example, you would edit the "
616
"<filename>/etc/samba/smb.conf</filename> file, and add the following line "
617
"under the <emphasis>[share]</emphasis> entry:"
620
#: serverguide/C/windows-networking.xml:548(programlisting)
624
" admin users = melissa\n"
627
#: serverguide/C/windows-networking.xml:552(para)
629
"After editing <filename>/etc/samba/smb.conf</filename>, restart Samba for "
630
"the changes to take effect:"
633
#: serverguide/C/windows-networking.xml:561(para)
635
"For the <emphasis>read list</emphasis> and <emphasis>write list</emphasis> "
636
"to work the Samba security mode must <emphasis>not</emphasis> be set to "
637
"<emphasis role=\"italic\">security = share</emphasis>"
640
#: serverguide/C/windows-networking.xml:567(para)
642
"Now that Samba has been configured to limit which groups have access to the "
643
"shared directory, the filesystem permissions need to be updated."
646
#: serverguide/C/windows-networking.xml:572(para)
648
"Traditional Linux file permissions do not map well to Windows NT Access "
649
"Control Lists (ACLs). Fortunately POSIX ACLs are available on Ubuntu servers "
650
"providing more fine grained control. For example, to enable ACLs on "
651
"<filename>/srv</filename> an EXT3 filesystem, edit "
652
"<filename>/etc/fstab</filename> adding the <emphasis>acl</emphasis> option:"
655
#: serverguide/C/windows-networking.xml:579(programlisting)
659
"UUID=66bcdd2e-8861-4fb0-b7e4-e61c569fe17d /srv ext3 noatime,relatime,acl "
663
#: serverguide/C/windows-networking.xml:583(para)
664
msgid "Then remount the partition:"
667
#: serverguide/C/windows-networking.xml:588(command)
668
msgid "sudo mount -v -o remount /srv"
671
#: serverguide/C/windows-networking.xml:592(para)
673
"The above example assumes <filename>/srv</filename> on a separate partition. "
674
"If <filename>/srv</filename>, or wherever you have configured your share "
675
"path, is part of the <filename>/</filename> partition a reboot may be "
679
#: serverguide/C/windows-networking.xml:599(para)
681
"To match the Samba configuration above the <emphasis>sysadmin</emphasis> "
682
"group will be given read, write, and execute permissions to "
683
"<filename>/srv/samba/share</filename>, the <emphasis>qa</emphasis> group "
684
"will be given read and execute permissions, and the files will be owned by "
685
"the username <emphasis>melissa</emphasis>. Enter the following in a terminal:"
688
#: serverguide/C/windows-networking.xml:607(command)
689
msgid "sudo chown -R melissa /srv/samba/share/"
692
#: serverguide/C/windows-networking.xml:608(command)
693
msgid "sudo chgrp -R sysadmin /srv/samba/share/"
696
#: serverguide/C/windows-networking.xml:609(command)
697
msgid "sudo setfacl -R -m g:qa:rx /srv/samba/share/"
700
#: serverguide/C/windows-networking.xml:613(para)
702
"The <application>setfacl</application> command above gives "
703
"<emphasis>execute</emphasis> permissions to all files in the "
704
"<filename>/srv/samba/share</filename> directory, which you may or may not "
708
#: serverguide/C/windows-networking.xml:619(para)
710
"Now from a Windows client you should notice the new file permissions are "
711
"implemented. See the <application>acl</application> and "
712
"<application>setfacl</application> man pages for more information on POSIX "
716
#: serverguide/C/windows-networking.xml:627(title)
717
msgid "Samba AppArmor Profile"
720
#: serverguide/C/windows-networking.xml:629(para)
722
"Ubuntu comes with the <application>AppArmor</application> security module, "
723
"which provides mandatory access controls. The default AppArmor profile for "
724
"Samba will need to be adapted to your configuration. For more details on "
725
"using AppArmor see <xref linkend=\"apparmor\"/>."
728
#: serverguide/C/windows-networking.xml:635(para)
730
"There are default AppArmor profiles for <filename>/usr/sbin/smbd</filename> "
731
"and <filename>/usr/sbin/nmbd</filename>, the Samba daemon binaries, as part "
732
"of the <application>apparmor-profiles</application> packages. To install the "
733
"package, from a terminal prompt enter:"
736
#: serverguide/C/windows-networking.xml:642(command) serverguide/C/security.xml:978(command)
737
msgid "sudo apt-get install apparmor-profiles"
740
#: serverguide/C/windows-networking.xml:646(para)
741
msgid "This package contains profiles for several other binaries."
744
#: serverguide/C/windows-networking.xml:651(para)
746
"By default the profiles for <application>smbd</application> and "
747
"<application>nmbd</application> are in <emphasis>complain</emphasis> mode "
748
"allowing Samba to work without modifying the profile, and only logging "
749
"errors. To place the <application>smbd</application> profile into "
750
"<emphasis>enforce</emphasis> mode, and have Samba work as expected, the "
751
"profile will need to be modified to reflect any directories that are shared."
754
#: serverguide/C/windows-networking.xml:658(para)
756
"Edit <filename>/etc/apparmor.d/usr.sbin.smbd</filename> adding information "
757
"for <emphasis>[share]</emphasis> from the file server example:"
760
#: serverguide/C/windows-networking.xml:663(programlisting)
764
" /srv/samba/share/ r,\n"
765
" /srv/samba/share/** rwkix,\n"
768
#: serverguide/C/windows-networking.xml:668(para)
770
"Now place the profile into <emphasis>enforce</emphasis> and reload it:"
773
#: serverguide/C/windows-networking.xml:673(command)
774
msgid "sudo aa-enforce /usr/sbin/smbd"
777
#: serverguide/C/windows-networking.xml:674(command)
778
msgid "cat /etc/apparmor.d/usr.sbin.smbd | sudo apparmor_parser -r"
781
#: serverguide/C/windows-networking.xml:677(para)
783
"You should now be able to read, write, and execute files in the shared "
784
"directory as normal, and the <application>smbd</application> binary will "
785
"have access to only the configured files and direcotories. Be sure to add "
786
"entries for each directory you configure Samba to share. Also, any errors "
787
"will be logged to <filename>/var/log/syslog</filename>."
790
#: serverguide/C/windows-networking.xml:702(para) serverguide/C/windows-networking.xml:1067(para)
793
"url=\"http://www.oreilly.com/catalog/9780596007690/\">Using Samba</ulink> is "
794
"also a good reference."
797
#: serverguide/C/windows-networking.xml:708(para)
799
"<ulink url=\"http://samba.org/samba/docs/man/Samba-HOWTO-Collection/securing-"
800
"samba.html\">Chapter 18</ulink> of the Samba HOWTO Collection is devoted to "
804
#: serverguide/C/windows-networking.xml:714(para)
806
"For more information on Samba and ACLs see the <ulink "
807
"url=\"http://samba.org/samba/docs/man/Samba-HOWTO-"
808
"Collection/AccessControls.html#id397568\">Samba ACLs page </ulink>."
811
#: serverguide/C/windows-networking.xml:725(title)
812
msgid "Samba as a Domain Controller"
815
#: serverguide/C/windows-networking.xml:727(para)
817
"Although it cannot act as an Active Directory Primary Domain Controller "
818
"(PDC), a Samba server can be configured to appear as a Windows NT4-style "
819
"domain controller. A major advantage of this configuration is the ability to "
820
"centralize user and machine credentials. Samba can also use multiple "
821
"backends to store the user information."
824
#: serverguide/C/windows-networking.xml:734(title)
825
msgid "Primary Domain Controller"
828
#: serverguide/C/windows-networking.xml:736(para)
830
"This section covers configuring Samba as a Primary Domain Controller (PDC) "
831
"using the default smbpasswd backend."
834
#: serverguide/C/windows-networking.xml:743(para)
836
"First, install Samba, and <application>libpam-smbpass</application> to sync "
837
"the user accounts, by entering the following in a terminal prompt:"
840
#: serverguide/C/windows-networking.xml:749(command) serverguide/C/windows-networking.xml:965(command)
841
msgid "sudo apt-get install samba libpam-smbpass"
844
#: serverguide/C/windows-networking.xml:755(para)
846
"Next, configure Samba by editing <filename>/etc/samba/smb.conf</filename>. "
847
"The <emphasis>security</emphasis> mode should be set to <emphasis "
848
"role=\"italic\">user</emphasis>, and the <emphasis>workgroup</emphasis> "
849
"should relate to your organization:"
852
#: serverguide/C/windows-networking.xml:761(programlisting)
856
" workgroup = EXAMPLE\n"
858
" security = domain\n"
861
#: serverguide/C/windows-networking.xml:770(para)
863
"In the commented <quote>Domains</quote> section add or uncomment the "
867
#: serverguide/C/windows-networking.xml:774(programlisting)
871
" domain logons = yes\n"
872
" logon path = \\\\%N\\%U\\profile\n"
873
" logon drive = H:\n"
874
" logon home = \\\\%N\\%U\n"
875
" logon script = logon.cmd\n"
876
" add machine script = sudo /usr/sbin/useradd -n -g machines -c Machine -d "
877
"/var/lib/samba -s /bin/false %u\n"
880
#: serverguide/C/windows-networking.xml:785(para)
882
"<emphasis>domain logons:</emphasis> provides the netlogon service causing "
883
"Samba to act as a domain controller."
886
#: serverguide/C/windows-networking.xml:790(para)
888
"<emphasis>logon path:</emphasis> places the user's Windows profile into "
889
"their home directory. It is also possible to configure a "
890
"<emphasis>[profiles]</emphasis> share placing all profiles under a single "
894
#: serverguide/C/windows-networking.xml:796(para)
896
"<emphasis>logon drive:</emphasis> specifies the home directory local path."
899
#: serverguide/C/windows-networking.xml:801(para)
901
"<emphasis>logon home:</emphasis> specifies the home directory location."
904
#: serverguide/C/windows-networking.xml:806(para)
906
"<emphasis>logon script:</emphasis> determines the script to be run locally "
907
"once a user has logged in. The script needs to be placed in the "
908
"<emphasis>[netlogon]</emphasis> share."
911
#: serverguide/C/windows-networking.xml:812(para)
913
"<emphasis>add machine script:</emphasis> a script that will automatically "
914
"create the <emphasis>Machine Trust Account</emphasis> needed for a "
915
"workstation to join the domain."
918
#: serverguide/C/windows-networking.xml:816(para)
920
"In this example the <emphasis>machines</emphasis> group will need to be "
921
"created using the <application>addgroup</application> utility see <xref "
922
"linkend=\"adding-deleting-users\"/> for details."
925
#: serverguide/C/windows-networking.xml:824(para)
927
"If you wish to not use <emphasis>Roaming Profiles</emphasis> leave the "
928
"<emphasis>logon home</emphasis> and <emphasis>logon path</emphasis> options "
932
#: serverguide/C/windows-networking.xml:833(para)
934
"Uncomment the <emphasis>[homes]</emphasis> share to allow the <emphasis "
935
"role=\"italic\">logon home</emphasis> to be mapped:"
938
#: serverguide/C/windows-networking.xml:838(programlisting)
943
" comment = Home Directories\n"
946
" create mask = 0700\n"
947
" directory mask = 0700\n"
948
" valid users = %S\n"
951
#: serverguide/C/windows-networking.xml:851(para)
953
"When configured as a domain controller a <emphasis>[netlogon]</emphasis> "
954
"share needs to be configured. To enable the share, uncomment:"
957
#: serverguide/C/windows-networking.xml:856(programlisting)
962
" comment = Network Logon Service\n"
963
" path = /srv/samba/netlogon\n"
966
" share modes = no\n"
969
#: serverguide/C/windows-networking.xml:866(para)
971
"The original <emphasis>netlogon</emphasis> share path is "
972
"<filename>/home/samba/netlogon</filename>, but according to the Filesystem "
973
"Hierarchy Standard (FHS), <ulink url=\"http://www.pathname.com/fhs/pub/fhs-"
974
"2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM\">/srv</ulink> is the correct "
975
"location for site-specific data provided by the system."
978
#: serverguide/C/windows-networking.xml:877(para)
980
"Now create the <filename role=\"directory\">netlogon</filename> directory, "
981
"and an empty (for now) <filename>logon.cmd</filename> script file:"
984
#: serverguide/C/windows-networking.xml:883(command)
985
msgid "sudo mkdir -p /srv/samba/netlogon"
988
#: serverguide/C/windows-networking.xml:884(command)
989
msgid "sudo touch /srv/samba/netlogon/logon.cmd"
992
#: serverguide/C/windows-networking.xml:887(para)
994
"You can enter any normal Windows logon script commands in "
995
"<filename>logon.cmd</filename> to customize the client's environment."
998
#: serverguide/C/windows-networking.xml:895(para)
1000
"With <emphasis>root</emphasis> being disabled by default, in order to join a "
1001
"workstation to the domain, a system group needs to be mapped to the Windows "
1002
"<emphasis>Domain Admins</emphasis> group. Using the "
1003
"<application>net</application> utility, from a terminal enter:"
1006
#: serverguide/C/windows-networking.xml:902(command)
1008
"sudo net groupmap add ntgroup=\"Domain Admins\" unixgroup=sysadmin rid=512 "
1012
#: serverguide/C/windows-networking.xml:906(para)
1014
"Change <emphasis role=\"italic\">sysadmin</emphasis> to whichever group you "
1015
"prefer. Also, the user used to join the domain needs to be a member of the "
1016
"<emphasis>sysadmin</emphasis> group, as well as a member of the system "
1017
"<emphasis>admin</emphasis> group. The <emphasis>admin</emphasis> group "
1018
"allows <application>sudo</application> use."
1021
#: serverguide/C/windows-networking.xml:917(para)
1022
msgid "Finally, restart Samba to enable the new domain controller:"
1025
#: serverguide/C/windows-networking.xml:928(para)
1027
"You should now be able to join Windows clients to the Domain in the same "
1028
"manner as joining them to an NT4 domain running on a Windows server."
1031
#: serverguide/C/windows-networking.xml:938(title)
1032
msgid "Backup Domain Controller"
1035
#: serverguide/C/windows-networking.xml:940(para)
1037
"With a Primary Domain Controller (PDC) on the network it is best to have a "
1038
"Backup Domain Controller (BDC) as well. This will allow clients to "
1039
"authenticate in case the PDC becomes unavailable."
1042
#: serverguide/C/windows-networking.xml:945(para)
1044
"When configuring Samba as a BDC you need a way to sync account information "
1045
"with the PDC. There are multiple ways of accomplishing this "
1046
"<application>scp</application>, <application>rsync</application>, or by "
1047
"using <application>LDAP</application> as the <emphasis>passdb "
1048
"backend</emphasis>."
1051
#: serverguide/C/windows-networking.xml:951(para)
1053
"Using LDAP is the most robust way to sync account information, because both "
1054
"domain controllers can use the same information in real time. However, "
1055
"setting up a LDAP server may be overly complicated for a small number of "
1056
"user and computer accounts. See <xref linkend=\"samba-ldap\"/> for details."
1059
#: serverguide/C/windows-networking.xml:960(para)
1061
"First, install <application>samba</application> and <application>libpam-"
1062
"smbpass</application>. From a terminal enter:"
1065
#: serverguide/C/windows-networking.xml:971(para)
1067
"Now, edit <filename>/etc/samba/smb.conf</filename> and uncomment the "
1068
"following in the <emphasis>[global]</emphasis>:"
1071
#: serverguide/C/windows-networking.xml:984(para)
1072
msgid "In the commented <emphasis>Domains</emphasis> uncomment or add:"
1075
#: serverguide/C/windows-networking.xml:988(programlisting)
1079
" domain logons = yes\n"
1080
" domain master = no\n"
1083
#: serverguide/C/windows-networking.xml:996(para)
1085
"Make sure a user has rights to read the files in "
1086
"<filename>/var/lib/samba</filename>. For example, to allow users in the "
1087
"<emphasis>admin</emphasis> group to <application>scp</application> the "
1091
#: serverguide/C/windows-networking.xml:1002(command)
1092
msgid "sudo chgrp -R admin /var/lib/samba"
1095
#: serverguide/C/windows-networking.xml:1008(para)
1097
"Next, sync the user accounts, using <application>scp</application> to copy "
1098
"the <filename>/var/lib/samba</filename> directory from the PDC:"
1101
#: serverguide/C/windows-networking.xml:1014(command)
1102
msgid "sudo scp -r username@pdc:/var/lib/samba /var/lib"
1105
#: serverguide/C/windows-networking.xml:1018(para)
1107
"Replace <emphasis>username</emphasis> with a valid username and "
1108
"<emphasis>pdc</emphasis> with the hostname or IP Address of your actual PDC."
1111
#: serverguide/C/windows-networking.xml:1027(para)
1112
msgid "Finally, restart <application>samba</application>:"
1115
#: serverguide/C/windows-networking.xml:1038(para)
1117
"You can test that your Backup Domain controller is working by stopping the "
1118
"Samba daemon on the PDC, then trying to login to a Windows client joined to "
1122
#: serverguide/C/windows-networking.xml:1043(para)
1124
"Another thing to keep in mind is if you have configured the <emphasis>logon "
1125
"home</emphasis> option as a directory on the PDC, and the PDC becomes "
1126
"unavailable, access to the user's <emphasis>Home</emphasis> drive will also "
1127
"be unavailable. For this reason it is best to configure the <emphasis>logon "
1128
"home</emphasis> to reside on a separate file server from the PDC and BDC."
1131
#: serverguide/C/windows-networking.xml:1073(para)
1133
"<ulink url=\"http://samba.org/samba/docs/man/Samba-HOWTO-Collection/samba-"
1134
"pdc.html\">Chapter 4</ulink> of the Samba HOWTO Collection explains setting "
1135
"up a Primary Domain Controller."
1138
#: serverguide/C/windows-networking.xml:1079(para)
1140
"<ulink url=\"http://us3.samba.org/samba/docs/man/Samba-HOWTO-"
1141
"Collection/samba-bdc.html\">Chapter 5</ulink> of the Samba HOWTO Collection "
1142
"explains setting up a Backup Domain Controller."
1145
#: serverguide/C/windows-networking.xml:1089(title)
1146
msgid "Samba Active Directory Integration"
1149
#: serverguide/C/windows-networking.xml:1092(title)
1150
msgid "Accessing a Samba Share"
1153
#: serverguide/C/windows-networking.xml:1094(para)
1155
"Another, use for Samba is to integrate into an existing Windows network. "
1156
"Once part of an Active Directory domain, Samba can provide file and print "
1157
"services to AD users."
1160
#: serverguide/C/windows-networking.xml:1099(para)
1162
"The simplest way to join an AD domain is to use <application>Likewise-"
1163
"open</application>. For detailed instructions see <xref linkend=\"likewise-"
1167
#: serverguide/C/windows-networking.xml:1104(para)
1168
msgid "Once part of the domain, install the following packages:"
1171
#: serverguide/C/windows-networking.xml:1109(command)
1172
msgid "sudo apt-get install samba smbfs smbclient"
1175
#: serverguide/C/windows-networking.xml:1112(para)
1177
"Since the <application>likewise-open</application> and "
1178
"<application>samba</application> packages use separate "
1179
"<filename>secrets.tdb</filename> files, a symlink will need to be created in "
1180
"<filename role=\"directory\">/var/lib/samba</filename>:"
1183
#: serverguide/C/windows-networking.xml:1118(command)
1184
msgid "sudo mv /var/lib/samba/secrets.tdb /var/lib/samba/secrets.tdb.orig"
1187
#: serverguide/C/windows-networking.xml:1119(command)
1188
msgid "sudo ln -s /etc/samba/secrets.tdb /var/lib/samba"
1191
#: serverguide/C/windows-networking.xml:1122(para)
1192
msgid "Next, edit <filename>/etc/samba/smb.conf</filename> changing:"
1195
#: serverguide/C/windows-networking.xml:1126(programlisting)
1199
" workgroup = EXAMPLE\n"
1202
" realm = EXAMPLE.COM\n"
1204
" idmap backend = lwopen\n"
1205
" idmap uid = 50-9999999999\n"
1206
" idmap gid = 50-9999999999\n"
1209
#: serverguide/C/windows-networking.xml:1137(para)
1211
"Restart <application>samba</application> for the new settings to take effect:"
1214
#: serverguide/C/windows-networking.xml:1145(para)
1216
"You should now be able to access any <application>Samba</application> shares "
1217
"from a Windows client. However, be sure to give the appropriate AD users or "
1218
"groups access to the share directory. See <xref linkend=\"samba-fileprint-"
1219
"security\"/> for more details."
1222
#: serverguide/C/windows-networking.xml:1153(title)
1223
msgid "Accessing a Windows Share"
1226
#: serverguide/C/windows-networking.xml:1155(para)
1228
"Now that the Samba server is part of the Active Directory domain you can "
1229
"access any Windows server shares:"
1232
#: serverguide/C/windows-networking.xml:1162(para)
1234
"To mount a Windows file share enter the following in a terminal prompt:"
1237
#: serverguide/C/windows-networking.xml:1166(command)
1238
msgid "mount.cifs //fs01.example.com/share mount_point"
1241
#: serverguide/C/windows-networking.xml:1169(para)
1243
"It is also possible to access shares on computers not part of an AD domain, "
1244
"but a username and password will need to be provided."
1247
#: serverguide/C/windows-networking.xml:1177(para)
1249
"To mount the share during boot place an entry in "
1250
"<filename>/etc/fstab</filename>, for example:"
1253
#: serverguide/C/windows-networking.xml:1181(programlisting)
1257
"//192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw "
1261
#: serverguide/C/windows-networking.xml:1188(para)
1263
"Another way to copy files from a Windows server is to use the "
1264
"<application>smbclient</application> utility. To list the files in a Windows "
1268
#: serverguide/C/windows-networking.xml:1194(command)
1269
msgid "smbclient //fs01.example.com/share -k -c \"ls\""
1272
#: serverguide/C/windows-networking.xml:1200(para)
1273
msgid "To copy a file from the share, enter:"
1276
#: serverguide/C/windows-networking.xml:1205(command)
1277
msgid "smbclient //fs01.example.com/share -k -c \"get file.txt\""
1280
#: serverguide/C/windows-networking.xml:1208(para)
1282
"This will copy the <filename>file.txt</filename> into the current directory."
1285
#: serverguide/C/windows-networking.xml:1215(para)
1286
msgid "And to copy a file to the share:"
1289
#: serverguide/C/windows-networking.xml:1220(command)
1290
msgid "smbclient //fs01.example.com/share -k -c \"put /etc/hosts hosts\""
1293
#: serverguide/C/windows-networking.xml:1223(para)
1295
"This will copy the the <filename>/etc/hosts</filename> to "
1296
"<filename>//fs01.example.com/share/hosts</filename>."
1299
#: serverguide/C/windows-networking.xml:1230(para)
1301
"The <emphasis>-c</emphasis> option used above allows you to execute the "
1302
"<application>smbclient</application> command all at once. This is useful for "
1303
"scripting and minor file operations. To enter the <emphasis>smb: \\"
1304
"></emphasis> prompt, a FTP like prompt where you can execute normal file "
1305
"and directory commands, simply execute:"
1308
#: serverguide/C/windows-networking.xml:1237(command)
1309
msgid "smbclient //fs01.example.com/share -k"
1312
#: serverguide/C/windows-networking.xml:1244(para)
1314
"Replace all instances of <emphasis>fs01.example.com/share</emphasis>, "
1315
"<emphasis>//192.168.0.5/share</emphasis>, "
1316
"<emphasis>username=steve,password=secret</emphasis>, and "
1317
"<emphasis>file.txt</emphasis> with your server's IP, hostname, share name, "
1318
"file name, and an actual username and password with rights to the share."
1321
#: serverguide/C/windows-networking.xml:1255(para)
1323
"For more <application>smbclient</application> options see the man page: "
1324
"<command>man smbclient</command>, also available <ulink "
1325
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man1/smbclient.1.html\">o"
1329
#: serverguide/C/windows-networking.xml:1260(para)
1331
"The <application>mount.cifs</application><ulink "
1332
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/mount.cifs.8.html\">"
1333
"man page</ulink> is also useful for more detailed information."
1336
#: serverguide/C/windows-networking.xml:1270(title)
1337
msgid "Likewise Open"
1340
#: serverguide/C/windows-networking.xml:1272(para)
1342
"<application>Likewise Open</application> simplifies the necessary "
1343
"configuration needed to authenticate a Linux machine to an Active Directory "
1344
"domain. Based on <application>winbind</application>, the "
1345
"<application>likewise-open</application> package takes the pain out of "
1346
"integrating Ubuntu authentication into an existing Windows network."
1349
#: serverguide/C/windows-networking.xml:1281(para)
1351
"There are two ways to use Likewise Open, <application>likewise-"
1352
"open</application> the command line utility and <application>likewise-open-"
1353
"gui</application>. This section focuses on the command line utility."
1356
#: serverguide/C/windows-networking.xml:1286(para)
1358
"To install the <application>likewise-open</application> package, open a "
1359
"terminal prompt and enter:"
1362
#: serverguide/C/windows-networking.xml:1291(command)
1363
msgid "sudo apt-get install likewise-open"
1366
#: serverguide/C/windows-networking.xml:1294(para)
1368
"With Ubuntu 9.04 <application>Likewise Open 5.0</application> is available "
1369
"in the <emphasis>Universe</emphasis> repository. However, since upgrading "
1370
"from <application>Likewise Open 4.1</application> currently requires the "
1371
"system to leave the domain and re-join, a separate package for version five "
1375
#: serverguide/C/windows-networking.xml:1300(para)
1376
msgid "To install <application>Likewise Open 5.0</application> enter:"
1379
#: serverguide/C/windows-networking.xml:1305(command)
1380
msgid "sudo apt-get install likewise-open5"
1383
#: serverguide/C/windows-networking.xml:1309(para)
1385
"Installing likewise-open5 over an existing likewise-open (4.1) installation "
1386
"will replace it. You will have to rejoin the domain after install."
1389
#: serverguide/C/windows-networking.xml:1316(para)
1391
"The command line tools, and GUI interface, for likewise-open5 are the same "
1395
#: serverguide/C/windows-networking.xml:1324(title)
1396
msgid "Joining a Domain"
1399
#: serverguide/C/windows-networking.xml:1326(para)
1401
"The main executable file of the <application>likewise-open</application> "
1402
"package is <filename>/usr/bin/domainjoin-cli</filename>, which is used to "
1403
"join your computer to the domain. Before you join a domain you will need to "
1404
"make sure you have:"
1407
#: serverguide/C/windows-networking.xml:1334(para)
1409
"Access to an Active Directory user with appropriate rights to join the "
1413
#: serverguide/C/windows-networking.xml:1339(para)
1415
"The <emphasis>Fully Qualified Domain Name</emphasis> (FQDN) of the domain "
1416
"you want to join. If your AD domain does not match a valid domain such as "
1417
"<emphasis role=\"italic\">example.com</emphasis>, it is likely that it has "
1418
"the form of <emphasis>domainname.local</emphasis>."
1421
#: serverguide/C/windows-networking.xml:1346(para)
1423
"DNS for the domain setup properly. In a production AD environment this "
1424
"should be the case. Proper Microsoft DNS is needed so that client "
1425
"workstations can determine the Active Directory domain is available."
1428
#: serverguide/C/windows-networking.xml:1350(para)
1430
"If you don't have a Windows DNS server on your network, see <xref "
1431
"linkend=\"likewise-open-ms-dns\"/> for details."
1434
#: serverguide/C/windows-networking.xml:1357(para)
1435
msgid "To join a domain, from a terminal prompt enter:"
1438
#: serverguide/C/windows-networking.xml:1362(command)
1439
msgid "sudo domainjoin-cli join example.com Administrator"
1442
#: serverguide/C/windows-networking.xml:1366(para)
1444
"Replace <emphasis>example.com</emphasis> with your domain name, and "
1445
"<emphasis>Administrator</emphasis> with the appropriate user name."
1448
#: serverguide/C/windows-networking.xml:1372(para)
1450
"You will then be prompted for the user's password. If all goes well a "
1451
"<emphasis>SUCCESS</emphasis> message should be printed to the console."
1454
#: serverguide/C/windows-networking.xml:1377(para)
1456
"After successfully joining an Ubuntu machine to an Active Directory domain "
1457
"you can authenticate using any valid AD user. To login you will need to "
1458
"enter the user name as 'domain\\username'. For example to ssh to a server "
1459
"joined to the domain enter:"
1462
#: serverguide/C/windows-networking.xml:1384(command)
1463
msgid "ssh 'example\\steve'@hostname"
1466
#: serverguide/C/windows-networking.xml:1388(para)
1468
"If configuring a Desktop the user name will need to be prefixed with "
1469
"<emphasis role=\"italic\">domain\\</emphasis> in the graphical logon as well."
1472
#: serverguide/C/windows-networking.xml:1394(para)
1474
"To make likewise-open use a default domain, you can add the following "
1475
"statement to <filename>/etc/samba/lwiauthd.conf</filename>:"
1478
#: serverguide/C/windows-networking.xml:1398(programlisting)
1482
"winbind use default domain = yes\n"
1485
#: serverguide/C/windows-networking.xml:1402(para)
1486
msgid "Then restart the <application>likewise-open</application> daemons:"
1489
#: serverguide/C/windows-networking.xml:1407(command)
1490
msgid "sudo /etc/init.d/likewise-open restart"
1493
#: serverguide/C/windows-networking.xml:1411(para)
1495
"Once configured for a <emphasis>default domain</emphasis> the <emphasis "
1496
"role=\"italic\">'domain\\'</emphasis> is no longer required, users can login "
1497
"using only their username."
1500
#: serverguide/C/windows-networking.xml:1417(para)
1502
"The <application>domainjoin-cli</application> utility can also be used to "
1503
"leave the domain. From a terminal:"
1506
#: serverguide/C/windows-networking.xml:1422(command)
1507
msgid "sudo domainjoin-cli leave"
1510
#: serverguide/C/windows-networking.xml:1427(title) serverguide/C/security.xml:1830(title)
1511
msgid "Other Utilities"
1514
#: serverguide/C/windows-networking.xml:1429(para)
1516
"The <application>likewise-open</application> package comes with a few other "
1517
"utilities that may be useful for gathering information about the Active "
1518
"Directory environment. These utilities are used to join the machine to the "
1519
"domain, and are the same as those available in the <application>samba-"
1520
"common</application> and <application>winbind</application> packages:"
1523
#: serverguide/C/windows-networking.xml:1438(para)
1525
"<application>lwinet</application>: Returns information about the network and "
1529
#: serverguide/C/windows-networking.xml:1443(para)
1531
"<application>lwimsg</application>: Allows interaction with the "
1532
"<application>likewise-winbindd</application> daemon."
1535
#: serverguide/C/windows-networking.xml:1448(para)
1537
"<application>lwiinfo</application>: Displays information about various parts "
1541
#: serverguide/C/windows-networking.xml:1454(para)
1542
msgid "Please refer to each utility's man page specific for details."
1545
#: serverguide/C/windows-networking.xml:1460(title) serverguide/C/mail.xml:155(title) serverguide/C/mail.xml:1370(title) serverguide/C/dns.xml:338(title)
1546
msgid "Troubleshooting"
1549
#: serverguide/C/windows-networking.xml:1464(para)
1551
"If the client has trouble joining the domain, double check that the "
1552
"Microsoft DNS is listed first in <filename>/etc/resolv.conf</filename>. For "
1556
#: serverguide/C/windows-networking.xml:1469(programlisting)
1560
"nameserver 192.168.0.1\n"
1563
#: serverguide/C/windows-networking.xml:1474(para)
1565
"For more information when joining a domain, use the <emphasis>--loglevel "
1566
"verbose</emphasis> or <emphasis>--advanced</emphasis> option of the "
1567
"<application>domainjoin-cli</application> utility:"
1570
#: serverguide/C/windows-networking.xml:1480(command)
1571
msgid "sudo domainjoin-cli --loglevel verbose join example.com Administrator"
1574
#: serverguide/C/windows-networking.xml:1484(para)
1576
"If an Active Directory user has trouble logging in, check the "
1577
"<filename>/var/log/auth.log</filename> for details."
1580
#: serverguide/C/windows-networking.xml:1489(para)
1582
"When joining an Ubuntu Desktop workstation to a domain, you may need to edit "
1583
"<filename>/etc/nsswitch.conf</filename> if your AD domain uses the <emphasis "
1584
"role=\"italic\">.local</emphasis> syntax. In order to join the domain the "
1585
"<emphasis>\"mdns4\"</emphasis> entry from the <emphasis>hosts</emphasis> "
1586
"option. For example:"
1589
#: serverguide/C/windows-networking.xml:1495(programlisting)
1593
"hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4\n"
1596
#: serverguide/C/windows-networking.xml:1499(para)
1597
msgid "Change the above to:"
1600
#: serverguide/C/windows-networking.xml:1503(programlisting)
1604
"hosts: files dns [NOTFOUND=return]\n"
1607
#: serverguide/C/windows-networking.xml:1507(para)
1608
msgid "Then restart networking by entering:"
1611
#: serverguide/C/windows-networking.xml:1512(command) serverguide/C/network-config.xml:237(command)
1612
msgid "sudo /etc/init.d/networking restart"
1615
#: serverguide/C/windows-networking.xml:1515(para)
1616
msgid "You should now be able to join the Active Directory domain."
1619
#: serverguide/C/windows-networking.xml:1523(title)
1620
msgid "Microsoft DNS"
1623
#: serverguide/C/windows-networking.xml:1525(para)
1625
"The following are instructions for installing DNS on an Active Directory "
1626
"domain controller running Windows Server 2003, but the instructions should "
1627
"be similar for other versions:"
1630
#: serverguide/C/windows-networking.xml:1532(para)
1633
"<menuchoice><guimenuitem>Start</guimenuitem><guimenuitem>Administrative Tools"
1634
"</guimenuitem><guimenuitem>Manager Your Server</guimenuitem></menuchoice>. "
1635
"This will open the <application>Server Role Mangement</application> utility."
1638
#: serverguide/C/windows-networking.xml:1540(para)
1639
msgid "Click Add or remove a role"
1642
#: serverguide/C/windows-networking.xml:1541(para) serverguide/C/windows-networking.xml:1543(para) serverguide/C/windows-networking.xml:1546(para)
1646
#: serverguide/C/windows-networking.xml:1542(para)
1647
msgid "Select \"DNS Server\""
1650
#: serverguide/C/windows-networking.xml:1544(para)
1654
#: serverguide/C/windows-networking.xml:1545(para)
1655
msgid "Select \"Create a forward lookup zone\" if it is not selected."
1658
#: serverguide/C/windows-networking.xml:1547(para)
1660
"Make sure \"This server maintains the zone\" is selected and click Next."
1663
#: serverguide/C/windows-networking.xml:1548(para)
1664
msgid "Enter your domain name and click Next"
1667
#: serverguide/C/windows-networking.xml:1549(para) serverguide/C/windows-networking.xml:1550(para)
1668
msgid "Click Next to \"Allow only secure dynamic updates\""
1671
#: serverguide/C/windows-networking.xml:1552(para)
1673
"Enter the IP for DNS servers to forward queries to, or Select \"No, it "
1674
"should not forward queries\" and click Next."
1677
#: serverguide/C/windows-networking.xml:1556(para) serverguide/C/windows-networking.xml:1557(para)
1678
msgid "Click Finish"
1681
#: serverguide/C/windows-networking.xml:1559(para)
1683
"DNS is now installed and can be further configured using the "
1684
"<application>Microsoft Management Console</application> DNS snap-in."
1687
#: serverguide/C/windows-networking.xml:1567(para)
1691
#: serverguide/C/windows-networking.xml:1568(para)
1692
msgid "Control Panel"
1695
#: serverguide/C/windows-networking.xml:1569(para)
1696
msgid "Network Connections"
1699
#: serverguide/C/windows-networking.xml:1570(para)
1700
msgid "Right Click \"Local Area Connection\""
1703
#: serverguide/C/windows-networking.xml:1571(para)
1704
msgid "Click Properties"
1707
#: serverguide/C/windows-networking.xml:1572(para)
1708
msgid "Double click \"Internet Protocol (TCP/IP)\""
1711
#: serverguide/C/windows-networking.xml:1573(para)
1712
msgid "Enter the Server's IP Address as the \"Preferred DNS server\""
1715
#: serverguide/C/windows-networking.xml:1574(para)
1719
#: serverguide/C/windows-networking.xml:1575(para)
1720
msgid "Click Ok again to save the settings"
1723
#: serverguide/C/windows-networking.xml:1564(para)
1725
"Next, configure the Server to use itself for DNS queries: <placeholder-1/>"
1728
#: serverguide/C/windows-networking.xml:1582(title) serverguide/C/web-servers.xml:624(title) serverguide/C/web-servers.xml:766(title) serverguide/C/web-servers.xml:910(title) serverguide/C/web-servers.xml:1002(title) serverguide/C/web-servers.xml:1218(title) serverguide/C/virtualization.xml:1303(title) serverguide/C/virtualization.xml:1492(title) serverguide/C/vcs.xml:534(title) serverguide/C/security.xml:935(title) serverguide/C/security.xml:1264(title) serverguide/C/security.xml:1679(title) serverguide/C/security.xml:1870(title) serverguide/C/remote-administration.xml:203(title) serverguide/C/package-management.xml:432(title) serverguide/C/other-apps.xml:379(title) serverguide/C/network-config.xml:694(title) serverguide/C/mail.xml:263(title) serverguide/C/mail.xml:444(title) serverguide/C/mail.xml:591(title) serverguide/C/mail.xml:1008(title) serverguide/C/mail.xml:1418(title) serverguide/C/lamp-applications.xml:252(title) serverguide/C/lamp-applications.xml:362(title) serverguide/C/lamp-applications.xml:464(title) serverguide/C/file-server.xml:284(title) serverguide/C/file-server.xml:431(title) serverguide/C/file-server.xml:592(title) serverguide/C/dns.xml:572(title) serverguide/C/clustering.xml:227(title) serverguide/C/chat.xml:107(title) serverguide/C/chat.xml:150(title) serverguide/C/backups.xml:297(title)
1732
#: serverguide/C/windows-networking.xml:1584(para)
1734
"Please refer to the <ulink "
1735
"url=\"http://www.likewisesoftware.com/\">Likewise</ulink> home page for "
1736
"further information."
1739
#: serverguide/C/windows-networking.xml:1588(para)
1741
"For more <application>domainjoin-cli</application> options see the man page: "
1742
"<command>man domainjoin-cli</command>."
1745
#: serverguide/C/web-servers.xml:13(title)
1749
#: serverguide/C/web-servers.xml:14(para)
1751
"A Web server is a software responsible for accepting HTTP requests from "
1752
"clients, which are known as Web browsers, and serving them HTTP responses "
1753
"along with optional data contents, which usually are Web pages such as HTML "
1754
"documents and linked objects (images, etc.)."
1757
#: serverguide/C/web-servers.xml:19(title)
1758
msgid "HTTPD - Apache2 Web Server"
1761
#: serverguide/C/web-servers.xml:20(para)
1763
"Apache is the most commonly used Web Server on Linux systems. Web Servers "
1764
"are used to serve Web Pages requested by client computers. Clients typically "
1765
"request and view Web Pages using Web Browser applications such as "
1766
"<application>Firefox</application>, <application>Opera</application>, or "
1767
"<application>Mozilla</application>."
1770
#: serverguide/C/web-servers.xml:24(para)
1772
"Users enter a Uniform Resource Locator (URL) to point to a Web server by "
1773
"means of its Fully Qualified Domain Name (FQDN) and a path to the required "
1774
"resource. For example, to view the home page of the <ulink "
1775
"url=\"http://www.ubuntu.com\">Ubuntu Web site</ulink> a user will enter only "
1776
"the FQDN. To request specific information about <ulink "
1777
"url=\"http://www.ubuntu.com/support/paid\">paid support</ulink>, a user will "
1778
"enter the FQDN followed by a path."
1781
#: serverguide/C/web-servers.xml:29(para)
1783
"The most common protocol used to transfer Web pages is the Hyper Text "
1784
"Transfer Protocol (HTTP). Protocols such as Hyper Text Transfer Protocol "
1785
"over Secure Sockets Layer (HTTPS), and File Transfer Protocol (FTP), a "
1786
"protocol for uploading and downloading files, are also supported."
1789
#: serverguide/C/web-servers.xml:33(para)
1791
"Apache Web Servers are often used in combination with the "
1792
"<application>MySQL</application> database engine, the HyperText Preprocessor "
1793
"(<application>PHP</application>) scripting language, and other popular "
1794
"scripting languages such as <application>Python</application> and "
1795
"<application>Perl</application>. This configuration is termed LAMP (Linux, "
1796
"Apache, MySQL and Perl/Python/PHP) and forms a powerful and robust platform "
1797
"for the development and deployment of Web-based applications."
1800
#: serverguide/C/web-servers.xml:42(para)
1802
"The Apache2 web server is available in Ubuntu Linux. To install Apache2:"
1805
#: serverguide/C/web-servers.xml:48(para)
1806
msgid "At a terminal prompt enter the following command:"
1809
#: serverguide/C/web-servers.xml:53(command)
1810
msgid "sudo apt-get install apache2"
1813
#: serverguide/C/web-servers.xml:63(para)
1815
"Apache2 is configured by placing <emphasis>directives</emphasis> in plain "
1816
"text configuration files. The configuration files are separated between the "
1817
"following files and directories:"
1820
#: serverguide/C/web-servers.xml:71(para)
1822
"<emphasis>apache2.conf:</emphasis> the main Apache2 configuration file. "
1823
"Contains settings that are <emphasis>global</emphasis> to Apache2."
1826
#: serverguide/C/web-servers.xml:77(para)
1828
"<emphasis>conf.d:</emphasis> contains configuration files which apply "
1829
"<emphasis>globally</emphasis> to Apache. Other packages that use Apache2 to "
1830
"serve content may add files, or symlinks, to this directory."
1833
#: serverguide/C/web-servers.xml:83(para)
1835
"<emphasis>envvars:</emphasis> file where Apache2 "
1836
"<emphasis>environment</emphasis> variables are set."
1839
#: serverguide/C/web-servers.xml:88(para)
1841
"<emphasis>httpd.conf:</emphasis> historically the main Apache2 configuration "
1842
"file, named after the <application>httpd</application> daemon. The file can "
1843
"be used for <emphasis>user specific</emphasis> configuration options that "
1844
"globally effect Apache2."
1847
#: serverguide/C/web-servers.xml:95(para)
1849
"<emphasis>mods-available:</emphasis> this directory contains configuration "
1850
"files to both load <emphasis>modules</emphasis> and configure them. Not all "
1851
"modules will have specific configuration files, however."
1854
#: serverguide/C/web-servers.xml:101(para)
1856
"<emphasis>mods-enabled:</emphasis> holds <emphasis>symlinks</emphasis> to "
1857
"the files in <filename>/etc/apache2/mods-available</filename>. When a module "
1858
"configuration file is symlinked it will be enabled the next time "
1859
"<application>apache2</application> is restarted."
1862
#: serverguide/C/web-servers.xml:108(para)
1864
"<emphasis>ports.conf:</emphasis> houses the directives that determine which "
1865
"TCP ports Apache2 is listening on."
1868
#: serverguide/C/web-servers.xml:113(para)
1870
"<emphasis>sites-available:</emphasis> this directory has configuration files "
1871
"for Apache <emphasis>Virtual Hosts</emphasis>. Virtual Hosts allow Apache2 "
1872
"to be configured for multiple sites that have separate configurations."
1875
#: serverguide/C/web-servers.xml:119(para)
1877
"<emphasis>sites-enabled:</emphasis> like mods-enabled, <filename "
1878
"role=\"directory\">sites-enabled</filename> contains symlinks to the "
1879
"<filename>/etc/apache2/sites-available</filename> directory. Similarly when "
1880
"a configuration file in sites-available is symlinked it will be active once "
1881
"Apache is restarted."
1884
#: serverguide/C/web-servers.xml:127(para)
1886
"In addition, other configuration files may be added using the "
1887
"<emphasis>Include</emphasis> directive, and wildcards can be used to include "
1888
"many configuration files. Any directive may be placed in any of these "
1889
"configuration files. Changes to the main configuration files are only "
1890
"recognized by Apache2 when it is started or restarted."
1893
#: serverguide/C/web-servers.xml:136(para)
1895
"The server also reads a file containing mime document types; the filename is "
1896
"set by the <emphasis>TypesConfig</emphasis> directive, and is "
1897
"<filename>/etc/mime.types</filename> by default."
1900
#: serverguide/C/web-servers.xml:141(title)
1901
msgid "Basic Settings"
1904
#: serverguide/C/web-servers.xml:142(para)
1906
"This section explains Apache2 server essential configuration parameters. "
1907
"Refer to the <ulink url=\"http://httpd.apache.org/docs/2.2/\">Apache2 "
1908
"Documentation</ulink> for more details."
1911
#: serverguide/C/web-servers.xml:150(para)
1913
"Apache2 ships with a virtual-host-friendly default configuration. That is, "
1914
"it is configured with a single default virtual host (using the "
1915
"<emphasis>VirtualHost</emphasis> directive) which can modified or used as-is "
1916
"if you have a single site, or used as a template for additional virtual "
1917
"hosts if you have multiple sites. If left alone, the default virtual host "
1918
"will serve as your default site, or the site users will see if the URL they "
1919
"enter does not match the <emphasis>ServerName</emphasis> directive of any of "
1920
"your custom sites. To modify the default virtual host, edit the file "
1921
"<filename>/etc/apache2/sites-available/default</filename>."
1924
#: serverguide/C/web-servers.xml:163(para)
1926
"The directives set for a virtual host only apply to that particular virtual "
1927
"host. If a directive is set server-wide and not defined within the virtual "
1928
"host settings, the default setting is used. For example, you can define a "
1929
"Webmaster email address and not define individual email addresses for each "
1933
#: serverguide/C/web-servers.xml:171(para)
1935
"If you wish to configure a new virtual host or site, copy that file into the "
1936
"same directory with a name you choose. For example:"
1939
#: serverguide/C/web-servers.xml:177(command)
1941
"sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-"
1942
"available/mynewsite"
1945
#: serverguide/C/web-servers.xml:180(para)
1947
"Edit the new file to configure the new site using some of the directives "
1951
#: serverguide/C/web-servers.xml:187(para)
1953
"The <emphasis>ServerAdmin</emphasis> directive specifies the email address "
1954
"to be advertised for the server's administrator. The default value is "
1955
"webmaster@localhost. This should be changed to an email address that is "
1956
"delivered to you (if you are the server's administrator). If your website "
1957
"has a problem, Apache2 will display an error message containing this email "
1958
"address to report the problem to. Find this directive in your site's "
1959
"configuration file in /etc/apache2/sites-available."
1962
#: serverguide/C/web-servers.xml:198(para)
1964
"The <emphasis>Listen</emphasis> directive specifies the port, and optionally "
1965
"the IP address, Apache2 should listen on. If the IP address is not "
1966
"specified, Apache2 will listen on all IP addresses assigned to the machine "
1967
"it runs on. The default value for the Listen directive is 80. Change this to "
1968
"127.0.0.1:80 to cause Apache2 to listen only on your loopback interface so "
1969
"that it will not be available to the Internet, to (for example) 81 to change "
1970
"the port that it listens on, or leave it as is for normal operation. This "
1971
"directive can be found and changed in its own file, "
1972
"<filename>/etc/apache2/ports.conf</filename>"
1975
#: serverguide/C/web-servers.xml:211(para)
1977
"The <emphasis>ServerName</emphasis> directive is optional and specifies what "
1978
"FQDN your site should answer to. The default virtual host has no ServerName "
1979
"directive specified, so it will respond to all requests that do not match a "
1980
"ServerName directive in another virtual host. If you have just acquired the "
1981
"domain name ubunturocks.com and wish to host it on your Ubuntu server, the "
1982
"value of the ServerName directive in your virtual host configuration file "
1983
"should be ubunturocks.com. Add this directive to the new virtual host file "
1984
"you created earlier (<filename>/etc/apache2/sites-"
1985
"available/mynewsite</filename>)."
1988
#: serverguide/C/web-servers.xml:223(para)
1990
"You may also want your site to respond to www.ubunturocks.com, since many "
1991
"users will assume the www prefix is appropriate. Use the "
1992
"<emphasis>ServerAlias</emphasis> directive for this. You may also use "
1993
"wildcards in the ServerAlias directive."
1996
#: serverguide/C/web-servers.xml:230(para)
1998
"For example, the following configuration will cause your site to respond to "
1999
"any domain request ending in <emphasis>.ubunturocks.com</emphasis>."
2002
#: serverguide/C/web-servers.xml:236(programlisting)
2006
"ServerAlias *.ubunturocks.com\n"
2009
#: serverguide/C/web-servers.xml:242(para)
2011
"The <emphasis>DocumentRoot</emphasis> directive specifies where Apache "
2012
"should look for the files that make up the site. The default value is "
2013
"/var/www. No site is configured there, but if you uncomment the "
2014
"<emphasis>RedirectMatch</emphasis> directive in "
2015
"<filename>/etc/apache2/apache2.conf</filename> requests will be redirected "
2016
"to /var/www/apache2-default where the default Apache2 site awaits. Change "
2017
"this value in your site's virtual host file, and remember to create that "
2018
"directory if necessary!"
2021
#: serverguide/C/web-servers.xml:254(para)
2023
"The /etc/apache2/sites-available directory is <emphasis role=\"bold\"> "
2024
"not</emphasis> parsed by Apache2. Symbolic links in /etc/apache2/sites-"
2025
"enabled point to \"available\" sites."
2028
#: serverguide/C/web-servers.xml:260(para)
2030
"Enable the new <emphasis>VirtualHost</emphasis> using the "
2031
"<application>a2ensite</application> utility and restart Apache:"
2034
#: serverguide/C/web-servers.xml:266(command)
2035
msgid "sudo a2ensite mynewsite"
2038
#: serverguide/C/web-servers.xml:267(command) serverguide/C/web-servers.xml:285(command) serverguide/C/web-servers.xml:538(command) serverguide/C/web-servers.xml:547(command) serverguide/C/web-servers.xml:606(command) serverguide/C/mail.xml:723(command) serverguide/C/lamp-applications.xml:221(command)
2039
msgid "sudo /etc/init.d/apache2 restart"
2042
#: serverguide/C/web-servers.xml:271(para)
2044
"Be sure to replace <emphasis>mynewsite</emphasis> with a more descriptive "
2045
"name for the VirtualHost. One method is to name the file after the "
2046
"<emphasis>ServerName</emphasis> directive of the VirtualHost."
2049
#: serverguide/C/web-servers.xml:278(para)
2051
"Similarly, use the <application>a2dissite</application> utility to disable "
2052
"sites. This is can be useful when troubleshooting configuration problems "
2053
"with multiple VirtualHosts:"
2056
#: serverguide/C/web-servers.xml:284(command)
2057
msgid "sudo a2dissite mynewsite"
2060
#: serverguide/C/web-servers.xml:290(title)
2061
msgid "Default Settings"
2064
#: serverguide/C/web-servers.xml:292(para)
2066
"This section explains configuration of the Apache2 server default settings. "
2067
"For example, if you add a virtual host, the settings you configure for the "
2068
"virtual host take precedence for that virtual host. For a directive not "
2069
"defined within the virtual host settings, the default value is used."
2072
#: serverguide/C/web-servers.xml:304(para)
2074
"The <emphasis>DirectoryIndex</emphasis> is the default page served by the "
2075
"server when a user requests an index of a directory by specifying a forward "
2076
"slash (/) at the end of the directory name."
2079
#: serverguide/C/web-servers.xml:311(para)
2081
"For example, when a user requests the page "
2082
"http://www.example.com/this_directory/, he or she will get either the "
2083
"DirectoryIndex page if it exists, a server-generated directory list if it "
2084
"does not and the Indexes option is specified, or a Permission Denied page if "
2085
"neither is true. The server will try to find one of the files listed in the "
2086
"DirectoryIndex directive and will return the first one it finds. If it does "
2087
"not find any of these files and if Options Indexes is set for that "
2088
"directory, the server will generate and return a list, in HTML format, of "
2089
"the subdirectories and files in the directory. The default value, found in "
2090
"<filename>/etc/apache2/apache2.conf</filename> is \" index.html index.cgi "
2091
"index.pl index.php index.xhtml\". Thus, if Apache2 finds a file in a "
2092
"requested directory matching any of these names, the first will be displayed."
2095
#: serverguide/C/web-servers.xml:332(para)
2097
"The <emphasis>ErrorDocument</emphasis> directive allows you to specify a "
2098
"file for Apache to use for specific error events. For example, if a user "
2099
"requests a resource that does not exist, a 404 error will occur, and per "
2100
"Apache2's default configuration, the file "
2101
"<filename>/usr/share/apache2/error/HTTP_NOT_FOUND.html.var </filename> will "
2102
"be displayed. That file is not in the server's DocumentRoot, but there is an "
2103
"Alias directive in <filename>/etc/apache2/apache2.conf</filename> that "
2104
"redirects requests to the /error directory to "
2105
"<filename>/usr/share/apache2/error/</filename>."
2108
#: serverguide/C/web-servers.xml:344(para)
2110
"To see a list of the default ErrorDocument directives, use this command:"
2113
#: serverguide/C/web-servers.xml:350(command)
2114
msgid "grep ErrorDocument /etc/apache2/apache2.conf"
2117
#: serverguide/C/web-servers.xml:355(para)
2119
"By default, the server writes the transfer log to the file "
2120
"<filename>/var/log/apache2/access.log</filename>. You can change this on a "
2121
"per-site basis in your virtual host configuration files with the "
2122
"<emphasis>CustomLog</emphasis> directive, or omit it to accept the default, "
2123
"specified in <filename> /etc/apache2/apache2.conf</filename>. You may also "
2124
"specify the file to which errors are logged, via the "
2125
"<emphasis>ErrorLog</emphasis> directive, whose default is "
2126
"<filename>/var/log/apache2/error.log</filename>. These are kept separate "
2127
"from the transfer logs to aid in troubleshooting problems with your Apache2 "
2128
"server. You may also specify the <emphasis>LogLevel</emphasis> (the default "
2129
"value is \"warn\") and the <emphasis>LogFormat</emphasis> (see <filename> "
2130
"/etc/apache2/apache2.conf</filename> for the default value)."
2133
#: serverguide/C/web-servers.xml:370(para)
2135
"Some options are specified on a per-directory basis rather than per-server. "
2136
"<emphasis>Options</emphasis> is one of these directives. A Directory stanza "
2137
"is enclosed in XML-like tags, like so:"
2140
#: serverguide/C/web-servers.xml:376(programlisting)
2144
"<Directory /var/www/mynewsite>\n"
2146
"</Directory>\n"
2149
#: serverguide/C/web-servers.xml:382(para)
2151
"The <emphasis>Options</emphasis> directive within a Directory stanza accepts "
2152
"one or more of the following values (among others), separated by spaces:"
2155
#: serverguide/C/web-servers.xml:394(para)
2157
"Most files should not be executed as CGI scripts. This would be very "
2158
"dangerous. CGI scripts should kept in a directory separate from and outside "
2159
"your DocumentRoot, and only this directory should have the ExecCGI option "
2160
"set. This is the default, and the default location for CGI scripts is "
2161
"<filename>/usr/lib/cgi-bin</filename>."
2164
#: serverguide/C/web-servers.xml:389(para)
2166
"<emphasis role=\"bold\">ExecCGI</emphasis> - Allow execution of CGI scripts. "
2167
"CGI scripts are not executed if this option is not chosen. <placeholder-1/>"
2170
#: serverguide/C/web-servers.xml:405(para)
2172
"<emphasis role=\"bold\">Includes</emphasis> - Allow server-side includes. "
2173
"Server-side includes allow an HTML file to <emphasis> include</emphasis> "
2174
"other files. This is not a common option. See <ulink "
2175
"url=\"http://httpd.apache.org/docs/2.2/howto/ssi.html\">the Apache2 SSI "
2176
"HOWTO</ulink> for more information."
2179
#: serverguide/C/web-servers.xml:414(para)
2181
"<emphasis role=\"bold\">IncludesNOEXEC</emphasis> - Allow server-side "
2182
"includes, but disable the <emphasis>#exec</emphasis> and "
2183
"<emphasis>#include</emphasis> commands in CGI scripts."
2186
#: serverguide/C/web-servers.xml:426(para)
2188
"For security reasons, this should usually not be set, and certainly should "
2189
"not be set on your DocumentRoot directory. Enable this option carefully on a "
2190
"per-directory basis only if you are certain you want users to see the entire "
2191
"contents of the directory."
2194
#: serverguide/C/web-servers.xml:421(para)
2196
"<emphasis role=\"bold\">Indexes</emphasis> - Display a formatted list of the "
2197
"directory's contents, if no <emphasis>DirectoryIndex</emphasis> (such as "
2198
"index.html) exists in the requested directory. <placeholder-1/>"
2201
#: serverguide/C/web-servers.xml:436(para)
2203
"<emphasis role=\"bold\">Multiview</emphasis> - Support content-negotiated "
2204
"multiviews; this option is disabled by default for security reasons. See the "
2206
"url=\"http://httpd.apache.org/docs/2.2/mod/mod_negotiation.html#multiviews\">"
2207
"Apache2 documentation on this option</ulink>."
2210
#: serverguide/C/web-servers.xml:444(para)
2212
"<emphasis role=\"bold\">SymLinksIfOwnerMatch</emphasis> - Only follow "
2213
"symbolic links if the target file or directory has the same owner as the "
2217
#: serverguide/C/web-servers.xml:456(title)
2218
msgid "httpd Settings"
2221
#: serverguide/C/web-servers.xml:458(para)
2223
"This section explains some basic <application>httpd</application> daemon "
2224
"configuration settings."
2227
#: serverguide/C/web-servers.xml:462(para)
2229
"<emphasis role=\"bold\">LockFile</emphasis> - The LockFile directive sets "
2230
"the path to the lockfile used when the server is compiled with either "
2231
"USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. It must be "
2232
"stored on the local disk. It should be left to the default value unless the "
2233
"logs directory is located on an NFS share. If this is the case, the default "
2234
"value should be changed to a location on the local disk and to a directory "
2235
"that is readable only by root."
2238
#: serverguide/C/web-servers.xml:471(para)
2240
"<emphasis role=\"bold\">PidFile</emphasis> - The PidFile directive sets the "
2241
"file in which the server records its process ID (pid). This file should only "
2242
"be readable by root. In most cases, it should be left to the default value."
2245
#: serverguide/C/web-servers.xml:477(para)
2247
"<emphasis role=\"bold\">User</emphasis> - The User directive sets the userid "
2248
"used by the server to answer requests. This setting determines the server's "
2249
"access. Any files inaccessible to this user will also be inaccessible to "
2250
"your website's visitors. The default value for User is www-data."
2253
#: serverguide/C/web-servers.xml:484(para)
2255
"Unless you know exactly what you are doing, do not set the User directive to "
2256
"root. Using root as the User will create large security holes for your Web "
2260
#: serverguide/C/web-servers.xml:490(para)
2262
"The Group directive is similar to the User directive. Group sets the group "
2263
"under which the server will answer requests. The default group is also www-"
2267
#: serverguide/C/web-servers.xml:496(title)
2268
msgid "Apache Modules"
2271
#: serverguide/C/web-servers.xml:498(para)
2273
"Apache is a modular server. This implies that only the most basic "
2274
"functionality is included in the core server. Extended features are "
2275
"available through modules which can be loaded into Apache. By default, a "
2276
"base set of modules is included in the server at compile-time. If the server "
2277
"is compiled to use dynamically loaded modules, then modules can be compiled "
2278
"separately, and added at any time using the LoadModule directive. Otherwise, "
2279
"Apache must be recompiled to add or remove modules."
2282
#: serverguide/C/web-servers.xml:510(para)
2284
"Ubuntu compiles Apache2 to allow the dynamic loading of modules. "
2285
"Configuration directives may be conditionally included on the presence of a "
2286
"particular module by enclosing them in an "
2287
"<emphasis><IfModule></emphasis> block."
2290
#: serverguide/C/web-servers.xml:517(para)
2292
"You can install additional Apache2 modules and use them with your Web "
2293
"server. For example, run the following command from a terminal prompt to "
2294
"install the <emphasis>MySQL Authentication</emphasis> module:"
2297
#: serverguide/C/web-servers.xml:524(command)
2298
msgid "sudo apt-get install libapache2-mod-auth-mysql"
2301
#: serverguide/C/web-servers.xml:527(para)
2303
"See the <filename>/etc/apache2/mods-available</filename> directory, for "
2304
"additional modules."
2307
#: serverguide/C/web-servers.xml:531(para)
2309
"Use the <application>a2enmod</application> utility to enable a module:"
2312
#: serverguide/C/web-servers.xml:537(command)
2313
msgid "sudo a2enmod auth_mysql"
2316
#: serverguide/C/web-servers.xml:541(para)
2317
msgid "Similarly, <application>a2dismod</application> will disable a module:"
2320
#: serverguide/C/web-servers.xml:546(command)
2321
msgid "sudo a2dismod auth_mysql"
2324
#: serverguide/C/web-servers.xml:553(title)
2325
msgid "HTTPS Configuration"
2328
#: serverguide/C/web-servers.xml:555(para)
2330
"The <application>mod_ssl</application> module adds an important feature to "
2331
"the Apache2 server - the ability to encrypt communications. Thus, when your "
2332
"browser is communicating using SSL, the https:// prefix is used at the "
2333
"beginning of the Uniform Resource Locator (URL) in the browser navigation "
2337
#: serverguide/C/web-servers.xml:564(para)
2339
"The <application>mod_ssl</application> module is available in "
2340
"<application>apache2-common</application> package. Execute the following "
2341
"command from a terminal prompt to enable the "
2342
"<application>mod_ssl</application> module:"
2345
#: serverguide/C/web-servers.xml:571(command)
2346
msgid "sudo a2enmod ssl"
2349
#: serverguide/C/web-servers.xml:574(para)
2351
"There is a default HTTPS configuration file in <filename>/etc/apache2/sites-"
2352
"available/default-ssl</filename>. In order for "
2353
"<application>Apache</application> to provide HTTPS, a "
2354
"<emphasis>certificate</emphasis> and <emphasis>key</emphasis> file are also "
2355
"needed. The default HTTPS configuration will use a certificate and key "
2356
"generated by the <application>ssl-cert</application> package. They are good "
2357
"for testing, but the auto-generated certificate and key should be replaced "
2358
"by a certificate specific to the site or server. For information on "
2359
"generating a key and obtaining a certificate see <xref "
2360
"linkend=\"certificates-and-security\"/>"
2363
#: serverguide/C/web-servers.xml:584(para)
2365
"To configure <application>Apache</application> for HTTPS, enter the "
2369
#: serverguide/C/web-servers.xml:589(command)
2370
msgid "sudo a2ensite default-ssl"
2373
#: serverguide/C/web-servers.xml:593(para)
2375
"The directories <filename>/etc/ssl/certs</filename> and "
2376
"<filename>/etc/ssl/private</filename> are the default locations. If you "
2377
"install the certificate and key in another directory make sure to change "
2378
"<emphasis>SSLCertificateFile</emphasis> and "
2379
"<emphasis>SSLCertificateKeyFile</emphasis> appropriately."
2382
#: serverguide/C/web-servers.xml:600(para)
2384
"With Apache now configured for HTTPS, restart the service to enable the new "
2388
#: serverguide/C/web-servers.xml:611(para)
2390
"Depending on how you obtained your certificate you may need to enter a "
2391
"passphrase when <application>Apache</application> starts."
2394
#: serverguide/C/web-servers.xml:617(para)
2396
"You can access the secure server pages by typing https://your_hostname/url/ "
2397
"in your browser address bar."
2400
#: serverguide/C/web-servers.xml:628(para)
2402
"<ulink url=\"http://httpd.apache.org/docs/2.2/\">Apache2 "
2403
"Documentation</ulink> contains in depth information on Apache2 configuration "
2404
"directives. Also, see the <application>apache2-doc</application> package for "
2405
"the official Apache2 docs."
2408
#: serverguide/C/web-servers.xml:635(para)
2410
"See the <ulink url=\"http://www.modssl.org/docs/\">Mod SSL "
2411
"Documentation</ulink> site for more SSL related information."
2414
#: serverguide/C/web-servers.xml:641(para)
2416
"O'Reilly's <ulink url=\"http://oreilly.com/catalog/9780596001919/\">Apache "
2417
"Cookbook</ulink> is a good resource for accomplishing specific Apache2 "
2421
#: serverguide/C/web-servers.xml:647(para)
2423
"For Ubuntu specific Apache2 questions, ask in the <emphasis>#ubuntu-"
2424
"server</emphasis> IRC channel on <ulink "
2425
"url=\"http://freenode.net/\">freenode.net</ulink>."
2428
#: serverguide/C/web-servers.xml:658(title)
2429
msgid "PHP5 - Scripting Language"
2432
#: serverguide/C/web-servers.xml:659(para)
2434
"PHP is a general-purpose scripting language suited for Web development. The "
2435
"PHP script can be embedded into HTML. This section explains how to install "
2436
"and configure PHP5 in Ubuntu System with Apache2 and MySQL."
2439
#: serverguide/C/web-servers.xml:663(para)
2441
"This section assumes you have installed and configured Apache 2 Web Server "
2442
"and MySQL Database Server. You can refer to Apache 2 section and MySQL "
2443
"sections in this document to install and configure Apache 2 and MySQL "
2447
#: serverguide/C/web-servers.xml:670(para)
2448
msgid "The PHP5 is available in Ubuntu Linux."
2451
#: serverguide/C/web-servers.xml:672(para)
2453
"To install PHP5 you can enter the following command in the terminal prompt: "
2455
"<command>sudo apt-get install php5 libapache2-mod-php5</command>\n"
2459
#: serverguide/C/web-servers.xml:681(para)
2461
"You can run PHP5 scripts from command line. To run PHP5 scripts from command "
2462
"line you should install <application>php5-cli</application> package. To "
2463
"install <application>php5-cli</application> you can enter the following "
2464
"command in the terminal prompt: <screen>\n"
2465
"<command>sudo apt-get install php5-cli</command>\n"
2469
#: serverguide/C/web-servers.xml:690(para)
2471
"You can also execute PHP5 scripts without installing PHP5 Apache module. To "
2472
"accomplish this, you should install <application>php5-cgi</application> "
2473
"package. You can run the following command in a terminal prompt to install "
2474
"<application>php5-cgi</application> package: <screen>\n"
2475
"<command>sudo apt-get install php5-cgi</command>\n"
2479
#: serverguide/C/web-servers.xml:700(para)
2481
"To use <application>MySQL</application> with PHP5 you should install "
2482
"<application>php5-mysql</application> package. To install <application>php5-"
2483
"mysql</application> you can enter the following command in the terminal "
2484
"prompt: <screen>\n"
2485
"<command>sudo apt-get install php5-mysql</command>\n"
2489
#: serverguide/C/web-servers.xml:708(para)
2491
"Similarly, to use <application>PostgreSQL</application> with PHP5 you should "
2492
"install <application>php5-pgsql</application> package. To install "
2493
"<application>php5-pgsql</application> you can enter the following command in "
2494
"the terminal prompt: <screen>\n"
2495
"<command>sudo apt-get install php5-pgsql</command>\n"
2499
#: serverguide/C/web-servers.xml:721(para)
2501
"Once you install PHP5, you can run PHP5 scripts from your web browser. If "
2502
"you have installed <application>php5-cli</application> package, you can run "
2503
"PHP5 scripts from your command prompt."
2506
#: serverguide/C/web-servers.xml:728(para)
2508
"By default, the Apache 2 Web server is configured to run PHP5 scripts. In "
2509
"other words, the PHP5 module is enabled in Apache2 Web server automatically "
2510
"when you install the module. Please verify if the files "
2511
"<filename>/etc/apache2/mods-enabled/php5.conf</filename> and "
2512
"<filename>/etc/apache2/mods-enabled/php5.load</filename> exist. If they do "
2513
"not exists, you can enable the module using <command>a2enmod</command> "
2517
#: serverguide/C/web-servers.xml:739(para)
2519
"Once you install PHP5 related packages and enabled PHP5 Apache 2 module, you "
2520
"should restart Apache2 Web server to run PHP5 scripts. You can run the "
2521
"following command at a terminal prompt to restart your web server: "
2522
"<screen><command>sudo /etc/init.d/apache2 restart</command> </screen>"
2525
#: serverguide/C/web-servers.xml:747(title) serverguide/C/mail.xml:124(title) serverguide/C/mail.xml:1341(title) serverguide/C/dns.xml:343(title) serverguide/C/clustering.xml:177(title)
2529
#: serverguide/C/web-servers.xml:748(para)
2531
"To verify your installation, you can run following PHP5 phpinfo script:"
2534
#: serverguide/C/web-servers.xml:751(programlisting)
2539
"print_r (phpinfo());\n"
2543
#: serverguide/C/web-servers.xml:756(para)
2545
"You can save the content in a file <filename>phpinfo.php</filename> and "
2546
"place it under <command>DocumentRoot</command> directory of Apache2 Web "
2547
"server. When point your browser to "
2548
"<filename>http://hostname/phpinfo.php</filename>, it would display values of "
2549
"various PHP5 configuration parameters."
2552
#: serverguide/C/web-servers.xml:770(para)
2554
"For more in depth information see <ulink "
2555
"url=\"http://www.php.net/docs.php\">php.net</ulink> documentation."
2558
#: serverguide/C/web-servers.xml:775(para)
2560
"There are a plethora of books on PHP. Two good books from O'Reilly are "
2561
"<ulink url=\"http://oreilly.com/catalog/9780596005603/\">Learning PHP "
2562
"5</ulink> and the <ulink "
2563
"url=\"http://oreilly.com/catalog/9781565926813/\">PHP Cook Book</ulink>."
2566
#: serverguide/C/web-servers.xml:787(title)
2567
msgid "Squid - Proxy Server"
2570
#: serverguide/C/web-servers.xml:788(para)
2572
"Squid is a full-featured web proxy cache server application which provides "
2573
"proxy and cache services for Hyper Text Transport Protocol (HTTP), File "
2574
"Transfer Protocol (FTP), and other popular network protocols. Squid can "
2575
"implement caching and proxying of Secure Sockets Layer (SSL) requests and "
2576
"caching of Domain Name Server (DNS) lookups, and perform transparent "
2577
"caching. Squid also supports a wide variety of caching protocols, such as "
2578
"Internet Cache Protocol, (ICP) the Hyper Text Caching Protocol, (HTCP) the "
2579
"Cache Array Routing Protocol (CARP), and the Web Cache Coordination "
2583
#: serverguide/C/web-servers.xml:796(para)
2585
"The Squid proxy cache server is an excellent solution to a variety of proxy "
2586
"and caching server needs, and scales from the branch office to enterprise "
2587
"level networks while providing extensive, granular access control mechanisms "
2588
"and monitoring of critical parameters via the Simple Network Management "
2589
"Protocol (SNMP). When selecting a computer system for use as a dedicated "
2590
"Squid proxy, or caching servers, ensure your system is configured with a "
2591
"large amount of physical memory, as Squid maintains an in-memory cache for "
2592
"increased performance."
2595
#: serverguide/C/web-servers.xml:805(para)
2597
"At a terminal prompt, enter the following command to install the Squid "
2601
#: serverguide/C/web-servers.xml:810(command)
2602
msgid "sudo apt-get install squid"
2605
#: serverguide/C/web-servers.xml:816(para)
2607
"Squid is configured by editing the directives contained within the "
2608
"<filename>/etc/squid/squid.conf</filename> configuration file. The following "
2609
"examples illustrate some of the directives which may be modified to affect "
2610
"the behavior of the Squid server. For more in-depth configuration of Squid, "
2611
"see the References section."
2614
#: serverguide/C/web-servers.xml:822(para)
2616
"Prior to editing the configuration file, you should make a copy of the "
2617
"original file and protect it from writing so you will have the original "
2618
"settings as a reference, and to re-use as necessary."
2621
#: serverguide/C/web-servers.xml:825(para)
2623
"Copy the <filename>/etc/squid/squid.conf</filename> file and protect it from "
2624
"writing with the following commands entered at a terminal prompt:"
2627
#: serverguide/C/web-servers.xml:830(command)
2628
msgid "sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original"
2631
#: serverguide/C/web-servers.xml:831(command)
2632
msgid "sudo chmod a-w /etc/squid/squid.conf.original"
2635
#: serverguide/C/web-servers.xml:837(para)
2637
"To set your Squid server to listen on TCP port 8888 instead of the default "
2638
"TCP port 3128, change the http_port directive as such:"
2641
#: serverguide/C/web-servers.xml:841(programlisting)
2648
#: serverguide/C/web-servers.xml:846(para)
2650
"Change the visible_hostname directive in order to give the Squid server a "
2651
"specific hostname. This hostname does not necessarily need to be the "
2652
"computer's hostname. In this example it is set to <emphasis>weezie</emphasis>"
2655
#: serverguide/C/web-servers.xml:850(programlisting)
2659
"visible_hostname weezie\n"
2662
#: serverguide/C/web-servers.xml:855(para)
2664
"Again, Using Squid's access control, you may configure use of Internet "
2665
"services proxied by Squid to be available only users with certain Internet "
2666
"Protocol (IP) addresses. For example, we will illustrate access by users of "
2667
"the 192.168.42.0/24 subnetwork only:"
2670
#: serverguide/C/web-servers.xml:860(para) serverguide/C/web-servers.xml:880(para)
2672
"Add the following to the <emphasis role=\"bold\">bottom</emphasis> of the "
2673
"ACL section of your <filename>/etc/squid/squid.conf</filename> file:"
2676
#: serverguide/C/web-servers.xml:863(programlisting)
2680
"acl fortytwo_network src 192.168.42.0/24\n"
2683
#: serverguide/C/web-servers.xml:866(para) serverguide/C/web-servers.xml:887(para)
2685
"Then, add the following to the <emphasis role=\"bold\">top</emphasis> of the "
2686
"http_access section of your <filename>/etc/squid/squid.conf</filename> file:"
2689
#: serverguide/C/web-servers.xml:870(programlisting)
2693
"http_access allow fortytwo_network\n"
2696
#: serverguide/C/web-servers.xml:875(para)
2698
"Using the excellent access control features of Squid, you may configure use "
2699
"of Internet services proxied by Squid to be available only during normal "
2700
"business hours. For example, we'll illustrate access by employees of a "
2701
"business which is operating between 9:00AM and 5:00PM, Monday through "
2702
"Friday, and which uses the 10.1.42.0/42 subnetwork:"
2705
#: serverguide/C/web-servers.xml:883(programlisting)
2709
"acl biz_network src 10.1.42.0/24\n"
2710
"acl biz_hours time M T W T F 9:00-17:00\n"
2713
#: serverguide/C/web-servers.xml:891(programlisting)
2717
"http_access allow biz_network biz_hours\n"
2720
#: serverguide/C/web-servers.xml:898(para)
2722
"After making changes to the <filename>/etc/squid/squid.conf</filename> file, "
2723
"save the file and restart the <application>squid</application> server "
2724
"application to effect the changes using the following command entered at a "
2728
#: serverguide/C/web-servers.xml:905(command)
2729
msgid "sudo /etc/init.d/squid restart"
2732
#: serverguide/C/web-servers.xml:912(ulink)
2733
msgid "Squid Website"
2736
#: serverguide/C/web-servers.xml:918(title)
2737
msgid "Ruby on Rails"
2740
#: serverguide/C/web-servers.xml:919(para)
2742
"Ruby on Rails is an open source web framework for developing database backed "
2743
"web applications. It is optimized for sustainable productivity of the "
2744
"programmer since it lets the programmer to write code by favouring "
2745
"convention over configuration."
2748
#: serverguide/C/web-servers.xml:926(para)
2750
"Before installing <application>Rails</application> you should install "
2751
"<application>Apache</application> and <application>MySQL</application>. To "
2752
"install the <application>Apache</application> package, please refer to <xref "
2753
"linkend=\"httpd\"/>. For instructions on installing "
2754
"<application>MySQL</application> refer to <xref linkend=\"mysql\"/>."
2757
#: serverguide/C/web-servers.xml:934(para)
2759
"Once you have <application>Apache</application> and "
2760
"<application>MySQL</application> packages installed, you are ready to "
2761
"install <application>Ruby on Rails</application> package."
2764
#: serverguide/C/web-servers.xml:941(para)
2766
"To install the <application>Ruby</application> base packages and "
2767
"<application>Ruby on Rails</application>, you can enter the following "
2768
"command in the terminal prompt:"
2771
#: serverguide/C/web-servers.xml:947(command)
2772
msgid "sudo apt-get install rails"
2775
#: serverguide/C/web-servers.xml:953(para)
2777
"Modify the <filename>/etc/apache2/sites-available/default</filename> "
2778
"configuration file to setup your domains."
2781
#: serverguide/C/web-servers.xml:957(para)
2783
"The first thing to change is the <emphasis>DocumentRoot</emphasis> directive:"
2786
#: serverguide/C/web-servers.xml:961(programlisting)
2790
"DocumentRoot /path/to/rails/application/public\n"
2793
#: serverguide/C/web-servers.xml:964(para)
2795
"Next, change the <Directory \"/path/to/rails/application/public\"> "
2799
#: serverguide/C/web-servers.xml:968(programlisting)
2803
"<Directory \"/path/to/rails/application/public\">\n"
2804
" Options Indexes FollowSymLinks MultiViews ExecCGI\n"
2805
" AllowOverride All\n"
2806
" Order allow,deny\n"
2808
" AddHandler cgi-script .cgi\n"
2809
"</Directory>\n"
2812
#: serverguide/C/web-servers.xml:978(para)
2814
"You should also enable the <application>mod_rewrite</application> module for "
2815
"Apache. To enable <application>mod_rewrite</application> module, please "
2816
"enter the following command in a terminal prompt:"
2819
#: serverguide/C/web-servers.xml:984(command)
2820
msgid "sudo a2enmod rewrite"
2823
#: serverguide/C/web-servers.xml:987(para)
2825
"Finally you will need to change the ownership of the "
2826
"<filename>/path/to/rails/application/public</filename> and "
2827
"<filename>/path/to/rails/application/tmp</filename> directories to the user "
2828
"used to run the <application>Apache</application> process:"
2831
#: serverguide/C/web-servers.xml:993(command)
2832
msgid "sudo chown -R www-data:www-data /path/to/rails/application/public"
2835
#: serverguide/C/web-servers.xml:994(command)
2836
msgid "sudo chown -R www-data:www-data /path/to/rails/application/tmp"
2839
#: serverguide/C/web-servers.xml:997(para)
2841
"That's it! Now you have your Server ready for your <application>Ruby on "
2842
"Rails</application> applications."
2845
#: serverguide/C/web-servers.xml:1006(para)
2847
"See the <ulink url=\"http://rubyonrails.org/\">Ruby on Rails</ulink> website "
2848
"for more information."
2851
#: serverguide/C/web-servers.xml:1011(para)
2853
"Also <ulink url=\"http://pragprog.com/titles/rails3/agile-web-development-"
2854
"with-rails-third-edition\">Agile Development with Rails</ulink> is a great "
2858
#: serverguide/C/web-servers.xml:1022(title)
2859
msgid "Apache Tomcat"
2862
#: serverguide/C/web-servers.xml:1023(para)
2864
"Apache Tomcat is a web container that allows you to serve Java Servlets and "
2865
"JSP (Java Server Pages) web applications."
2868
#: serverguide/C/web-servers.xml:1025(para)
2870
"The <application>Tomcat 6.0</application> packages in Ubuntu support two "
2871
"different ways of running Tomcat. You can install them as a classic unique "
2872
"system-wide instance, that will be started at boot time and will run as the "
2873
"tomcat6 unpriviledged user. But you can also deploy private instances that "
2874
"will run with your own user rights, and that you should start and stop by "
2875
"yourself. This second way is particularly useful in a development server "
2876
"context where multiple users need to test on their own private Tomcat "
2880
#: serverguide/C/web-servers.xml:1035(title)
2881
msgid "System-wide installation"
2884
#: serverguide/C/web-servers.xml:1036(para)
2886
"To install the <application>Tomcat</application> server, you can enter the "
2887
"following command in the terminal prompt:"
2890
#: serverguide/C/web-servers.xml:1039(command)
2891
msgid "sudo apt-get install tomcat6"
2894
#: serverguide/C/web-servers.xml:1041(para)
2896
"This will install a Tomcat server with just a default ROOT webapp that "
2897
"displays a minimal \"It works\" page by default."
2900
#: serverguide/C/web-servers.xml:1047(para)
2902
"Tomcat configuration files can be found in "
2903
"<filename>/etc/tomcat6</filename>. Only a few common configuration tweaks "
2904
"will be described here, please see <ulink "
2905
"url=\"http://tomcat.apache.org/tomcat-6.0-doc/index.html\">Tomcat 6.0 "
2906
"documentation</ulink> for more."
2909
#: serverguide/C/web-servers.xml:1053(title)
2910
msgid "Changing default ports"
2913
#: serverguide/C/web-servers.xml:1054(para)
2915
"By default Tomcat 6.0 runs a HTTP connector on port 8080 and an AJP "
2916
"connector on port 8009. You might want to change those default ports to "
2917
"avoid conflict with another server on the system. This is done by changing "
2918
"the following lines in <filename>/etc/tomcat6/server.xml</filename>:"
2921
#: serverguide/C/web-servers.xml:1059(programlisting)
2925
"<Connector port=\"8080\" protocol=\"HTTP/1.1\" \n"
2926
" connectionTimeout=\"20000\" \n"
2927
" redirectPort=\"8443\" />\n"
2929
"<Connector port=\"8009\" protocol=\"AJP/1.3\" redirectPort=\"8443\" "
2933
#: serverguide/C/web-servers.xml:1068(title)
2934
msgid "Changing JVM used"
2937
#: serverguide/C/web-servers.xml:1069(para)
2939
"By default Tomcat will run preferably with OpenJDK-6, then try Sun's JVM, "
2940
"then try some other JVMs. If you have various JVMs installed, you can set "
2941
"which should be used by setting JAVA_HOME in "
2942
"<filename>/etc/default/tomcat6</filename>:"
2945
#: serverguide/C/web-servers.xml:1073(programlisting)
2949
"JAVA_HOME=/usr/lib/jvm/java-6-sun\n"
2952
#: serverguide/C/web-servers.xml:1078(title)
2953
msgid "Declaring users and roles"
2956
#: serverguide/C/web-servers.xml:1079(para)
2958
"Usernames, passwords and roles (groups) can be defined centrally in a "
2959
"Servlet container. In Tomcat 6.0 this is done in the "
2960
"<filename>/etc/tomcat6/tomcat-users.xml</filename> file:"
2963
#: serverguide/C/web-servers.xml:1082(programlisting)
2967
"<role rolename=\"admin\"/>\n"
2968
"<user username=\"tomcat\" password=\"s3cret\" roles=\"admin\"/>\n"
2971
#: serverguide/C/web-servers.xml:1090(title)
2972
msgid "Using Tomcat standard webapps"
2975
#: serverguide/C/web-servers.xml:1091(para)
2977
"Tomcat is shipped with webapps that you can install for documentation, "
2978
"administration or demo purposes."
2981
#: serverguide/C/web-servers.xml:1094(title)
2982
msgid "Tomcat documentation"
2985
#: serverguide/C/web-servers.xml:1095(para)
2987
"The <application>tomcat6-docs</application> package contains Tomcat 6.0 "
2988
"documentation, packaged as a webapp that you can access by default at "
2989
"http://yourserver:8080/docs. You can install it by entering the following "
2990
"command in the terminal prompt:"
2993
#: serverguide/C/web-servers.xml:1100(command)
2994
msgid "sudo apt-get install tomcat6-docs"
2997
#: serverguide/C/web-servers.xml:1104(title)
2998
msgid "Tomcat administration webapps"
3001
#: serverguide/C/web-servers.xml:1105(para)
3003
"The <application>tomcat6-admin</application> package contains two webapps "
3004
"that can be used to administer the Tomcat server using a web interface. You "
3005
"can install them by entering the following command in the terminal prompt:"
3008
#: serverguide/C/web-servers.xml:1110(command)
3009
msgid "sudo apt-get install tomcat6-admin"
3012
#: serverguide/C/web-servers.xml:1112(para)
3014
"The first one is the <emphasis>manager</emphasis> webapp, which you can "
3015
"access by default at http://yourserver:8080/manager/html. It is primarily "
3016
"used to get server status and restart webapps."
3019
#: serverguide/C/web-servers.xml:1115(para)
3021
"Access to the <emphasis>manager</emphasis> application is protected by "
3022
"default: you need to define a user with the role \"manager\" in "
3023
"<filename>/etc/tomcat6/tomcat-users.xml</filename> before you can access it."
3026
#: serverguide/C/web-servers.xml:1119(para)
3028
"The second one is the <emphasis>host-manager</emphasis> webapp, which you "
3029
"can access by default at http://yourserver:8080/host-manager/html. It can be "
3030
"used to create virtual hosts dynamically."
3033
#: serverguide/C/web-servers.xml:1123(para)
3035
"Access to the <emphasis>host-manager</emphasis> application is also "
3036
"protected by default: you need to define a user with the role \"admin\" in "
3037
"<filename>/etc/tomcat6/tomcat-users.xml</filename> before you can access it."
3040
#: serverguide/C/web-servers.xml:1128(para)
3042
"For security reasons, the tomcat6 user cannot write to the "
3043
"<filename>/etc/tomcat6</filename> directory by default. Some features in "
3044
"these admin webapps (application deployment, virtual host creation) need "
3045
"write access to that directory. If you want to use these features execute "
3046
"the following, to give users in the tomcat6 group the necessary rights:"
3049
#: serverguide/C/web-servers.xml:1135(command)
3050
msgid "sudo chgrp -R tomcat6 /etc/tomcat6"
3053
#: serverguide/C/web-servers.xml:1136(command)
3054
msgid "sudo chmod -R g+w /etc/tomcat6"
3057
#: serverguide/C/web-servers.xml:1141(title)
3058
msgid "Tomcat examples webapps"
3061
#: serverguide/C/web-servers.xml:1142(para)
3063
"The <application>tomcat6-examples</application> package contains two webapps "
3064
"that can be used to test or demonstrate Servlets and JSP features, which you "
3065
"can access them by default at http://yourserver:8080/examples. You can "
3066
"install them by entering the following command in the terminal prompt:"
3069
#: serverguide/C/web-servers.xml:1148(command)
3070
msgid "sudo apt-get install tomcat6-examples"
3073
#: serverguide/C/web-servers.xml:1154(title)
3074
msgid "Using private instances"
3077
#: serverguide/C/web-servers.xml:1155(para)
3079
"Tomcat is heavily used in development and testing scenarios where using a "
3080
"single system-wide instance doesn't meet the requirements of multiple users "
3081
"on a single system. The Tomcat 6.0 packages in Ubuntu come with tools to "
3082
"help deploy your own user-oriented instances, allowing every user on a "
3083
"system to run (without root rights) separate private instances while still "
3084
"using the system-installed libraries."
3087
#: serverguide/C/web-servers.xml:1162(para)
3089
"It is possible to run the system-wide instance and the private instances in "
3090
"parallel, as long as they do not use the same TCP ports."
3093
#: serverguide/C/web-servers.xml:1166(title)
3094
msgid "Installing private instance support"
3097
#: serverguide/C/web-servers.xml:1167(para)
3099
"You can install everything necessary to run private instances by entering "
3100
"the following command in the terminal prompt:"
3103
#: serverguide/C/web-servers.xml:1170(command)
3104
msgid "sudo apt-get install tomcat6-user"
3107
#: serverguide/C/web-servers.xml:1174(title)
3108
msgid "Creating a private instance"
3111
#: serverguide/C/web-servers.xml:1175(para)
3113
"You can create a private instance directory by entering the following "
3114
"command in the terminal prompt:"
3117
#: serverguide/C/web-servers.xml:1178(command)
3118
msgid "tomcat6-instance-create my-instance"
3121
#: serverguide/C/web-servers.xml:1180(para)
3123
"This will create a new <filename>my-instance</filename> directory with all "
3124
"the necessary subdirectories and scripts. You can for example install your "
3125
"common libraries in the <filename>lib/</filename> subdirectory and deploy "
3126
"your webapps in the <filename>webapps/</filename> subdirectory. No webapps "
3127
"are deployed by default."
3130
#: serverguide/C/web-servers.xml:1188(title)
3131
msgid "Configuring your private instance"
3134
#: serverguide/C/web-servers.xml:1189(para)
3136
"You will find the classic Tomcat configuration files for your private "
3137
"instance in the <filename>conf/</filename> subdirectory. You should for "
3138
"example certainly edit the <filename>conf/server.xml</filename> file to "
3139
"change the default ports used by your private Tomcat instance to avoid "
3140
"conflict with other instances that might be running."
3143
#: serverguide/C/web-servers.xml:1197(title)
3144
msgid "Starting/stopping your private instance"
3147
#: serverguide/C/web-servers.xml:1198(para)
3149
"You can start your private instance by entering the following command in the "
3150
"terminal prompt (supposing your instance is located in the <filename>my-"
3151
"instance</filename> directory):"
3154
#: serverguide/C/web-servers.xml:1202(command)
3155
msgid "my-instance/bin/startup.sh"
3158
#: serverguide/C/web-servers.xml:1204(para)
3160
"You should check the <filename>logs/</filename> subdirectory for any error. "
3161
"If you have a <emphasis>java.net.BindException: Address already in "
3162
"use<null>:8080</emphasis> error, it means that the port you're using "
3163
"is already taken and that you should change it."
3166
#: serverguide/C/web-servers.xml:1209(para)
3168
"You can stop your instance by entering the following command in the terminal "
3169
"prompt (supposing your instance is located in the <filename>my-"
3170
"instance</filename> directory):"
3173
#: serverguide/C/web-servers.xml:1213(command)
3174
msgid "my-instance/bin/shutdown.sh"
3177
#: serverguide/C/web-servers.xml:1222(para)
3179
"See the <ulink url=\"http://tomcat.apache.org/\">Apache Tomcat</ulink> "
3180
"website for more information."
3183
#: serverguide/C/web-servers.xml:1227(para)
3185
"<ulink url=\"http://oreilly.com/catalog/9780596003180/\">Tomcat: The "
3186
"Definitive Guide</ulink> is a good resource for building web applications "
3190
#: serverguide/C/web-servers.xml:1233(para)
3192
"For additional books see the <ulink "
3193
"url=\"http://wiki.apache.org/tomcat/Tomcat/Books\">Tomcat Books</ulink> list "
3197
#: serverguide/C/virtualization.xml:13(title)
3198
msgid "Virtualization"
3201
#: serverguide/C/virtualization.xml:14(para)
3203
"Virtualization is being adopted in many different environments and "
3204
"situations. If you are a developer, virtualization can provide you with a "
3205
"contained environment where you can safely do almost any sort of development "
3206
"safe from messing up your main working environment. If you are a systems "
3207
"administrator, you can use virtualization to more easily separate your "
3208
"services and move them around based on demand."
3211
#: serverguide/C/virtualization.xml:20(para)
3213
"The default virtualization technology supported in Ubuntu is "
3214
"<application>KVM</application>, a technology that takes advantage of "
3215
"virtualization extensions built into Intel and AMD hardware. For hardware "
3216
"without virtualization extensions <application>Xen</application> and "
3217
"<application>Qemu</application> are popular solutions."
3220
#: serverguide/C/virtualization.xml:27(title)
3224
#: serverguide/C/virtualization.xml:28(para)
3226
"The <application>libvirt</application> library is used to interface with "
3227
"different virtualization technologies. Before getting started with "
3228
"<application>libvirt</application> it is best to make sure your hardware "
3229
"supports the necessary virtualization extensions for "
3230
"<application>KVM</application>. Enter the following from a terminal prompt:"
3233
#: serverguide/C/virtualization.xml:34(command)
3234
msgid "egrep '(vmx|svm)' /proc/cpuinfo"
3237
#: serverguide/C/virtualization.xml:36(para)
3239
"If nothing is printed, it means that your cpu does <emphasis>not</emphasis> "
3240
"support hardware virtualization."
3243
#: serverguide/C/virtualization.xml:40(para)
3245
"On most computer whose processor supports virtualization, it is necessary to "
3246
"activate an option in the bios to enable it. The method described above does "
3247
"not show the status of it's activation."
3250
#: serverguide/C/virtualization.xml:47(title)
3251
msgid "Virtual Networking"
3254
#: serverguide/C/virtualization.xml:49(para)
3256
"There are a few different ways to allow a virtual machine access to the "
3257
"external network. The default virtual network configuration is "
3258
"<emphasis>usermode</emphasis> networking, which uses the SLIRP protocol and "
3259
"traffic is NATed through the host interface to the outside network."
3262
#: serverguide/C/virtualization.xml:54(para)
3264
"To enable external hosts to directly access services on virtual machines a "
3265
"<emphasis>bridge</emphasis> needs to be configured. This allows the virtual "
3266
"interfaces to connect to the outside network through the physical interface, "
3267
"making them appear as normal hosts to the rest of the network. For "
3268
"information on setting up a bridge see <xref linkend=\"bridging\"/>."
3271
#: serverguide/C/virtualization.xml:63(para)
3272
msgid "To install the necessary packages, from a terminal prompt enter:"
3275
#: serverguide/C/virtualization.xml:67(command)
3276
msgid "sudo apt-get install kvm libvirt-bin"
3279
#: serverguide/C/virtualization.xml:69(para)
3281
"After installing <application>libvirt-bin</application>, the user used to "
3282
"manage virtual machines will need to be added to the "
3283
"<emphasis>libvirtd</emphasis> group. Doing so will grant the user access to "
3284
"the advanced networking options."
3287
#: serverguide/C/virtualization.xml:73(para)
3288
msgid "In a terminal enter:"
3291
#: serverguide/C/virtualization.xml:77(command)
3292
msgid "sudo adduser $USER libvirtd"
3295
#: serverguide/C/virtualization.xml:80(para)
3297
"If the user chosen is the current user, you will need to log out and back in "
3298
"for the new group membership to take effect."
3301
#: serverguide/C/virtualization.xml:84(para)
3303
"You are now ready to install a <emphasis>Guest</emphasis> operating system. "
3304
"Installing a virtual machine follows the same process as installing the "
3305
"operating system directly on the hardware. You either need a way to automate "
3306
"the installation, or a keyboard and monitor will need to be attached to the "
3310
#: serverguide/C/virtualization.xml:89(para)
3312
"In the case of virtual machines a Graphical User Interface (GUI) is "
3313
"analogous to using a physical keyboard and mouse. Instead of installing a "
3314
"GUI the <application>virt-viewer</application> application can be used to "
3315
"connect to a virtual machine's console using <application>VNC</application>. "
3316
"See <xref linkend=\"libvirt-virt-viewer\"/> for more information."
3319
#: serverguide/C/virtualization.xml:94(para)
3321
"There are several ways to automate the Ubuntu installation process, for "
3322
"example using preseeds, kickstart, etc. Refer to the <ulink "
3323
"url=\"https://help.ubuntu.com/9.04/installation-guide/\">Ubuntu Installation "
3324
"Guide</ulink> for details."
3327
#: serverguide/C/virtualization.xml:98(para)
3329
"Yet another way to install an Ubuntu virtual machine is to use "
3330
"<application>ubuntu-vm-builder</application>. <application>ubuntu-vm-"
3331
"builder</application> allows you to setup advanced partitions, execute "
3332
"custom post-install scripts, etc. For details see <xref linkend=\"jeos-and-"
3336
#: serverguide/C/virtualization.xml:104(title)
3337
msgid "virt-install"
3340
#: serverguide/C/virtualization.xml:105(para)
3342
"<application>virt-install</application> is part of the <application>python-"
3343
"virtinst</application> package. To install it, from a terminal prompt enter:"
3346
#: serverguide/C/virtualization.xml:109(command)
3347
msgid "sudo apt-get install python-virtinst"
3350
#: serverguide/C/virtualization.xml:111(para)
3352
"There are several options available when using <application>virt-"
3353
"install</application>. For example:"
3356
#: serverguide/C/virtualization.xml:115(command)
3358
"sudo virt-install -n web_devel -r 256 -f web_devel.img \\ -s 4 -c jeos.iso --"
3359
"accelerate \\ --connect=qemu:///system --vnc \\ --noautoconsole -v"
3362
#: serverguide/C/virtualization.xml:122(para)
3364
"<emphasis>-n web_devel:</emphasis> the name of the new virtual machine will "
3365
"be <emphasis>web_devel</emphasis> in this example."
3368
#: serverguide/C/virtualization.xml:127(para)
3370
"<emphasis>-r 256:</emphasis> specifies the amount of memory the virtual "
3374
#: serverguide/C/virtualization.xml:132(para)
3376
"<emphasis>-f web_devel.img:</emphasis> indicates the path to the virtual "
3377
"disk which can be a file, partition, or logical volume. In this example a "
3378
"file named <filename>web_devel.img</filename>."
3381
#: serverguide/C/virtualization.xml:138(para)
3382
msgid "<emphasis>-s 4:</emphasis> the size of the virtual disk."
3385
#: serverguide/C/virtualization.xml:143(para)
3387
"<emphasis>-c jeos.iso:</emphasis> file to be used as a virtual CDROM. The "
3388
"file can be either an ISO file or the path to the host's CDROM device."
3391
#: serverguide/C/virtualization.xml:149(para)
3393
"<emphasis>--accelerate:</emphasis> enables the kernel's acceleration "
3397
#: serverguide/C/virtualization.xml:154(para)
3399
"<emphasis>--vnc:</emphasis> exports the guest's virtual console using VNC."
3402
#: serverguide/C/virtualization.xml:159(para)
3404
"<emphasis>--noautoconsole:</emphasis> will not automatically connect to the "
3405
"virtual machine's console."
3408
#: serverguide/C/virtualization.xml:164(para)
3409
msgid "<emphasis>-v:</emphasis> creates a fully virtualized guest."
3412
#: serverguide/C/virtualization.xml:169(para)
3414
"After launching <application>virt-install</application> you can connect to "
3415
"the virtual machine's console either locally using a GUI or with the "
3416
"<application>virt-viewer</application> utility."
3419
#: serverguide/C/virtualization.xml:175(title)
3423
#: serverguide/C/virtualization.xml:176(para)
3425
"The <application>virt-clone</application> application can be used to copy "
3426
"one virtual machine to another. For example:"
3429
#: serverguide/C/virtualization.xml:180(command)
3431
"sudo virt-clone -o web_devel -n database_devel -f "
3432
"/path/to/database_devel.img --connect=qemu:///system"
3435
#: serverguide/C/virtualization.xml:184(para)
3436
msgid "<emphasis>-o:</emphasis> original virtual machine."
3439
#: serverguide/C/virtualization.xml:189(para)
3440
msgid "<emphasis>-n:</emphasis> name of the new virtual machine."
3443
#: serverguide/C/virtualization.xml:194(para)
3445
"<emphasis>-f:</emphasis> path to the file, logical volume, or partition to "
3446
"be used by the new virtual machine."
3449
#: serverguide/C/virtualization.xml:199(para)
3451
"<emphasis>--connect:</emphasis> specifies which hypervisor to connect to."
3454
#: serverguide/C/virtualization.xml:204(para)
3456
"Also, use <emphasis>-d</emphasis> or <emphasis>--debug</emphasis> option to "
3457
"help troubleshoot problems with <application>virt-clone</application>."
3460
#: serverguide/C/virtualization.xml:209(para)
3462
"Replace <emphasis>web_devel</emphasis> and "
3463
"<emphasis>database_devel</emphasis> with appropriate virtual machine names."
3466
#: serverguide/C/virtualization.xml:215(title)
3467
msgid "Virtual Machine Management"
3470
#: serverguide/C/virtualization.xml:217(title)
3474
#: serverguide/C/virtualization.xml:218(para)
3476
"There are several utilities available to manage virtual machines and "
3477
"<application>libvirt</application>. The <application>virsh</application> "
3478
"utility can be used from the command line. Some examples:"
3481
#: serverguide/C/virtualization.xml:224(para)
3482
msgid "To list running virtual machines:"
3485
#: serverguide/C/virtualization.xml:228(command)
3486
msgid "virsh -c qemu:///system list"
3489
#: serverguide/C/virtualization.xml:232(para)
3490
msgid "To start a virtual machine:"
3493
#: serverguide/C/virtualization.xml:236(command)
3494
msgid "virsh -c qemu:///system start web_devel"
3497
#: serverguide/C/virtualization.xml:240(para)
3498
msgid "Similarly, to start a virtual machine at boot:"
3501
#: serverguide/C/virtualization.xml:244(command)
3502
msgid "virsh -c qemu:///system autostart web_devel"
3505
#: serverguide/C/virtualization.xml:248(para)
3506
msgid "Reboot a virtual machine with:"
3509
#: serverguide/C/virtualization.xml:252(command)
3510
msgid "virsh -c qemu:///system reboot web_devel"
3513
#: serverguide/C/virtualization.xml:256(para)
3515
"The <emphasis>state</emphasis> of virtual machines can be saved to a file in "
3516
"order to be restored later. The following will save the virtual machine "
3517
"state into a file named according to the date:"
3520
#: serverguide/C/virtualization.xml:261(command)
3521
msgid "virsh -c qemu:///system save web_devel web_devel-022708.state"
3524
#: serverguide/C/virtualization.xml:263(para)
3525
msgid "Once saved the virtual machine will no longer be running."
3528
#: serverguide/C/virtualization.xml:268(para)
3529
msgid "A saved virtual machine can be restored using:"
3532
#: serverguide/C/virtualization.xml:272(command)
3533
msgid "virsh -c qemu:///system restore web_devel-022708.state"
3536
#: serverguide/C/virtualization.xml:276(para)
3537
msgid "To shutdown a virtual machine do:"
3540
#: serverguide/C/virtualization.xml:280(command)
3541
msgid "virsh -c qemu:///system shutdown web_devel"
3544
#: serverguide/C/virtualization.xml:284(para)
3545
msgid "A CDROM device can be mounted in a virtual machine by entering:"
3548
#: serverguide/C/virtualization.xml:288(command)
3549
msgid "virsh -c qemu:///system attach-disk web_devel /dev/cdrom /media/cdrom"
3552
#: serverguide/C/virtualization.xml:293(para)
3554
"In the above examples replace <emphasis>web_devel</emphasis> with the "
3555
"appropriate virtual machine name, and <filename>web_devel-"
3556
"022708.state</filename> with a descriptive file name."
3559
#: serverguide/C/virtualization.xml:300(title)
3560
msgid "Virtual Machine Manager"
3563
#: serverguide/C/virtualization.xml:301(para)
3565
"The <application>virt-manager</application> package contains a graphical "
3566
"utility to manage local and remote virtual machines. To install virt-manager "
3570
#: serverguide/C/virtualization.xml:306(command)
3571
msgid "sudo apt-get install virt-manager"
3574
#: serverguide/C/virtualization.xml:308(para)
3576
"Since <application>virt-manager</application> requires a Graphical User "
3577
"Interface (GUI) environment it is recommended to be installed on a "
3578
"workstation or test machine instead of a production server. To connect to "
3579
"the local <application>libvirt</application> service enter:"
3582
#: serverguide/C/virtualization.xml:314(command)
3583
msgid "virt-manager -c qemu:///system"
3586
#: serverguide/C/virtualization.xml:316(para)
3588
"You can connect to the <application>libvirt</application> service running on "
3589
"another host by entering the following in a terminal prompt:"
3592
#: serverguide/C/virtualization.xml:320(command)
3593
msgid "virt-manager -c qemu+ssh://virtnode1.mydomain.com/system"
3596
#: serverguide/C/virtualization.xml:323(para)
3598
"The above example assumes that <application>SSH</application> connectivity "
3599
"between the management system and virtnode1.mydomain.com has already been "
3600
"configured, and uses SSH keys for authentication. SSH "
3601
"<emphasis>keys</emphasis> are needed because "
3602
"<application>libvirt</application> sends the password prompt to another "
3603
"process. For details on configuring <application>SSH</application> see <xref "
3604
"linkend=\"openssh-server\"/>"
3607
#: serverguide/C/virtualization.xml:333(title)
3608
msgid "Virtual Machine Viewer"
3611
#: serverguide/C/virtualization.xml:334(para)
3613
"The <application>virt-viewer</application> application allows you to connect "
3614
"to a virtual machine's console. <application>virt-viewer</application> does "
3615
"require a Graphical User Interface (GUI) to interface with the virtual "
3619
#: serverguide/C/virtualization.xml:338(para)
3621
"To install <application>virt-viewer</application> from a terminal enter:"
3624
#: serverguide/C/virtualization.xml:342(command)
3625
msgid "sudo apt-get install virt-viewer"
3628
#: serverguide/C/virtualization.xml:344(para)
3630
"Once a virtual machine is installed and running you can connect to the "
3631
"virtual machine's console by using:"
3634
#: serverguide/C/virtualization.xml:348(command)
3635
msgid "virt-viewer -c qemu:///system web_devel"
3638
#: serverguide/C/virtualization.xml:350(para)
3640
"Similar to <application>virt-manager</application>, <application>virt-"
3641
"viewer</application> can connect to a remote host using "
3642
"<emphasis>SSH</emphasis> with key authentication, as well:"
3645
#: serverguide/C/virtualization.xml:355(command)
3646
msgid "virt-viewer -c qemu+ssh://virtnode1.mydomain.com/system web_devel"
3649
#: serverguide/C/virtualization.xml:357(para)
3651
"Be sure to replace <emphasis role=\"italic\">web_devel</emphasis> with the "
3652
"appropriate virtual machine name."
3655
#: serverguide/C/virtualization.xml:360(para)
3657
"If configured to use a <emphasis>bridged</emphasis> network interface you "
3658
"can also setup <application>SSH</application> access to the virtual machine. "
3659
"See <xref linkend=\"openssh-server\"/> and <xref linkend=\"bridging\"/> for "
3663
#: serverguide/C/virtualization.xml:369(para)
3665
"See the <ulink url=\"http://kvm.qumranet.com/kvmwiki\">KVM</ulink> home page "
3669
#: serverguide/C/virtualization.xml:374(para)
3671
"For more information on <application>libvirt</application> see the <ulink "
3672
"url=\"http://libvirt.org/\">libvirt home page</ulink>"
3675
#: serverguide/C/virtualization.xml:379(para)
3677
"The <ulink url=\"http://virt-manager.et.redhat.com/\">Virtual Machine "
3678
"Manager</ulink> site has more information on <application>virt-"
3679
"manager</application> development."
3682
#: serverguide/C/virtualization.xml:385(para)
3684
"Also, stop by the <emphasis>#ubuntu-virt</emphasis> IRC channel on <ulink "
3685
"url=\"http://freenode.net/\">freenode</ulink> to discuss virtualization "
3686
"technology in Ubuntu."
3689
#: serverguide/C/virtualization.xml:394(title) serverguide/C/jeos.xml:13(title)
3690
msgid "JeOS and vmbuilder"
3693
#: serverguide/C/virtualization.xml:400(title) serverguide/C/jeos.xml:19(title)
3694
msgid "What is JeOS"
3697
#: serverguide/C/virtualization.xml:402(para) serverguide/C/jeos.xml:21(para)
3699
"Ubuntu <emphasis>JeOS</emphasis> (pronounced \"Juice\") is an efficient "
3700
"variant of the Ubuntu Server operating system, configured specifically for "
3701
"virtual appliances. No longer available as a CD-ROM ISO for download, but "
3702
"only as an option either:"
3705
#: serverguide/C/virtualization.xml:409(para)
3707
"While installing from the Server Edition ISO (pressing "
3708
"<emphasis>F4</emphasis> on the first screen will allow you to pick \"Minimal "
3709
"installation\", which is the package selection equivalent to JeOS)."
3712
#: serverguide/C/virtualization.xml:415(para) serverguide/C/jeos.xml:34(para)
3713
msgid "Or to be built using Ubuntu's vmbuilder, which is described here."
3716
#: serverguide/C/virtualization.xml:421(para) serverguide/C/jeos.xml:40(para)
3718
"JeOS is a specialized installation of Ubuntu Server Edition with a tuned "
3719
"kernel that only contains the base elements needed to run within a "
3720
"virtualized environment."
3723
#: serverguide/C/virtualization.xml:426(para) serverguide/C/jeos.xml:45(para)
3725
"Ubuntu JeOS has been tuned to take advantage of key performance technologies "
3726
"in the latest virtualization products from VMware. This combination of "
3727
"reduced size and optimized performance ensures that Ubuntu JeOS Edition "
3728
"delivers a highly efficient use of server resources in large virtual "
3732
#: serverguide/C/virtualization.xml:432(para) serverguide/C/jeos.xml:51(para)
3734
"Without unnecessary drivers, and only the minimal required packages, ISVs "
3735
"can configure their supporting OS exactly as they require. They have the "
3736
"peace of mind that updates, whether for security or enhancement reasons, "
3737
"will be limited to the bare minimum of what is required in their specific "
3738
"environment. In turn, users deploying virtual appliances built on top of "
3739
"JeOS will have to go through fewer updates and therefore less maintenance "
3740
"than they would have had to with a standard full installation of a server."
3743
#: serverguide/C/virtualization.xml:441(title) serverguide/C/jeos.xml:60(title)
3744
msgid "What is vmbuilder"
3747
#: serverguide/C/virtualization.xml:443(para) serverguide/C/jeos.xml:62(para)
3749
"With vmbuilder, there is no need to download a JeOS ISO anymore. vmbuilder "
3750
"will fetch the various package and build a virtual machine tailored for our "
3751
"need in about a minute for us. Vmbuilder is a Script that automates the "
3752
"process of creating a ready to use Linux based VM. The currently supported "
3753
"hypervisors are KVM and Xen."
3756
#: serverguide/C/virtualization.xml:449(para) serverguide/C/jeos.xml:68(para)
3758
"You can pass command line options to add extra packages, remove packages, "
3759
"choose which version of Ubuntu, which mirror etc. On recent hardware with "
3760
"plenty of RAM, tmpdir in <filename>/dev/shm</filename> or using a tmpfs, and "
3761
"a local mirror, you can bootstrap a VM in less than a minute."
3764
#: serverguide/C/virtualization.xml:455(para) serverguide/C/jeos.xml:74(para)
3766
"First introduced as a shell script in Ubuntu 8.04LTS, <application>ubuntu-vm-"
3767
"builder</application> started with little emphasis as a hack to help "
3768
"developers test their new code in a virtual machine without having to "
3769
"restart from scratch each time. As a few Ubuntu administrators started to "
3770
"notice this script, a few of them went on improving it and adapting it for "
3771
"so many use case that Soren Hansen (the author of the script and Ubuntu "
3772
"virtualization specialist, not the golf player) decided to rewrite it from "
3773
"scratch for Intrepid as a python script with a few new design goals:"
3776
#: serverguide/C/virtualization.xml:465(para) serverguide/C/jeos.xml:84(para)
3777
msgid "Develop it so that it can be reused by other distributions."
3780
#: serverguide/C/virtualization.xml:470(para) serverguide/C/jeos.xml:89(para)
3782
"Use a plugin mechanisms for all virtualization interactions so that others "
3783
"can easily add logic for other virtualization environments."
3786
#: serverguide/C/virtualization.xml:475(para) serverguide/C/jeos.xml:94(para)
3788
"Provide an easy to maintain web interface as an option to the command line "
3792
#: serverguide/C/virtualization.xml:481(para) serverguide/C/jeos.xml:100(para)
3793
msgid "But the general principles and commands remain the same."
3796
#: serverguide/C/virtualization.xml:488(title) serverguide/C/jeos.xml:107(title)
3797
msgid "Initial Setup"
3800
#: serverguide/C/virtualization.xml:490(para) serverguide/C/jeos.xml:109(para)
3802
"It is assumed that you have installed and configured "
3803
"<application>libvirt</application> and <application>KVM</application> "
3804
"locally on the machine you are using. For details on how to perform this, "
3808
#: serverguide/C/virtualization.xml:502(para) serverguide/C/jeos.xml:121(para)
3810
"The <ulink url=\"https://help.ubuntu.com/community/KVM\">KVM</ulink> Wiki "
3814
#: serverguide/C/virtualization.xml:508(para) serverguide/C/jeos.xml:127(para)
3816
"We also assume that you know how to use a text based text editor such as "
3817
"nano or vi. If you have not used any of them before, you can get an overview "
3818
"of the various text editors available by reading the <ulink "
3819
"url=\"https://help.ubuntu.com/community/PowerUsersTextEditors\">PowerUsersTex"
3820
"tEditors</ulink> page. This tutorial has been done on KVM, but the general "
3821
"principle should remain on other virtualization technologies."
3824
#: serverguide/C/virtualization.xml:516(title) serverguide/C/jeos.xml:135(title)
3825
msgid "Install vmbuilder"
3828
#: serverguide/C/virtualization.xml:518(para) serverguide/C/jeos.xml:137(para)
3830
"The name of the package that we need to install is <application>python-vm-"
3831
"builder</application>. In a terminal prompt enter:"
3834
#: serverguide/C/virtualization.xml:523(command) serverguide/C/jeos.xml:142(command)
3835
msgid "sudo apt-get install python-vm-builder"
3838
#: serverguide/C/virtualization.xml:527(para) serverguide/C/jeos.xml:146(para)
3840
"If you are running Hardy, you can still perform most of this using the older "
3841
"version of the package named <application>ubuntu-vm-builder</application>, "
3842
"there are only a few changes to the syntax of the tool."
3845
#: serverguide/C/virtualization.xml:536(title) serverguide/C/jeos.xml:155(title)
3846
msgid "Defining Your Virtual Machine"
3849
#: serverguide/C/virtualization.xml:538(para) serverguide/C/jeos.xml:157(para)
3851
"Defining a virtual machine with Ubuntu's vmbuilder is quite simple, but here "
3852
"are a few thing to consider:"
3855
#: serverguide/C/virtualization.xml:544(para) serverguide/C/jeos.xml:163(para)
3857
"If you plan on shipping a virtual appliance, do not assume that the end-user "
3858
"will know how to extend disk size to fit their need, so either plan for a "
3859
"large virtual disk to allow for your appliance to grow, or explain fairly "
3860
"well in your documentation how to allocate more space. It might actually be "
3861
"a good idea to store data on some separate external storage."
3864
#: serverguide/C/virtualization.xml:551(para) serverguide/C/jeos.xml:170(para)
3866
"Given that RAM is much easier to allocate in a VM, RAM size should be set to "
3867
"whatever you think is a safe minimum for your appliance."
3870
#: serverguide/C/virtualization.xml:557(para) serverguide/C/jeos.xml:176(para)
3872
"The <application>vmbuilder</application> command has 2 main parameters: the "
3873
"<emphasis>virtualization technology (hypervisor)</emphasis> and the targeted "
3874
"<emphasis>distribution</emphasis>. Optional parameters are quite numerous "
3875
"and can be found using the following command:"
3878
#: serverguide/C/virtualization.xml:563(command) serverguide/C/jeos.xml:182(command)
3879
msgid "vmbuilder --help"
3882
#: serverguide/C/virtualization.xml:567(title) serverguide/C/jeos.xml:186(title)
3883
msgid "Base Parameters"
3886
#: serverguide/C/virtualization.xml:569(para) serverguide/C/jeos.xml:188(para)
3888
"As this example is based on <application>KVM</application> and Ubuntu 9.04 "
3889
"(Jaunty Jackalope), and we are likely to rebuild the same virtual machine "
3890
"multiple time, we'll invoke vmbuilder with the following first parameters:"
3893
#: serverguide/C/virtualization.xml:575(command) serverguide/C/jeos.xml:194(command)
3895
"sudo vmbuilder kvm ubuntu --suite jaunty --flavour virtual --arch i386 -o --"
3896
"libvirt qemu:///system"
3899
#: serverguide/C/virtualization.xml:578(para) serverguide/C/jeos.xml:197(para)
3901
"The <emphasis>--suite</emphasis> defines the Ubuntu release, the <emphasis>--"
3902
"flavour</emphasis> specifies that we want to use the virtual kernel (that's "
3903
"the one used to build a JeOS image), the <emphasis>--arch</emphasis> tells "
3904
"that we want to use a 32 bit machine, the <emphasis>-o</emphasis> tells "
3905
"vmbuilder to overwrite the previous version of the VM and the <emphasis>--"
3906
"libvirt</emphasis> tells to inform the local virtualization environment to "
3907
"add the resulting VM to the list of available machines."
3910
#: serverguide/C/virtualization.xml:586(para) serverguide/C/jeos.xml:205(para)
3914
#: serverguide/C/virtualization.xml:592(para)
3916
"Because of the nature of operations performed by vmbuilder, it needs to have "
3917
"root privilege, hence the use of sudo."
3920
#: serverguide/C/virtualization.xml:597(para) serverguide/C/jeos.xml:216(para)
3922
"If your virtual machine needs to use more than 3Gb of ram, you should build "
3923
"a 64 bit machine (--arch amd64)."
3926
#: serverguide/C/virtualization.xml:602(para) serverguide/C/jeos.xml:221(para)
3928
"Until Ubuntu 8.10, the virtual kernel was only built for 32 bit "
3929
"architecture, so if you want to define an amd64 machine on Hardy, you should "
3930
"use <emphasis>--flavour</emphasis> server instead."
3933
#: serverguide/C/virtualization.xml:610(title) serverguide/C/jeos.xml:229(title)
3934
msgid "JeOS Installation Parameters"
3937
#: serverguide/C/virtualization.xml:613(title) serverguide/C/jeos.xml:232(title)
3938
msgid "JeOS Networking"
3941
#: serverguide/C/virtualization.xml:616(title) serverguide/C/jeos.xml:235(title)
3942
msgid "Assigning a fixed IP address"
3945
#: serverguide/C/virtualization.xml:618(para) serverguide/C/jeos.xml:237(para)
3947
"As a virtual appliance that may be deployed on various very different "
3948
"networks, it is very difficult to know what the actual network will look "
3949
"like. In order to simplify configuration, it is a good idea to take an "
3950
"approach similar to what network hardware vendors usually do, namely "
3951
"assigning an initial fixed IP address to the appliance in a private class "
3952
"network that you will provide in your documentation. An address in the range "
3953
"192.168.0.0/255 is usually a good choice."
3956
#: serverguide/C/virtualization.xml:625(para) serverguide/C/jeos.xml:244(para)
3957
msgid "To do this we'll use the following parameters:"
3960
#: serverguide/C/virtualization.xml:631(para) serverguide/C/jeos.xml:250(para)
3962
"<emphasis>--ip ADDRESS</emphasis>: IP address in dotted form (defaults to "
3963
"dhcp if not specified)"
3966
#: serverguide/C/virtualization.xml:636(para) serverguide/C/jeos.xml:255(para)
3968
"<emphasis>--mask VALUE</emphasis>: IP mask in dotted form (default: "
3972
#: serverguide/C/virtualization.xml:641(para) serverguide/C/jeos.xml:260(para)
3973
msgid "<emphasis>--net VALUE</emphasis>: IP net address (default: X.X.X.0)"
3976
#: serverguide/C/virtualization.xml:646(para) serverguide/C/jeos.xml:265(para)
3977
msgid "<emphasis>--bcast VALUE</emphasis>: IP broadcast (default: X.X.X.255)"
3980
#: serverguide/C/virtualization.xml:651(para) serverguide/C/jeos.xml:270(para)
3981
msgid "<emphasis>--gw ADDRESS</emphasis>: Gateway address (default: X.X.X.1)"
3984
#: serverguide/C/virtualization.xml:656(para) serverguide/C/jeos.xml:275(para)
3986
"<emphasis>--dns ADDRESS</emphasis>: Name server address (default: X.X.X.1)"
3989
#: serverguide/C/virtualization.xml:662(para) serverguide/C/jeos.xml:281(para)
3991
"We assume for now that default values are good enough, so the resulting "
3992
"invocation becomes:"
3995
#: serverguide/C/virtualization.xml:667(command) serverguide/C/jeos.xml:286(command)
3997
"sudo vmbuilder kvm ubuntu --suite jaunty --flavour virtual --arch i386 -o --"
3998
"libvirt qemu:///system --ip 192.168.0.100"
4001
#: serverguide/C/virtualization.xml:672(title) serverguide/C/jeos.xml:291(title)
4002
msgid "Modifying the libvirt Template to use Bridging"
4005
#: serverguide/C/virtualization.xml:674(para) serverguide/C/jeos.xml:293(para)
4007
"Because our appliance will be likely to need to be accessed by remote hosts, "
4008
"we need to configure libvirt so that the appliance uses bridge networking. "
4009
"To do this we use vmbuilder template mechanism to modify the default one."
4012
#: serverguide/C/virtualization.xml:679(para) serverguide/C/jeos.xml:298(para)
4014
"In our working directory we create the template hierarchy and copy the "
4018
#: serverguide/C/virtualization.xml:684(command) serverguide/C/jeos.xml:303(command)
4019
msgid "mkdir -p VMBuilder/plugins/libvirt/templates"
4022
#: serverguide/C/virtualization.xml:685(command) serverguide/C/jeos.xml:304(command)
4023
msgid "cp /etc/vmbuilder/libvirt/* VMBuilder/plugins/libvirt/templates/"
4026
#: serverguide/C/virtualization.xml:688(para) serverguide/C/jeos.xml:307(para)
4029
"<filename>VMBuilder/plugins/libvirt/templates/libvirtxml.tmpl</filename> to "
4033
#: serverguide/C/virtualization.xml:692(programlisting) serverguide/C/jeos.xml:311(programlisting)
4037
" <interface type='network'>\n"
4038
" <source network='default'/>\n"
4039
" </interface>\n"
4042
#: serverguide/C/virtualization.xml:698(para) serverguide/C/jeos.xml:317(para)
4046
#: serverguide/C/virtualization.xml:702(programlisting)
4050
" <interface type='bridge'>\n"
4051
" <source bridge='br0'/>\n"
4052
" </interface>\n"
4055
#: serverguide/C/virtualization.xml:712(title) serverguide/C/jeos.xml:331(title) serverguide/C/installation.xml:406(title)
4056
msgid "Partitioning"
4059
#: serverguide/C/virtualization.xml:714(para) serverguide/C/jeos.xml:333(para)
4061
"Partitioning of the virtual appliance will have to take into consideration "
4062
"what you are planning to do with is. Because most appliances want to have a "
4063
"separate storage for data, having a separate <filename>/var</filename> would "
4067
#: serverguide/C/virtualization.xml:719(para) serverguide/C/jeos.xml:338(para)
4069
"In order to do this vmbuilder provides us with <emphasis>--part</emphasis>:"
4072
#: serverguide/C/virtualization.xml:723(programlisting) serverguide/C/jeos.xml:342(programlisting)
4077
" Allows to specify a partition table in partfile each line of partfile "
4080
" mountpoint size\n"
4081
" where size is in megabytes. You can have up to 4 virtual disks, a new "
4082
"disk starts on a\n"
4083
" line with ’---’. ie :\n"
4092
#: serverguide/C/virtualization.xml:738(para) serverguide/C/jeos.xml:357(para)
4094
"In our case we will define a text file name "
4095
"<filename>vmbuilder.partition</filename> which will contain the following:"
4098
#: serverguide/C/virtualization.xml:742(programlisting) serverguide/C/jeos.xml:361(programlisting)
4108
#: serverguide/C/virtualization.xml:750(para) serverguide/C/jeos.xml:369(para)
4110
"Note that as we are using virtual disk images, the actual sizes that we put "
4111
"here are maximum sizes for these volumes."
4114
#: serverguide/C/virtualization.xml:755(para) serverguide/C/jeos.xml:374(para)
4115
msgid "Our command line now looks like:"
4118
#: serverguide/C/virtualization.xml:760(command) serverguide/C/jeos.xml:379(command)
4120
"sudo vmbuilder kvm ubuntu --suite jaunty --flavour virtual --arch i386 \\ -o "
4121
"--libvirt qemu:///system --ip 192.168.0.100 --part vmbuilder.partition"
4124
#: serverguide/C/virtualization.xml:765(para) serverguide/C/jeos.xml:384(para)
4126
"Using a \"\\\" in a command will allow long command strings to wrap to the "
4130
#: serverguide/C/virtualization.xml:772(title) serverguide/C/jeos.xml:391(title)
4131
msgid "User and Password"
4134
#: serverguide/C/virtualization.xml:774(para) serverguide/C/jeos.xml:393(para)
4136
"Again setting up a virtual appliance, you will need to provide a default "
4137
"user and password that is generic so that you can include it in your "
4138
"documentation. We will see later on in this tutorial how we will provide "
4139
"some security by defining a script that will be run the first time a user "
4140
"actually logs in the appliance, that will, among other things, ask him to "
4141
"change his password. In this example I will use <emphasis>'user'</emphasis> "
4142
"as my user name, and <emphasis>'default'</emphasis> as the password."
4145
#: serverguide/C/virtualization.xml:782(para) serverguide/C/jeos.xml:401(para)
4146
msgid "To do this we use the following optional parameters:"
4149
#: serverguide/C/virtualization.xml:788(para) serverguide/C/jeos.xml:407(para)
4151
"<emphasis>--user USERNAME:</emphasis> Sets the name of the user to be added. "
4155
#: serverguide/C/virtualization.xml:793(para) serverguide/C/jeos.xml:412(para)
4157
"<emphasis>--name FULLNAME:</emphasis> Sets the full name of the user to be "
4158
"added. Default: Ubuntu."
4161
#: serverguide/C/virtualization.xml:798(para) serverguide/C/jeos.xml:417(para)
4163
"<emphasis>--pass PASSWORD:</emphasis> Sets the password for the user. "
4167
#: serverguide/C/virtualization.xml:804(para) serverguide/C/jeos.xml:423(para)
4168
msgid "Our resulting command line becomes:"
4171
#: serverguide/C/virtualization.xml:809(command) serverguide/C/jeos.xml:428(command)
4173
"sudo vmbuilder kvm ubuntu --suite intrepid --flavour virtual --arch i386 \\ -"
4174
"o --libvirt qemu:///system --ip 192.168.0.100 --part vmbuilder.partition \\ -"
4175
"-user user --name user --pass default"
4178
#: serverguide/C/virtualization.xml:817(title) serverguide/C/jeos.xml:436(title)
4179
msgid "Installing Required Packages"
4182
#: serverguide/C/virtualization.xml:819(para) serverguide/C/jeos.xml:438(para)
4184
"In this example we will be installing a package "
4185
"<application>(Limesurvey)</application> that accesses a "
4186
"<application>MySQL</application> database and has a web interface. We will "
4187
"therefore require our OS to provide us with:"
4190
#: serverguide/C/virtualization.xml:826(para) serverguide/C/jeos.xml:445(para)
4194
#: serverguide/C/virtualization.xml:827(para) serverguide/C/jeos.xml:446(para)
4198
#: serverguide/C/virtualization.xml:828(para) serverguide/C/jeos.xml:447(para) serverguide/C/databases.xml:19(trademark) serverguide/C/databases.xml:31(title)
4202
#: serverguide/C/virtualization.xml:829(para) serverguide/C/remote-administration.xml:20(title) serverguide/C/jeos.xml:448(para)
4203
msgid "OpenSSH Server"
4206
#: serverguide/C/virtualization.xml:830(para) serverguide/C/jeos.xml:449(para)
4207
msgid "Limesurvey (as an example application that we have packaged)"
4210
#: serverguide/C/virtualization.xml:833(para) serverguide/C/jeos.xml:452(para)
4212
"This is done using vmbuilder by specifying the --addpkg command multiple "
4216
#: serverguide/C/virtualization.xml:837(programlisting) serverguide/C/jeos.xml:456(programlisting)
4221
" Install PKG into the guest (can be specfied multiple times)\n"
4224
#: serverguide/C/virtualization.xml:842(para) serverguide/C/jeos.xml:461(para)
4226
"However, due to the way vmbuilder operates, packages that have to ask "
4227
"questions to the user during the post install phase are not supported and "
4228
"should instead be installed while interactivity can occur. This is the case "
4229
"of Limesurvey, which we will have to install later, once the user logs in."
4232
#: serverguide/C/virtualization.xml:848(para) serverguide/C/jeos.xml:467(para)
4234
"Other packages that ask simple debconf question, such as <application>mysql-"
4235
"server</application> asking to set a password, the package can be installed "
4236
"immediately, but we will have to reconfigure it the first time the user logs "
4240
#: serverguide/C/virtualization.xml:854(para) serverguide/C/jeos.xml:473(para)
4242
"If some packages that we need to install are not in main, we need to enable "
4243
"the additional repositories using --comp and --ppa:"
4246
#: serverguide/C/virtualization.xml:858(programlisting) serverguide/C/jeos.xml:477(programlisting)
4250
"--components COMP1,COMP2,...,COMPN\n"
4251
" A comma separated list of distro components to include (e.g. "
4252
"main,universe). This defaults\n"
4254
"--ppa=PPA Add ppa belonging to PPA to the vm's sources.list.\n"
4257
#: serverguide/C/virtualization.xml:865(para) serverguide/C/jeos.xml:484(para)
4259
"Limesurvey not being part of the archive at the moment, we'll specify it's "
4260
"PPA (personal package archive) address so that it is added to the VM "
4261
"<filename>/etc/apt/source.list</filename>, so we add the following options "
4262
"to the command line:"
4265
#: serverguide/C/virtualization.xml:871(command) serverguide/C/jeos.xml:490(command)
4267
"--addpkg apache2 --addpkg apache2-mpm-prefork --addpkg apache2-utils --"
4268
"addpkg apache2.2-common \\ --addpkg dbconfig-common --addpkg libapache2-mod-"
4269
"php5 --addpkg mysql-client --addpkg php5-cli \\ --addpkg php5-gd --addpkg "
4270
"php5-ldap --addpkg php5-mysql --addpkg wwwconfig-common \\ --addpkg mysql-"
4271
"server --ppa nijaba"
4274
#: serverguide/C/virtualization.xml:878(title) serverguide/C/jeos.xml:497(title)
4278
#: serverguide/C/virtualization.xml:880(para)
4280
"Another convenient tool that we want to have on our appliance is OpenSSH, as "
4281
"it will allow our admins to access the appliance remotely. However, pushing "
4282
"in the wild an appliance with a pre-installed OpenSSH server is a big "
4283
"security risk as all these server will share the same secret key, making it "
4284
"very easy for hackers to target our appliance with all the tools they need "
4285
"to crack it open in a breeze. As for the user password, we will instead rely "
4286
"on a script that will install OpenSSH the first time a user logs in so that "
4287
"the key generated will be different for each appliance. For this we'll use a "
4288
"<emphasis>--firstboot</emphasis> script, as it does not need any user "
4292
#: serverguide/C/virtualization.xml:892(title) serverguide/C/jeos.xml:511(title)
4293
msgid "Speed Considerations"
4296
#: serverguide/C/virtualization.xml:895(title) serverguide/C/jeos.xml:514(title)
4297
msgid "Package Caching"
4300
#: serverguide/C/virtualization.xml:897(para) serverguide/C/jeos.xml:516(para)
4302
"When vmbuilder creates builds your system, it has to go fetch each one of "
4303
"the packages that composes it over the network to one of the official "
4304
"repositories, which, depending on your internet connection speed and the "
4305
"load of the mirror, can have a big impact on the actual build time. In order "
4306
"to reduce this, it is recommended to either have a local repository (which "
4307
"can be created using <application>apt-mirror</application>) or using a "
4308
"caching proxy such as <application>apt-cache</application>. The later option "
4309
"being much simpler to implement and requiring less disk space, it is the one "
4310
"we will pick in this tutorial. To install it, simply type:"
4313
#: serverguide/C/virtualization.xml:907(command) serverguide/C/jeos.xml:526(command)
4314
msgid "sudo apt-get install apt-proxy"
4317
#: serverguide/C/virtualization.xml:910(para) serverguide/C/jeos.xml:529(para)
4319
"Once this is complete, your (empty) proxy is ready for use on "
4320
"http://mirroraddress:9999 and will find ubuntu repository under /ubuntu. For "
4321
"vmbuilder to use it, we'll have to use the <emphasis>--mirror</emphasis> "
4325
#: serverguide/C/virtualization.xml:915(programlisting) serverguide/C/jeos.xml:534(programlisting)
4329
"--mirror=URL Use Ubuntu mirror at URL instead of the default, which\n"
4330
" is http://archive.ubuntu.com/ubuntu for official\n"
4331
" arches and http://ports.ubuntu.com/ubuntu-ports\n"
4335
#: serverguide/C/virtualization.xml:922(para) serverguide/C/jeos.xml:541(para)
4336
msgid "So we add to the command line:"
4339
#: serverguide/C/virtualization.xml:927(command) serverguide/C/jeos.xml:546(command)
4340
msgid "--mirror http://mirroraddress:9999/ubuntu"
4343
#: serverguide/C/virtualization.xml:931(para) serverguide/C/jeos.xml:550(para)
4345
"The mirror address specified here will also be used in the "
4346
"<filename>/etc/apt/source.list</filename> of the newly created guest, so it "
4347
"is usefull to specify here an address that can be resolved by the guest or "
4348
"to plan on reseting this address later on, such as in a <emphasis>--"
4349
"firstboot</emphasis> script."
4352
#: serverguide/C/virtualization.xml:940(title) serverguide/C/jeos.xml:559(title)
4353
msgid "Install a Local Mirror"
4356
#: serverguide/C/virtualization.xml:942(para) serverguide/C/jeos.xml:561(para)
4358
"If we are in a larger environment, it may make sense to setup a local mirror "
4359
"of the Ubuntu repositories. The package apt-mirror provides you with a "
4360
"script that will handle the mirroring for you. You should plan on having "
4361
"about 20 gigabyte of free space per supported release and architecture."
4364
#: serverguide/C/virtualization.xml:948(para) serverguide/C/jeos.xml:567(para)
4366
"By default, <application>apt-mirror</application> uses the configuration "
4367
"file in <filename>/etc/apt/mirror.list</filename>. As it is set up, it will "
4368
"replicate only the architecture of the local machine. If you would like to "
4369
"support other architectures on your mirror, simply duplicate the lines "
4370
"starting with “deb”, replacing the deb keyword by /deb-{arch} where arch can "
4371
"be i386, amd64, etc... For example, on an amd64 machine, to have the i386 "
4372
"archives as well, you will have:"
4375
#: serverguide/C/virtualization.xml:955(programlisting) serverguide/C/jeos.xml:574(programlisting)
4379
"deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe "
4381
"/deb-i386 http://archive.ubuntu.com/ubuntu jaunty main restricted universe "
4384
"deb http://archive.ubuntu.com/ubuntu jaunty-updates main restricted "
4385
"universe multiverse \n"
4386
"/deb-i386 http://archive.ubuntu.com/ubuntu jaunty-updates main restricted "
4387
"universe multiverse \n"
4389
"deb http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted "
4390
"universe multiverse \n"
4391
"/deb-i386 http://archive.ubuntu.com/ubuntu jaunty-backports main restricted "
4392
"universe multiverse \n"
4394
"deb http://security.ubuntu.com/ubuntu jaunty-security main restricted "
4395
"universe multiverse \n"
4396
"/deb-i386 http://security.ubuntu.com/ubuntu jaunty-security main restricted "
4397
"universe multiverse \n"
4399
"deb http://archive.ubuntu.com/ubuntu jaunty main/debian-installer "
4400
"restricted/debian-installer universe/debian-installer multiverse/debian-"
4402
"/deb-i386 http://archive.ubuntu.com/ubuntu jaunty main/debian-installer "
4403
"restricted/debian-installer universe/debian-installer multiverse/debian-"
4407
#: serverguide/C/virtualization.xml:972(para) serverguide/C/jeos.xml:591(para)
4409
"Notice that the source packages are not mirrored as they are seldom used "
4410
"compared to the binaries and they do take a lot more space, but they can be "
4411
"easily added to the list."
4414
#: serverguide/C/virtualization.xml:977(para) serverguide/C/jeos.xml:596(para)
4416
"Once the mirror has finished replicating (and this can be quite long), you "
4417
"need to configure Apache so that your mirror files (in "
4418
"<filename>/var/spool/apt-mirror</filename> if you did not change the "
4419
"default), are published by your Apache server. For more information on "
4420
"Apache see <xref linkend=\"httpd\"/>."
4423
#: serverguide/C/virtualization.xml:986(title) serverguide/C/jeos.xml:605(title)
4424
msgid "Installing in a RAM Disk"
4427
#: serverguide/C/virtualization.xml:988(para) serverguide/C/jeos.xml:607(para)
4429
"As you can easily imagine, writing to RAM is a <emphasis>LOT</emphasis> "
4430
"faster than writing to disk. If you have some free memory, letting vmbuilder "
4431
"perform its operation in a RAMdisk will help a lot and the option <emphasis>-"
4432
"-tmpfs</emphasis> will help you do just that:"
4435
#: serverguide/C/virtualization.xml:994(programlisting) serverguide/C/jeos.xml:613(programlisting)
4439
"--tmpfs OPTS Use a tmpfs as the working directory, specifying its\n"
4440
" size or \"-\" to use tmpfs default (suid,dev,size=1G).\n"
4443
#: serverguide/C/virtualization.xml:999(para) serverguide/C/jeos.xml:618(para)
4445
"So adding <command>--tmpfs -</command> sounds like a very good idea if you "
4446
"have 1G of free ram."
4449
#: serverguide/C/virtualization.xml:1006(title) serverguide/C/jeos.xml:625(title)
4450
msgid "Package the Application"
4453
#: serverguide/C/virtualization.xml:1008(para) serverguide/C/jeos.xml:627(para)
4454
msgid "Two option are available to us:"
4457
#: serverguide/C/virtualization.xml:1014(para) serverguide/C/jeos.xml:633(para)
4459
"The recommended method to do so is to make a <emphasis>Debian</emphasis> "
4460
"package. Since this is outside of the scope of this tutorial, we will not "
4461
"perform this here and invite the reader to read the documentation on how to "
4462
"do this in the <ulink url=\"https://wiki.ubuntu.com/PackagingGuide\">Ubuntu "
4463
"Packaging Guide</ulink>. In this case it is also a good idea to setup a "
4464
"repository for your package so that updates can be conveniently pulled from "
4465
"it. See the <ulink url=\"http://www.debian-"
4466
"administration.org/articles/286\">Debian Administration</ulink> article for "
4467
"a tutorial on this."
4470
#: serverguide/C/virtualization.xml:1023(para) serverguide/C/jeos.xml:642(para)
4472
"Manually install the application under <filename>/opt</filename> as "
4473
"recommended by the <ulink url=\"http://www.pathname.com/fhs/\">FHS "
4474
"guidelines</ulink>."
4477
#: serverguide/C/virtualization.xml:1030(para) serverguide/C/jeos.xml:649(para)
4479
"In our case we'll use <application>Limesurvey</application> as example web "
4480
"application for which we wish to provide a virtual appliance. As noted "
4481
"before, we've made a version of the package available in a PPA (Personal "
4485
#: serverguide/C/virtualization.xml:1037(title) serverguide/C/jeos.xml:656(title)
4486
msgid "Finishing Install"
4489
#: serverguide/C/virtualization.xml:1040(title) serverguide/C/jeos.xml:659(title)
4493
#: serverguide/C/virtualization.xml:1042(para) serverguide/C/jeos.xml:661(para)
4495
"As we mentioned earlier, the first time the machine boots we'll need to "
4496
"install <application>openssh-server</application> so that the key generated "
4497
"for it is unique for each machine. To do this, we'll write a script called "
4498
"<filename>boot.sh</filename> as follows:"
4501
#: serverguide/C/virtualization.xml:1048(programlisting) serverguide/C/jeos.xml:667(programlisting)
4505
"# This script will run the first time the virtual machine boots\n"
4506
"# It is ran as root.\n"
4509
"apt-get install -qqy --force-yes openssh-server\n"
4512
#: serverguide/C/virtualization.xml:1056(para) serverguide/C/jeos.xml:675(para)
4514
"And we add the <command>--firstboot boot.sh</command> option to our command "
4518
#: serverguide/C/virtualization.xml:1062(title) serverguide/C/jeos.xml:681(title)
4522
#: serverguide/C/virtualization.xml:1064(para) serverguide/C/jeos.xml:683(para)
4524
"Mysql and Limesurvey needing some user interaction during their setup, we'll "
4525
"set them up the first time a user logs in using a script named login.sh. "
4526
"We'll also use this script to let the user specify:"
4529
#: serverguide/C/virtualization.xml:1070(para) serverguide/C/jeos.xml:689(para)
4530
msgid "His own password"
4533
#: serverguide/C/virtualization.xml:1071(para) serverguide/C/jeos.xml:690(para)
4534
msgid "Define the keyboard and other locale info he wants to use"
4537
#: serverguide/C/virtualization.xml:1074(para) serverguide/C/jeos.xml:693(para)
4538
msgid "So we'll define <filename>login.sh</filename> as follows:"
4541
#: serverguide/C/virtualization.xml:1078(programlisting) serverguide/C/jeos.xml:697(programlisting)
4545
"# This script is ran the first time a user logs in\n"
4547
"echo \"Your appliance is about to be finished to be set up.\"\n"
4548
"echo \"In order to do it, we'll need to ask you a few questions,\"\n"
4549
"echo \"starting by changing your user password.\"\n"
4553
"#give the opportunity to change the keyboard\n"
4554
"sudo dpkg-reconfigure console-setup\n"
4556
"#configure the mysql server root password\n"
4557
"sudo dpkg-reconfigure mysql-server-5.0\n"
4559
"#install limesurvey\n"
4560
"sudo apt-get install -qqy --force-yes limesurvey\n"
4562
"echo \"Your appliance is now configured. To use it point your\"\n"
4563
"echo \"browser to http://serverip/limesurvey/admin\"\n"
4566
#: serverguide/C/virtualization.xml:1100(para) serverguide/C/jeos.xml:719(para)
4568
"And we add the <command>--firstlogin login.sh</command> option to our "
4572
#: serverguide/C/virtualization.xml:1107(title) serverguide/C/jeos.xml:726(title)
4573
msgid "Useful Additions"
4576
#: serverguide/C/virtualization.xml:1110(title) serverguide/C/jeos.xml:729(title)
4577
msgid "Configuring Automatic Updates"
4580
#: serverguide/C/virtualization.xml:1112(para) serverguide/C/jeos.xml:731(para)
4582
"To have your system be configured to update itself on a regular basis, we "
4583
"will just install <application>unattended-upgrades</application>, so we add "
4584
"the following option to our command line:"
4587
#: serverguide/C/virtualization.xml:1118(command) serverguide/C/jeos.xml:737(command)
4588
msgid "--addpkg unattended-upgrades"
4591
#: serverguide/C/virtualization.xml:1121(para) serverguide/C/jeos.xml:740(para)
4593
"As we have put our application package in a PPA, the process will update not "
4594
"only the system, but also the application each time we update the version in "
4598
#: serverguide/C/virtualization.xml:1128(title) serverguide/C/jeos.xml:747(title)
4599
msgid "ACPI Event Handling"
4602
#: serverguide/C/virtualization.xml:1130(para) serverguide/C/jeos.xml:749(para)
4604
"For your virtual machine to be able to handle restart and shutdown events it "
4605
"is being sent, it is a good idea to install the acpid package as well. To do "
4606
"this we just add the following option:"
4609
#: serverguide/C/virtualization.xml:1136(command) serverguide/C/jeos.xml:755(command)
4610
msgid "--addpkg acpid"
4613
#: serverguide/C/virtualization.xml:1142(title) serverguide/C/jeos.xml:761(title)
4614
msgid "Final Command"
4617
#: serverguide/C/virtualization.xml:1144(para) serverguide/C/jeos.xml:763(para)
4618
msgid "Here is what the command with all the options discussed above:"
4621
#: serverguide/C/virtualization.xml:1149(command) serverguide/C/jeos.xml:768(command)
4623
"sudo vmbuilder kvm ubuntu --suite intrepid --flavour virtual --arch i386 -o "
4624
"\\ --libvirt qemu:///system --ip 192.168.0.100 --part vmbuilder.partition --"
4625
"user user \\ --name user --pass default --addpkg apache2 --addpkg apache2-"
4626
"mpm-prefork \\ --addpkg apache2-utils --addpkg apache2.2-common --addpkg "
4627
"dbconfig-common \\ --addpkg libapache2-mod-php5 --addpkg mysql-client --"
4628
"addpkg php5-cli \\ --addpkg php5-gd --addpkg php5-ldap --addpkg php5-mysql --"
4629
"addpkg wwwconfig-common \\ --addpkg mysql-server --addpkg unattended-"
4630
"upgrades --addpkg acpid --ppa nijaba \\ --mirror "
4631
"http://mirroraddress:9999/ubuntu --tmpfs - --firstboot boot.sh \\ --"
4632
"firstlogin login.sh es"
4635
#: serverguide/C/virtualization.xml:1164(para) serverguide/C/jeos.xml:783(para)
4637
"If you are interested in learning more, have questions or suggestions, "
4638
"please contact the Ubuntu Server Team at:"
4641
#: serverguide/C/virtualization.xml:1169(para) serverguide/C/jeos.xml:788(para)
4642
msgid "IRC: #ubuntu-server on freenode"
4645
#: serverguide/C/virtualization.xml:1174(para) serverguide/C/jeos.xml:793(para)
4647
"Mailing list: <ulink url=\"https://lists.ubuntu.com/mailman/listinfo/ubuntu-"
4648
"server\">ubuntu-server at lists.ubuntu.com</ulink>"
4651
#: serverguide/C/virtualization.xml:1182(title)
4655
#: serverguide/C/virtualization.xml:1185(title) serverguide/C/network-auth.xml:1670(title) serverguide/C/lamp-applications.xml:17(title) serverguide/C/installation.xml:878(title) serverguide/C/dns.xml:64(title) serverguide/C/chat.xml:17(title) serverguide/C/backups.xml:541(title)
4659
#: serverguide/C/virtualization.xml:1187(para)
4661
"<emphasis>Eucalyptus</emphasis> is an open-source software infrastructure "
4662
"for implementing \"cloud computing\" on your own clusters. "
4663
"<emphasis>Eucalyptus</emphasis> allows you to create your own cloud "
4664
"computing environment in order to maximize computing resources and provide a "
4665
"cloud computing environment to your users."
4668
#: serverguide/C/virtualization.xml:1193(para)
4670
"This section will cover setting up a Cloud Computing environment using "
4671
"<application>Eucalyptus</application> with <application>KVM</application>. "
4672
"For more information on KVM see <xref linkend=\"libvirt\"/>."
4675
#: serverguide/C/virtualization.xml:1198(para)
4677
"The Cloud Computing environment will consist of three components, typically "
4678
"installed on at least two separate machines (termed the 'front-end' and "
4679
"'node(s)' for the rest of this document):"
4682
#: serverguide/C/virtualization.xml:1205(para)
4684
"<emphasis>One Front-End:</emphasis> hosts one Cloud Controller, a Java based "
4685
"Web configuration interface, and a Cluster Controller, which determines "
4686
"where virtual machines (VMs) will be housed and manages cluster level VM "
4690
#: serverguide/C/virtualization.xml:1211(para)
4692
"<emphasis>One or more Compute Nodes:</emphasis> runs the Node Controller "
4693
"component of Eucalyptus, which allows the machine to be part of the cloud as "
4697
#: serverguide/C/virtualization.xml:1218(para)
4699
"The simple <emphasis>System</emphasis> networking option will be used by "
4700
"default. This network method allows virtual machine instances, to obtain IP "
4701
"addresses from the local LAN, assuming that a DHCP server is properly "
4702
"configured on the LAN to hand out IPs dynamically to VMs that request them. "
4703
"Each node will be configured for bridge networking. For more details see "
4704
"<xref linkend=\"bridging\"/>."
4707
#: serverguide/C/virtualization.xml:1228(para)
4709
"First, on the <emphasis>Front-End</emphasis> install the appropriate "
4710
"packages. In a terminal prompt on the Front-End enter:"
4713
#: serverguide/C/virtualization.xml:1233(command)
4714
msgid "sudo apt-get install eucalyptus-cloud eucalyptus-cc"
4717
#: serverguide/C/virtualization.xml:1236(para)
4719
"Next, on the each <emphasis>Compute Node</emphasis> install the node "
4720
"controller package. In a terminal prompt on each Compute Node enter:"
4723
#: serverguide/C/virtualization.xml:1241(command)
4724
msgid "sudo apt-get install eucalyptus-nc"
4727
#: serverguide/C/virtualization.xml:1244(para)
4729
"Once the installation is complete, and it may take a while, in a browser go "
4730
"to <emphasis>https://front-end:8443</emphasis> and login to the "
4731
"administration interface using the default username and password of "
4732
"<emphasis>admin</emphasis>. You will then be prompted to change the "
4733
"password, configure an email address for the admin user, and set the storage "
4737
#: serverguide/C/virtualization.xml:1250(para)
4739
"In the web interface's <emphasis>\"Configuration\"</emphasis> tab, add a "
4740
"cluster under the <emphasis>\"Clusters\"</emphasis> heading (in this "
4741
"configuration, the cluster controller is on the same system as the cloud "
4742
"controller, so entering 'localhost' as the cluster hostname is correct). "
4743
"Once the form is filled out click the <emphasis>\"Add Cluster\"</emphasis> "
4747
#: serverguide/C/virtualization.xml:1256(para)
4749
"Now, back on the <emphasis>Front-End</emphasis>, add the nodes to the "
4753
#: serverguide/C/virtualization.xml:1261(command)
4754
msgid "sudo euca_conf -addnode hostname_of_node"
4757
#: serverguide/C/virtualization.xml:1264(para)
4759
"You will then be prompted to log into your Node, install the "
4760
"<application>eucalyptus-nc</application> package, and add the "
4761
"<emphasis>eucalyptus</emphasis> user's ssh key to the node's "
4762
"<filename>authorized_keys</filename> file, and confirm authenticity of the "
4763
"host's OpenSSH RSA key fingerprint. Finally, the command will complete by "
4764
"synchronizing the eucalyptus component keys and node registration is "
4768
#: serverguide/C/virtualization.xml:1270(para)
4770
"On the Node, the <filename>/etc/eucalyptus/eucalyptus.conf</filename> "
4771
"configuration file will need editing to use your node's bridge interface "
4772
"(assuming here that the interface is named <emphasis>'br0'</emphasis>):"
4775
#: serverguide/C/virtualization.xml:1275(programlisting)
4779
"VNET_INTERFACE=\"br0\"\n"
4781
"VNET_BRIDGE=\"br0\"\n"
4784
#: serverguide/C/virtualization.xml:1281(para)
4785
msgid "Finally, restart <application>eucalyptus-nc</application>:"
4788
#: serverguide/C/virtualization.xml:1286(command)
4789
msgid "sudo /etc/init.d/eucalyptus-nc restart"
4792
#: serverguide/C/virtualization.xml:1291(para)
4794
"Be sure to replace <emphasis>nodecontroller</emphasis>, "
4795
"<emphasis>node01</emphasis>, and <emphasis>node02</emphasis> with actual "
4799
#: serverguide/C/virtualization.xml:1297(para)
4801
"<application>Eucalyptus</application> is now ready to host images on the "
4805
#: serverguide/C/virtualization.xml:1307(para)
4807
"See the <ulink url=\"http://eucalyptus.cs.ucsb.edu/\">Eucalyptus "
4808
"website</ulink> for more information."
4811
#: serverguide/C/virtualization.xml:1312(para)
4813
"For information on loading instances see the <ulink "
4814
"url=\"https://help.ubuntu.com/community/Eucalyptus\">Eucalyptus Wiki</ulink> "
4818
#: serverguide/C/virtualization.xml:1317(para)
4820
"You can also find help in the <emphasis>#ubuntu-virt</emphasis>, "
4821
"<emphasis>#eucalyptus</emphasis>, and <emphasis>#ubuntu-server</emphasis> "
4822
"IRC channels on <ulink url=\"http://freenode.net\">Freenode</ulink>."
4825
#: serverguide/C/virtualization.xml:1327(title)
4829
#: serverguide/C/virtualization.xml:1329(para)
4831
"<application>OpenNebula</application> allows virtual machines to be placed "
4832
"and re-placed dynamically on a pool of physical resources. This allows a "
4833
"virtual machine to be hosted from any location available."
4836
#: serverguide/C/virtualization.xml:1334(para)
4838
"This section will detail configuring an OpenNebula cluster using three "
4839
"machines: one <emphasis>Front-End</emphasis> host, and two <emphasis>Compute "
4840
"Nodes</emphasis> used to run the virtual machines. The Compute Nodes will "
4841
"also need a bridge configured to allow the virtual machines access to the "
4842
"local network. For details see <xref linkend=\"bridging\"/>."
4845
#: serverguide/C/virtualization.xml:1343(para)
4846
msgid "First, from a terminal on the Front-End enter:"
4849
#: serverguide/C/virtualization.xml:1348(command)
4850
msgid "sudo apt-get install opennebula"
4853
#: serverguide/C/virtualization.xml:1351(para)
4854
msgid "On each Compute Node install:"
4857
#: serverguide/C/virtualization.xml:1356(command)
4858
msgid "sudo apt-get install opennebula-node"
4861
#: serverguide/C/virtualization.xml:1359(para)
4863
"In order to copy SSH keys, the <emphasis>oneadmin</emphasis> user will need "
4864
"to have a password. On each machine execute:"
4867
#: serverguide/C/virtualization.xml:1364(command)
4868
msgid "sudo passwd oneadmin"
4871
#: serverguide/C/virtualization.xml:1367(para)
4873
"Next, copy the <emphasis>oneadmin</emphasis> user's SSH key to the Compute "
4874
"Nodes, and to the Front-End's <filename>authorized_keys</filename> file:"
4877
#: serverguide/C/virtualization.xml:1372(command)
4879
"sudo scp /var/lib/one/.ssh/id_rsa.pub "
4880
"oneadmin@node01:/var/lib/one/.ssh/authorized_keys"
4883
#: serverguide/C/virtualization.xml:1373(command)
4885
"sudo scp /var/lib/one/.ssh/id_rsa.pub "
4886
"oneadmin@node02:/var/lib/one/.ssh/authorized_keys"
4889
#: serverguide/C/virtualization.xml:1374(command)
4891
"sudo sh -c \"cat /var/lib/one/.ssh/id_rsa.pub >> "
4892
"/var/lib/one/.ssh/authorized_keys\""
4895
#: serverguide/C/virtualization.xml:1377(para)
4897
"The SSH key for the Compute Nodes needs to be added to the "
4898
"<filename>/etc/ssh/ssh_known_hosts</filename> file on the Front-End host. To "
4899
"accomplish this <application>ssh</application> to each Compute Node as a "
4900
"user other than <emphasis>oneadmin</emphasis>. Then exit from the SSH "
4901
"session, and execute the following to copy the SSH key from "
4902
"<filename>~/.ssh/known_hosts</filename> to "
4903
"<filename>/etc/ssh/ssh_known_hosts</filename>:"
4906
#: serverguide/C/virtualization.xml:1384(command)
4908
"sudo sh -c \"ssh-keygen -f .ssh/known_hosts -F node01 1>> "
4909
"/etc/ssh/ssh_known_hosts\""
4912
#: serverguide/C/virtualization.xml:1385(command)
4914
"sudo sh -c \"ssh-keygen -f .ssh/known_hosts -F node02 1>> "
4915
"/etc/ssh/ssh_known_hosts\""
4918
#: serverguide/C/virtualization.xml:1389(para)
4920
"Replace <emphasis>node01</emphasis> and <emphasis>node02</emphasis> with the "
4921
"appropriate host names."
4924
#: serverguide/C/virtualization.xml:1394(para)
4926
"This allows the <emphasis>oneadmin</emphasis> to use "
4927
"<application>scp</application>, without a password or manual intervention, "
4928
"to deploy an image to the Compute Nodes."
4931
#: serverguide/C/virtualization.xml:1399(para)
4933
"On the Front-End create a directory to store the VM images, giving the "
4934
"<emphasis>oneadmin</emphasis> user access to the directory:"
4937
#: serverguide/C/virtualization.xml:1404(command)
4938
msgid "sudo mkdir /var/lib/one/images"
4941
#: serverguide/C/virtualization.xml:1405(command)
4942
msgid "sudo chown oneadmin /var/lib/one/images/"
4945
#: serverguide/C/virtualization.xml:1408(para)
4947
"Finally, copy a virtual machine disk file into "
4948
"<filename>/var/lib/one/images</filename>. You can create an Ubuntu virtual "
4949
"machine using <application>vmbuilder</application>, see <xref linkend=\"jeos-"
4950
"and-vmbuilder\"/> for details."
4953
#: serverguide/C/virtualization.xml:1417(para)
4955
"The <emphasis>OpenNebula Cluster</emphasis> is now ready to be configured, "
4956
"and virtual machines added to the cluster."
4959
#: serverguide/C/virtualization.xml:1421(para)
4960
msgid "From a terminal prompt enter:"
4963
#: serverguide/C/virtualization.xml:1426(command)
4964
msgid "onehost create node01 im_kvm vmm_kvm tm_ssh"
4967
#: serverguide/C/virtualization.xml:1427(command)
4968
msgid "onehost create node02 im_kvm vmm_kvm tm_ssh"
4971
#: serverguide/C/virtualization.xml:1430(para)
4973
"Next, create a <emphasis>Virtual Network</emphasis> template file named "
4974
"<filename>vnet01.template</filename>:"
4977
#: serverguide/C/virtualization.xml:1434(programlisting)
4984
"NETWORK_SIZE = C\n"
4985
"NETWORK_ADDRESS = 192.168.0.0\n"
4988
#: serverguide/C/virtualization.xml:1443(para)
4990
"Be sure to change <emphasis>192.168.0.0</emphasis> to your local network."
4993
#: serverguide/C/virtualization.xml:1448(para)
4995
"Using the <application>onevnet</application> utility, add the virtual "
4996
"network to OpenNebula:"
4999
#: serverguide/C/virtualization.xml:1453(command)
5000
msgid "onevnet create vnet01.template"
5003
#: serverguide/C/virtualization.xml:1456(para)
5005
"Now create a <emphasis>VM Template</emphasis> file named "
5006
"<filename>vm01.template</filename>:"
5009
#: serverguide/C/virtualization.xml:1460(programlisting)
5017
"OS = [ BOOT = hd ]\n"
5020
" source = \"/var/lib/one/images/vm01.qcow2\",\n"
5021
" target = \"hda\",\n"
5022
" readonly = \"no\" ]\n"
5024
"NIC = [ NETWORK=\"LAN\" ]\n"
5026
"GRAPHICS = [type=\"vnc\",listen=\"127.0.0.1\",port=\"-1\"]\n"
5029
#: serverguide/C/virtualization.xml:1477(para)
5030
msgid "Start the virtual machine using <application>onevm</application>:"
5033
#: serverguide/C/virtualization.xml:1482(command)
5034
msgid "onevm submit vm01.template"
5037
#: serverguide/C/virtualization.xml:1485(para)
5039
"Use the <application>onevm list</application> option to view information "
5040
"about virtual machines. Also, the <application>onevm show vm01</application> "
5041
"option will display more details about a specific virtual machine."
5044
#: serverguide/C/virtualization.xml:1496(para)
5047
"url=\"http://www.opennebula.org/doku.php?id=start\">OpenNebula website</ulink"
5048
"> for more information."
5051
#: serverguide/C/virtualization.xml:1501(para)
5053
"You can also find help in the <emphasis>#ubuntu-virt</emphasis> and "
5054
"<emphasis>#ubuntu-server</emphasis> IRC channels on <ulink "
5055
"url=\"http://freenode.net\">Freenode</ulink>."
5058
#: serverguide/C/vcs.xml:13(title)
5059
msgid "Version Control System"
5062
#: serverguide/C/vcs.xml:14(para)
5064
"Version control is the art of managing changes to information. It has long "
5065
"been a critical tool for programmers, who typically spend their time making "
5066
"small changes to software and then undoing those changes the next day. But "
5067
"the usefulness of version control software extends far beyond the bounds of "
5068
"the software development world. Anywhere you can find people using computers "
5069
"to manage information that changes often, there is room for version control."
5072
#: serverguide/C/vcs.xml:17(title)
5076
#: serverguide/C/vcs.xml:18(para)
5078
"Bazaar is a new version control system sponsored by Canonical, the "
5079
"commercial company behind Ubuntu. Unlike Subversion and CVS that only "
5080
"support a central repository model, Bazaar also supports "
5081
"<emphasis>distributed version control</emphasis>, giving people the ability "
5082
"to collaborate more efficiently. In particular, Bazaar is designed to "
5083
"maximize the level of community participation in open source projects."
5086
#: serverguide/C/vcs.xml:29(para)
5088
"At a terminal prompt, enter the following command to install "
5089
"<application>bzr</application>: <screen>\n"
5090
"<command>sudo apt-get install bzr</command>\n"
5094
#: serverguide/C/vcs.xml:40(para)
5096
"To introduce yourself to <application>bzr</application>, use the "
5097
"<emphasis>whoami</emphasis> command like this: <screen>\n"
5098
"<command>$ bzr whoami 'Joe Doe <joe.doe@gmail.com>'</command>\n"
5102
#: serverguide/C/vcs.xml:49(title)
5103
msgid "Learning Bazaar"
5106
#: serverguide/C/vcs.xml:50(para)
5108
"Bazaar comes with bundled documentation installed into "
5109
"<application>/usr/share/doc/bzr/html</application> by default. The tutorial "
5110
"is a good place to start. The <application>bzr</application> command also "
5111
"comes with built-in help: <screen>\n"
5112
"<command>$ bzr help</command>\n"
5116
#: serverguide/C/vcs.xml:60(para)
5118
"To learn more about the <emphasis>foo</emphasis> command: <screen>\n"
5119
"<command>$ bzr help foo</command>\n"
5123
#: serverguide/C/vcs.xml:68(title)
5124
msgid "Launchpad Integration"
5127
#: serverguide/C/vcs.xml:69(para)
5129
"While highly useful as a stand-alone system, Bazaar has good, optional "
5130
"integration with <ulink url=\"https://launchpad.net/\">Launchpad</ulink>, "
5131
"the collaborative development system used by Canonical and the broader open "
5132
"source community to manage and extend Ubuntu itself. For information on how "
5133
"Bazaar can be used with Launchpad to collaborate on open source projects, "
5134
"see <ulink url=\"http://bazaar-vcs.org/LaunchpadIntegration/\"> "
5135
"http://bazaar-vcs.org/LaunchpadIntegration</ulink>."
5138
#: serverguide/C/vcs.xml:81(title)
5142
#: serverguide/C/vcs.xml:82(para)
5144
"Subversion is an open source version control system. Using Subversion, you "
5145
"can record the history of source files and documents. It manages files and "
5146
"directories over time. A tree of files is placed into a central repository. "
5147
"The repository is much like an ordinary file server, except that it "
5148
"remembers every change ever made to files and directories."
5151
#: serverguide/C/vcs.xml:87(para)
5153
"To access Subversion repository using the HTTP protocol, you must install "
5154
"and configure a web server. Apache2 is proven to work with Subversion. "
5155
"Please refer to the HTTP subsection in the Apache2 section to install and "
5156
"configure Apache2. To access the Subversion repository using the HTTPS "
5157
"protocol, you must install and configure a digital certificate in your "
5158
"Apache 2 web server. Please refer to the HTTPS subsection in the Apache2 "
5159
"section to install and configure the digital certificate."
5162
#: serverguide/C/vcs.xml:96(para)
5164
"To install Subversion, run the following command from a terminal prompt:"
5167
#: serverguide/C/vcs.xml:101(command)
5168
msgid "sudo apt-get install subversion libapache2-svn"
5171
#: serverguide/C/vcs.xml:107(title)
5172
msgid "Server Configuration"
5175
#: serverguide/C/vcs.xml:108(para)
5177
"This step assumes you have installed above mentioned packages on your "
5178
"system. This section explains how to create a Subversion repository and "
5179
"access the project."
5182
#: serverguide/C/vcs.xml:111(title)
5183
msgid "Create Subversion Repository"
5186
#: serverguide/C/vcs.xml:112(para)
5188
"The Subversion repository can be created using the following command from a "
5192
#: serverguide/C/vcs.xml:116(command)
5193
msgid "svnadmin create /path/to/repos/project"
5196
#: serverguide/C/vcs.xml:121(title)
5197
msgid "Importing Files"
5200
#: serverguide/C/vcs.xml:122(para)
5202
"Once you create the repository you can <emphasis>import</emphasis> files "
5203
"into the repository. To import a directory, enter the following from a "
5204
"terminal prompt: <screen>\n"
5205
"<command>svn import /path/to/import/directory "
5206
"file:///path/to/repos/project</command>\n"
5210
#: serverguide/C/vcs.xml:134(title) serverguide/C/vcs.xml:139(title)
5211
msgid "Access Methods"
5214
#: serverguide/C/vcs.xml:135(para)
5216
"Subversion repositories can be accessed (checked out) through many different "
5217
"methods --on local disk, or through various network protocols. A repository "
5218
"location, however, is always a URL. The table describes how different URL "
5219
"schemes map to the available access methods."
5222
#: serverguide/C/vcs.xml:146(para)
5226
#: serverguide/C/vcs.xml:147(para)
5227
msgid "Access Method"
5230
#: serverguide/C/vcs.xml:152(para)
5234
#: serverguide/C/vcs.xml:153(para)
5235
msgid "direct repository access (on local disk)"
5238
#: serverguide/C/vcs.xml:156(para)
5242
#: serverguide/C/vcs.xml:157(para)
5243
msgid "Access via WebDAV protocol to Subversion-aware Apache2 web server"
5246
#: serverguide/C/vcs.xml:160(para)
5250
#: serverguide/C/vcs.xml:161(para)
5251
msgid "Same as http://, but with SSL encryption"
5254
#: serverguide/C/vcs.xml:164(para)
5258
#: serverguide/C/vcs.xml:165(para)
5259
msgid "Access via custom protocol to an svnserve server"
5262
#: serverguide/C/vcs.xml:168(para)
5266
#: serverguide/C/vcs.xml:169(para)
5267
msgid "Same as svn://, but through an SSH tunnel"
5270
#: serverguide/C/vcs.xml:175(para)
5272
"In this section, we will see how to configure Subversion for all these "
5273
"access methods. Here, we cover the basics. For more advanced usage details, "
5274
"refer to the <ulink url=\"http://svnbook.red-bean.com/\">svn book</ulink>."
5277
#: serverguide/C/vcs.xml:182(title)
5278
msgid "Direct repository access (file://)"
5281
#: serverguide/C/vcs.xml:183(para)
5283
"This is the simplest of all access methods. It does not require any "
5284
"Subversion server process to be running. This access method is used to "
5285
"access Subversion from the same machine. The syntax of the command, entered "
5286
"at a terminal prompt, is as follows:"
5289
#: serverguide/C/vcs.xml:190(command)
5290
msgid "svn co file:///path/to/repos/project"
5293
#: serverguide/C/vcs.xml:193(para)
5297
#: serverguide/C/vcs.xml:196(command)
5298
msgid "svn co file://localhost/path/to/repos/project"
5301
#: serverguide/C/vcs.xml:200(para)
5303
"If you do not specify the hostname, there are three forward slashes (///) -- "
5304
"two for the protocol (file, in this case) plus the leading slash in the "
5305
"path. If you specify the hostname, you must use two forward slashes (//)."
5308
#: serverguide/C/vcs.xml:202(para)
5310
"The repository permissions depend on filesystem permissions. If the user has "
5311
"read/write permission, he can checkout from and commit to the repository."
5314
#: serverguide/C/vcs.xml:205(title)
5315
msgid "Access via WebDAV protocol (http://)"
5318
#: serverguide/C/vcs.xml:206(para)
5320
"To access the Subversion repository via WebDAV protocol, you must configure "
5321
"your Apache 2 web server. You must add the following snippet in your "
5322
"<filename>/etc/apache2/apache2.conf</filename> file:"
5325
#: serverguide/C/vcs.xml:208(programlisting)
5328
" <Location /svn>\n"
5330
" SVNParentPath /home/svn\n"
5332
" AuthName \"Your repository name\"\n"
5333
" AuthUserFile /etc/subversion/passwd\n"
5334
" <LimitExcept GET PROPFIND OPTIONS REPORT>\n"
5335
" Require valid-user\n"
5336
" </LimitExcept>\n"
5337
" </Location> "
5340
#: serverguide/C/vcs.xml:219(para)
5342
"The above configuration snippet assumes that Subversion repositories are "
5343
"created under <filename>/home/svn/</filename> directory using "
5344
"<command>svnadmin</command> command. They can be accessible using "
5345
"<command>htpp://hostname/svn/repos_name</command> url."
5348
#: serverguide/C/vcs.xml:225(para)
5350
"To import or commit files to your Subversion repository over HTTP, the "
5351
"repository should be owned by the HTTP user. In Ubuntu systems, normally the "
5352
"HTTP user is <command>www-data</command>. To change the ownership of the "
5353
"repository files enter the following command from terminal prompt:"
5356
#: serverguide/C/vcs.xml:234(command)
5357
msgid "sudo chown -R www-data:www-data /path/to/repos"
5360
#: serverguide/C/vcs.xml:237(para)
5362
"By changing the ownership of repository as <command>www-data</command> you "
5363
"will not be able to import or commit files into the repository by running "
5364
"<command>svn import file:///</command> command as any user other than "
5365
"<command>www-data</command>."
5368
#: serverguide/C/vcs.xml:246(para)
5370
"Next, you must create the <filename>/etc/subversion/passwd</filename> file "
5371
"that will contain user authentication details. To create a file issue the "
5372
"following command at a command prompt (which will create the file and add "
5376
#: serverguide/C/vcs.xml:252(command)
5377
msgid "sudo htpasswd -c /etc/subversion/passwd user_name"
5380
#: serverguide/C/vcs.xml:255(para)
5382
"To add additional users omit the <emphasis>\"-c\"</emphasis> option as this "
5383
"option replaces the old file. Instead use this form:"
5386
#: serverguide/C/vcs.xml:260(command)
5387
msgid "sudo htpasswd /etc/subversion/password user_name"
5390
#: serverguide/C/vcs.xml:264(para)
5392
"This command will prompt you to enter the password. Once you enter the "
5393
"password, the user is added. Now, to access the repository you can run the "
5394
"following command:"
5397
#: serverguide/C/vcs.xml:265(command)
5398
msgid "svn co http://servername/svn"
5401
#: serverguide/C/vcs.xml:267(para)
5403
"The password is transmitted as plain text. If you are worried about password "
5404
"snooping, you are advised to use SSL encryption. For details, please refer "
5408
#: serverguide/C/vcs.xml:273(title)
5409
msgid "Access via WebDAV protocol with SSL encryption (https://)"
5412
#: serverguide/C/vcs.xml:274(para)
5414
"Accessing Subversion repository via WebDAV protocol with SSL encryption "
5415
"(https://) is similar to http:// except that you must install and configure "
5416
"the digital certificate in your Apache2 web server."
5419
#: serverguide/C/vcs.xml:281(para)
5421
"You can install a digital certificate issued by a signing authority like "
5422
"Verisign. Alternatively, you can install your own self-signed certificate."
5425
#: serverguide/C/vcs.xml:286(para)
5427
"This step assumes you have installed and configured a digital certificate in "
5428
"your Apache 2 web server. Now, to access the Subversion repository, please "
5429
"refer to the above section! The access methods are exactly the same, except "
5430
"the protocol. You must use https:// to access the Subversion repository."
5433
#: serverguide/C/vcs.xml:296(title)
5434
msgid "Access via custom protocol (svn://)"
5437
#: serverguide/C/vcs.xml:297(para)
5439
"Once the Subversion repository is created, you can configure the access "
5440
"control. You can edit the <filename> "
5441
"/path/to/repos/project/conf/svnserve.conf</filename> file to configure the "
5442
"access control. For example, to set up authentication, you can uncomment the "
5443
"following lines in the configuration file:"
5446
#: serverguide/C/vcs.xml:304(programlisting)
5450
"# password-db = passwd"
5453
#: serverguide/C/vcs.xml:307(para)
5455
"After uncommenting the above lines, you can maintain the user list in the "
5456
"passwd file. So, edit the file <filename>passwd </filename> in the same "
5457
"directory and add the new user. The syntax is as follows:"
5460
#: serverguide/C/vcs.xml:313(programlisting)
5462
msgid "username = password"
5465
#: serverguide/C/vcs.xml:314(para)
5466
msgid "For more details, please refer to the file."
5469
#: serverguide/C/vcs.xml:318(para)
5471
"Now, to access Subversion via the svn:// custom protocol, either from the "
5472
"same machine or a different machine, you can run svnserver using svnserve "
5473
"command. The syntax is as follows:"
5476
#: serverguide/C/vcs.xml:323(programlisting)
5479
"$ svnserve -d --foreground -r /path/to/repos\n"
5480
"# -d -- daemon mode\n"
5481
"# --foreground -- run in foreground (useful for debugging)\n"
5482
"# -r -- root of directory to serve\n"
5484
"For more usage details, please refer to:\n"
5488
#: serverguide/C/vcs.xml:331(para)
5490
"Once you run this command, Subversion starts listening on default port "
5491
"(3690). To access the project repository, you must run the following command "
5492
"from a terminal prompt:"
5495
#: serverguide/C/vcs.xml:334(command)
5496
msgid "svn co svn://hostname/project project --username user_name"
5499
#: serverguide/C/vcs.xml:337(para)
5501
"Based on server configuration, it prompts for password. Once you are "
5502
"authenticated, it checks out the code from Subversion repository. To "
5503
"synchronize the project repository with the local copy, you can run the "
5504
"<command>update</command> sub-command. The syntax of the command, entered at "
5505
"a terminal prompt, is as follows:"
5508
#: serverguide/C/vcs.xml:345(command)
5509
msgid "cd project_dir ; svn update"
5512
#: serverguide/C/vcs.xml:348(para)
5514
"For more details about using each Subversion sub-command, you can refer to "
5515
"the manual. For example, to learn more about the co (checkout) command, "
5516
"please run the following command from a terminal prompt:"
5519
#: serverguide/C/vcs.xml:352(command)
5523
#: serverguide/C/vcs.xml:356(title)
5524
msgid "Access via custom protocol with SSL encryption (svn+ssh://)"
5527
#: serverguide/C/vcs.xml:357(para)
5529
"The configuration and server process is same as in the svn:// method. For "
5530
"details, please refer to the above section. This step assumes you have "
5531
"followed the above step and started the Subversion server using "
5532
"<application>svnserve</application> command."
5535
#: serverguide/C/vcs.xml:363(para)
5537
"It is also assumed that the ssh server is running on that machine and that "
5538
"it is allowing incoming connections. To confirm, please try to login to that "
5539
"machine using ssh. If you can login, everything is perfect. If you cannot "
5540
"login, please address it before continuing further."
5543
#: serverguide/C/vcs.xml:369(para)
5545
"The svn+ssh:// protocol is used to access the Subversion repository using "
5546
"SSL encryption. The data transfer is encrypted using this method. To access "
5547
"the project repository (for example with a checkout), you must use the "
5548
"following command syntax:"
5551
#: serverguide/C/vcs.xml:376(command)
5552
msgid "svn co svn+ssh://hostname/var/svn/repos/project"
5555
#: serverguide/C/vcs.xml:380(para)
5557
"You must use the full path (/path/to/repos/project) to access the Subversion "
5558
"repository using this access method."
5561
#: serverguide/C/vcs.xml:383(para)
5563
"Based on server configuration, it prompts for password. You must enter the "
5564
"password you use to login via ssh. Once you are authenticated, it checks out "
5565
"the code from the Subversion repository."
5568
#: serverguide/C/vcs.xml:394(title)
5572
#: serverguide/C/vcs.xml:395(para)
5574
"CVS is a version control system. You can use it to record the history of "
5578
#: serverguide/C/vcs.xml:401(para)
5580
"To install <application>CVS</application>, run the following command from a "
5581
"terminal prompt: <screen>\n"
5582
"<command>sudo apt-get install cvs</command>\n"
5583
"</screen> After you install <application>cvs</application>, you should "
5584
"install <application>xinetd</application> to start/stop the cvs server. At "
5585
"the prompt, enter the following command to install "
5586
"<application>xinetd</application>: <screen>\n"
5587
"<command>sudo apt-get install xinetd</command>\n"
5591
#: serverguide/C/vcs.xml:434(programlisting)
5595
"service cvspserver\n"
5598
" socket_type = stream\n"
5602
" type = UNLISTED\n"
5603
" server = /usr/bin/cvs\n"
5604
" server_args = -f --allow-root /var/lib/cvs pserver\n"
5609
#: serverguide/C/vcs.xml:450(para)
5611
"Be sure to edit the repository if you have changed the default repository "
5612
"(<application>/var/lib/cvs</application>) directory."
5615
#: serverguide/C/vcs.xml:419(para)
5617
"Once you install cvs, the repository will be automatically initialized. By "
5618
"default, the repository resides under the "
5619
"<application>/var/lib/cvs</application> directory. You can change this path "
5620
"by running following command: <screen>\n"
5621
"<command>cvs -d /your/new/cvs/repo init</command>\n"
5622
"</screen> Once the initial repository is set up, you can configure "
5623
"<application>xinetd</application> to start the CVS server. You can copy the "
5624
"following lines to the <filename> /etc/xinetd.d/cvspserver</filename> file. "
5625
"<placeholder-1/><placeholder-2/> Once you have configured "
5626
"<application>xinetd</application> you can start the cvs server by running "
5627
"following command: <screen>\n"
5628
"<command>sudo /etc/init.d/xinetd restart</command>\n"
5632
#: serverguide/C/vcs.xml:463(para)
5634
"You can confirm that the CVS server is running by issuing the following "
5638
#: serverguide/C/vcs.xml:470(command)
5639
msgid "sudo netstat -tap | grep cvs"
5642
#: serverguide/C/vcs.xml:474(para) serverguide/C/databases.xml:65(para)
5644
"When you run this command, you should see the following line or something "
5648
#: serverguide/C/vcs.xml:479(programlisting)
5652
"tcp 0 0 *:cvspserver *:* LISTEN \n"
5655
#: serverguide/C/vcs.xml:483(para)
5657
"From here you can continue to add users, add new projects, and manage the "
5661
#: serverguide/C/vcs.xml:488(para)
5663
"CVS allows the user to add users independently of the underlying OS "
5664
"installation. Probably the easiest way is to use the Linux Users for CVS, "
5665
"although it has potential security issues. Please refer to the CVS manual "
5669
#: serverguide/C/vcs.xml:498(title)
5670
msgid "Add Projects"
5673
#: serverguide/C/vcs.xml:510(para)
5675
"You can use the CVSROOT environment variable to store the CVS root "
5676
"directory. Once you export the CVSROOT environment variable, you can avoid "
5677
"using -d option in the above cvs command."
5680
#: serverguide/C/vcs.xml:522(para)
5682
"When you add a new project, the CVS user you use must have write access to "
5683
"the CVS repository (<application>/var/lib/cvs</application>). By default, "
5684
"the <application>src</application> group has write access to the CVS "
5685
"repository. So, you can add the user to this group, and he can then add and "
5686
"manage projects in the CVS repository."
5689
#: serverguide/C/vcs.xml:499(para)
5691
"This section explains how to add new project to the CVS repository. Create "
5692
"the directory and add necessary document and source files to the directory. "
5693
"Now, run the following command to add this project to CVS repository: "
5695
"<command>cd your/project</command>\n"
5696
"<command>cvs -d :pserver:username@hostname.com:/var/lib/cvs import -m "
5697
"\"Importing my project to CVS repository\" . new_project start</command>\n"
5698
"</screen><placeholder-1/> The string <emphasis>new_project</emphasis> is a "
5699
"vendor tag, and <emphasis>start</emphasis> is a release tag. They serve no "
5700
"purpose in this context, but since CVS requires them, they must be present. "
5704
#: serverguide/C/vcs.xml:535(ulink)
5705
msgid "Bazaar Home Page"
5708
#: serverguide/C/vcs.xml:536(ulink)
5712
#: serverguide/C/vcs.xml:537(ulink)
5713
msgid "Subversion Home Page"
5716
#: serverguide/C/vcs.xml:538(ulink)
5717
msgid "Subversion Book"
5720
#: serverguide/C/vcs.xml:540(ulink)
5724
#: serverguide/C/serverguide.xml:3(title) serverguide/C/bookinfo.xml:3(title)
5725
msgid "Credits and License"
5728
#: serverguide/C/serverguide.xml:4(para) serverguide/C/bookinfo.xml:4(para)
5730
"This document is maintained by the Ubuntu documentation team "
5731
"(https://wiki.ubuntu.com/DocumentationTeam). For a list of contributors, see "
5732
"the <ulink url=\"../../libs/C/contributors.xml\">contributors page</ulink>"
5735
#: serverguide/C/serverguide.xml:5(para) serverguide/C/bookinfo.xml:5(para)
5737
"This document is made available under the Creative Commons ShareAlike 2.5 "
5738
"License (CC-BY-SA)."
5741
#: serverguide/C/serverguide.xml:6(para) serverguide/C/bookinfo.xml:6(para)
5743
"You are free to modify, extend, and improve the Ubuntu documentation source "
5744
"code under the terms of this license. All derivative works must be released "
5745
"under this license."
5748
#: serverguide/C/serverguide.xml:8(para) serverguide/C/bookinfo.xml:8(para)
5750
"This documentation is distributed in the hope that it will be useful, but "
5751
"WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY "
5752
"or FITNESS FOR A PARTICULAR PURPOSE AS DESCRIBED IN THE DISCLAIMER."
5755
#: serverguide/C/serverguide.xml:11(para) serverguide/C/bookinfo.xml:11(para)
5757
"A copy of the license is available here: <ulink url=\"/usr/share/ubuntu-"
5758
"docs/libs/C/ccbysa.xml\">Creative Commons ShareAlike License</ulink>."
5761
#: serverguide/C/serverguide.xml:14(year) serverguide/C/bookinfo.xml:14(year)
5765
#: serverguide/C/serverguide.xml:15(ulink) serverguide/C/bookinfo.xml:15(ulink)
5766
msgid "Ubuntu Documentation Project"
5769
#: serverguide/C/serverguide.xml:15(holder) serverguide/C/bookinfo.xml:15(holder)
5770
msgid "Canonical Ltd. and members of the <placeholder-1/>"
5773
#: serverguide/C/serverguide.xml:18(publishername) serverguide/C/bookinfo.xml:18(publishername)
5774
msgid "The Ubuntu Documentation Project"
5777
#: serverguide/C/serverguide.xml:17(para)
5779
"Welcome to the <emphasis>Ubuntu Server Guide</emphasis>! It contains "
5780
"information on how to install and configure various server applications on "
5781
"your Ubuntu system to fit your needs. It is a step-by-step, task-oriented "
5782
"guide for configuring and customizing your system."
5785
#: serverguide/C/security.xml:13(title)
5789
#: serverguide/C/security.xml:14(para)
5791
"Security should always be considered when installing, deploying, and using "
5792
"any type of computer system. Although a fresh installation of Ubuntu is "
5793
"relatively safe for immediate use on the Internet, it is important to have a "
5794
"balanced understanding of your systems security posture based on how it will "
5795
"be used after deployment."
5798
#: serverguide/C/security.xml:17(para)
5800
"This chapter provides an overview of security related topics as they pertain "
5801
"to Ubuntu 9.04 Server Edition, and outlines simple measures you may use to "
5802
"protect your server and network from any number of potential security "
5806
#: serverguide/C/security.xml:21(title)
5807
msgid "User Management"
5810
#: serverguide/C/security.xml:22(para)
5812
"User management is a critical part of maintaining a secure system. "
5813
"Ineffective user and privilege management often lead many systems into being "
5814
"compromised. Therefore, it is important that you understand how you can "
5815
"protect your server through simple and effective user account management "
5819
#: serverguide/C/security.xml:26(title)
5820
msgid "Where is root?"
5823
#: serverguide/C/security.xml:27(para)
5825
"Ubuntu developers made a conscientious decision to disable the "
5826
"administrative root account by default in all Ubuntu installations. This "
5827
"does not mean that the root account has been deleted or that it may not be "
5828
"accessed. It merely has been given a password which matches no possible "
5829
"encrypted value, therefore may not log in directly by itself."
5832
#: serverguide/C/security.xml:30(para)
5834
"Instead, users are encouraged to make use of a tool by the name of "
5835
"<application>sudo</application> to carry out system administrative duties. "
5836
"<application>Sudo</application> allows an authorized user to temporarily "
5837
"elevate their privileges using their own password instead of having to know "
5838
"the password belonging to the root account. This simple yet effective "
5839
"methodology provides accountability for all user actions, and gives the "
5840
"administrator granular control over which actions a user can perform with "
5844
#: serverguide/C/security.xml:35(para)
5846
"If for some reason you wish to enable the root account, simply give it a "
5850
#: serverguide/C/security.xml:39(command)
5854
#: serverguide/C/security.xml:41(para)
5856
"Sudo will prompt you for your password, and then ask you to supply a new "
5857
"password for root as shown below:"
5860
#: serverguide/C/security.xml:44(userinput)
5862
msgid "(enter your own password)"
5865
#: serverguide/C/security.xml:45(userinput)
5867
msgid "(enter a new password for root)"
5870
#: serverguide/C/security.xml:46(userinput)
5872
msgid "(repeat new password for root)"
5875
#: serverguide/C/security.xml:44(computeroutput)
5878
"[sudo] password for username: <placeholder-1/>\n"
5879
"Enter new UNIX password: <placeholder-2/>\n"
5880
"Retype new UNIX password: <placeholder-3/>\n"
5881
"passwd: password updated successfully"
5884
#: serverguide/C/security.xml:51(para)
5885
msgid "To disable the root account, use the following passwd syntax:"
5888
#: serverguide/C/security.xml:55(command)
5889
msgid "sudo passwd -l root"
5892
#: serverguide/C/security.xml:59(para)
5894
"You should read more on <application>Sudo</application> by checking out it's "
5898
#: serverguide/C/security.xml:63(command)
5902
#: serverguide/C/security.xml:67(para)
5904
"By default, the initial user created by the Ubuntu installer is a member of "
5905
"the group \"admin\" which is added to the file "
5906
"<filename>/etc/sudoers</filename> as an authorized sudo user. If you wish to "
5907
"give any other account full root access through "
5908
"<application>sudo</application>, simply add them to the admin group."
5911
#: serverguide/C/security.xml:73(title)
5912
msgid "Adding and Deleting Users"
5915
#: serverguide/C/security.xml:74(para)
5917
"The process for managing local users and groups is straight forward and "
5918
"differs very little from most other GNU/Linux operating systems. Ubuntu and "
5919
"other Debian based distributions, encourage the use of the \"adduser\" "
5920
"package for account management."
5923
#: serverguide/C/security.xml:79(para)
5925
"To add a user account, use the following syntax, and follow the prompts to "
5926
"give the account a password and identifiable characteristics such as a full "
5927
"name, phone number, etc."
5930
#: serverguide/C/security.xml:83(command)
5931
msgid "sudo adduser username"
5934
#: serverguide/C/security.xml:87(para)
5936
"To delete a user account and its primary group, use the following syntax:"
5939
#: serverguide/C/security.xml:91(command)
5940
msgid "sudo deluser username"
5943
#: serverguide/C/security.xml:93(para)
5945
"Deleting an account does not remove their respective home folder. It is up "
5946
"to you whether or not you wish to delete the folder manually or keep it "
5947
"according to your desired retention policies."
5950
#: serverguide/C/security.xml:96(para)
5952
"Remember, any user added later on with the same UID/GID as the previous "
5953
"owner will now have access to this folder if you have not taken the "
5954
"necessary precautions."
5957
#: serverguide/C/security.xml:99(para)
5959
"You may want to change these UID/GID values to something more appropriate, "
5960
"such as the root account, and perhaps even relocate the folder to avoid "
5964
#: serverguide/C/security.xml:103(command)
5965
msgid "sudo chown -R root:root /home/username/"
5968
#: serverguide/C/security.xml:104(command)
5969
msgid "sudo mkdir /home/archived_users/"
5972
#: serverguide/C/security.xml:105(command)
5973
msgid "sudo mv /home/username /home/archived_users/"
5976
#: serverguide/C/security.xml:109(para)
5978
"To temporarily lock or unlock a user account, use the following syntax, "
5982
#: serverguide/C/security.xml:113(command)
5983
msgid "sudo passwd -l username"
5986
#: serverguide/C/security.xml:114(command)
5987
msgid "sudo passwd -u username"
5990
#: serverguide/C/security.xml:118(para)
5992
"To add or delete a personalized group, use the following syntax, "
5996
#: serverguide/C/security.xml:122(command)
5997
msgid "sudo addgroup groupname"
6000
#: serverguide/C/security.xml:123(command)
6001
msgid "sudo delgroup groupname"
6004
#: serverguide/C/security.xml:127(para)
6005
msgid "To add a user to a group, use the following syntax:"
6008
#: serverguide/C/security.xml:131(command)
6009
msgid "sudo adduser username groupname"
6012
#: serverguide/C/security.xml:138(title)
6013
msgid "User Profile Security"
6016
#: serverguide/C/security.xml:139(para)
6018
"When a new user is created, the adduser utility creates a brand new home "
6019
"directory named <filename class=\"directory\">/home/username</filename>, "
6020
"respectively. The default profile is modeled after the contents found in the "
6021
"directory of <filename class=\"directory\">/etc/skel</filename>, which "
6022
"includes all profile basics."
6025
#: serverguide/C/security.xml:142(para)
6027
"If your server will be home to multiple users, you should pay close "
6028
"attention to the user home directory permissions to ensure confidentiality. "
6029
"By default, user home directories in Ubuntu are created with world "
6030
"read/execute permissions. This means that all users can browse and access "
6031
"the contents of other users home directories. This may not be suitable for "
6035
#: serverguide/C/security.xml:147(para)
6037
"To verify your current users home directory permissions, use the following "
6041
#: serverguide/C/security.xml:151(command) serverguide/C/security.xml:183(command)
6042
msgid "ls -ld /home/username"
6045
#: serverguide/C/security.xml:153(para)
6047
"The following output shows that the directory <filename "
6048
"class=\"directory\">/home/username</filename> has world readable permissions:"
6051
#: serverguide/C/security.xml:156(computeroutput)
6053
msgid "drwxr-xr-x 2 username username 4096 2007-10-02 20:03 username"
6056
#: serverguide/C/security.xml:160(para)
6058
"You can remove the world readable permissions using the following syntax:"
6061
#: serverguide/C/security.xml:164(command)
6062
msgid "sudo chmod 0750 /home/username"
6065
#: serverguide/C/security.xml:167(para)
6067
"Some people tend to use the recursive option (-R) indiscriminately which "
6068
"modifies all child folders and files, but this is not necessary, and may "
6069
"yield other undesirable results. The parent directory alone is sufficient "
6070
"for preventing unauthorized access to anything below the parent."
6073
#: serverguide/C/security.xml:171(para)
6075
"A much more efficient approach to the matter would be to modify the "
6076
"<application>adduser</application> global default permissions when creating "
6077
"user home folders. Simply edit the file "
6078
"<filename>/etc/adduser.conf</filename> and modify the "
6079
"<varname>DIR_MODE</varname> variable to something appropriate, so that all "
6080
"new home directories will receive the correct permissions."
6083
#: serverguide/C/security.xml:174(programlisting)
6090
#: serverguide/C/security.xml:179(para)
6092
"After correcting the directory permissions using any of the previously "
6093
"mentioned techniques, verify the results using the following syntax:"
6096
#: serverguide/C/security.xml:185(para)
6098
"The results below show that world readable permissions have been removed:"
6101
#: serverguide/C/security.xml:188(computeroutput)
6103
msgid "drwxr-x--- 2 username username 4096 2007-10-02 20:03 username"
6106
#: serverguide/C/security.xml:195(title)
6107
msgid "Password Policy"
6110
#: serverguide/C/security.xml:196(para)
6112
"A strong password policy is one of the most important aspects of your "
6113
"security posture. Many successful security breaches involve simple brute "
6114
"force and dictionary attacks against weak passwords. If you intend to offer "
6115
"any form of remote access involving your local password system, make sure "
6116
"you adequately address minimum password complexity requirements, maximum "
6117
"password lifetimes, and frequent audits of your authentication systems."
6120
#: serverguide/C/security.xml:200(title)
6121
msgid "Minimum Password Length"
6124
#: serverguide/C/security.xml:201(para)
6126
"By default, Ubuntu requires a minimum password length of 4 characters, as "
6127
"well as some basic entropy checks. These values are controlled in the file "
6128
"<filename>/etc/pam.d/common-password</filename>, which is outlined below."
6131
#: serverguide/C/security.xml:204(programlisting)
6135
"password required pam_unix.so nullok obscure min=4 max=8 md5\n"
6138
#: serverguide/C/security.xml:207(para)
6140
"If you would like to adjust the minimum length to 6 characters, change the "
6141
"appropriate variable to min=6. The modification is outlined below."
6144
#: serverguide/C/security.xml:210(programlisting)
6148
"password required pam_unix.so nullok obscure min=6 max=8 md5\n"
6151
#: serverguide/C/security.xml:214(para)
6153
"The <varname>max=8</varname> variable does not represent the maximum length "
6154
"of a password. It only means that complexity requirements will not be "
6155
"checked on passwords over 8 characters. You may want to look at the "
6156
"<application>libpam-cracklib</application> package for additional password "
6157
"entropy assistance."
6160
#: serverguide/C/security.xml:220(title)
6161
msgid "Password Expiration"
6164
#: serverguide/C/security.xml:221(para)
6166
"When creating user accounts, you should make it a policy to have a minimum "
6167
"and maximum password age forcing users to change their passwords when they "
6171
#: serverguide/C/security.xml:226(para)
6173
"To easily view the current status of a user account, use the following "
6177
#: serverguide/C/security.xml:230(command) serverguide/C/security.xml:263(command)
6178
msgid "sudo chage -l username"
6181
#: serverguide/C/security.xml:232(para)
6183
"The output below shows interesting facts about the user account, namely that "
6184
"there are no policies applied:"
6187
#: serverguide/C/security.xml:235(computeroutput)
6190
"Last password change : Jan 20, 2008\n"
6191
"Password expires : never\n"
6192
"Password inactive : never\n"
6193
"Account expires : never\n"
6194
"Minimum number of days between password change : 0\n"
6195
"Maximum number of days between password change : 99999\n"
6196
"Number of days of warning before password expires : 7"
6199
#: serverguide/C/security.xml:245(para)
6201
"To set any of these values, simply use the following syntax, and follow the "
6202
"interactive prompts:"
6205
#: serverguide/C/security.xml:249(command)
6206
msgid "sudo chage username"
6209
#: serverguide/C/security.xml:251(para)
6211
"The following is also an example of how you can manually change the explicit "
6212
"expiration date (-E) to 01/31/2008, minimum password age (-m) of 5 days, "
6213
"maximum password age (-M) of 90 days, inactivity period (-I) of 5 days after "
6214
"password expiration, and a warning time period (-W) of 14 days before "
6215
"password expiration."
6218
#: serverguide/C/security.xml:255(command)
6219
msgid "sudo chage -E 01/31/2008 -m 5 -M 90 -I 30 -W 14 username"
6222
#: serverguide/C/security.xml:259(para)
6223
msgid "To verify changes, use the same syntax as mentioned previously:"
6226
#: serverguide/C/security.xml:265(para)
6228
"The output below shows the new policies that have been established for the "
6232
#: serverguide/C/security.xml:268(computeroutput)
6235
"Last password change : Jan 20, 2008\n"
6236
"Password expires : Apr 19, 2008\n"
6237
"Password inactive : May 19, 2008\n"
6238
"Account expires : Jan 31, 2008\n"
6239
"Minimum number of days between password change : 5\n"
6240
"Maximum number of days between password change : 90\n"
6241
"Number of days of warning before password expires : 14"
6244
#: serverguide/C/security.xml:284(title)
6245
msgid "Other Security Considerations"
6248
#: serverguide/C/security.xml:285(para)
6250
"Many applications use alternate authentication mechanisms that can be easily "
6251
"overlooked by even experienced system administrators. Therefore, it is "
6252
"important to understand and control how users authenticate and gain access "
6253
"to services and applications on your server."
6256
#: serverguide/C/security.xml:290(title)
6257
msgid "SSH Access by Disabled Users"
6260
#: serverguide/C/security.xml:291(para)
6262
"Simply disabling/locking a user account will not prevent a user from logging "
6263
"into your server remotely if they have previously set up RSA public key "
6264
"authentication. They will still be able to gain shell access to the server, "
6265
"without the need for any password. Remember to check the users home "
6266
"directory for files that will allow for this type of authenticated SSH "
6267
"access. e.g. <filename>/home/username/.ssh/authorized_keys</filename>."
6270
#: serverguide/C/security.xml:294(para)
6272
"Remove or rename the directory <filename "
6273
"class=\"directory\">.ssh/</filename> in the user's home folder to prevent "
6274
"further SSH authentication capabilities."
6277
#: serverguide/C/security.xml:297(para)
6279
"Be sure to check for any established SSH connections by the disabled user, "
6280
"as it is possible they may have existing inbound or outbound connections. "
6281
"Kill any that are found."
6284
#: serverguide/C/security.xml:300(para)
6286
"Restrict SSH access to only user accounts that should have it. For example, "
6287
"you may create a group called \"sshlogin\" and add the group name as the "
6288
"value associated with the <varname>AllowGroups</varname> variable located in "
6289
"the file <filename>/etc/ssh/sshd_config</filename>."
6292
#: serverguide/C/security.xml:303(programlisting)
6296
"AllowGroups sshlogin\n"
6299
#: serverguide/C/security.xml:306(para)
6301
"Then add your permitted SSH users to the group \"sshlogin\", and restart the "
6305
#: serverguide/C/security.xml:310(command)
6306
msgid "sudo adduser username sshlogin"
6309
#: serverguide/C/security.xml:311(command) serverguide/C/remote-administration.xml:150(command)
6310
msgid "sudo /etc/init.d/ssh restart"
6313
#: serverguide/C/security.xml:315(title)
6314
msgid "External User Database Authentication"
6317
#: serverguide/C/security.xml:316(para)
6319
"Most enterprise networks require centralized authentication and access "
6320
"controls for all system resources. If you have configured your server to "
6321
"authenticate users against external databases, be sure to disable the user "
6322
"accounts both externally and locally, this way you ensure that local "
6323
"fallback authentication is not possible."
6326
#: serverguide/C/security.xml:325(title)
6327
msgid "Console Security"
6330
#: serverguide/C/security.xml:326(para)
6332
"As with any other security barrier you put in place to protect your server, "
6333
"it is pretty tough to defend against untold damage caused by someone with "
6334
"physical access to your environment, for example, theft of hard drives, "
6335
"power or service disruption and so on. Therefore, console security should be "
6336
"addressed merely as one component of your overall physical security "
6337
"strategy. A locked \"screen door\" may deter a casual criminal, or at the "
6338
"very least slow down a determined one, so it is still advisable to perform "
6339
"basic precautions with regard to console security."
6342
#: serverguide/C/security.xml:329(para)
6344
"The following instructions will help defend your server against issues that "
6345
"could otherwise yield very serious consequences."
6348
#: serverguide/C/security.xml:334(title)
6349
msgid "Disable Ctrl+Alt+Delete"
6352
#: serverguide/C/security.xml:335(para)
6354
"First and foremost, anyone that has physical access to the keyboard can "
6356
"<keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Delete</keycap></k"
6357
"eycombo> key combination to reboot the server without having to log on. "
6358
"Sure, someone could simply unplug the power source, but you should still "
6359
"prevent the use of this key combination on a production server. This forces "
6360
"an attacker to take more drastic measures to reboot the server, and will "
6361
"prevent accidental reboots at the same time."
6364
#: serverguide/C/security.xml:340(para)
6366
"To disable the reboot action taken by pressing the "
6367
"<keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Delete</keycap></k"
6368
"eycombo> key combination, comment out the following line in the file "
6369
"<filename>/etc/event.d/control-alt-delete</filename>."
6372
#: serverguide/C/security.xml:343(programlisting)
6376
"#exec /sbin/shutdown -r now \"Control-Alt-Delete pressed\"\n"
6379
#: serverguide/C/security.xml:350(title)
6380
msgid "GRUB Password Security"
6383
#: serverguide/C/security.xml:351(para)
6385
"Ubuntu installs GNU GRUB as its default boot loader, which allows for great "
6386
"flexibility and recovery options. For example, when you install additional "
6387
"kernel images, these are automatically added as available boot options in "
6388
"the <application>grub</application> menu. Also, by default, alternate boot "
6389
"options are available for each kernel entry that may be used for system "
6390
"recovery, aptly labeled (recovery mode). Recovery mode simply boots the "
6391
"corresponding kernel image into single user mode (init 1), which lands the "
6392
"administrator at a root prompt without the need for any password."
6395
#: serverguide/C/security.xml:354(para)
6397
"Therefore, it is important to control who may edit the "
6398
"<application>grub</application> menu items which, would otherwise allow for "
6399
"someone to perform the following dangerous actions:"
6402
#: serverguide/C/security.xml:359(para)
6403
msgid "Pass kernel options at boot up."
6406
#: serverguide/C/security.xml:364(para)
6407
msgid "Boot the server into single user mode."
6410
#: serverguide/C/security.xml:369(para)
6412
"You can prevent these actions by adding a password to GRUB's configuration "
6413
"file of <filename>/boot/grub/menu.lst</filename>, which will be required to "
6414
"unlock GRUB's more advanced features prior to use."
6417
#: serverguide/C/security.xml:374(para)
6419
"To add a password for use with <application>grub</application>, first you "
6420
"must generate an md5 password hash using the <application>grub-md5-"
6421
"crypt</application> utility:"
6424
#: serverguide/C/security.xml:378(command)
6425
msgid "grub-md5-crypt"
6428
#: serverguide/C/security.xml:380(para)
6430
"The command will ask you to enter a password and offer a resulting hash "
6431
"value as shown below:"
6434
#: serverguide/C/security.xml:383(userinput)
6436
msgid "(enter new password)"
6439
#: serverguide/C/security.xml:384(userinput)
6441
msgid "(repeat password)"
6444
#: serverguide/C/security.xml:383(computeroutput)
6447
"Password: <placeholder-1/>\n"
6448
"Retype password: <placeholder-2/>\n"
6449
"$1$s3YiK$M3lxAbqA6JLm2FbDWnClQ0"
6452
#: serverguide/C/security.xml:389(para)
6454
"Add the resulting hash value to the file "
6455
"<filename>/boot/grub/menu.lst</filename> in the following format:"
6458
#: serverguide/C/security.xml:392(programlisting)
6460
msgid "password --md5 $1$s3YiK$M3lxAbqA6JLm2FbDWnClQ0"
6463
#: serverguide/C/security.xml:395(para)
6465
"To require use of the password for entering single user mode, change the "
6466
"value of the <varname>lockalternative</varname> variable in the file "
6467
"<filename>/boot/grub/menu.lst</filename> to <varname>true</varname>, as "
6468
"shown in the following example."
6471
#: serverguide/C/security.xml:398(programlisting)
6473
msgid "# lockalternative=true"
6476
#: serverguide/C/security.xml:402(para)
6478
"This does not prevent someone from booting the server from alternate media. "
6479
"A determined attacker would simply boot into an alternate environment, "
6480
"overwrite your master boot record, mount or copy your physical volumes, "
6481
"destroy your data, or anything else they can imagine. Please explore other "
6482
"countermeasures that may help you with these types of attacks."
6485
#: serverguide/C/security.xml:410(title)
6489
#: serverguide/C/security.xml:413(para)
6491
"The Linux kernel includes the <emphasis>Netfilter</emphasis> subsystem, "
6492
"which is used to manipulate or decide the fate of network traffic headed "
6493
"into or through your server. All modern Linux firewall solutions use this "
6494
"system for packet filtering."
6497
#: serverguide/C/security.xml:418(para)
6499
"The kernel's packet filtering system would be of little use to "
6500
"administrators without a userspace interface to manage it. This is the "
6501
"purpose of iptables. When a packet reaches your server, it will be handed "
6502
"off to the Netfilter subsystem for acceptance, manipulation, or rejection "
6503
"based on the rules supplied to it from userspace via iptables. Thus, "
6504
"iptables is all you need to manage your firewall if you're familiar with it, "
6505
"but many frontends are available to simplify the task."
6508
#: serverguide/C/security.xml:428(title)
6509
msgid "ufw - Uncomplicated Firewall"
6512
#: serverguide/C/security.xml:429(para)
6514
"The default firewall configuration tool for Ubuntu is "
6515
"<application>ufw</application>. Developed to ease iptables firewall "
6516
"configuration, <application>ufw</application> provides a user friendly way "
6517
"to create an IPv4 or IPv6 host-based firewall."
6520
#: serverguide/C/security.xml:433(para)
6522
"<application>ufw</application> by default is initially disabled. From the "
6523
"<application>ufw</application> man page:"
6526
#: serverguide/C/security.xml:437(quote)
6528
"ufw is not intended to provide complete firewall functionality via its "
6529
"command interface, but instead provides an easy way to add or remove simple "
6530
"rules. It is currently mainly used for host-based firewalls."
6533
#: serverguide/C/security.xml:441(para)
6535
"The following are some examples of how to use <application>ufw</application>:"
6538
#: serverguide/C/security.xml:446(para)
6540
"First, <application>ufw</application> needs to be enabled. From a terminal "
6544
#: serverguide/C/security.xml:450(command)
6545
msgid "sudo ufw enable"
6548
#: serverguide/C/security.xml:454(para)
6549
msgid "To open a port (ssh in this example):"
6552
#: serverguide/C/security.xml:458(command)
6553
msgid "sudo ufw allow 22"
6556
#: serverguide/C/security.xml:462(para)
6557
msgid "Rules can also be added using a <emphasis>numbered</emphasis> format:"
6560
#: serverguide/C/security.xml:466(command)
6561
msgid "sudo ufw insert 1 allow 80"
6564
#: serverguide/C/security.xml:470(para)
6565
msgid "Similarly, to close an opened port:"
6568
#: serverguide/C/security.xml:474(command)
6569
msgid "sudo ufw deny 22"
6572
#: serverguide/C/security.xml:478(para)
6573
msgid "To remove a rule, use delete followed by the rule:"
6576
#: serverguide/C/security.xml:482(command)
6577
msgid "sudo ufw delete deny 22"
6580
#: serverguide/C/security.xml:486(para)
6582
"It is also possible to allow access from specific hosts or networks to a "
6583
"port. The following example allows ssh access from host 192.168.0.2 to any "
6584
"ip address on this host:"
6587
#: serverguide/C/security.xml:491(command)
6588
msgid "sudo ufw allow proto tcp from 192.168.0.2 to any port 22"
6591
#: serverguide/C/security.xml:493(para)
6593
"Replace 192.168.0.2 with 192.168.0.0/24 to allow ssh access from the entire "
6597
#: serverguide/C/security.xml:499(para)
6599
"Adding the <emphasis>--dry-run</emphasis> option to a "
6600
"<emphasis>ufw</emphasis> command will output the resulting rules, but not "
6601
"apply them. For example, the following is what would be applied if opening "
6605
#: serverguide/C/security.xml:505(command)
6606
msgid "sudo ufw --dry-run allow http"
6609
#: serverguide/C/security.xml:509(computeroutput)
6613
":ufw-user-input - [0:0]\n"
6614
":ufw-user-output - [0:0]\n"
6615
":ufw-user-forward - [0:0]\n"
6616
":ufw-user-limit - [0:0]\n"
6617
":ufw-user-limit-accept - [0:0]\n"
6620
"### tuple ### allow tcp 80 0.0.0.0/0 any 0.0.0.0/0\n"
6621
"-A ufw-user-input -p tcp --dport 80 -j ACCEPT\n"
6623
"### END RULES ###\n"
6624
"-A ufw-user-input -j RETURN\n"
6625
"-A ufw-user-output -j RETURN\n"
6626
"-A ufw-user-forward -j RETURN\n"
6627
"-A ufw-user-limit -m limit --limit 3/minute -j LOG --log-prefix \"[UFW "
6629
"-A ufw-user-limit -j REJECT\n"
6630
"-A ufw-user-limit-accept -j ACCEPT\n"
6635
#: serverguide/C/security.xml:533(para)
6636
msgid "<application>ufw</application> can be disabled by:"
6639
#: serverguide/C/security.xml:537(command)
6640
msgid "sudo ufw disable"
6643
#: serverguide/C/security.xml:541(para)
6644
msgid "To see the firewall status, enter:"
6647
#: serverguide/C/security.xml:545(command)
6648
msgid "sudo ufw status"
6651
#: serverguide/C/security.xml:549(para)
6652
msgid "And for more verbose status information use:"
6655
#: serverguide/C/security.xml:553(command)
6656
msgid "sudo ufw status verbose"
6659
#: serverguide/C/security.xml:557(para)
6660
msgid "To view the <emphasis>numbered</emphasis> format:"
6663
#: serverguide/C/security.xml:561(command)
6664
msgid "sudo ufw status numbered"
6667
#: serverguide/C/security.xml:566(para)
6669
"If the port you want to open or close is defined in "
6670
"<filename>/etc/services</filename>, you can use the port name instead of the "
6671
"number. In the above examples, replace <emphasis>22</emphasis> with "
6672
"<emphasis>ssh</emphasis>."
6675
#: serverguide/C/security.xml:572(para)
6677
"This is a quick introduction to using <application>ufw</application>. Please "
6678
"refer to the <application>ufw</application> man page for more information."
6681
#: serverguide/C/security.xml:578(title)
6682
msgid "ufw Application Integration"
6685
#: serverguide/C/security.xml:580(para)
6687
"Applications that open ports can include an <application>ufw</application> "
6688
"profile, which details the ports needed for the application to function "
6689
"properly. The profiles are kept in <filename "
6690
"role=\"directory\">/etc/ufw/applications.d</filename>, and can be edited if "
6691
"the default ports have been changed."
6694
#: serverguide/C/security.xml:589(para)
6696
"To view which applications have installed a profile, enter the following in "
6700
#: serverguide/C/security.xml:594(command)
6701
msgid "sudo ufw app list"
6704
#: serverguide/C/security.xml:600(para)
6706
"Similar to allowing traffic to a port, using an application profile is "
6707
"accomplished by entering:"
6710
#: serverguide/C/security.xml:605(command)
6711
msgid "sudo ufw allow Samba"
6714
#: serverguide/C/security.xml:611(para)
6715
msgid "An extended syntax is available as well:"
6718
#: serverguide/C/security.xml:616(command)
6719
msgid "ufw allow from 192.168.0.0/24 to any app Samba"
6722
#: serverguide/C/security.xml:619(para)
6724
"Replace <emphasis>Samba</emphasis> and <emphasis>192.168.0.0/24</emphasis> "
6725
"with the application profile you are using and the IP range for your network."
6728
#: serverguide/C/security.xml:625(para)
6730
"There is no need to specify the <emphasis>protocol</emphasis> for the "
6731
"application, because that information is detailed in the profile. Also, note "
6732
"that the <emphasis>app</emphasis> name replaces the "
6733
"<emphasis>port</emphasis> number."
6736
#: serverguide/C/security.xml:634(para)
6738
"To view details about which ports, protocols, etc are defined for an "
6739
"application, enter:"
6742
#: serverguide/C/security.xml:639(command)
6743
msgid "sudo ufw app info Samba"
6746
#: serverguide/C/security.xml:645(para)
6748
"Not all applications that require opening a network port come with "
6749
"<application>ufw</application> profiles, but if you have profiled an "
6750
"application and want the file to be included with the package, please file a "
6751
"bug against the package in <ulink "
6752
"url=\"https://launchpad.net/\">Launchpad</ulink>."
6755
#: serverguide/C/security.xml:654(title)
6756
msgid "IP Masquerading"
6759
#: serverguide/C/security.xml:655(para)
6761
"The purpose of IP Masquerading is to allow machines with private, non-"
6762
"routable IP addresses on your network to access the Internet through the "
6763
"machine doing the masquerading. Traffic from your private network destined "
6764
"for the Internet must be manipulated for replies to be routable back to the "
6765
"machine that made the request. To do this, the kernel must modify the "
6766
"<emphasis>source</emphasis> IP address of each packet so that replies will "
6767
"be routed back to it, rather than to the private IP address that made the "
6768
"request, which is impossible over the Internet. Linux uses "
6769
"<emphasis>Connection Tracking</emphasis> (conntrack) to keep track of which "
6770
"connections belong to which machines and reroute each return packet "
6771
"accordingly. Traffic leaving your private network is thus \"masqueraded\" as "
6772
"having originated from your Ubuntu gateway machine. This process is referred "
6773
"to in Microsoft documentation as Internet Connection Sharing."
6776
#: serverguide/C/security.xml:671(title)
6777
msgid "ufw Masquerading"
6780
#: serverguide/C/security.xml:672(para)
6782
"IP Masquerading can be achieved using custom <application>ufw</application> "
6783
"rules. This is possible because the current back-end for "
6784
"<application>ufw</application> is <application>iptables-"
6785
"restore</application> with the rules files located in "
6786
"<filename>/etc/ufw/*.rules</filename>. These files are a great place to add "
6787
"legacy iptables rules used without <application>ufw</application>, and rules "
6788
"that are more network gateway or bridge related."
6791
#: serverguide/C/security.xml:678(para)
6793
"The rules are split into two different files, rules that should be executed "
6794
"before <application>ufw</application> command line rules, and rules that are "
6795
"executed after <application>ufw</application> command line rules."
6798
#: serverguide/C/security.xml:684(para)
6800
"First, packet forwarding needs to be enabled in "
6801
"<application>ufw</application>. Two configuration files will need to be "
6802
"adjusted, in <filename>/etc/default/ufw</filename> change the "
6803
"<emphasis>DEFAULT_FORWARD_POLICY</emphasis> to <quote>ACCEPT</quote>:"
6806
#: serverguide/C/security.xml:688(programlisting)
6810
"DEFAULT_FORWARD_POLICY=\"ACCEPT\"\n"
6813
#: serverguide/C/security.xml:691(para)
6814
msgid "Then edit <filename>/etc/ufw/sysctl.conf</filename> and uncomment:"
6817
#: serverguide/C/security.xml:694(programlisting) serverguide/C/security.xml:772(programlisting)
6821
"net.ipv4.ip_forward=1\n"
6824
#: serverguide/C/security.xml:697(para)
6825
msgid "Similarly, for IPv6 forwarding uncomment:"
6828
#: serverguide/C/security.xml:700(programlisting) serverguide/C/security.xml:778(programlisting)
6832
"net.ipv6.conf.default.forwarding=1\n"
6835
#: serverguide/C/security.xml:705(para)
6837
"Now we will add rules to the <filename>/etc/ufw/before.rules</filename> "
6838
"file. The default rules only configure the <emphasis>filter</emphasis> "
6839
"table, and to enable masquerading the <emphasis>nat</emphasis> table will "
6840
"need to be configured. Add the following to the top of the file just after "
6841
"the header comments:"
6844
#: serverguide/C/security.xml:710(programlisting)
6848
"# nat Table rules\n"
6850
":POSTROUTING ACCEPT [0:0]\n"
6852
"# Forward traffic from eth1 through eth0.\n"
6853
"-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE\n"
6855
"# don't delete the 'COMMIT' line or these nat table rules won't be "
6860
#: serverguide/C/security.xml:721(para)
6862
"The comments are not strictly necessary, but it is considered good practice "
6863
"to document your configuration. Also, when modifying any of the "
6864
"<emphasis>rules</emphasis> files in <filename "
6865
"class=\"directory\">/etc/ufw</filename>, make sure these lines are the last "
6866
"line for each table modified:"
6869
#: serverguide/C/security.xml:727(programlisting)
6873
"# don't delete the 'COMMIT' line or these rules won't be processed\n"
6877
#: serverguide/C/security.xml:732(para)
6879
"For each <emphasis>Table</emphasis> a corresponding "
6880
"<emphasis>COMMIT</emphasis> statement is required. In these examples only "
6881
"the <emphasis>nat</emphasis> and <emphasis>filter</emphasis> tables are "
6882
"shown, but you can also add rules for the <emphasis>raw</emphasis> and "
6883
"<emphasis>mangle</emphasis> tables."
6886
#: serverguide/C/security.xml:739(para)
6888
"In the above example replace <emphasis>eth0</emphasis>, "
6889
"<emphasis>eth1</emphasis>, and <emphasis>192.168.0.0/24</emphasis> with the "
6890
"appropriate interfaces and IP range for your network."
6893
#: serverguide/C/security.xml:747(para)
6895
"Finally, disable and re-enable <application>ufw</application> to apply the "
6899
#: serverguide/C/security.xml:751(command)
6900
msgid "sudo ufw disable && sudo ufw enable"
6903
#: serverguide/C/security.xml:755(para)
6905
"IP Masquerading should now be enabled. You can also add any additional "
6906
"FORWARD rules to the <filename>/etc/ufw/before.rules</filename>. It is "
6907
"recommended that these additional rules be added to the <emphasis>ufw-before-"
6908
"forward</emphasis> chain."
6911
#: serverguide/C/security.xml:762(title)
6912
msgid "iptables Masquerading"
6915
#: serverguide/C/security.xml:763(para)
6917
"<application>iptables</application> can also be used to enable masquerading."
6920
#: serverguide/C/security.xml:768(para)
6922
"Similar to <application>ufw</application>, the first step is to enable IPv4 "
6923
"packet forwarding by editing <filename>/etc/sysctl.conf</filename> and "
6924
"uncomment the following line"
6927
#: serverguide/C/security.xml:775(para)
6928
msgid "If you wish to enable IPv6 forwarding also uncomment:"
6931
#: serverguide/C/security.xml:783(para)
6933
"Next, execute the <application>sysctl</application> command to enable the "
6934
"new settings in the configuration file:"
6937
#: serverguide/C/security.xml:787(command)
6938
msgid "sudo sysctl -p"
6941
#: serverguide/C/security.xml:791(para)
6943
"IP Masquerading can now be accomplished with a single iptables rule, which "
6944
"may differ slightly based on your network configuration:"
6947
#: serverguide/C/security.xml:794(screen)
6951
"sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o ppp0 -j MASQUERADE\n"
6954
#: serverguide/C/security.xml:797(para)
6956
"The above command assumes that your private address space is 192.168.0.0/16 "
6957
"and that your Internet-facing device is ppp0. The syntax is broken down as "
6961
#: serverguide/C/security.xml:802(para)
6962
msgid "-t nat -- the rule is to go into the nat table"
6965
#: serverguide/C/security.xml:803(para)
6967
"-A POSTROUTING -- the rule is to be appended (-A) to the POSTROUTING chain"
6970
#: serverguide/C/security.xml:804(para)
6972
"-s 192.168.0.0/16 -- the rule applies to traffic originating from the "
6973
"specified address space"
6976
#: serverguide/C/security.xml:805(para)
6978
"-o ppp0 -- the rule applies to traffic scheduled to be routed through the "
6979
"specified network device"
6982
#: serverguide/C/security.xml:807(para)
6984
"-j MASQUERADE -- traffic matching this rule is to \"jump\" (-j) to the "
6985
"MASQUERADE target to be manipulated as described above"
6988
#: serverguide/C/security.xml:815(para)
6990
"Also, each chain in the filter table (the default table, and where most or "
6991
"all packet filtering occurs) has a default <emphasis>policy</emphasis> of "
6992
"ACCEPT, but if you are creating a firewall in addition to a gateway device, "
6993
"you may have set the policies to DROP or REJECT, in which case your "
6994
"masqueraded traffic needs to be allowed through the FORWARD chain for the "
6995
"above rule to work:"
6998
#: serverguide/C/security.xml:822(screen)
7002
"sudo iptables -A FORWARD -s 192.168.0.0/16 -o ppp0 -j ACCEPT\n"
7003
"sudo iptables -A FORWARD -d 192.168.0.0/16 -m state --state "
7004
"ESTABLISHED,RELATED -i ppp0 -j ACCEPT\n"
7007
#: serverguide/C/security.xml:826(para)
7009
"The above commands will allow all connections from your local network to the "
7010
"Internet and all traffic related to those connections to return to the "
7011
"machine that initiated them."
7014
#: serverguide/C/security.xml:833(para)
7016
"If you want masquerading to be enabled on reboot, which you probably do, "
7017
"edit <filename>/etc/rc.local</filename> and add any commands used above. For "
7018
"example add the first command with no filtering:"
7021
#: serverguide/C/security.xml:837(screen)
7025
"iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o ppp0 -j MASQUERADE\n"
7028
#: serverguide/C/security.xml:845(title)
7032
#: serverguide/C/security.xml:846(para)
7034
"Firewall logs are essential for recognizing attacks, troubleshooting your "
7035
"firewall rules, and noticing unusual activity on your network. You must "
7036
"include logging rules in your firewall for them to be generated, though, and "
7037
"logging rules must come before any applicable terminating rule (a rule with "
7038
"a target that decides the fate of the packet, such as ACCEPT, DROP, or "
7042
#: serverguide/C/security.xml:853(para)
7044
"If you are using <application>ufw</application>, you can turn on logging by "
7045
"entering the following in a terminal:"
7048
#: serverguide/C/security.xml:857(command)
7049
msgid "sudo ufw logging on"
7052
#: serverguide/C/security.xml:859(para)
7054
"To turn logging off in <application>ufw</application>, simply replace "
7055
"<emphasis role=\"italic\">on</emphasis> with <emphasis "
7056
"role=\"italic\">off</emphasis> in the above command."
7059
#: serverguide/C/security.xml:862(para)
7061
"If using <application>iptables</application> instead of "
7062
"<application>ufw</application>, enter:"
7065
#: serverguide/C/security.xml:865(screen)
7069
"sudo iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j LOG --log-"
7070
"prefix \"NEW_HTTP_CONN: \"\n"
7073
#: serverguide/C/security.xml:868(para)
7075
"A request on port 80 from the local machine, then, would generate a log in "
7076
"dmesg that looks like this:"
7079
#: serverguide/C/security.xml:873(programlisting)
7082
"[4304885.870000] NEW_HTTP_CONN: IN=lo OUT= "
7083
"MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.0.1 "
7084
"LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=58288 DF PROTO=TCP SPT=53981 DPT=80 "
7085
"WINDOW=32767 RES=0x00 SYN URGP=0"
7088
#: serverguide/C/security.xml:875(para)
7090
"The above log will also appear in <filename>/var/log/messages</filename>, "
7091
"<filename>/var/log/syslog</filename>, and "
7092
"<filename>/var/log/kern.log</filename>. This behavior can be modified by "
7093
"editing <filename>/etc/syslog.conf</filename> appropriately or by installing "
7094
"and configuring <application>ulogd</application> and using the ULOG target "
7095
"instead of LOG. The <application>ulogd</application> daemon is a userspace "
7096
"server that listens for logging instructions from the kernel specifically "
7097
"for firewalls, and can log to any file you like, or even to a "
7098
"<application>PostgreSQL</application> or <application>MySQL</application> "
7099
"database. Making sense of your firewall logs can be simplified by using a "
7100
"log analyzing tool such as <application>fwanalog</application>, "
7101
"<application> fwlogwatch</application>, or <application>lire</application>."
7104
#: serverguide/C/security.xml:890(title)
7108
#: serverguide/C/security.xml:891(para)
7110
"There are many tools available to help you construct a complete firewall "
7111
"without intimate knowledge of iptables. For the GUI-inclined:"
7114
#: serverguide/C/security.xml:897(para)
7116
"<ulink url=\"http://www.fs-security.com/\">Firestarter</ulink> is quite "
7117
"popular and easy to use."
7120
#: serverguide/C/security.xml:902(para)
7122
"<ulink url=\"http://www.fwbuilder.org/\">fwbuilder</ulink> is very powerful "
7123
"and will look familiar to an administrator who has used a commercial "
7124
"firewall utility such as <application>Checkpoint FireWall-1</application>."
7127
#: serverguide/C/security.xml:908(para)
7129
"If you prefer a command-line tool with plain-text configuration files:"
7132
#: serverguide/C/security.xml:913(para)
7134
"<ulink url=\"http://www.shorewall.net/\">Shorewall</ulink> is a very "
7135
"powerful solution to help you configure an advanced firewall for any network."
7138
#: serverguide/C/security.xml:919(para)
7140
"<ulink url=\"http://www.linuxkungfu.org/\">ipkungfu</ulink> should give you "
7141
"a working firewall \"out of the box\" with zero configuration, and will "
7142
"allow you to easily set up a more advanced firewall by editing simple, well-"
7143
"documented configuration files."
7146
#: serverguide/C/security.xml:926(para)
7148
"<ulink url=\"http://fireflier.sourceforge.net/\">fireflier</ulink> is "
7149
"designed to be a desktop firewall application. It is made up of a server "
7150
"(fireflier-server) and your choice of GUI clients (GTK or QT), and behaves "
7151
"like many popular interactive firewall applications for Windows."
7154
#: serverguide/C/security.xml:938(para)
7156
"The <ulink url=\"https://wiki.ubuntu.com/UbuntuFirewall\">Ubuntu "
7157
"Firewall</ulink> wiki page contains information on the development of "
7158
"<application>ufw</application>."
7161
#: serverguide/C/security.xml:944(para)
7163
"Also, the <application>ufw</application> manual page contains some very "
7164
"useful information: <command>man ufw</command>."
7167
#: serverguide/C/security.xml:949(para)
7169
"See the <ulink url=\"http://www.netfilter.org/documentation/HOWTO/packet-"
7170
"filtering-HOWTO.html\">packet-filtering-HOWTO</ulink> for more information "
7171
"on using <application>iptables</application>."
7174
#: serverguide/C/security.xml:955(para)
7176
"The <ulink url=\"http://www.netfilter.org/documentation/HOWTO/NAT-"
7177
"HOWTO.html\">nat-HOWTO</ulink> contains further details on masquerading."
7180
#: serverguide/C/security.xml:964(title)
7184
#: serverguide/C/security.xml:965(para)
7186
"<application>AppArmor</application> is a Linux Security Module "
7187
"implementation of name-based mandatory access controls. AppArmor confines "
7188
"individual programs to a set of listed files and posix 1003.1e draft "
7192
#: serverguide/C/security.xml:969(para)
7194
"<application>AppArmor</application> is installed and loaded by default. It "
7195
"uses <emphasis>profiles</emphasis> of an application to determine what files "
7196
"and permissions the application requires. Some packages will install their "
7197
"own profiles, and additional profiles can be found in the "
7198
"<application>apparmor-profiles</application> package."
7201
#: serverguide/C/security.xml:974(para)
7203
"To install the <application>apparmor-profiles</application> package from a "
7207
#: serverguide/C/security.xml:980(para)
7208
msgid "AppArmor profiles have two modes of execution:"
7211
#: serverguide/C/security.xml:985(para)
7213
"Complaining/Learning: profile violations are permitted and logged. Useful "
7214
"for testing and developing new profiles."
7217
#: serverguide/C/security.xml:990(para)
7219
"Enforced/Confined: enforces profile policy as well as logging the violation."
7222
#: serverguide/C/security.xml:996(title)
7223
msgid "Using AppArmor"
7226
#: serverguide/C/security.xml:997(para)
7228
"The <application>apparmor-utils</application> package contains command line "
7229
"utilities that you can use to change the <application>AppArmor</application> "
7230
"execution mode, find the status of a profile, create new profiles, etc."
7233
#: serverguide/C/security.xml:1003(para)
7235
"<application>apparmor_status</application> is used to view the current "
7236
"status of AppArmor profiles."
7239
#: serverguide/C/security.xml:1007(command)
7240
msgid "sudo apparmor_status"
7243
#: serverguide/C/security.xml:1011(para)
7245
"<application>aa-complain</application> places a profile into "
7246
"<emphasis>complain</emphasis> mode."
7249
#: serverguide/C/security.xml:1015(command)
7250
msgid "sudo aa-complain /path/to/bin"
7253
#: serverguide/C/security.xml:1019(para)
7255
"<application>aa-enforce</application> places a profile into "
7256
"<emphasis>enforce</emphasis> mode."
7259
#: serverguide/C/security.xml:1023(command)
7260
msgid "sudo aa-enforce /path/to/bin"
7263
#: serverguide/C/security.xml:1027(para)
7265
"The <filename>/etc/apparmor.d</filename> directory is where the AppArmor "
7266
"profiles are located. It can be used to manipulate the "
7267
"<emphasis>mode</emphasis> of all profiles."
7270
#: serverguide/C/security.xml:1031(para)
7271
msgid "Enter the following to place all profiles into complain mode:"
7274
#: serverguide/C/security.xml:1035(command)
7275
msgid "sudo aa-complain /etc/apparmor.d/*"
7278
#: serverguide/C/security.xml:1037(para)
7279
msgid "To place all profiles in enforce mode:"
7282
#: serverguide/C/security.xml:1041(command)
7283
msgid "sudo aa-enforce /etc/apparmor.d/*"
7286
#: serverguide/C/security.xml:1045(para)
7288
"<application>apparmor_parser</application> is used to load a profile into "
7289
"the kernel. It can also be used to reload a currently loaded profile using "
7290
"the <emphasis>-r</emphasis> option. To load a profile:"
7293
#: serverguide/C/security.xml:1050(command) serverguide/C/security.xml:1082(command)
7294
msgid "cat /etc/apparmor.d/profile.name | sudo apparmor_parser -a"
7297
#: serverguide/C/security.xml:1052(para)
7298
msgid "To reload a profile:"
7301
#: serverguide/C/security.xml:1056(command)
7302
msgid "cat /etc/apparmor.d/profile.name | sudo apparmor_parser -r"
7305
#: serverguide/C/security.xml:1060(para)
7307
"<filename>/etc/init.d/apparmor</filename> can be used to "
7308
"<emphasis>reload</emphasis> all profiles:"
7311
#: serverguide/C/security.xml:1064(command)
7312
msgid "sudo /etc/init.d/apparmor reload"
7315
#: serverguide/C/security.xml:1068(para)
7317
"The <filename>/etc/apparmor.d/disable</filename> directory can be used along "
7318
"with the <application>apparmor_parser -R</application> option to "
7319
"<emphasis>disable</emphasis> a profile."
7322
#: serverguide/C/security.xml:1073(command)
7323
msgid "sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/"
7326
#: serverguide/C/security.xml:1074(command)
7327
msgid "sudo apparmor_parser -R /etc/apparmor.d/profile.name"
7330
#: serverguide/C/security.xml:1076(para)
7332
"To <emphasis>re-enable</emphasis> a disabled profile remove the symbolic "
7333
"link to the profile in <filename>/etc/apparmor.d/disable/</filename>. Then "
7334
"load the profile using the <emphasis>-a</emphasis> option."
7337
#: serverguide/C/security.xml:1081(command)
7338
msgid "sudo rm /etc/apparmor.d/disable/profile.name"
7341
#: serverguide/C/security.xml:1086(para)
7343
"<application>AppArmor</application> can be disabled, and the kernel module "
7344
"unloaded by entering the following:"
7347
#: serverguide/C/security.xml:1090(command)
7348
msgid "sudo /etc/init.d/apparmor stop"
7351
#: serverguide/C/security.xml:1091(command)
7352
msgid "sudo update-rc.d -f apparmor remove"
7355
#: serverguide/C/security.xml:1095(para)
7356
msgid "To re-enable <application>AppArmor</application> enter:"
7359
#: serverguide/C/security.xml:1099(command)
7360
msgid "sudo /etc/init.d/apparmor start"
7363
#: serverguide/C/security.xml:1100(command)
7364
msgid "sudo update-rc.d apparmor defaults"
7367
#: serverguide/C/security.xml:1105(para)
7369
"Replace <emphasis>profile.name</emphasis> with the name of the profile you "
7370
"want to manipulate. Also, replace <filename>/path/to/bin/</filename> with "
7371
"the actual executable file path. For example for the "
7372
"<application>ping</application> command use <filename>/bin/ping</filename>"
7375
#: serverguide/C/security.xml:1113(title)
7379
#: serverguide/C/security.xml:1114(para)
7381
"<application>AppArmor</application> profiles are simple text files located "
7382
"in <filename>/etc/apparmor.d/</filename>. The files are named after the full "
7383
"path to the executable they profile replacing the \"/\" with \".\". For "
7384
"example <filename>/etc/apparmor.d/bin.ping</filename> is the AppArmor "
7385
"profile for the <filename>/bin/ping</filename> command."
7388
#: serverguide/C/security.xml:1120(para)
7389
msgid "There are two main type of rules used in profiles:"
7392
#: serverguide/C/security.xml:1125(para)
7394
"<emphasis>Path entries:</emphasis> which detail which files an application "
7395
"can access in the file system."
7398
#: serverguide/C/security.xml:1130(para)
7400
"<emphasis>Capability entries:</emphasis> determine what privileges a "
7401
"confined process is allowed to use."
7404
#: serverguide/C/security.xml:1135(para)
7406
"As an example take a look at <filename>/etc/apparmor.d/bin.ping</filename>:"
7409
#: serverguide/C/security.xml:1138(programlisting)
7413
"#include <tunables/global>\n"
7414
"/bin/ping flags=(complain) {\n"
7415
" #include <abstractions/base>\n"
7416
" #include <abstractions/consoles>\n"
7417
" #include <abstractions/nameservice>\n"
7419
" capability net_raw,\n"
7420
" capability setuid,\n"
7421
" network inet raw,\n"
7423
" /bin/ping mixr,\n"
7424
" /etc/modules.conf r,\n"
7428
#: serverguide/C/security.xml:1155(para)
7430
"<emphasis>#include <tunables/global>:</emphasis> include statements "
7431
"from other files. This allows statements pertaining to multiple applications "
7432
"to be placed in a common file."
7435
#: serverguide/C/security.xml:1161(para)
7437
"<emphasis>/bin/ping flags=(complain):</emphasis> path to the profiled "
7438
"program, also setting the mode to <emphasis>complain</emphasis>."
7441
#: serverguide/C/security.xml:1167(para)
7443
"<emphasis>capability net_raw,:</emphasis> allows the application access to "
7444
"the CAP_NET_RAW Posix.1e capability."
7447
#: serverguide/C/security.xml:1172(para)
7449
"<emphasis>/bin/ping mixr,:</emphasis> allows the application read and "
7450
"execute access to the file."
7453
#: serverguide/C/security.xml:1178(para)
7455
"After editing a profile file the profile must be reloaded. See <xref "
7456
"linkend=\"apparmor-usage\"/> for details."
7459
#: serverguide/C/security.xml:1183(title)
7460
msgid "Creating a Profile"
7463
#: serverguide/C/security.xml:1186(para)
7465
"<emphasis>Design a test plan:</emphasis> Try to think about how the "
7466
"application should be exercised. The test plan should be divided into small "
7467
"test cases. Each test case should have a small description and list the "
7471
#: serverguide/C/security.xml:1190(para)
7472
msgid "Some standard test cases are:"
7475
#: serverguide/C/security.xml:1195(para)
7476
msgid "Starting the program."
7479
#: serverguide/C/security.xml:1200(para)
7480
msgid "Stopping the program."
7483
#: serverguide/C/security.xml:1205(para)
7484
msgid "Reloading the program."
7487
#: serverguide/C/security.xml:1210(para)
7488
msgid "Testing all the commands supported by the init script."
7491
#: serverguide/C/security.xml:1217(para)
7493
"<emphasis>Generate the new profile:</emphasis> Use <application>aa-"
7494
"genprof</application> to generate a new profile. From a terminal:"
7497
#: serverguide/C/security.xml:1222(command)
7498
msgid "sudo aa-genprof executable"
7501
#: serverguide/C/security.xml:1224(para)
7502
msgid "For example:"
7505
#: serverguide/C/security.xml:1228(command)
7506
msgid "sudo aa-genprof slapd"
7509
#: serverguide/C/security.xml:1232(para)
7511
"To get your new profile included in the <application>apparmor-"
7512
"profiles</application> package, file a bug in <emphasis>Launchpad</emphasis> "
7513
"against the <ulink "
7514
"url=\"https://bugs.launchpad.net/ubuntu/+source/apparmor/+filebug\">AppArmor<"
7518
#: serverguide/C/security.xml:1239(para)
7519
msgid "Include your test plan and test cases."
7522
#: serverguide/C/security.xml:1244(para)
7523
msgid "Attach your new profile to the bug."
7526
#: serverguide/C/security.xml:1253(title)
7527
msgid "Updating Profiles"
7530
#: serverguide/C/security.xml:1254(para)
7532
"When the program is misbehaving, audit messages are sent to the log files. "
7533
"The program <application>aa-logprof</application> can be used to scan log "
7534
"files for <application>AppArmor</application> audit messages, review them "
7535
"and update the profiles. From a terminal:"
7538
#: serverguide/C/security.xml:1259(command)
7539
msgid "sudo aa-logprof"
7542
#: serverguide/C/security.xml:1267(para)
7545
"url=\"http://www.novell.com/documentation/apparmor/apparmor201_sp10_admin/ind"
7546
"ex.html?page=/documentation/apparmor/apparmor201_sp10_admin/data/book_apparmo"
7547
"r_admin.html\">AppArmor Administration Guide</ulink> for advanced "
7548
"configuration options."
7551
#: serverguide/C/security.xml:1274(para)
7553
"For details using AppArmor with other Ubuntu releases see the <ulink "
7554
"url=\"https://help.ubuntu.com/community/AppArmor\"> AppArmor Community "
7555
"Wiki</ulink> page."
7558
#: serverguide/C/security.xml:1282(para)
7560
"The <ulink url=\"http://en.opensuse.org/AppArmor\">OpenSUSE AppArmor</ulink> "
7561
"page is another introduction to AppArmor."
7564
#: serverguide/C/security.xml:1289(para)
7566
"A great place to ask for <application>AppArmor</application> assistance, and "
7567
"get involved with the Ubuntu Server community, is the <emphasis>#ubuntu-"
7568
"server</emphasis> IRC channel on <ulink "
7569
"url=\"http://freenode.net\">freenode</ulink>."
7572
#: serverguide/C/security.xml:1299(title)
7573
msgid "Certificates"
7576
#: serverguide/C/security.xml:1300(para)
7578
"One of the most common forms of cryptography today is <emphasis>public-"
7579
"key</emphasis> cryptography. Public-key cryptography utilizes a "
7580
"<emphasis>public key</emphasis> and a <emphasis>private key</emphasis>. The "
7581
"system works by <emphasis>encrypting</emphasis> information using the public "
7582
"key. The information can then only be <emphasis>decrypted</emphasis> using "
7586
#: serverguide/C/security.xml:1306(para)
7588
"A common use for public-key cryptography is encrypting application traffic "
7589
"using a Secure Socket Layer (SSL) or Transport Layer Security (TLS) "
7590
"connection. For example, configuring Apache to provide "
7591
"<emphasis>HTTPS</emphasis>, the HTTP protocol over SSL. This allows a way to "
7592
"encrypt traffic using a protocol that does not itself provide encryption."
7595
#: serverguide/C/security.xml:1311(para)
7597
"A <emphasis>Certificate</emphasis> is a method used to distribute a "
7598
"<emphasis>public key</emphasis> and other information about a server and the "
7599
"organization who is responsible for it. Certificates can be digitally signed "
7600
"by a <emphasis>Certification Authority</emphasis> or CA. A CA is a trusted "
7601
"third party that has confirmed that the information contained in the "
7602
"certificate is accurate."
7605
#: serverguide/C/security.xml:1318(title)
7606
msgid "Types of Certificates"
7609
#: serverguide/C/security.xml:1319(para)
7611
"To set up a secure server using public-key cryptography, in most cases, you "
7612
"send your certificate request (including your public key), proof of your "
7613
"company's identity, and payment to a CA. The CA verifies the certificate "
7614
"request and your identity, and then sends back a certificate for your secure "
7615
"server. Alternatively, you can create your own <emphasis>self-"
7616
"signed</emphasis> certificate."
7619
#: serverguide/C/security.xml:1329(para)
7621
"Note, that self-signed certificates should not be used in most production "
7625
#: serverguide/C/security.xml:1333(para)
7627
"Continuing the HTTPS example, a CA-signed certificate provides two important "
7628
"capabilities that a self-signed certificate does not:"
7631
#: serverguide/C/security.xml:1340(para)
7633
"Browsers (usually) automatically recognize the certificate and allow a "
7634
"secure connection to be made without prompting the user."
7637
#: serverguide/C/security.xml:1347(para)
7639
"When a CA issues a signed certificate, it is guaranteeing the identity of "
7640
"the organization that is providing the web pages to the browser."
7643
#: serverguide/C/security.xml:1355(para)
7645
"Most Web browsers, and computers, that support SSL have a list of CAs whose "
7646
"certificates they automatically accept. If a browser encounters a "
7647
"certificate whose authorizing CA is not in the list, the browser asks the "
7648
"user to either accept or decline the connection. Also, other applications "
7649
"may generate an error message when using a self-singed certificate."
7652
#: serverguide/C/security.xml:1363(para)
7654
"The process of getting a certificate from a CA is fairly easy. A quick "
7655
"overview is as follows:"
7658
#: serverguide/C/security.xml:1370(para)
7659
msgid "Create a private and public encryption key pair."
7662
#: serverguide/C/security.xml:1373(para)
7664
"Create a certificate request based on the public key. The certificate "
7665
"request contains information about your server and the company hosting it."
7668
#: serverguide/C/security.xml:1378(para)
7670
"Send the certificate request, along with documents proving your identity, to "
7671
"a CA. We cannot tell you which certificate authority to choose. Your "
7672
"decision may be based on your past experiences, or on the experiences of "
7673
"your friends or colleagues, or purely on monetary factors."
7676
#: serverguide/C/security.xml:1384(para)
7678
"Once you have decided upon a CA, you need to follow the instructions they "
7679
"provide on how to obtain a certificate from them."
7682
#: serverguide/C/security.xml:1389(para)
7684
"When the CA is satisfied that you are indeed who you claim to be, they send "
7685
"you a digital certificate."
7688
#: serverguide/C/security.xml:1393(para)
7690
"Install this certificate on your secure server, and configure the "
7691
"appropriate applications to use the certificate."
7694
#: serverguide/C/security.xml:1402(title)
7695
msgid "Generating a Certificate Signing Request (CSR)"
7698
#: serverguide/C/security.xml:1404(para)
7700
"Whether you are getting a certificate from a CA or generating your own self-"
7701
"signed certificate, the first step is to generate a key."
7704
#: serverguide/C/security.xml:1409(para)
7706
"If the certificate will be used by service daemons, such as Apache, Postfix, "
7707
"Dovecot, etc, a key without a passphrase is often appropriate. Not having a "
7708
"passphrase allows the services to start without manual intervention, usually "
7709
"the preferred way to start a daemon."
7712
#: serverguide/C/security.xml:1415(para)
7714
"This section will cover generating a key with a passphrase, and one without. "
7715
"The non-passphrase key will then be used to generate a certificate that can "
7716
"be used with various service daemons."
7719
#: serverguide/C/security.xml:1421(para)
7721
"Running your secure service without a passphrase is convenient because you "
7722
"will not need to enter the passphrase every time you start your secure "
7723
"service. But it is insecure and a compromise of the key means a compromise "
7724
"of the server as well."
7727
#: serverguide/C/security.xml:1428(para)
7729
"To generate the <emphasis>keys</emphasis> for the Certificate Signing "
7730
"Request (CSR) run the following command from a terminal prompt:"
7733
#: serverguide/C/security.xml:1434(command)
7734
msgid "openssl genrsa -des3 -out server.key 1024"
7737
#: serverguide/C/security.xml:1437(programlisting)
7741
"Generating RSA private key, 1024 bit long modulus\n"
7742
".....................++++++\n"
7743
".................++++++\n"
7744
"unable to write 'random state'\n"
7745
"e is 65537 (0x10001)\n"
7746
"Enter pass phrase for server.key:\n"
7749
#: serverguide/C/security.xml:1446(para)
7751
"You can now enter your passphrase. For best security, it should at least "
7752
"contain eight characters. The minimum length when specifying -des3 is four "
7753
"characters. It should include numbers and/or punctuation and not be a word "
7754
"in a dictionary. Also remember that your passphrase is case-sensitive."
7757
#: serverguide/C/security.xml:1454(para)
7759
"Re-type the passphrase to verify. Once you have re-typed it correctly, the "
7760
"server key is generated and stored in the <filename>server.key</filename> "
7764
#: serverguide/C/security.xml:1460(para)
7766
"Now create the insecure key, the one without a passphrase, and shuffle the "
7770
#: serverguide/C/security.xml:1466(command)
7771
msgid "openssl rsa -in server.key -out server.key.insecure"
7774
#: serverguide/C/security.xml:1467(command)
7775
msgid "mv server.key server.key.secure"
7778
#: serverguide/C/security.xml:1468(command)
7779
msgid "mv server.key.insecure server.key"
7782
#: serverguide/C/security.xml:1471(para)
7784
"The insecure key is now named <filename>server.key</filename>, and you can "
7785
"use this file to generate the CSR without passphrase."
7788
#: serverguide/C/security.xml:1476(para)
7789
msgid "To create the CSR, run the following command at a terminal prompt:"
7792
#: serverguide/C/security.xml:1481(command)
7793
msgid "openssl req -new -key server.key -out server.csr"
7796
#: serverguide/C/security.xml:1484(para)
7798
"It will prompt you enter the passphrase. If you enter the correct "
7799
"passphrase, it will prompt you to enter Company Name, Once you enter all "
7800
"these details, your CSR will be created and it will be stored in the "
7801
"<filename>server.csr</filename> file. Site Name, Email Id, etc."
7804
#: serverguide/C/security.xml:1492(para)
7806
"You can now submit this CSR file to a CA for processing. The CA will use "
7807
"this CSR file and issue the certificate. On the other hand, you can create "
7808
"self-signed certificate using this CSR."
7811
#: serverguide/C/security.xml:1500(title)
7812
msgid "Creating a Self-Signed Certificate"
7815
#: serverguide/C/security.xml:1501(para)
7817
"To create the self-signed certificate, run the following command at a "
7821
#: serverguide/C/security.xml:1506(command)
7823
"openssl x509 -req -days 365 -in server.csr -signkey server.key -out "
7827
#: serverguide/C/security.xml:1509(para)
7829
"The above command will prompt you to enter the passphrase. Once you enter "
7830
"the correct passphrase, your certificate will be created and it will be "
7831
"stored in the <filename>server.crt</filename> file."
7834
#: serverguide/C/security.xml:1514(para)
7836
"If your secure server is to be used in a production environment, you "
7837
"probably need a CA-signed certificate. It is not recommended to use self-"
7838
"signed certificate."
7841
#: serverguide/C/security.xml:1522(title)
7842
msgid "Installing the Certificate"
7845
#: serverguide/C/security.xml:1524(para)
7847
"You can install the key file <filename>server.key</filename> and certificate "
7848
"file <filename>server.crt</filename>, or the certificate file issued by your "
7849
"CA, by running following commands at a terminal prompt:"
7852
#: serverguide/C/security.xml:1530(command)
7853
msgid "sudo cp server.crt /etc/ssl/certs"
7856
#: serverguide/C/security.xml:1531(command)
7857
msgid "sudo cp server.key /etc/ssl/private"
7860
#: serverguide/C/security.xml:1533(para)
7862
"Now simply configure any applications, with the ability to use public-key "
7863
"cryptography, to use the <emphasis>certificate</emphasis> and "
7864
"<emphasis>key</emphasis> files. For example, "
7865
"<application>Apache</application> can provide HTTPS, "
7866
"<application>Dovecot</application> can provide IMAPS and POP3S, etc."
7869
#: serverguide/C/security.xml:1540(title)
7870
msgid "Certification Authority"
7873
#: serverguide/C/security.xml:1542(para)
7875
"If the services on your network require more than a few self-signed "
7876
"certificates it may be worth the additional effort to setup your own "
7877
"internal <emphasis>Certification Authority (CA)</emphasis>. Using "
7878
"certificates signed by your own CA, allows the various services using the "
7879
"certificates to easily trust other services using certificates issued from "
7883
#: serverguide/C/security.xml:1552(para)
7885
"First, create the directories to hold the CA certificate and related files:"
7888
#: serverguide/C/security.xml:1557(command)
7889
msgid "sudo mkdir /etc/ssl/CA"
7892
#: serverguide/C/security.xml:1558(command)
7893
msgid "sudo mkdir /etc/ssl/newcerts"
7896
#: serverguide/C/security.xml:1564(para)
7898
"The CA needs a few additional files to operate, one to keep track of the "
7899
"last serial number used by the CA, each certificate must have a unique "
7900
"serial number, and another file to record which certificates have been "
7904
#: serverguide/C/security.xml:1571(command)
7905
msgid "sudo sh -c \"echo '01' > /etc/ssl/CA/serial\""
7908
#: serverguide/C/security.xml:1572(command)
7909
msgid "sudo touch /etc/ssl/CA/index.txt"
7912
#: serverguide/C/security.xml:1578(para)
7914
"The third file is a CA configuration file. Though not strictly necessary, it "
7915
"is very convenient when issuing multiple certificates. Edit "
7916
"<filename>/etc/ssl/openssl.cnf</filename>, and in the <emphasis>[ CA_default "
7917
"]</emphasis> change:"
7920
#: serverguide/C/security.xml:1584(programlisting)
7924
"dir = /etc/ssl/ # Where everything is kept\n"
7925
"database = $dir/CA/index.txt # database index file.\n"
7926
"certificate = $dir/certs/cacert.pem # The CA certificate\n"
7927
"serial = $dir/CA/serial # The current serial number\n"
7928
"private_key = $dir/private/cakey.pem# The private key\n"
7931
#: serverguide/C/security.xml:1595(para)
7932
msgid "Next, create the self-singed root certificate:"
7935
#: serverguide/C/security.xml:1600(command)
7937
"openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -"
7941
#: serverguide/C/security.xml:1603(para)
7942
msgid "You will then be asked to enter the details about the certificate."
7945
#: serverguide/C/security.xml:1610(para)
7946
msgid "Now install the root certificate and key:"
7949
#: serverguide/C/security.xml:1615(command)
7950
msgid "sudo mv cakey.pem /etc/ssl/private/"
7953
#: serverguide/C/security.xml:1616(command)
7954
msgid "sudo mv cacert.pem /etc/ssl/certs/"
7957
#: serverguide/C/security.xml:1622(para)
7959
"You are now ready to start signing certificates. The first item needed is a "
7960
"Certificate Signing Request (CSR), see <xref linkend=\"generating-a-csr\"/> "
7961
"for details. Once you have a CSR, enter the following to generate a "
7962
"certificate signed by the CA:"
7965
#: serverguide/C/security.xml:1629(command)
7966
msgid "sudo openssl ca -in server.csr -config /etc/ssl/openssl.cnf"
7969
#: serverguide/C/security.xml:1632(para)
7971
"After entering the password for the CA key, you will be prompted to sign the "
7972
"certificate, and again to commit the new certificate. You should then see a "
7973
"somewhat large amount of output related to the certificate creation."
7976
#: serverguide/C/security.xml:1641(para)
7978
"There should now be a new file, "
7979
"<filename>/etc/ssl/newcerts/01.pem</filename>, containing the same output. "
7980
"Copy and paste everything between the <emphasis>-----BEGIN CERTIFICATE-----"
7981
"</emphasis> and <emphasis>----END CERTIFICATE-----</emphasis> lines to a "
7982
"file named after the hostname of the server where the certificate will be "
7983
"installed. For example <filename>mail.example.com.crt</filename>, is a nice "
7987
#: serverguide/C/security.xml:1649(para)
7989
"Subsequent certificates will be named <filename>02.pem</filename>, "
7990
"<filename>03.pem</filename>, etc."
7993
#: serverguide/C/security.xml:1654(para)
7995
"Replace <emphasis>mail.example.com.crt</emphasis> with your own descriptive "
7999
#: serverguide/C/security.xml:1662(para)
8001
"Finally, copy the new certificate to the host that needs it, and configure "
8002
"the appropriate applications to use it. The default location to install "
8003
"certificates is <filename role=\"directory\">/etc/ssl/certs</filename>. This "
8004
"enables multiple services to use the same certificate without overly "
8005
"complicated file permissions."
8008
#: serverguide/C/security.xml:1668(para)
8010
"For applications that can be configured to use a CA certificate, you should "
8011
"also copy the <filename>/etc/ssl/certs/cacert.pem</filename> file to the "
8012
"<filename role=\"directory\">/etc/ssl/certs/</filename> directory on each "
8016
#: serverguide/C/security.xml:1682(para)
8018
"For more detailed instructions on using cryptography see the <ulink "
8019
"url=\"http://tldp.org/HOWTO/SSL-Certificates-HOWTO/index.html\">SSL "
8020
"Certificates HOWTO</ulink> by tlpd.org"
8023
#: serverguide/C/security.xml:1688(para)
8025
"<ulink url=\"http://www.pki-page.org/\">The PKI Page</ulink> contains a list "
8026
"of Certificate Authorities."
8029
#: serverguide/C/security.xml:1693(para)
8031
"The Wikipedia <ulink "
8032
"url=\"http://en.wikipedia.org/wiki/Https\">HTTPS</ulink> page has more "
8033
"information regarding HTTPS."
8036
#: serverguide/C/security.xml:1698(para)
8038
"For more information on <emphasis>OpenSSL</emphasis> see the <ulink "
8039
"url=\"http://www.openssl.org/\">OpenSSL Home Page</ulink>."
8042
#: serverguide/C/security.xml:1703(para)
8044
"Also, O'Reilly's <ulink "
8045
"url=\"http://oreilly.com/catalog/9780596002701/\">Network Security with "
8046
"OpenSSL</ulink> is a good in depth reference."
8049
#: serverguide/C/security.xml:1712(title)
8053
#: serverguide/C/security.xml:1714(para)
8055
"<emphasis>eCryptfs</emphasis> is a POSIX-compliant enterprise-class stacked "
8056
"cryptographic filesystem for Linux. Layering on top of the filesystem layer "
8057
"<emphasis>eCryptfs</emphasis> protects files no matter the underlying "
8058
"filesystem, partition type, etc."
8061
#: serverguide/C/security.xml:1720(para)
8063
"During installation there is an option to encrypt the <filename "
8064
"role=\"directory\">/home</filename> partition. This will automatically "
8065
"configure everything needed to encrypt and mount the partition."
8068
#: serverguide/C/security.xml:1725(para)
8070
"As an example, this section will cover configuring <filename "
8071
"role=\"directory\">/srv</filename> to be encrypted using eCryptfs."
8074
#: serverguide/C/security.xml:1730(title)
8075
msgid "Using eCryptfs"
8078
#: serverguide/C/security.xml:1732(para)
8079
msgid "First, install the necessary packages. From a terminal prompt enter:"
8082
#: serverguide/C/security.xml:1737(command)
8083
msgid "sudo apt-get install ecryptfs-utils"
8086
#: serverguide/C/security.xml:1740(para)
8087
msgid "Now mount the partition to be encrypted:"
8090
#: serverguide/C/security.xml:1745(command)
8091
msgid "sudo mount -t ecryptfs /srv /srv"
8094
#: serverguide/C/security.xml:1748(para)
8096
"You will then be prompted for some details on how "
8097
"<application>ecryptfs</application> should encrypt the data."
8100
#: serverguide/C/security.xml:1752(para)
8102
"To test that files placed in <filename>/srv</filename> are indeed encrypted "
8103
"copy the <filename>/etc/default</filename> folder to "
8104
"<filename>/srv</filename>:"
8107
#: serverguide/C/security.xml:1758(command) serverguide/C/clustering.xml:185(command)
8108
msgid "sudo cp -r /etc/default /srv"
8111
#: serverguide/C/security.xml:1761(para)
8112
msgid "Now unmount <filename>/srv</filename>, and try to view a file:"
8115
#: serverguide/C/security.xml:1766(command) serverguide/C/installation.xml:1088(command) serverguide/C/clustering.xml:193(command)
8116
msgid "sudo umount /srv"
8119
#: serverguide/C/security.xml:1767(command)
8120
msgid "cat /srv/default/cron"
8123
#: serverguide/C/security.xml:1770(para)
8125
"Remounting <filename>/srv</filename> using "
8126
"<application>ecryptfs</application> will make the data viewable once again."
8129
#: serverguide/C/security.xml:1776(title)
8130
msgid "Automatically Mounting Encrypted Partitions"
8133
#: serverguide/C/security.xml:1778(para)
8135
"There are a couple of ways to automatically mount an "
8136
"<application>ecryptfs</application> encrypted filesystem at boot. This "
8137
"example will use a <filename>/root/.ecryptfsrc</filename> file containing "
8138
"mount options, along with a passphrase file residing on a USB key."
8141
#: serverguide/C/security.xml:1784(para)
8142
msgid "First, create <filename>/root/.ecryptfsrc</filename> containing:"
8145
#: serverguide/C/security.xml:1788(programlisting)
8149
"key=passphrase:passphrase_passwd_file=/mnt/usb/passwd_file.txt\n"
8150
"ecryptfs_sig=5826dd62cf81c615\n"
8151
"ecryptfs_cipher=aes\n"
8152
"ecryptfs_key_bytes=16\n"
8153
"ecryptfs_passthrough=n\n"
8154
"ecryptfs_enable_filename_crypto=n\n"
8157
#: serverguide/C/security.xml:1798(para)
8159
"Adjust the <emphasis>ecryptfs_sig</emphasis> to the signature in "
8160
"<filename>/root/.ecryptfs/sig-cache.txt</filename>."
8163
#: serverguide/C/security.xml:1803(para)
8165
"Next, create the <filename>/mnt/usb/passwd_file.txt</filename> passphrase "
8169
#: serverguide/C/security.xml:1807(programlisting)
8173
"passphrase_passwd=[secrets]\n"
8176
#: serverguide/C/security.xml:1811(para)
8177
msgid "Now add the necessary lines to <filename>/etc/fstab</filename>:"
8180
#: serverguide/C/security.xml:1815(programlisting)
8184
"/dev/sdb1 /mnt/usb ext3 ro 0 0\n"
8185
"/srv /srv ecryptfs defaults 0 0\n"
8188
#: serverguide/C/security.xml:1820(para)
8189
msgid "Make sure the USB drive is mounted before the encrypted partition."
8192
#: serverguide/C/security.xml:1824(para)
8194
"Finally, reboot and the <filename>/srv</filename> should be mounted using "
8198
#: serverguide/C/security.xml:1832(para)
8200
"The <application>ecryptfs-utils</application> package includes several other "
8204
#: serverguide/C/security.xml:1838(para)
8206
"<emphasis>ecryptfs-setup-private:</emphasis> creates a "
8207
"<filename>~/Private</filename> directory to contain encrypted information. "
8208
"This utility can be run by unprivileged users to keep data private from "
8209
"other users on the system."
8212
#: serverguide/C/security.xml:1845(para)
8214
"<emphasis>ecryptfs-mount-private and ecryptfs-umount-private:</emphasis> "
8215
"will mount and unmount respectively, a users <filename>~/Private</filename> "
8219
#: serverguide/C/security.xml:1851(para)
8221
"<emphasis>ecryptfs-add-passphrase:</emphasis> adds a new passphrase to the "
8225
#: serverguide/C/security.xml:1856(para)
8227
"<emphasis>ecryptfs-manager:</emphasis> manages "
8228
"<application>eCryptfs</application> objects such as keys."
8231
#: serverguide/C/security.xml:1861(para)
8233
"<emphasis>ecryptfs-stat:</emphasis> allows you to view the "
8234
"<application>ecryptfs</application> meta information for a file."
8237
#: serverguide/C/security.xml:1874(para)
8239
"For more information on eCryptfs see the <ulink "
8240
"url=\"https://launchpad.net/ecryptfs\">Launch Pad project page</ulink>"
8243
#: serverguide/C/security.xml:1879(para)
8245
"There is also a <ulink "
8246
"url=\"http://www.linuxjournal.com/article/9400\">Linux Journal</ulink> "
8247
"article covering eCryptfs."
8250
#: serverguide/C/security.xml:1884(para)
8252
"Also, for more <application>ecryptfs</application> options see the <ulink "
8253
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man7/ecryptfs.7.html\">ec"
8254
"ryptfs man page</ulink>."
8257
#: serverguide/C/remote-administration.xml:13(title)
8258
msgid "Remote Administration"
8261
#: serverguide/C/remote-administration.xml:14(para)
8263
"There are many ways to remotely administer a Linux server. This chapter will "
8264
"cover one of the most popular <application>SSH</application> as well as "
8265
"<application>eBox</application>, a web based administration framework."
8268
#: serverguide/C/remote-administration.xml:23(para)
8270
"This section of the Ubuntu Server Guide introduces a powerful collection of "
8271
"tools for the remote control of networked computers and transfer of data "
8272
"between networked computers, called <emphasis>OpenSSH</emphasis>. You will "
8273
"also learn about some of the configuration settings possible with the "
8274
"OpenSSH server application and how to change them on your Ubuntu system."
8277
#: serverguide/C/remote-administration.xml:30(para)
8279
"OpenSSH is a freely available version of the Secure Shell (SSH) protocol "
8280
"family of tools for remotely controlling a computer or transferring files "
8281
"between computers. Traditional tools used to accomplish these functions, "
8282
"such as <application>telnet</application> or <application>rcp</application>, "
8283
"are insecure and transmit the user's password in cleartext when used. "
8284
"OpenSSH provides a server daemon and client tools to facilitate secure, "
8285
"encrypted remote control and file transfer operations, effectively replacing "
8289
#: serverguide/C/remote-administration.xml:39(para)
8291
"The OpenSSH server component, <application>sshd</application>, listens "
8292
"continuously for client connections from any of the client tools. When a "
8293
"connection request occurs, <application>sshd</application> sets up the "
8294
"correct connection depending on the type of client tool connecting. For "
8295
"example, if the remote computer is connecting with the "
8296
"<application>ssh</application> client application, the OpenSSH server sets "
8297
"up a remote control session after authentication. If a remote user connects "
8298
"to an OpenSSH server with <application>scp</application>, the OpenSSH server "
8299
"daemon initiates a secure copy of files between the server and client after "
8300
"authentication. OpenSSH can use many authentication methods, including plain "
8301
"password, public key, and <application>Kerberos</application> tickets."
8304
#: serverguide/C/remote-administration.xml:53(para)
8306
"Installation of the OpenSSH client and server applications is simple. To "
8307
"install the OpenSSH client applications on your Ubuntu system, use this "
8308
"command at a terminal prompt:"
8311
#: serverguide/C/remote-administration.xml:59(command)
8312
msgid "sudo apt-get install openssh-client"
8315
#: serverguide/C/remote-administration.xml:61(para)
8317
"To install the OpenSSH server application, and related support files, use "
8318
"this command at a terminal prompt:"
8321
#: serverguide/C/remote-administration.xml:66(command)
8322
msgid "sudo apt-get install openssh-server"
8325
#: serverguide/C/remote-administration.xml:68(para)
8327
"The <application>openssh-server</application> package can also be selected "
8328
"to install during the Server Edition installation process."
8331
#: serverguide/C/remote-administration.xml:75(para)
8333
"You may configure the default behavior of the OpenSSH server application, "
8334
"<application>sshd</application>, by editing the file "
8335
"<filename>/etc/ssh/sshd_config</filename>. For information about the "
8336
"configuration directives used in this file, you may view the appropriate "
8337
"manual page with the following command, issued at a terminal prompt:"
8340
#: serverguide/C/remote-administration.xml:83(command)
8341
msgid "man sshd_config"
8344
#: serverguide/C/remote-administration.xml:85(para)
8346
"There are many directives in the <application>sshd</application> "
8347
"configuration file controlling such things as communication settings and "
8348
"authentication modes. The following are examples of configuration directives "
8349
"that can be changed by editing the <filename>/etc/ssh/sshd_config</filename> "
8353
#: serverguide/C/remote-administration.xml:92(para)
8355
"Prior to editing the configuration file, you should make a copy of the "
8356
"original file and protect it from writing so you will have the original "
8357
"settings as a reference and to reuse as necessary."
8360
#: serverguide/C/remote-administration.xml:96(para)
8362
"Copy the <filename>/etc/ssh/sshd_config</filename> file and protect it from "
8363
"writing with the following commands, issued at a terminal prompt:"
8366
#: serverguide/C/remote-administration.xml:101(command)
8367
msgid "sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original"
8370
#: serverguide/C/remote-administration.xml:102(command)
8371
msgid "sudo chmod a-w /etc/ssh/sshd_config.original"
8374
#: serverguide/C/remote-administration.xml:104(para)
8376
"The following are examples of configuration directives you may change:"
8379
#: serverguide/C/remote-administration.xml:109(para)
8381
"To set your OpenSSH to listen on TCP port 2222 instead of the default TCP "
8382
"port 22, change the Port directive as such:"
8385
#: serverguide/C/remote-administration.xml:113(para)
8389
#: serverguide/C/remote-administration.xml:118(para)
8391
"To have <application>sshd</application> allow public key-based login "
8392
"credentials, simply add or modify the line:"
8395
#: serverguide/C/remote-administration.xml:122(para)
8396
msgid "PubkeyAuthentication yes"
8399
#: serverguide/C/remote-administration.xml:125(para)
8401
"In the <filename>/etc/ssh/sshd_config</filename> file, or if already "
8402
"present, ensure the line is not commented out."
8405
#: serverguide/C/remote-administration.xml:131(para)
8407
"To make your OpenSSH server display the contents of the "
8408
"<filename>/etc/issue.net</filename> file as a pre-login banner, simply add "
8409
"or modify the line:"
8412
#: serverguide/C/remote-administration.xml:136(para)
8413
msgid "Banner /etc/issue.net"
8416
#: serverguide/C/remote-administration.xml:139(para)
8417
msgid "In the <filename>/etc/ssh/sshd_config</filename> file."
8420
#: serverguide/C/remote-administration.xml:144(para)
8422
"After making changes to the <filename>/etc/ssh/sshd_config</filename> file, "
8423
"save the file, and restart the <application>sshd</application> server "
8424
"application to effect the changes using the following command at a terminal "
8428
#: serverguide/C/remote-administration.xml:153(para)
8430
"Many other configuration directives for <application>sshd</application> are "
8431
"available for changing the server application's behavior to fit your needs. "
8432
"Be advised, however, if your only method of access to a server is "
8433
"<application>ssh</application>, and you make a mistake in configuring "
8434
"<application>sshd</application> via the "
8435
"<filename>/etc/ssh/sshd_config</filename> file, you may find you are locked "
8436
"out of the server upon restarting it, or that the "
8437
"<application>sshd</application> server refuses to start due to an incorrect "
8438
"configuration directive, so be extra careful when editing this file on a "
8442
#: serverguide/C/remote-administration.xml:168(title)
8446
#: serverguide/C/remote-administration.xml:169(para)
8448
"SSH <emphasis>keys</emphasis> allow authentication between two hosts without "
8449
"the need of a password. SSH key authentication uses two keys a "
8450
"<emphasis>private</emphasis> key and a <emphasis>public</emphasis> key."
8453
#: serverguide/C/remote-administration.xml:173(para)
8454
msgid "To generate the keys, from a terminal prompt enter:"
8457
#: serverguide/C/remote-administration.xml:177(command)
8458
msgid "ssh-keygen -t dsa"
8461
#: serverguide/C/remote-administration.xml:179(para)
8463
"This will generate the keys using a <emphasis>DSA</emphasis> authentication "
8464
"identity of the user. During the process you will be prompted for a "
8465
"password. Simply hit <emphasis>Enter</emphasis> when prompted to create the "
8469
#: serverguide/C/remote-administration.xml:183(para)
8471
"By default the <emphasis>public</emphasis> key is saved in the file "
8472
"<filename>~/.ssh/id_dsa.pub</filename>, while "
8473
"<filename>~/.ssh/id_dsa</filename> is the <emphasis>private</emphasis> key. "
8474
"Now copy the <filename>id_dsa.pub</filename> file to the remote host and "
8475
"append it to <filename>~/.ssh/authorized_keys</filename> by entering:"
8478
#: serverguide/C/remote-administration.xml:189(command)
8479
msgid "ssh-copy-id username@remotehost"
8482
#: serverguide/C/remote-administration.xml:191(para)
8484
"Finally, double check the permissions on the "
8485
"<filename>authorized_keys</filename> file, only the authenticated user "
8486
"should have read and write permissions. If the permissions are not correct "
8490
#: serverguide/C/remote-administration.xml:196(command)
8491
msgid "chmod 644 .ssh/authorized_keys"
8494
#: serverguide/C/remote-administration.xml:198(para)
8496
"You should now be able to SSH to the host without being prompted for a "
8500
#: serverguide/C/remote-administration.xml:205(ulink)
8501
msgid "OpenSSH Website"
8504
#: serverguide/C/remote-administration.xml:208(ulink)
8505
msgid "Advanced OpenSSH Wiki Page"
8508
#: serverguide/C/remote-administration.xml:213(title)
8512
#: serverguide/C/remote-administration.xml:214(para)
8514
"<application>eBox</application> is a web framework used to manage server "
8515
"application configuration. The modular design of eBox allows you to pick and "
8516
"choose which services you want to configure using eBox."
8519
#: serverguide/C/remote-administration.xml:221(para)
8521
"The different <application>eBox</application> modules are split into "
8522
"different packages, allowing you to only install those necessary. One way to "
8523
"view the available packages is to enter the following from a terminal:"
8526
#: serverguide/C/remote-administration.xml:227(command)
8527
msgid "apt-cache rdepends ebox | uniq"
8530
#: serverguide/C/remote-administration.xml:229(para)
8532
"To install the <application>ebox</application> package, which contains the "
8533
"default modules, enter the following:"
8536
#: serverguide/C/remote-administration.xml:234(command)
8537
msgid "sudo apt-get install ebox"
8540
#: serverguide/C/remote-administration.xml:237(para)
8542
"During the installation you will be asked to supply a password for the ebox "
8543
"user. After installing eBox the web interface can be accessed from: "
8544
"<emphasis>https://yourserver/ebox</emphasis>."
8547
#: serverguide/C/remote-administration.xml:246(para)
8549
"An important thing to remember when using <application>eBox</application> is "
8550
"that when configuring most modules there is a <emphasis>Change</emphasis> "
8551
"button that implements the new configuration. After clicking the Change "
8552
"button most, but not all, modules will then need to be "
8553
"<emphasis>Saved</emphasis>. To save the new configuration click on the "
8554
"<quote>Save changes</quote> link in the top right hand corner."
8557
#: serverguide/C/remote-administration.xml:254(para)
8559
"Once you make a change that requires a Save, the link will change from green "
8563
#: serverguide/C/remote-administration.xml:260(title)
8564
msgid "eBox Modules"
8567
#: serverguide/C/remote-administration.xml:261(para)
8569
"By default all eBox <emphasis>Modules</emphasis> are not enabled, and when a "
8570
"new module is installed it will not be automatically enabled."
8573
#: serverguide/C/remote-administration.xml:265(para)
8575
"To enable a disabled module click on the <emphasis>Module status</emphasis> "
8576
"link in the left hand menu. Then <emphasis role=\"italic\">check</emphasis> "
8577
"which modules you would like to enable and click the <quote>Save</quote> "
8581
#: serverguide/C/remote-administration.xml:271(title)
8582
msgid "Default Modules"
8585
#: serverguide/C/remote-administration.xml:272(para)
8587
"This section provides a quick summary of the default "
8588
"<application>eBox</application> modules."
8591
#: serverguide/C/remote-administration.xml:278(para)
8593
"<emphasis>System:</emphasis> contains options allowing configuration of "
8594
"general eBox items."
8597
#: serverguide/C/remote-administration.xml:284(para)
8599
"<emphasis>General:</emphasis> allows you to set the language, port number, "
8600
"and contains a change password form."
8603
#: serverguide/C/remote-administration.xml:290(para)
8605
"<emphasis>Disk Usage:</emphasis> displays a graph detailing information "
8609
#: serverguide/C/remote-administration.xml:296(para)
8611
"<emphasis>Backup:</emphasis> is used to backup "
8612
"<application>eBox</application> configuration information, and the "
8613
"<emphasis>Full Backup</emphasis> option allows you to save all eBox "
8614
"information not included in the <emphasis>Configuration</emphasis> option "
8615
"such as log files."
8618
#: serverguide/C/remote-administration.xml:304(para)
8620
"<emphasis>Halt/Reboot:</emphasis> will shutdown the system or reboot it."
8623
#: serverguide/C/remote-administration.xml:309(para)
8625
"<emphasis>Bug Report:</emphasis> creates a file containing details helpful "
8626
"when reporting bugs to the eBox developers."
8629
#: serverguide/C/remote-administration.xml:317(para)
8631
"<emphasis>Logs:</emphasis> allows <application>eBox</application> logs to be "
8632
"queried depending on the purge time configured."
8635
#: serverguide/C/remote-administration.xml:323(para)
8637
"<emphasis>Events:</emphasis> this module has the ability to send alerts "
8638
"through rss, jabber, and log file."
8641
#: serverguide/C/remote-administration.xml:330(emphasis)
8642
msgid "Available Events:"
8645
#: serverguide/C/remote-administration.xml:334(para)
8647
"<emphasis>Free Storage Space:</emphasis> will send alert if free disk space "
8648
"drops below a configured percentage, 10% by default."
8651
#: serverguide/C/remote-administration.xml:340(para)
8653
"<emphasis>Log Observer:</emphasis> unfortunately this event does not work "
8654
"with the <application>eBox</application> version shipped with Ubuntu 7.10."
8657
#: serverguide/C/remote-administration.xml:346(para)
8659
"<emphasis>RAID:</emphasis> will monitor the RAID system and send alerts if "
8663
#: serverguide/C/remote-administration.xml:352(para)
8665
"<emphasis>Service:</emphasis> sends alerts if a service restarts multiple "
8666
"times in a short time period."
8669
#: serverguide/C/remote-administration.xml:358(para)
8671
"<emphasis>State:</emphasis> alerts on the state of "
8672
"<application>eBox</application>, either up or down."
8675
#: serverguide/C/remote-administration.xml:367(emphasis)
8676
msgid "Dispatchers:"
8679
#: serverguide/C/remote-administration.xml:371(para)
8681
"<emphasis>Log:</emphasis> this dispatcher will send event messages to the "
8682
"<application>eBox</application> log file "
8683
"<filename>/var/log/ebox/ebox.log</filename>."
8686
#: serverguide/C/remote-administration.xml:378(para)
8688
"<emphasis>Jabber:</emphasis> before enabling this dispatcher you must first "
8689
"configure it by clicking on the <quote>Configure</quote> icon."
8692
#: serverguide/C/remote-administration.xml:384(para)
8694
"<emphasis>RSS:</emphasis> once this dispatcher is configured you can "
8695
"subscribe to the link in order to view event alerts."
8698
#: serverguide/C/remote-administration.xml:397(title)
8699
msgid "Additional Modules"
8702
#: serverguide/C/remote-administration.xml:398(para)
8704
"Here is a quick description of other available "
8705
"<application>eBox</application> modules:"
8708
#: serverguide/C/remote-administration.xml:403(para)
8710
"<emphasis>Network:</emphasis> allows configuration of the server's network "
8711
"options through eBox."
8714
#: serverguide/C/remote-administration.xml:409(para)
8716
"<emphasis>Firewall:</emphasis> configures firewall options for the eBox host."
8719
#: serverguide/C/remote-administration.xml:414(para)
8721
"<emphasis>UsersandGroups:</emphasis> this module will manage users and "
8722
"groups contained in an <application>OpenLDAP</application> LDAP directory."
8725
#: serverguide/C/remote-administration.xml:420(para)
8727
"<emphasis>DHCP:</emphasis> provides an interface for configuring a DHCP "
8731
#: serverguide/C/remote-administration.xml:425(para)
8733
"<emphasis>DNS:</emphasis> provides <application>BIND9</application> DNS "
8734
"server configuration options."
8737
#: serverguide/C/remote-administration.xml:431(para)
8739
"<emphasis>Objects:</emphasis> allow configuration of eBox <emphasis>Network "
8740
"Objects</emphasis>, which allow you to assign a name to an IP address or "
8744
#: serverguide/C/remote-administration.xml:438(para)
8746
"<emphasis>Services:</emphasis> displays configuration information for "
8747
"services that are available to the network."
8750
#: serverguide/C/remote-administration.xml:444(para)
8752
"<emphasis>Squid:</emphasis> configuration options for the "
8753
"<application>Squid</application> proxy server."
8756
#: serverguide/C/remote-administration.xml:450(para)
8758
"<emphasis>CA:</emphasis> configures a Certificate Authority for the server."
8761
#: serverguide/C/remote-administration.xml:455(para)
8762
msgid "<emphasis>NTP:</emphasis> set Network Time Protocol options."
8765
#: serverguide/C/remote-administration.xml:460(para)
8766
msgid "<emphasis>Printers:</emphasis> allows the configuration of printers."
8769
#: serverguide/C/remote-administration.xml:465(para)
8770
msgid "<emphasis>Samba:</emphasis> configuration options for Samba."
8773
#: serverguide/C/remote-administration.xml:470(para)
8775
"<emphasis>OpenVPN:</emphasis> setup options for OpenVPN Virtual Private "
8776
"Network application."
8779
#: serverguide/C/remote-administration.xml:481(para)
8781
"For more information see the <ulink url=\"http://ebox-platform.com/\">eBox "
8782
"Home Page</ulink>."
8785
#: serverguide/C/package-management.xml:13(title)
8786
msgid "Package Management"
8789
#: serverguide/C/package-management.xml:14(para)
8791
"Ubuntu features a comprehensive package management system for the "
8792
"installation, upgrade, configuration, and removal of software. In addition "
8793
"to providing access to an organized base of over 24,000 software packages "
8794
"for your Ubuntu computer, the package management facilities also feature "
8795
"dependency resolution capabilities and software update checking."
8798
#: serverguide/C/package-management.xml:16(para)
8800
"Several tools are available for interacting with Ubuntu's package management "
8801
"system, from simple command-line utilities which may be easily automated by "
8802
"system administrators, to a simple graphical interface which is easy to use "
8803
"by those new to Ubuntu."
8806
#: serverguide/C/package-management.xml:21(para)
8808
"Ubuntu's package management system is derived from the same system used by "
8809
"the Debian GNU/Linux distribution. The package files contain all of the "
8810
"necessary files, meta-data, and instructions to implement a particular "
8811
"functionality or software application on your Ubuntu computer."
8814
#: serverguide/C/package-management.xml:24(para)
8816
"Debian package files typically have the extension '.deb', and typically "
8817
"exist in <emphasis role=\"italics\">repositories</emphasis> which are "
8818
"collections of packages found on various media, such as CD-ROM discs, or "
8819
"online. Packages are normally of the pre-compiled binary format; thus "
8820
"installation is quick and requires no compiling of software."
8823
#: serverguide/C/package-management.xml:27(para)
8825
"Many complex packages use the concept of <emphasis "
8826
"role=\"italics\">dependencies</emphasis>. Dependencies are additional "
8827
"packages required by the principal package in order to function properly. "
8828
"For example, the speech synthesis package "
8829
"<application>Festival</application> depends upon the package "
8830
"<application>libasound2</application>, which is a package supplying the "
8831
"<application>ALSA</application> sound library needed for audio playback. In "
8832
"order for <application>Festival</application> to function, it and all of its "
8833
"dependencies must be installed. The software management tools in Ubuntu will "
8834
"do this automatically."
8837
#: serverguide/C/package-management.xml:32(title)
8841
#: serverguide/C/package-management.xml:34(para)
8843
"<application>dpkg</application> is a package manager for "
8844
"<emphasis>Debian</emphasis> based systems. It can install, remove, and build "
8845
"packages, but unlike other package management system's it can not "
8846
"automatically download and install packages and their dependencies. This "
8847
"section covers using <application>dpkg</application> to manage locally "
8848
"installed packages:"
8851
#: serverguide/C/package-management.xml:43(para)
8853
"To list all packages installed on the system, from a terminal prompt enter:"
8856
#: serverguide/C/package-management.xml:48(command)
8860
#: serverguide/C/package-management.xml:54(para)
8862
"Depending on the amount of packages on your system, this can generate a "
8863
"large amount of output. Pipe the output through "
8864
"<application>grep</application> to see if a specific package is installed:"
8867
#: serverguide/C/package-management.xml:60(command)
8868
msgid "dpkg -l | grep apache2"
8871
#: serverguide/C/package-management.xml:63(para)
8873
"Replace <emphasis>apache2</emphasis> with any package name, part of a "
8874
"package name, or other regular expression."
8877
#: serverguide/C/package-management.xml:70(para)
8879
"To list the files installed by a package, in this case the "
8880
"<application>ufw</application> package, enter:"
8883
#: serverguide/C/package-management.xml:75(command)
8887
#: serverguide/C/package-management.xml:81(para)
8889
"If you are not sure which package installed a file, <application>dpkg -"
8890
"S</application> may be able to tell you. For example:"
8893
#: serverguide/C/package-management.xml:87(command)
8894
msgid "dpkg -S /etc/host.conf"
8897
#: serverguide/C/package-management.xml:88(computeroutput)
8899
msgid "base-files: /etc/host.conf"
8902
#: serverguide/C/package-management.xml:91(para)
8904
"The output shows that the <filename>/etc/host.conf</filename> belongs to the "
8905
"<application>base-files</application> package."
8908
#: serverguide/C/package-management.xml:96(para)
8910
"Many files are automatically generated during the package install process, "
8911
"and even though they are on the filesystem <command>dpkg -S</command> may "
8912
"not know which package they belong to."
8915
#: serverguide/C/package-management.xml:105(para)
8916
msgid "You can install a local <emphasis>.deb</emphasis> file by entering:"
8919
#: serverguide/C/package-management.xml:110(command)
8920
msgid "sudo dpkg -i zip_2.32-1_i386.deb"
8923
#: serverguide/C/package-management.xml:113(para)
8925
"Change <filename>zip_2.32-1_i386.deb</filename> to the actual file name of "
8926
"the local .deb file."
8929
#: serverguide/C/package-management.xml:120(para)
8930
msgid "Uninstalling a package can be accomplished by:"
8933
#: serverguide/C/package-management.xml:125(command)
8934
msgid "sudo dpkg -r zip"
8937
#: serverguide/C/package-management.xml:129(para)
8939
"Uninstalling packages using <application>dpkg</application>, in most cases, "
8940
"is <emphasis>NOT</emphasis> recommended. It is better to use a package "
8941
"manager that handles dependencies, to ensure that the system is in a "
8942
"consistent state. For example using <command>dpkg -r</command> you can "
8943
"remove the <application>zip</application> package, but any packages that "
8944
"depend on it will still be installed and may no longer function correctly."
8947
#: serverguide/C/package-management.xml:140(para)
8949
"For more <application>dpkg</application> options see the man page: "
8950
"<command>man dpkg</command>."
8953
#: serverguide/C/package-management.xml:146(title)
8957
#: serverguide/C/package-management.xml:147(para)
8959
"The <application>apt-get</application> command is a powerful command-line "
8960
"tool used to work with Ubuntu's <emphasis>Advanced Packaging Tool</emphasis> "
8961
"(APT) performing such functions as installation of new software packages, "
8962
"upgrade of existing software packages, updating of the package list index, "
8963
"and even upgrading the entire Ubuntu system."
8966
#: serverguide/C/package-management.xml:150(para)
8968
"Being a simple command-line tool, <application>apt-get</application> has "
8969
"numerous advantages over other package management tools available in Ubuntu "
8970
"for server administrators. Some of these advantages include ease of use over "
8971
"simple terminal connections (SSH) and the ability to be used in system "
8972
"administration scripts, which can in turn be automated by the "
8973
"<application>cron</application> scheduling utility."
8976
#: serverguide/C/package-management.xml:157(para)
8978
"<emphasis role=\"bold\">Install a Package</emphasis>: Installation of "
8979
"packages using the <application>apt-get</application> tool is quite simple. "
8980
"For example, to install the network scanner <emphasis "
8981
"role=\"italics\">nmap</emphasis>, type the following: <screen>\n"
8982
"<command>sudo apt-get install nmap</command>\n"
8986
#: serverguide/C/package-management.xml:165(para)
8988
"<emphasis role=\"bold\">Remove a Package</emphasis>: Removal of a package or "
8989
"packages is also a straightforward and simple process. To remove the nmap "
8990
"package installed in the previous example, type the following: <screen>\n"
8991
"<command>sudo apt-get remove nmap</command>\n"
8995
#: serverguide/C/package-management.xml:172(para)
8997
"<emphasis role=\"bold\">Multiple Packages</emphasis>: You may specify "
8998
"multiple packages to be installed or removed, separated by spaces."
9001
#: serverguide/C/package-management.xml:175(para)
9003
"Also, adding the <emphasis>--purge</emphasis> options to <command>apt-get "
9004
"remove</command> will remove the package configuration files as well. This "
9005
"may or may not be the desired effect so use with caution."
9008
#: serverguide/C/package-management.xml:181(para)
9010
"<emphasis role=\"bold\">Update the Package Index</emphasis>: The APT package "
9011
"index is essentially a database of available packages from the repositories "
9012
"defined in the <filename>/etc/apt/sources.list</filename> file. To update "
9013
"the local package index with the latest changes made in repositories, type "
9014
"the following: <screen>\n"
9015
"<command>sudo apt-get update</command>\n"
9019
#: serverguide/C/package-management.xml:189(para)
9021
"<emphasis role=\"bold\">Upgrade Packages</emphasis>: Over time, updated "
9022
"versions of packages currently installed on your computer may become "
9023
"available from the package repositories (for example security updates). To "
9024
"upgrade your system, first update your package index as outlined above, and "
9025
"then type: <screen>\n"
9026
"<command>sudo apt-get upgrade</command>\n"
9030
#: serverguide/C/package-management.xml:195(para)
9032
"For information on upgrading to a new Ubuntu release see <xref "
9033
"linkend=\"installing-upgrading\"/>."
9036
#: serverguide/C/package-management.xml:153(para)
9038
"Some examples of popular uses for the <application>apt-get</application> "
9039
"utility: <placeholder-1/>"
9042
#: serverguide/C/package-management.xml:201(para)
9044
"Actions of the <application>apt-get</application> command, such as "
9045
"installation and removal of packages, are logged in the /var/log/dpkg.log "
9049
#: serverguide/C/package-management.xml:204(para)
9051
"For further information about the use of <application>APT</application>, "
9052
"read the comprehensive <ulink url=\"http://www.debian.org/doc/user-"
9053
"manuals#apt-howto\">Debian APT User Manual</ulink> or type: <screen>apt-get "
9057
#: serverguide/C/package-management.xml:208(title)
9061
#: serverguide/C/package-management.xml:209(para)
9063
"<application>Aptitude</application> is a menu-driven, text-based front-end "
9064
"to the <emphasis>Advanced Packaging Tool</emphasis> (APT) system. Many of "
9065
"the common package management functions, such as installation, removal, and "
9066
"upgrade, are performed in <application>Aptitude</application> with single-"
9067
"key commands, which are typically lowercase letters."
9070
#: serverguide/C/package-management.xml:212(para)
9072
"<application>Aptitude</application> is best suited for use in a non-"
9073
"graphical terminal environment to ensure proper functioning of the command "
9074
"keys. You may start <application>Aptitude</application> as a normal user "
9075
"with the following command at a terminal prompt: <screen>\n"
9076
"<command>sudo aptitude</command>\n"
9080
#: serverguide/C/package-management.xml:219(para)
9082
"When <application>Aptitude</application> starts, you will see a menu bar at "
9083
"the top of the screen and two panes below the menu bar. The top pane "
9084
"contains package categories, such as <emphasis role=\"italics\">New "
9085
"Packages</emphasis> and <emphasis role=\"italics\">Not Installed "
9086
"Packages</emphasis>. The bottom pane contains information related to the "
9087
"packages and package categories."
9090
#: serverguide/C/package-management.xml:222(para)
9092
"Using <application>Aptitude</application> for package management is "
9093
"relatively straightforward, and the user interface makes common tasks simple "
9094
"to perform. The following are examples of common package management "
9095
"functions as performed in <application>Aptitude</application>:"
9098
#: serverguide/C/package-management.xml:226(para)
9100
"<emphasis role=\"bold\">Install Packages</emphasis>: To install a package, "
9101
"locate the package via the Not Installed Packages package category, for "
9102
"example, by using the keyboard arrow keys and the <keycap>ENTER</keycap> "
9103
"key, and highlight the package you wish to install. After highlighting the "
9104
"package you wish to install, press the <keycap>+</keycap> key, and the "
9105
"package entry should turn <emphasis role=\"italics\">green</emphasis>, "
9106
"indicating it has been marked for installation. Now press <keycap>g</keycap> "
9107
"to be presented with a summary of package actions. Press <keycap>g</keycap> "
9108
"again, and you will be prompted to become root to complete the installation. "
9109
"Press <keycap>ENTER</keycap> which will result in a Password: prompt. Enter "
9110
"your user password to become root. Finally, press <keycap>g</keycap> once "
9111
"more and you'll be prompted to download the package. Press "
9112
"<keycap>ENTER</keycap> on the <emphasis role=\"italics\">Continue</emphasis> "
9113
"prompt, and downloading and installation of the package will commence."
9116
#: serverguide/C/package-management.xml:230(para)
9118
"<emphasis role=\"bold\">Remove Packages</emphasis>: To remove a package, "
9119
"locate the package via the Installed Packages package category, for example, "
9120
"by using the keyboard arrow keys and the <keycap>ENTER</keycap> key, and "
9121
"highlight the package you wish to remove. After highlighting the package you "
9122
"wish to install, press the <keycap>-</keycap> key, and the package entry "
9123
"should turn <emphasis role=\"italics\">pink</emphasis>, indicating it has "
9124
"been marked for removal. Now press <keycap>g</keycap> to be presented with a "
9125
"summary of package actions. Press <keycap>g</keycap> again, and you will be "
9126
"prompted to become root to complete the installation. Press "
9127
"<keycap>ENTER</keycap> which will result in a Password: prompt. Enter your "
9128
"user password to become root. Finally, press <keycap>g</keycap> once more, "
9129
"and you'll be prompted to download the package. Press <keycap>ENTER</keycap> "
9130
"on the <emphasis role=\"italics\">Continue</emphasis> prompt, and removal of "
9131
"the package will commence."
9134
#: serverguide/C/package-management.xml:234(para)
9136
"<emphasis role=\"bold\">Update Package Index</emphasis>: To update the "
9137
"package index, simply press the <keycap>u</keycap> key and you will be "
9138
"prompted to become root to complete the update. Press <keycap>ENTER</keycap> "
9139
"which will result in a Password: prompt. Enter your user password to become "
9140
"root. Updating of the package index will commence. Press "
9141
"<keycap>ENTER</keycap> on the OK prompt when the download dialog is "
9142
"presented to complete the process."
9145
#: serverguide/C/package-management.xml:238(para)
9147
"<emphasis role=\"bold\">Upgrade Packages</emphasis>: To upgrade packages, "
9148
"perform the update of the package index as detailed above, and then press "
9149
"the <keycap>U</keycap> key to mark all packages with updates. Now press "
9150
"<keycap>g</keycap> whereby you'll be presented with a summary of package "
9151
"actions. Press <keycap>g</keycap> again, and you will be prompted to become "
9152
"root to complete the installation. Press <keycap>ENTER</keycap> which will "
9153
"result in a Password: prompt. Enter your user password to become root. "
9154
"Finally, press <keycap>g</keycap> once more, and you'll be prompted to "
9155
"download the packages. Press <keycap>ENTER</keycap> on the <emphasis "
9156
"role=\"italics\">Continue</emphasis> prompt, and upgrade of the packages "
9160
#: serverguide/C/package-management.xml:245(para)
9161
msgid "<emphasis role=\"bold\">i</emphasis>: Installed package"
9164
#: serverguide/C/package-management.xml:250(para)
9166
"<emphasis role=\"bold\">c</emphasis>: Package not installed, but package "
9167
"configuration remains on system"
9170
#: serverguide/C/package-management.xml:254(para)
9171
msgid "<emphasis role=\"bold\">p</emphasis>: Purged from system"
9174
#: serverguide/C/package-management.xml:258(para)
9175
msgid "<emphasis role=\"bold\">v</emphasis>: Virtual package"
9178
#: serverguide/C/package-management.xml:262(para)
9179
msgid "<emphasis role=\"bold\">B</emphasis>: Broken package"
9182
#: serverguide/C/package-management.xml:266(para)
9184
"<emphasis role=\"bold\">u</emphasis>: Unpacked files, but package not yet "
9188
#: serverguide/C/package-management.xml:270(para)
9190
"<emphasis role=\"bold\">C</emphasis>: Half-configured - Configuration failed "
9194
#: serverguide/C/package-management.xml:274(para)
9196
"<emphasis role=\"bold\">H</emphasis>: Half-installed - Removal failed and "
9200
#: serverguide/C/package-management.xml:242(para)
9202
"The first column of information displayed in the package list in the top "
9203
"pane, when actually viewing packages lists the current state of the package, "
9204
"and uses the following key to describe the state of the package: "
9208
#: serverguide/C/package-management.xml:280(para)
9210
"To exit Aptitude, simply press the <keycap>q</keycap> key and confirm you "
9211
"wish to exit. Many other functions are available from the Aptitude menu by "
9212
"pressing the <keycap>F10</keycap> key."
9215
#: serverguide/C/package-management.xml:285(title)
9216
msgid "Automatic Updates"
9219
#: serverguide/C/package-management.xml:287(para)
9221
"The <application>unattended-upgrades</application> package can be used to "
9222
"automatically install updated packages, and can be configured to update all "
9223
"packages or just install security updates. First, install the package by "
9224
"entering the following in a terminal:"
9227
#: serverguide/C/package-management.xml:293(command)
9228
msgid "sudo apt-get install unattended-upgrades"
9231
#: serverguide/C/package-management.xml:296(para)
9233
"To configure <application>unattended-upgrades</application>, edit "
9234
"<filename>/etc/apt/apt.conf.d/50unattended-upgrades</filename> and adjust "
9235
"the following to fit your needs:"
9238
#: serverguide/C/package-management.xml:301(programlisting)
9242
"Unattended-Upgrade::Allowed-Origins {\n"
9243
" \"Ubuntu jaunty-security\";\n"
9244
"// \"Ubuntu jaunty-updates\";\n"
9248
#: serverguide/C/package-management.xml:308(para)
9250
"Certain packages can also be <emphasis>blacklisted</emphasis> and therefore "
9251
"will not be automatically updated. To blacklist a package, add it to the "
9255
#: serverguide/C/package-management.xml:313(programlisting)
9259
"Unattended-Upgrade::Package-Blacklist {\n"
9262
"// \"libc6-dev\";\n"
9263
"// \"libc6-i686\";\n"
9267
#: serverguide/C/package-management.xml:323(para)
9269
"The double <emphasis><quote>//</quote></emphasis> serve as comments, so "
9270
"whatever follows \"//\" will not be evaluated."
9273
#: serverguide/C/package-management.xml:328(para)
9275
"The results of <application>unattended-upgrades</application> will be logged "
9276
"to <filename>/var/log/unattended-upgrades</filename>."
9279
#: serverguide/C/package-management.xml:333(title)
9280
msgid "Notifications"
9283
#: serverguide/C/package-management.xml:335(para)
9285
"Configuring <emphasis>Unattended-Upgrade::Mail</emphasis> in "
9286
"<filename>/etc/apt/apt.conf.d/50unattended-upgrades</filename> will enable "
9287
"<application>unattended-upgrades</application> to email an administrator "
9288
"detailing any packages that need upgrading or have problems."
9291
#: serverguide/C/package-management.xml:340(para)
9293
"Another useful package is <application>apticron</application>. "
9294
"<application>apticron</application> will configure a "
9295
"<application>cron</application> job to email an administrator information "
9296
"about any packages on the system that need updated as well as a summary of "
9297
"changes in each package."
9300
#: serverguide/C/package-management.xml:346(para)
9302
"To install the <application>apticron</application> package, in a terminal "
9306
#: serverguide/C/package-management.xml:351(command)
9307
msgid "sudo apt-get install apticron"
9310
#: serverguide/C/package-management.xml:354(para)
9312
"Once the package is installed edit "
9313
"<filename>/etc/apticron/apticron.conf</filename>, to set the email address "
9314
"and other options:"
9317
#: serverguide/C/package-management.xml:358(programlisting)
9321
"EMAIL=\"root@example.com\"\n"
9324
#: serverguide/C/package-management.xml:367(para)
9326
"Configuration of the <emphasis>Advanced Packaging Tool</emphasis> (APT) "
9327
"system repositories is stored in the /etc/apt/sources.list configuration "
9328
"file. An example of this file is referenced here, along with information on "
9329
"adding or removing repository references from the file."
9332
#: serverguide/C/package-management.xml:373(para)
9334
"<ulink url=\"../sample/sources.list\">Here</ulink> is a simple example of a "
9335
"typical <filename>/etc/apt/sources.list</filename> file."
9338
#: serverguide/C/package-management.xml:377(para)
9340
"You may edit the file to enable repositories or disable them. For example, "
9341
"to disable the requirement of inserting the Ubuntu CD-ROM whenever package "
9342
"operations occur, simply comment out the appropriate line for the CD-ROM, "
9343
"which appears at the top of the file:"
9346
#: serverguide/C/package-management.xml:382(screen)
9350
"# no more prompting for CD-ROM please\n"
9351
"# deb cdrom:[Ubuntu 9.04_Jaunty_Jackalope - Release i386 (20070419.1)]/ "
9352
"jaunty main restricted\n"
9355
#: serverguide/C/package-management.xml:388(title)
9356
msgid "Extra Repositories"
9359
#: serverguide/C/package-management.xml:389(para)
9361
"In addition to the officially supported package repositories available for "
9362
"Ubuntu, there exist additional community-maintained repositories which add "
9363
"thousands more potential packages for installation. Two of the most popular "
9364
"are the <emphasis>Universe</emphasis> and <emphasis>Multiverse</emphasis> "
9365
"repositories. These repositories are not officially supported by Ubuntu, but "
9366
"because they are maintained by the community they generally provide packages "
9367
"which are safe for use with your Ubuntu computer."
9370
#: serverguide/C/package-management.xml:392(para)
9372
"Packages in the <emphasis>Multiverse</emphasis> repository often have "
9373
"licensing issues that prevent them from being distributed with a free "
9374
"operating system, and they may be illegal in your locality."
9377
#: serverguide/C/package-management.xml:394(para)
9379
"Be advised that neither the <emphasis>Universe</emphasis> or "
9380
"<emphasis>Multiverse</emphasis> repositories contain officially supported "
9381
"packages. In particular, there may not be security updates for these "
9385
#: serverguide/C/package-management.xml:398(para)
9387
"Many other package sources are available, sometimes even offering only one "
9388
"package, as in the case of package sources provided by the developer of a "
9389
"single application. You should always be very careful and cautious when "
9390
"using non-standard package sources, however. Research the source and "
9391
"packages carefully before performing any installation, as some package "
9392
"sources and their packages could render your system unstable or non-"
9393
"functional in some respects."
9396
#: serverguide/C/package-management.xml:401(para)
9398
"By default, the <emphasis>Universe</emphasis> and "
9399
"<emphasis>Multiverse</emphasis> repositories are enabled but if you would "
9400
"like to disable them edit <filename>/etc/apt/sources.list</filename> and "
9401
"comment the following lines:"
9404
#: serverguide/C/package-management.xml:408(programlisting)
9408
"deb http://archive.ubuntu.com/ubuntu jaunty universe multiverse\n"
9409
"deb-src http://archive.ubuntu.com/ubuntu jaunty universe multiverse\n"
9411
"deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe\n"
9412
"deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty universe\n"
9413
"deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates universe\n"
9414
"deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty-updates universe\n"
9416
"deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse\n"
9417
"deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse\n"
9418
"deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse\n"
9419
"deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse\n"
9421
"deb http://security.ubuntu.com/ubuntu jaunty-security universe\n"
9422
"deb-src http://security.ubuntu.com/ubuntu jaunty-security universe\n"
9423
"deb http://security.ubuntu.com/ubuntu jaunty-security multiverse\n"
9424
"deb-src http://security.ubuntu.com/ubuntu jaunty-security multiverse\n"
9427
#: serverguide/C/package-management.xml:434(para)
9429
"Most of the material covered in this chapter is available in "
9430
"<application>man</application> pages, many of which are available online."
9433
#: serverguide/C/package-management.xml:441(para)
9435
"For more <application>dpkg</application> details see the <ulink "
9436
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man1/dpkg.1.html\">dpkg "
9440
#: serverguide/C/package-management.xml:447(para)
9442
"The <ulink url=\"http://www.debian.org/doc/manuals/apt-howto/\">APT "
9443
"HOWTO</ulink> and <ulink "
9444
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/apt-"
9445
"get.8.html\">apt-get man page</ulink> contain useful information regarding "
9446
"<application>apt-get</application> usage."
9449
#: serverguide/C/package-management.xml:454(para)
9452
"url=\"http://manpages.ubuntu.com/manpages/jaunty/man8/aptitude.8.html\">aptit"
9453
"ude man page</ulink> for more <application>aptitude</application> options."
9456
#: serverguide/C/package-management.xml:460(para)
9459
"url=\"https://help.ubuntu.com/community/Repositories/Ubuntu\">Adding "
9460
"Repositories HOWTO (Ubuntu Wiki)</ulink> page contains more details on "
9461
"adding repositories."
9464
#: serverguide/C/other-apps.xml:13(title)
9465
msgid "Other Useful Applications"
9468
#: serverguide/C/other-apps.xml:15(para)
9470
"There are many very useful applications developed by the Ubuntu Server Team, "
9471
"and others that are well integrated with Ubuntu Server Edition, that might "
9472
"not be well known. This chapter will showcase some useful applications that "
9473
"can make administering an Ubuntu server, or many Ubuntu servers, that much "
9477
#: serverguide/C/other-apps.xml:23(title)
9481
#: serverguide/C/other-apps.xml:25(para)
9483
"When logging into an Ubuntu server you may have noticed the informative "
9484
"Message Of The Day (MOTD). This information is obtained and displayed using "
9485
"a couple of packages:"
9488
#: serverguide/C/other-apps.xml:32(para)
9490
"<emphasis>landscape-common:</emphasis> provides the core libraries of "
9491
"<application>landscape-client</application>, which can be used to manage "
9492
"systems using the web based <emphasis>Landscape</emphasis> application. The "
9493
"package includes the <application>/usr/bin/landscape-sysinfo</application> "
9494
"utility which is used to gather the information displayed in the MOTD."
9497
#: serverguide/C/other-apps.xml:40(para)
9499
"<emphasis>update-motd:</emphasis> is used to automatically update the MOTD "
9500
"via <application>cron</application>."
9503
#: serverguide/C/other-apps.xml:46(para)
9505
"The <application>update-motd</application> utility has several options to "
9506
"further customize the MOTD:"
9509
#: serverguide/C/other-apps.xml:52(para)
9511
"<emphasis>--disable:</emphasis> prevents automatic updates of the MOTD. "
9512
"Using this option creates the <filename>/var/lib/update-"
9513
"motd/disabled</filename> file, which if present stops <application>update-"
9514
"motd</application> from modifying <filename>/etc/motd</filename>."
9517
#: serverguide/C/other-apps.xml:59(para)
9519
"<emphasis>--enable:</emphasis> enables the automatic MOTD updates. If "
9520
"<filename>/var/lib/update-motd</filename> is present it will be removed."
9523
#: serverguide/C/other-apps.xml:65(para)
9525
"<emphasis>--force:</emphasis> does a one time update of "
9526
"<filename>/etc/motd</filename>, overriding <application>update-"
9527
"motd</application> if it has been disabled."
9530
#: serverguide/C/other-apps.xml:71(para)
9532
"<emphasis>d, hourly, weekly, monthly:</emphasis> option will run the scripts "
9533
"in <filename>/etc/update-motd.d/</filename> (default), <filename>/etc/update-"
9534
"motd.d/hourly</filename>, <filename>/etc/update-motd.d/weekly</filename>, or "
9535
"<filename>/etc/update-motd.d/monthly</filename> respectively."
9538
#: serverguide/C/other-apps.xml:79(para)
9540
"<application>update-motd</application> executes the scripts in "
9541
"<filename>/etc/update-motd.d</filename> in order based on the number "
9542
"prepended to the script. Separate <application>cron</application> scripts "
9543
"execute every ten minutes, hourly, weekly, and monthly running the "
9544
"corresponding scripts in <filename>/etc/update-motd.d</filename>. The output "
9545
"of the scripts is written to <filename>/var/run/update-motd/</filename>, "
9546
"keeping the numerical order, then concatenated with "
9547
"<filename>/etc/motd.tail</filename> and written to "
9548
"<filename>/etc/motd</filename>."
9551
#: serverguide/C/other-apps.xml:87(para)
9553
"You can add your own dynamic information to the MOTD. For example, to add "
9554
"local weather information:"
9557
#: serverguide/C/other-apps.xml:93(para)
9558
msgid "First, install the <application>weather-util</application> package:"
9561
#: serverguide/C/other-apps.xml:98(command)
9562
msgid "sudo apt-get install weather-util"
9565
#: serverguide/C/other-apps.xml:103(para)
9567
"The <application>weather</application> utility uses METAR data from the "
9568
"National Oceanic and Atmospheric Administration and forecasts from the "
9569
"National Weather Service. In order to find local information you will need "
9570
"the 4-character ICAO location indicator. This can be determined by browsing "
9571
"to the <ulink url=\"http://www.weather.gov/tg/siteloc.shtml\">National "
9572
"Weather Service</ulink> site."
9575
#: serverguide/C/other-apps.xml:110(para)
9577
"Although the National Weather Service is a United States government agency "
9578
"there are weather stations available world wide. However, local weather "
9579
"information for all locations outside the U.S. may not be available."
9582
#: serverguide/C/other-apps.xml:116(para)
9584
"Create <filename>/usr/local/bin/local-weather</filename>, a simple shell "
9585
"script to use <application>weather</application> with your local ICAO "
9589
#: serverguide/C/other-apps.xml:121(programlisting)
9594
"##########################################################################\n"
9596
"# Prints the local weather to /var/run/update-motd/60-local-weather \n"
9597
"# for update-motd.\n"
9599
"##########################################################################\n"
9601
"# Replace KINT with your local weather station.\n"
9602
"# Local stations can be found here: http://www.weather.gov/tg/siteloc.shtml\n"
9604
"echo \"\" > /var/run/update-motd/60-local-weather\n"
9605
"weather -i KINT >> /var/run/update-motd/60-local-weather\n"
9609
#: serverguide/C/other-apps.xml:139(para)
9610
msgid "Make the script executable:"
9613
#: serverguide/C/other-apps.xml:144(command)
9614
msgid "sudo chmod 755 /usr/local/bin/local-weather"
9617
#: serverguide/C/other-apps.xml:148(para)
9619
"Next, create a symlink to <filename>/etc/update-motd.d/60-local-"
9620
"weather</filename>:"
9623
#: serverguide/C/other-apps.xml:153(command)
9625
"sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/60-local-weather"
9628
#: serverguide/C/other-apps.xml:157(para)
9629
msgid "Finally, update the MOTD:"
9632
#: serverguide/C/other-apps.xml:162(command)
9633
msgid "sudo update-motd"
9636
#: serverguide/C/other-apps.xml:167(para)
9638
"You should now be greeted with some useful information, and some information "
9639
"about the local weather that may not be quite so useful. Hopefully the "
9640
"<application>local-weather</application> example demonstrates the "
9641
"flexibility of <application>update-motd</application>."
9644
#: serverguide/C/other-apps.xml:175(title)
9648
#: serverguide/C/other-apps.xml:177(para)
9650
"<application>etckeeper</application> allows the contents of <filename "
9651
"role=\"directory\">/etc</filename> be easily stored in Version Control "
9652
"System (VCS) repository. It hooks into <application>apt</application> to "
9653
"automatically commit changes to <filename>/etc</filename> when packages are "
9654
"installed or upgraded. Placing <filename>/etc</filename> under version "
9655
"control is considered an industry best practice, and the goal of "
9656
"<application>etckeeper</application> is to make this process as painless as "
9660
#: serverguide/C/other-apps.xml:185(para)
9662
"Install <application>etckeeper</application> by entering the following in a "
9666
#: serverguide/C/other-apps.xml:190(command)
9667
msgid "sudo apt-get install etckeeper"
9670
#: serverguide/C/other-apps.xml:193(para)
9672
"The main configuration file, "
9673
"<filename>/etc/etckeeper/etckeeper.conf</filename>, is fairly simple. The "
9674
"main options being which VCS and which package management system to use. By "
9675
"default <application>etckeeper</application> is configured to use "
9676
"<application>bzr</application> for version control, "
9677
"<application>apt</application> for high level package mangement, and "
9678
"<application>dpkg</application> for low level package management."
9681
#: serverguide/C/other-apps.xml:200(para)
9683
"With the package installed, it is time to initialize the repository. In a "
9687
#: serverguide/C/other-apps.xml:205(command)
9688
msgid "sudo etckeeper init"
9691
#: serverguide/C/other-apps.xml:208(para)
9692
msgid "Next, commit the files to the repository:"
9695
#: serverguide/C/other-apps.xml:213(command)
9696
msgid "sudo etckeeper commit \"initial import\""
9699
#: serverguide/C/other-apps.xml:216(para)
9701
"Using the VCS commands you can view log information about files in "
9702
"<filename>/etc</filename>:"
9705
#: serverguide/C/other-apps.xml:221(command)
9706
msgid "sudo bzr log /etc/passswd"
9709
#: serverguide/C/other-apps.xml:224(para)
9711
"To demonstrate the integration with the package management system, install "
9712
"<application>postfix</application>:"
9715
#: serverguide/C/other-apps.xml:229(command) serverguide/C/mail.xml:38(command)
9716
msgid "sudo apt-get install postfix"
9719
#: serverguide/C/other-apps.xml:232(para)
9721
"When the installation is finished, all the "
9722
"<application>postfix</application> configuration files should be committed "
9723
"to the repository:"
9726
#: serverguide/C/other-apps.xml:238(computeroutput)
9729
"Committing to: /etc/\n"
9730
"added aliases.db\n"
9733
"modified gshadow\n"
9734
"modified gshadow-\n"
9736
"modified passwd-\n"
9738
"added resolvconf\n"
9741
"modified shadow-\n"
9742
"added init.d/postfix\n"
9743
"added network/if-down.d/postfix\n"
9744
"added network/if-up.d/postfix\n"
9745
"added postfix/dynamicmaps.cf\n"
9746
"added postfix/main.cf\n"
9747
"added postfix/master.cf\n"
9748
"added postfix/post-install\n"
9749
"added postfix/postfix-files\n"
9750
"added postfix/postfix-script\n"
9751
"added postfix/sasl\n"
9752
"added ppp/ip-down.d\n"
9753
"added ppp/ip-down.d/postfix\n"
9754
"added ppp/ip-up.d/postfix\n"
9755
"added rc0.d/K20postfix\n"
9756
"added rc1.d/K20postfix\n"
9757
"added rc2.d/S20postfix\n"
9758
"added rc3.d/S20postfix\n"
9759
"added rc4.d/S20postfix\n"
9760
"added rc5.d/S20postfix\n"
9761
"added rc6.d/K20postfix\n"
9762
"added resolvconf/update-libc.d\n"
9763
"added resolvconf/update-libc.d/postfix\n"
9764
"added rsyslog.d/postfix.conf\n"
9765
"added ufw/applications.d/postfix\n"
9766
"Committed revision 2."
9769
#: serverguide/C/other-apps.xml:278(para)
9771
"For an example of how <application>etckeeper</application> tracks manual "
9772
"changes, add new a host to <filename>/etc/hosts</filename>. Using "
9773
"<application>bzr</application> you can see which files have been modified:"
9776
#: serverguide/C/other-apps.xml:284(command)
9777
msgid "sudo bzr status /etc/"
9780
#: serverguide/C/other-apps.xml:285(computeroutput)
9787
#: serverguide/C/other-apps.xml:289(para)
9788
msgid "Now commit the changes:"
9791
#: serverguide/C/other-apps.xml:294(command)
9792
msgid "sudo etckeeper commit \"new host\""
9795
#: serverguide/C/other-apps.xml:297(para)
9797
"For more information on <application>bzr</application> see <xref "
9798
"linkend=\"bazaar\"/>."
9801
#: serverguide/C/other-apps.xml:303(title)
9802
msgid "Screen Profiles"
9805
#: serverguide/C/other-apps.xml:305(para)
9807
"One of the most useful applications for any system administrator is "
9808
"<application>screen</application>. It allows the execution of multiple "
9809
"shells in one terminal. To make some of the advanced "
9810
"<application>screen</application> features more user friendly, and provide "
9811
"some useful information about the system, the <application>screen-"
9812
"profiles</application> package was created."
9815
#: serverguide/C/other-apps.xml:312(para)
9817
"When executing <application>screen</application> for the first time you will "
9818
"be presented with the <application>screen-profiles-helper</application> "
9819
"menu. This menu will allow you to:"
9822
#: serverguide/C/other-apps.xml:318(para)
9823
msgid "View the Help menu"
9826
#: serverguide/C/other-apps.xml:319(para)
9827
msgid "Change the key binding set"
9830
#: serverguide/C/other-apps.xml:320(para)
9831
msgid "Change screen profiles"
9834
#: serverguide/C/other-apps.xml:321(para)
9835
msgid "Change the escape sequence"
9838
#: serverguide/C/other-apps.xml:322(para)
9839
msgid "Create new screen windows"
9842
#: serverguide/C/other-apps.xml:323(para)
9843
msgid "Manage the default windows"
9846
#: serverguide/C/other-apps.xml:324(para)
9847
msgid "Install screen by default at login"
9850
#: serverguide/C/other-apps.xml:327(para)
9852
"The <emphasis>key bindings</emphasis> determine such things as the escape "
9853
"sequence, new window, change window, etc. There are two key binding sets to "
9854
"choose from <emphasis>common</emphasis> and <emphasis>none</emphasis>. If "
9855
"you wish to use the original key bindings choose the "
9856
"<emphasis>none</emphasis> set."
9859
#: serverguide/C/other-apps.xml:333(para)
9861
"The Ubuntu <application>screen-profiles</application> provide a menu which "
9862
"displays the Ubuntu release, processor information, memory information, and "
9863
"the time and date. The effect is similar to a desktop menu. When a profile "
9864
"is selected it will be symlinked to <filename>~/.screenrc</filename>. The "
9865
"<application>select-screen-profile</application> utility can also be used to "
9866
"change profiles, in a terminal enter:"
9869
#: serverguide/C/other-apps.xml:341(command)
9870
msgid "select-screen-profile -s ubuntu-light"
9873
#: serverguide/C/other-apps.xml:344(para)
9875
"The <emphasis>plain</emphasis> profile will change "
9876
"<application>screen</application> back to the defaults, which does not "
9877
"include the information menu at the bottom."
9880
#: serverguide/C/other-apps.xml:349(para)
9882
"Using the <emphasis>\"Install screen by default at login\"</emphasis> option "
9883
"will cause screen to be executed any time a terminal is opened. Changes made "
9884
"to <application>screen</application> are on a per user basis, and will not "
9885
"affect other users on the system."
9888
#: serverguide/C/other-apps.xml:354(para)
9890
"One difference when using screen is the <emphasis>scrollback</emphasis> "
9891
"mode. If you are using one of the Ubuntu profiles press the "
9892
"<emphasis>F7</emphasis>, or <emphasis>Ctrl+a+[</emphasis> if not, to enter "
9893
"scrollback mode. Scrollback mode allows you to navigate past output using "
9894
"<emphasis>vi</emphasis> like commands. Here is a quick list of movement "
9898
#: serverguide/C/other-apps.xml:361(para)
9899
msgid "<emphasis>h</emphasis> - Move the cursor left by one character"
9902
#: serverguide/C/other-apps.xml:362(para)
9903
msgid "<emphasis>j</emphasis> - Move the cursor down by one line"
9906
#: serverguide/C/other-apps.xml:363(para)
9907
msgid "<emphasis>k</emphasis> - Move the cursor up by one line"
9910
#: serverguide/C/other-apps.xml:364(para)
9911
msgid "<emphasis>l</emphasis> - Move the cursor right by one character"
9914
#: serverguide/C/other-apps.xml:365(para)
9915
msgid "<emphasis>0</emphasis> - Move to the beginning of the current line"
9918
#: serverguide/C/other-apps.xml:366(para)
9919
msgid "<emphasis>$</emphasis> - Move to the end of the current line"
9922
#: serverguide/C/other-apps.xml:367(para)
9924
"<emphasis>G</emphasis> - Moves to the specified line (defaults to the end of "
9928
#: serverguide/C/other-apps.xml:368(para)
9929
msgid "<emphasis>C-u</emphasis> - Scrolls a half page up"
9932
#: serverguide/C/other-apps.xml:369(para)
9933
msgid "<emphasis>C-b</emphasis> - Scrolls a full page up"
9936
#: serverguide/C/other-apps.xml:370(para)
9937
msgid "<emphasis>C-d</emphasis> - Scrolls a half page down"
9940
#: serverguide/C/other-apps.xml:371(para)
9941
msgid "<emphasis>C-f</emphasis> - Scrolls the full page down"
9944
#: serverguide/C/other-apps.xml:372(para)
9945
msgid "<emphasis>/</emphasis> - Search forward"
9948
#: serverguide/C/other-apps.xml:373(para)
9949
msgid "<emphasis>?</emphasis> - Search backward"
9952
#: serverguide/C/other-apps.xml:374(para)
9954
"<emphasis>n</emphasis> - Moves to the next match, either forward or backword"
9957
#: serverguide/C/other-apps.xml:383(para)
9960
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man1/update-"
9961
"motd.1.html\">update-motd man page</ulink> for more options available to "
9962
"<application>update-motd</application>."
9965
#: serverguide/C/other-apps.xml:389(para)
9967
"The Debian Package of the Day <ulink "
9968
"url=\"http://debaday.debian.net/2007/10/04/weather-check-weather-conditions-"
9969
"and-forecasts-on-the-command-line/\">weather</ulink> article has more "
9970
"details about using the <application>weather</application>utility."
9973
#: serverguide/C/other-apps.xml:396(para)
9976
"url=\"http://kitenet.net/~joey/code/etckeeper/\">etckeeper</ulink> site for "
9977
"more details on using <application>etckeeper</application>."
9980
#: serverguide/C/other-apps.xml:402(para)
9982
"For the latest news and information about <application>bzr</application> see "
9983
"the <ulink url=\"http://bazaar-vcs.org/\">bzr</ulink> web site."
9986
#: serverguide/C/other-apps.xml:407(para)
9988
"For more information on <application>screen</application> see the <ulink "
9989
"url=\"http://www.gnu.org/software/screen/\">screen web site</ulink>."
9992
#: serverguide/C/other-apps.xml:412(para)
9994
"Also, see the <application>screen-profiles</application><ulink "
9995
"url=\"https://launchpad.net/screen-profiles\">project page</ulink> for more "
9999
#: serverguide/C/network-config.xml:13(title)
10003
#: serverguide/C/network-config.xml:14(para)
10005
"Networks consist of two or more devices, such as computer systems, printers, "
10006
"and related equipment which are connected by either physical cabling or "
10007
"wireless links for the purpose of sharing and distributing information among "
10008
"the connected devices."
10011
#: serverguide/C/network-config.xml:20(para)
10013
"This section provides general and specific information pertaining to "
10014
"networking, including an overview of network concepts and detailed "
10015
"discussion of popular network protocols."
10018
#: serverguide/C/network-config.xml:26(title)
10019
msgid "Network Configuration"
10022
#: serverguide/C/network-config.xml:27(para)
10024
"Ubuntu ships with a number of graphical utilities to configure your network "
10025
"devices. This document is geared toward server administrators and will focus "
10026
"on managing your network on the command line."
10029
#: serverguide/C/network-config.xml:33(title)
10033
#: serverguide/C/network-config.xml:34(para)
10035
"Most Ethernet configuration is centralized in a single file, "
10036
"<filename>/etc/network/interfaces</filename>. If you have no Ethernet "
10037
"devices, only the loopback interface will appear in this file, and it will "
10038
"look something like this:"
10041
#: serverguide/C/network-config.xml:40(programlisting)
10045
"# This file describes the network interfaces available on your system\n"
10046
"# and how to activate them. For more information, see interfaces(5).\n"
10048
"# The loopback network interface\n"
10050
"iface lo inet loopback\n"
10051
"address 127.0.0.1\n"
10052
"netmask 255.0.0.0\n"
10055
#: serverguide/C/network-config.xml:50(para)
10057
"If you have only one Ethernet device, eth0, and it gets its configuration "
10058
"from a DHCP server, and it should come up automatically at boot, only two "
10059
"additional lines are required:"
10062
#: serverguide/C/network-config.xml:55(programlisting)
10067
"iface eth0 inet dhcp\n"
10070
#: serverguide/C/network-config.xml:59(para)
10072
"The first line specifies that the eth0 device should come up automatically "
10073
"when you boot. The second line means that interface (<quote>iface</quote>) "
10074
"eth0 should have an IPv4 address space (replace <quote>inet</quote> with "
10075
"<quote>inet6</quote> for an IPv6 device) and that it should get its "
10076
"configuration automatically from DHCP. Assuming your network and DHCP server "
10077
"are properly configured, this machine's network should need no further "
10078
"configuration to operate properly. The DHCP server will provide the default "
10079
"gateway (implemented via the <application>route</application> command), the "
10080
"device's IP address (implemented via the <application>ifconfig</application> "
10081
"command), and DNS servers used on the network (implemented in the "
10082
"<filename>/etc/resolv.conf</filename> file.)"
10085
#: serverguide/C/network-config.xml:72(para)
10087
"To configure your Ethernet device with a static IP address and custom "
10088
"configuration, some more information will be required. Suppose you want to "
10089
"assign the IP address 192.168.0.2 to the device eth1, with the typical "
10090
"netmask of 255.255.255.0. Your default gateway's IP address is 192.168.0.1. "
10091
"You would enter something like this into "
10092
"<filename>/etc/network/interfaces</filename>:"
10095
#: serverguide/C/network-config.xml:79(programlisting)
10099
"iface eth1 inet static\n"
10100
"\taddress 192.168.0.2\n"
10101
"\tnetmask 255.255.255.0\n"
10102
"\tgateway 192.168.0.1\n"
10105
#: serverguide/C/network-config.xml:85(para)
10107
"In this case, you will need to specify your DNS servers manually in "
10108
"<filename>/etc/resolv.conf</filename>, which should look something like this:"
10111
#: serverguide/C/network-config.xml:89(programlisting)
10115
"search mydomain.example\n"
10116
"nameserver 192.168.0.1\n"
10117
"nameserver 4.2.2.2\n"
10120
#: serverguide/C/network-config.xml:94(para)
10122
"The <emphasis role=\"italics\">search</emphasis> directive will append "
10123
"mydomain.example to hostname queries in an attempt to resolve names to your "
10124
"network. For example, if your network's domain is mydomain.example and you "
10125
"try to ping the host <quote>mybox</quote>, the DNS query will be modified to "
10126
"<quote>mybox.mydomain.example</quote> for resolution. The <emphasis "
10127
"role=\"italics\">nameserver</emphasis> directives specify DNS servers to be "
10128
"used to resolve hostnames to IP addresses. If you use your own nameserver, "
10129
"enter it here. Otherwise, ask your Internet Service Provider for the primary "
10130
"and secondary DNS servers to use, and enter them into "
10131
"<filename>/etc/resolv.conf</filename> as shown above."
10134
#: serverguide/C/network-config.xml:106(para)
10136
"Many more configurations are possible, including dialup PPP interfaces, IPv6 "
10137
"networking, VPN devices, etc. Refer to <application>man 5 "
10138
"interfaces</application> for more information and supported options. "
10139
"Remember that <filename>/etc/network/interfaces</filename> is used by the "
10140
"<application>ifup</application>/<application>ifdown</application> scripts as "
10141
"a higher level configuration scheme than may be used in some other Linux "
10142
"distributions, and that the traditional, lower level utilities such as "
10143
"<application>ifconfig</application>, <application>route</application>, and "
10144
"<application>dhclient</application> are still available to you for ad hoc "
10148
#: serverguide/C/network-config.xml:120(title)
10149
msgid "Managing DNS Entries"
10152
#: serverguide/C/network-config.xml:121(para)
10154
"This section explains how to configure which nameserver to use when "
10155
"resolving IP addresses to hostnames and vice versa. It does not explain how "
10156
"to configure the system as a name server."
10159
#: serverguide/C/network-config.xml:126(para)
10161
"To manage DNS entries, you can add, edit, or remove DNS names from the "
10162
"<filename>/etc/resolv.conf</filename> file. A sample file is given below:"
10165
#: serverguide/C/network-config.xml:130(programlisting)
10170
"nameserver 204.11.126.131\n"
10171
"nameserver 64.125.134.133\n"
10172
"nameserver 64.125.134.132\n"
10173
"nameserver 208.185.179.218\n"
10176
#: serverguide/C/network-config.xml:138(para)
10178
"The <application>search</application> key specifies the string which will be "
10179
"appended to an incomplete hostname. Here, we have configured it to "
10180
"<application>com</application>. So, when we run: <command>ping "
10181
"ubuntu</command> it would be interpreted as <command>ping "
10182
"ubuntu.com</command>."
10185
#: serverguide/C/network-config.xml:146(para)
10187
"The <application>nameserver</application> key specifies the nameserver IP "
10188
"address. It will be used to resolve a given IP address or hostname. This "
10189
"file can have multiple nameserver entries. The nameservers will be used by "
10190
"the network query in the same order."
10193
#: serverguide/C/network-config.xml:155(para)
10195
"If the DNS server names are retrieved dynamically from DHCP or PPPoE "
10196
"(retrieved from your ISP), do not add nameserver entries in this file. It "
10197
"will be overwritten."
10200
#: serverguide/C/network-config.xml:164(title)
10201
msgid "Managing Hosts"
10204
#: serverguide/C/network-config.xml:165(para)
10206
"To manage hosts, you can add, edit, or remove hosts from "
10207
"<filename>/etc/hosts</filename> file. The file contains IP addresses and "
10208
"their corresponding hostnames. When your system tries to resolve a hostname "
10209
"to an IP address or determine the hostname for an IP address, it refers to "
10210
"the <filename>/etc/hosts</filename> file before using the name servers. If "
10211
"the IP address is listed in the <filename>/etc/hosts</filename> file, the "
10212
"name servers are not used. This behavior can be modified by editing "
10213
"<filename>/etc/nsswitch.conf</filename> at your peril."
10216
#: serverguide/C/network-config.xml:178(para)
10218
"If your network contains computers whose IP addresses are not listed in DNS, "
10219
"it is recommended that you add them to the <filename>/etc/hosts</filename> "
10223
#: serverguide/C/network-config.xml:186(title)
10227
#: serverguide/C/network-config.xml:188(para)
10229
"Bridging multiple interfaces is a more advanced configuration, but is very "
10230
"useful in multiple scenarios. One scenario is setting up a bridge with "
10231
"multiple network interfaces, then using a firewall to filter traffic between "
10232
"two network segments. Another scenario is using bridge on a system with one "
10233
"interface to allow virtual machines direct access to the outside network. "
10234
"The following example covers the latter scenario."
10237
#: serverguide/C/network-config.xml:195(para)
10239
"Before configuring a bridge you will need to install the <application>bridge-"
10240
"utils</application> package. To install the package, in a terminal enter:"
10243
#: serverguide/C/network-config.xml:201(command)
10244
msgid "sudo apt-get install bridge-utils"
10247
#: serverguide/C/network-config.xml:204(para)
10249
"Next, configure the bridge by editing "
10250
"<filename>/etc/network/interfaces</filename>:"
10253
#: serverguide/C/network-config.xml:208(programlisting)
10258
"iface lo inet loopback\n"
10261
"iface br0 inet static\n"
10262
" address 192.168.0.10\n"
10263
" network 192.168.0.0\n"
10264
" netmask 255.255.255.0\n"
10265
" broadcast 192.168.0.255\n"
10266
" gateway 192.168.0.1\n"
10267
" bridge_ports eth0\n"
10269
" bridge_hello 2\n"
10270
" bridge_maxage 12\n"
10271
" bridge_stp off\n"
10274
#: serverguide/C/network-config.xml:227(para)
10275
msgid "Enter the appropriate values for your physical interface and network."
10278
#: serverguide/C/network-config.xml:232(para)
10279
msgid "Now restart networking to enable the bridge interface:"
10282
#: serverguide/C/network-config.xml:240(para)
10284
"If setting up a bridge interface using Ubuntu Desktop Edition, or if "
10285
"<application>dhcdbd</application> is installed, the "
10286
"<application>dhcdbd</application> daemon will need to be stopped and "
10290
#: serverguide/C/network-config.xml:245(para)
10292
"After configuring the bridge in "
10293
"<filename>/etc/network/interfaces</filename>, shutdown "
10294
"<application>dhcdbd</application> by:"
10297
#: serverguide/C/network-config.xml:250(command)
10298
msgid "sudo /etc/init.d/dhcdbd stop"
10301
#: serverguide/C/network-config.xml:253(para)
10302
msgid "Now to disable it from starting on boot enter:"
10305
#: serverguide/C/network-config.xml:258(command)
10306
msgid "sudo update-rc.d -f dhcdbd remove"
10309
#: serverguide/C/network-config.xml:261(para)
10311
"The new bridge interface should now be up and running. The "
10312
"<application>brctl</application> provides useful information about the state "
10313
"of the bridge, controls which interfaces are part of the bridge, etc. See "
10314
"<command>man brctl</command> for more information."
10317
#: serverguide/C/network-config.xml:277(para)
10320
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/interfaces.5.html\">"
10321
"interafaces man page</ulink> has details on more options for "
10322
"<filename>/etc/network/interfaces</filename>."
10325
#: serverguide/C/network-config.xml:283(para)
10327
"For more information on DNS client configuration see the <ulink "
10328
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/resolver.5.html\">re"
10329
"solver man page</ulink>. Also, Chapter 6 of O'Reilly's <ulink "
10330
"url=\"http://oreilly.com/catalog/linag2/book/ch06.html\">Linux Network "
10331
"Administrator's Guide</ulink> is a good source of resolver and name service "
10332
"configuration information."
10335
#: serverguide/C/network-config.xml:291(para)
10337
"For more information on <emphasis>bridging</emphasis> see the <ulink "
10338
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/brctl.8.html\">brctl"
10339
" man page</ulink> and the Linux Foundation's <ulink "
10340
"url=\"http://www.linuxfoundation.org/en/Net:Bridge\">Net:Bridge</ulink> page."
10343
#: serverguide/C/network-config.xml:302(title)
10347
#: serverguide/C/network-config.xml:303(para)
10349
"The Transmission Control Protocol and Internet Protocol (TCP/IP) is a "
10350
"standard set of protocols developed in the late 1970s by the Defense "
10351
"Advanced Research Projects Agency (DARPA) as a means of communication "
10352
"between different types of computers and computer networks. TCP/IP is the "
10353
"driving force of the Internet, and thus it is the most popular set of "
10354
"network protocols on Earth."
10357
#: serverguide/C/network-config.xml:311(title)
10358
msgid "TCP/IP Introduction"
10361
#: serverguide/C/network-config.xml:312(para)
10363
"The two protocol components of TCP/IP deal with different aspects of "
10364
"computer networking. <emphasis>Internet Protocol</emphasis>, the \"IP\" of "
10365
"TCP/IP is a connectionless protocol which deals only with network packet "
10366
"routing using the <emphasis role=\"italics\">IP Datagram</emphasis> as the "
10367
"basic unit of networking information. The IP Datagram consists of a header "
10368
"followed by a message. The <emphasis> Transmission Control "
10369
"Protocol</emphasis> is the \"TCP\" of TCP/IP and enables network hosts to "
10370
"establish connections which may be used to exchange data streams. TCP also "
10371
"guarantees that the data between connections is delivered and that it "
10372
"arrives at one network host in the same order as sent from another network "
10376
#: serverguide/C/network-config.xml:325(title)
10377
msgid "TCP/IP Configuration"
10380
#: serverguide/C/network-config.xml:326(para)
10382
"The TCP/IP protocol configuration consists of several elements which must be "
10383
"set by editing the appropriate configuration files, or deploying solutions "
10384
"such as the Dynamic Host Configuration Protocol (DHCP) server which in turn, "
10385
"can be configured to provide the proper TCP/IP configuration settings to "
10386
"network clients automatically. These configuration values must be set "
10387
"correctly in order to facilitate the proper network operation of your Ubuntu "
10391
#: serverguide/C/network-config.xml:338(para)
10393
"<emphasis role=\"bold\">IP address</emphasis> The IP address is a unique "
10394
"identifying string expressed as four decimal numbers ranging from zero (0) "
10395
"to two-hundred and fifty-five (255), separated by periods, with each of the "
10396
"four numbers representing eight (8) bits of the address for a total length "
10397
"of thirty-two (32) bits for the whole address. This format is called "
10398
"<emphasis>dotted quad notation</emphasis>."
10401
#: serverguide/C/network-config.xml:348(para)
10403
"<emphasis role=\"bold\">Netmask</emphasis> The Subnet Mask (or simply, "
10404
"<emphasis>netmask</emphasis>) is a local bit mask, or set of flags which "
10405
"separate the portions of an IP address significant to the network from the "
10406
"bits significant to the <emphasis>subnetwork</emphasis>. For example, in a "
10407
"Class C network, the standard netmask is 255.255.255.0 which masks the first "
10408
"three bytes of the IP address and allows the last byte of the IP address to "
10409
"remain available for specifying hosts on the subnetwork."
10412
#: serverguide/C/network-config.xml:359(para)
10414
"<emphasis role=\"bold\">Network Address</emphasis> The Network Address "
10415
"represents the bytes comprising the network portion of an IP address. For "
10416
"example, the host 12.128.1.2 in a Class A network would use 12.0.0.0 as the "
10417
"network address, where twelve (12) represents the first byte of the IP "
10418
"address, (the network part) and zeroes (0) in all of the remaining three "
10419
"bytes to represent the potential host values. A network host using the "
10420
"private IP address 192.168.1.100 would in turn use a Network Address of "
10421
"192.168.1.0, which specifies the first three bytes of the Class C 192.168.1 "
10422
"network and a zero (0) for all the possible hosts on the network."
10425
#: serverguide/C/network-config.xml:372(para)
10427
"<emphasis role=\"bold\">Broadcast Address</emphasis> The Broadcast Address "
10428
"is an IP address which allows network data to be sent simultaneously to all "
10429
"hosts on a given subnetwork rather than specifying a particular host. The "
10430
"standard general broadcast address for IP networks is 255.255.255.255, but "
10431
"this broadcast address cannot be used to send a broadcast message to every "
10432
"host on the Internet because routers block it. A more appropriate broadcast "
10433
"address is set to match a specific subnetwork. For example, on the private "
10434
"Class C IP network, 192.168.1.0, the broadcast address is 192.168.1.255. "
10435
"Broadcast messages are typically produced by network protocols such as the "
10436
"Address Resolution Protocol (ARP) and the Routing Information Protocol (RIP)."
10439
#: serverguide/C/network-config.xml:385(para)
10441
"<emphasis role=\"bold\">Gateway Address</emphasis> A Gateway Address is the "
10442
"IP address through which a particular network, or host on a network, may be "
10443
"reached. If one network host wishes to communicate with another network "
10444
"host, and that host is not located on the same network, then a "
10445
"<emphasis>gateway</emphasis> must be used. In many cases, the Gateway "
10446
"Address will be that of a router on the same network, which will in turn "
10447
"pass traffic on to other networks or hosts, such as Internet hosts. The "
10448
"value of the Gateway Address setting must be correct, or your system will "
10449
"not be able to reach any hosts beyond those on the same network."
10452
#: serverguide/C/network-config.xml:396(para)
10454
"<emphasis role=\"bold\">Nameserver Address</emphasis> Nameserver Addresses "
10455
"represent the IP addresses of Domain Name Service (DNS) systems, which "
10456
"resolve network hostnames into IP addresses. There are three levels of "
10457
"Nameserver Addresses, which may be specified in order of precedence: The "
10458
"<emphasis>Primary</emphasis> Nameserver, the <emphasis>Secondary</emphasis> "
10459
"Nameserver, and the <emphasis>Tertiary</emphasis> Nameserver. In order for "
10460
"your system to be able to resolve network hostnames into their corresponding "
10461
"IP addresses, you must specify valid Nameserver Addresses which you are "
10462
"authorized to use in your system's TCP/IP configuration. In many cases these "
10463
"addresses can and will be provided by your network service provider, but "
10464
"many free and publicly accessible nameservers are available for use, such as "
10465
"the Level3 (Verizon) servers with IP addresses from 4.2.2.1 to 4.2.2.6."
10468
#: serverguide/C/network-config.xml:410(para)
10470
"The IP address, Netmask, Network Address, Broadcast Address, and Gateway "
10471
"Address are typically specified via the appropriate directives in the file "
10472
"<filename>/etc/network/interfaces</filename>. The Nameserver Addresses are "
10473
"typically specified via <emphasis>nameserver</emphasis> directives in the "
10474
"file <filename>/etc/resolv.conf</filename>. For more information, view the "
10475
"system manual page for <filename>interfaces</filename> or "
10476
"<filename>resolv.conf</filename> respectively, with the following commands "
10477
"typed at a terminal prompt:"
10480
#: serverguide/C/network-config.xml:417(para)
10482
"Access the system manual page for <filename>interfaces</filename> with the "
10483
"following command:"
10486
#: serverguide/C/network-config.xml:422(command)
10487
msgid "man interfaces"
10490
#: serverguide/C/network-config.xml:425(para)
10492
"Access the system manual page for <filename>resolv.conf</filename> with the "
10493
"following command:"
10496
#: serverguide/C/network-config.xml:429(command)
10497
msgid "man resolv.conf"
10500
#: serverguide/C/network-config.xml:334(para)
10502
"The common configuration elements of TCP/IP and their purposes are as "
10503
"follows: <placeholder-1/>"
10506
#: serverguide/C/network-config.xml:436(title)
10510
#: serverguide/C/network-config.xml:437(para)
10512
"IP routing is a means of specifying and discovering paths in a TCP/IP "
10513
"network along which network data may be sent. Routing uses a set of "
10514
"<emphasis>routing tables</emphasis> to direct the forwarding of network data "
10515
"packets from their source to the destination, often via many intermediary "
10516
"network nodes known as <emphasis>routers</emphasis>. There are two primary "
10517
"forms of IP routing: <emphasis>Static Routing</emphasis> and "
10518
"<emphasis>Dynamic Routing.</emphasis>"
10521
#: serverguide/C/network-config.xml:446(para)
10523
"Static routing involves manually adding IP routes to the system's routing "
10524
"table, and this is usually done by manipulating the routing table with the "
10525
"<application>route</application> command. Static routing enjoys many "
10526
"advantages over dynamic routing, such as simplicity of implementation on "
10527
"smaller networks, predictability (the routing table is always computed in "
10528
"advance, and thus the route is precisely the same each time it is used), and "
10529
"low overhead on other routers and network links due to the lack of a dynamic "
10530
"routing protocol. However, static routing does present some disadvantages as "
10531
"well. For example, static routing is limited to small networks and does not "
10532
"scale well. Static routing also fails completely to adapt to network outages "
10533
"and failures along the route due to the fixed nature of the route."
10536
#: serverguide/C/network-config.xml:456(para)
10538
"Dynamic routing depends on large networks with multiple possible IP routes "
10539
"from a source to a destination and makes use of special routing protocols, "
10540
"such as the Router Information Protocol (RIP), which handle the automatic "
10541
"adjustments in routing tables that make dynamic routing possible. Dynamic "
10542
"routing has several advantages over static routing, such as superior "
10543
"scalability and the ability to adapt to failures and outages along network "
10544
"routes. Additionally, there is less manual configuration of the routing "
10545
"tables, since routers learn from one another about their existence and "
10546
"available routes. This trait also eliminates the possibility of introducing "
10547
"mistakes in the routing tables via human error. Dynamic routing is not "
10548
"perfect, however, and presents disadvantages such as heightened complexity "
10549
"and additional network overhead from router communications, which does not "
10550
"immediately benefit the end users, but still consumes network bandwidth."
10553
#: serverguide/C/network-config.xml:470(title)
10554
msgid "TCP and UDP"
10557
#: serverguide/C/network-config.xml:471(para)
10559
"TCP is a connection-based protocol, offering error correction and guaranteed "
10560
"delivery of data via what is known as <emphasis>flow control</emphasis>. "
10561
"Flow control determines when the flow of a data stream needs to be stopped, "
10562
"and previously sent data packets should to be re-sent due to problems such "
10563
"as <emphasis>collisions</emphasis>, for example, thus ensuring complete and "
10564
"accurate delivery of the data. TCP is typically used in the exchange of "
10565
"important information such as database transactions."
10568
#: serverguide/C/network-config.xml:479(para)
10570
"The User Datagram Protocol (UDP), on the other hand, is a "
10571
"<emphasis>connectionless</emphasis> protocol which seldom deals with the "
10572
"transmission of important data because it lacks flow control or any other "
10573
"method to ensure reliable delivery of the data. UDP is commonly used in such "
10574
"applications as audio and video streaming, where it is considerably faster "
10575
"than TCP due to the lack of error correction and flow control, and where the "
10576
"loss of a few packets is not generally catastrophic."
10579
#: serverguide/C/network-config.xml:489(title)
10583
#: serverguide/C/network-config.xml:490(para)
10585
"The Internet Control Messaging Protocol (ICMP) is an extension to the "
10586
"Internet Protocol (IP) as defined in the Request For Comments (RFC) #792 and "
10587
"supports network packets containing control, error, and informational "
10588
"messages. ICMP is used by such network applications as the "
10589
"<application>ping</application> utility, which can determine the "
10590
"availability of a network host or device. Examples of some error messages "
10591
"returned by ICMP which are useful to both network hosts and devices such as "
10592
"routers, include <emphasis>Destination Unreachable</emphasis> and "
10593
"<emphasis>Time Exceeded</emphasis>."
10596
#: serverguide/C/network-config.xml:500(title)
10600
#: serverguide/C/network-config.xml:501(para)
10602
"Daemons are special system applications which typically execute continuously "
10603
"in the background and await requests for the functions they provide from "
10604
"other applications. Many daemons are network-centric; that is, a large "
10605
"number of daemons executing in the background on an Ubuntu system may "
10606
"provide network-related functionality. Some examples of such network daemons "
10607
"include the <emphasis>Hyper Text Transport Protocol Daemon</emphasis> "
10608
"(httpd), which provides web server functionality; the <emphasis>Secure SHell "
10609
"Daemon</emphasis> (sshd), which provides secure remote login shell and file "
10610
"transfer capabilities; and the <emphasis>Internet Message Access Protocol "
10611
"Daemon</emphasis> (imapd), which provides E-Mail services."
10614
#: serverguide/C/network-config.xml:516(para)
10616
"There are man pages for <ulink "
10617
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man7/tcp.7.html\">TCP</ul"
10619
"url=\"http://manpages.ubuntu.com/manpages/jaunty/man7/ip.7.html\">IP</ulink> "
10620
"that contain more useful information."
10623
#: serverguide/C/network-config.xml:522(para)
10625
"Also, see the <ulink "
10626
"url=\"http://www.redbooks.ibm.com/abstracts/gg243376.html\">TCP/IP Tutorial "
10627
"and Technical Overview</ulink> IBM Redbook."
10630
#: serverguide/C/network-config.xml:528(para)
10632
"Another resource is O'Reilly's <ulink "
10633
"url=\"http://oreilly.com/catalog/9780596002978/\">TCP/IP Network "
10634
"Administration</ulink>."
10637
#: serverguide/C/network-config.xml:537(title)
10638
msgid "Dynamic Host Configuration Protocol (DHCP)"
10641
#: serverguide/C/network-config.xml:538(para)
10643
"The Dynamic Host Configuration Protocol (DHCP) is a network service that "
10644
"enables host computers to be automatically assigned settings from a server "
10645
"as opposed to manually configuring each network host. Computers configured "
10646
"to be DHCP clients have no control over the settings they receive from the "
10647
"DHCP server, and the configuration is transparent to the computer's user."
10650
#: serverguide/C/network-config.xml:545(para)
10652
"The most common settings provided by a DHCP server to DHCP clients include:"
10655
#: serverguide/C/network-config.xml:550(para)
10656
msgid "IP-Address and Netmask"
10659
#: serverguide/C/network-config.xml:553(para)
10663
#: serverguide/C/network-config.xml:556(para)
10667
#: serverguide/C/network-config.xml:559(para)
10669
"However, a DHCP server can also supply configuration properties such as:"
10672
#: serverguide/C/network-config.xml:564(para)
10676
#: serverguide/C/network-config.xml:567(para)
10677
msgid "Domain Name"
10680
#: serverguide/C/network-config.xml:570(para)
10681
msgid "Default Gateway"
10684
#: serverguide/C/network-config.xml:573(para)
10685
msgid "Time Server"
10688
#: serverguide/C/network-config.xml:576(para)
10689
msgid "Print Server"
10692
#: serverguide/C/network-config.xml:579(para)
10694
"The advantage of using DHCP is that changes to the network, for example a "
10695
"change in the address of the DNS server, need only be changed at the DHCP "
10696
"server, and all network hosts will be reconfigured the next time their DHCP "
10697
"clients poll the DHCP server. As an added advantage, it is also easier to "
10698
"integrate new computers into the network, as there is no need to check for "
10699
"the availability of an IP address. Conflicts in IP address allocation are "
10703
#: serverguide/C/network-config.xml:587(para)
10704
msgid "A DHCP server can provide configuration settings using two methods:"
10707
#: serverguide/C/network-config.xml:592(term)
10708
msgid "MAC Address"
10711
#: serverguide/C/network-config.xml:594(para)
10713
"This method entails using DHCP to identify the unique hardware address of "
10714
"each network card connected to the network and then continually supplying a "
10715
"constant configuration each time the DHCP client makes a request to the DHCP "
10716
"server using that network device."
10719
#: serverguide/C/network-config.xml:603(term)
10720
msgid "Address Pool"
10723
#: serverguide/C/network-config.xml:605(para)
10725
"This method entails defining a pool (sometimes also called a range or scope) "
10726
"of IP addresses from which DHCP clients are supplied their configuration "
10727
"properties dynamically and on a \"first come, first served\" basis. When a "
10728
"DHCP client is no longer on the network for a specified period, the "
10729
"configuration is expired and released back to the address pool for use by "
10730
"other DHCP Clients."
10733
#: serverguide/C/network-config.xml:616(para)
10735
"Ubuntu is shipped with both DHCP server and client. The server is "
10736
"<application>dhcpd</application> (dynamic host configuration protocol "
10737
"daemon). The client provided with Ubuntu is "
10738
"<application>dhclient</application> and should be installed on all computers "
10739
"required to be automatically configured. Both programs are easy to install "
10740
"and configure and will be automatically started at system boot."
10743
#: serverguide/C/network-config.xml:626(para)
10745
"At a terminal prompt, enter the following command to install "
10746
"<application>dhcpd</application>:"
10749
#: serverguide/C/network-config.xml:631(command)
10750
msgid "sudo apt-get install dhcp3-server"
10753
#: serverguide/C/network-config.xml:633(para)
10755
"You will probably need to change the default configuration by editing "
10756
"/etc/dhcp3/dhcpd.conf to suit your needs and particular configuration."
10759
#: serverguide/C/network-config.xml:637(para)
10761
"You also need to edit /etc/default/dhcp3-server to specify the interfaces "
10762
"dhcpd should listen to. By default it listens to eth0."
10765
#: serverguide/C/network-config.xml:641(para)
10767
"NOTE: dhcpd's messages are being sent to syslog. Look there for diagnostics "
10771
#: serverguide/C/network-config.xml:648(para)
10773
"The error message the installation ends with might be a little confusing, "
10774
"but the following steps will help you configure the service:"
10777
#: serverguide/C/network-config.xml:652(para)
10779
"Most commonly, what you want to do is assign an IP address randomly. This "
10780
"can be done with settings as follows:"
10783
#: serverguide/C/network-config.xml:656(programlisting)
10787
"# Sample /etc/dhcpd.conf\n"
10788
"# (add your comments here) \n"
10789
"default-lease-time 600;\n"
10790
"max-lease-time 7200;\n"
10791
"option subnet-mask 255.255.255.0;\n"
10792
"option broadcast-address 192.168.1.255;\n"
10793
"option routers 192.168.1.254;\n"
10794
"option domain-name-servers 192.168.1.1, 192.168.1.2;\n"
10795
"option domain-name \"mydomain.example\";\n"
10797
"subnet 192.168.1.0 netmask 255.255.255.0 {\n"
10798
"range 192.168.1.10 192.168.1.100;\n"
10799
"range 192.168.1.150 192.168.1.200;\n"
10803
#: serverguide/C/network-config.xml:672(para)
10805
"This will result in the DHCP server giving a client an IP address from the "
10806
"range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will "
10807
"lease an IP address for 600 seconds if the client doesn't ask for a specific "
10808
"time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The "
10809
"server will also \"advise\" the client that it should use 255.255.255.0 as "
10810
"its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as "
10811
"the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers."
10814
#: serverguide/C/network-config.xml:681(para)
10816
"If you need to specify a WINS server for your Windows clients, you will need "
10817
"to include the netbios-name-servers option, e.g."
10820
#: serverguide/C/network-config.xml:685(programlisting)
10824
"option netbios-name-servers 192.168.1.1; \n"
10827
#: serverguide/C/network-config.xml:688(para)
10829
"Dhcpd configuration settings are taken from the DHCP mini-HOWTO, which can "
10831
"url=\"http://www.tldp.org/HOWTO/DHCP/index.html\">here</ulink>."
10834
#: serverguide/C/network-config.xml:698(para)
10836
"For more <filename>/etc/dhcp3/dchpd.conf</filename> options see the <ulink "
10837
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/dhcpd.conf.5.html\">"
10838
"dhcpd.conf man page</ulink>."
10841
#: serverguide/C/network-config.xml:704(para)
10843
"Also see the <ulink url=\"http://www.dhcp-handbook.com/dhcp_faq.html\">DHCP "
10847
#: serverguide/C/network-config.xml:714(title)
10848
msgid "Time Synchronisation with NTP"
10851
#: serverguide/C/network-config.xml:715(para)
10853
"This page describes methods for keeping your computer's time accurate. This "
10854
"is useful for servers, but is not necessary (or desirable) for desktop "
10858
#: serverguide/C/network-config.xml:718(para)
10860
"NTP is a TCP/IP protocol for synchronising time over a network. Basically a "
10861
"client requests the current time from a server, and uses it to set its own "
10865
#: serverguide/C/network-config.xml:721(para)
10867
"Behind this simple description, there is a lot of complexity - there are "
10868
"tiers of NTP servers, with the tier one NTP servers connected to atomic "
10869
"clocks (often via GPS), and tier two and three servers spreading the load of "
10870
"actually handling requests across the Internet. Also the client software is "
10871
"a lot more complex than you might think - it has to factor out communication "
10872
"delays, and adjust the time in a way that does not upset all the other "
10873
"processes that run on the server. But luckily all that complexity is hidden "
10877
#: serverguide/C/network-config.xml:724(para)
10879
"Ubuntu has two ways of automatically setting your time: ntpdate and ntpd."
10882
#: serverguide/C/network-config.xml:729(title)
10886
#: serverguide/C/network-config.xml:730(para)
10888
"Ubuntu comes with ntpdate as standard, and will run it once at boot time to "
10889
"set up your time according to Ubuntu's NTP server. However, a server's clock "
10890
"is likely to drift considerably between reboots, so it makes sense to "
10891
"correct the time occasionally. The easiest way to do this is to get cron to "
10892
"run ntpdate every day. With your favourite editor, as root, create a file "
10893
"<code>/etc/cron.daily/ntpdate</code> containing:"
10896
#: serverguide/C/network-config.xml:735(screen)
10898
msgid "ntpdate ntp.ubuntu.com\n"
10901
#: serverguide/C/network-config.xml:737(para)
10903
"The file <code>/etc/cron.daily/ntpdate</code> must also be executable."
10906
#: serverguide/C/network-config.xml:740(screen)
10908
msgid "sudo chmod 755 /etc/cron.daily/ntpdate\n"
10911
#: serverguide/C/network-config.xml:744(title)
10915
#: serverguide/C/network-config.xml:745(para)
10917
"ntpdate is a bit of a blunt instrument - it can only adjust the time once a "
10918
"day, in one big correction. The ntp daemon ntpd is far more subtle. It "
10919
"calculates the drift of your system clock and continuously adjusts it, so "
10920
"there are no large corrections that could lead to inconsistent logs for "
10921
"instance. The cost is a little processing power and memory, but for a modern "
10922
"server this is negligible."
10925
#: serverguide/C/network-config.xml:748(para)
10926
msgid "To set up ntpd:"
10929
#: serverguide/C/network-config.xml:749(screen)
10931
msgid "sudo apt-get install ntp\n"
10934
#: serverguide/C/network-config.xml:754(title)
10935
msgid "Changing Time Servers"
10938
#: serverguide/C/network-config.xml:755(para)
10940
"In both cases above, your system will use Ubuntu's NTP server at "
10941
"<code>ntp.ubuntu.com</code> by default. This is OK, but you might want to "
10942
"use several servers to increase accuracy and resilience, and you may want to "
10943
"use time servers that are geographically closer to you. to do this for "
10944
"ntpdate, change the contents of <code>/etc/cron.daily/ntpdate</code> to:"
10947
#: serverguide/C/network-config.xml:762(screen)
10949
msgid "ntpdate ntp.ubuntu.com pool.ntp.org \n"
10952
#: serverguide/C/network-config.xml:764(para)
10954
"And for ntpd edit <code>/etc/ntp.conf</code> to include additional server "
10958
#: serverguide/C/network-config.xml:769(screen)
10961
"server ntp.ubuntu.com\n"
10962
"server pool.ntp.org\n"
10965
#: serverguide/C/network-config.xml:772(para)
10967
"You may notice <code>pool.ntp.org</code> in the examples above. This is a "
10968
"really good idea which uses round-robin DNS to return an NTP server from a "
10969
"pool, spreading the load between several different servers. Even better, "
10970
"they have pools for different regions - for instance, if you are in New "
10971
"Zealand, so you could use <code>nz.pool.ntp.org</code> instead of "
10972
"<code>pool.ntp.org</code> . Look at <ulink "
10973
"url=\"http://www.pool.ntp.org/\">http://www.pool.ntp.org/</ulink> for more "
10977
#: serverguide/C/network-config.xml:783(para)
10979
"You can also Google for NTP servers in your region, and add these to your "
10980
"configuration. To test that a server works, just type <code>sudo ntpdate "
10981
"ntp.server.name</code> and see what happens."
10984
#: serverguide/C/network-config.xml:791(title)
10985
msgid "Related Pages"
10988
#: serverguide/C/network-config.xml:795(ulink)
10989
msgid "NTP Support"
10992
#: serverguide/C/network-config.xml:800(ulink)
10993
msgid "The NTP FAQ and HOWTO"
10996
#: serverguide/C/network-auth.xml:13(title)
10997
msgid "Network Authentication"
11000
#: serverguide/C/network-auth.xml:15(para)
11001
msgid "This section explains various Network Authentication protocols."
11004
#: serverguide/C/network-auth.xml:19(title)
11005
msgid "OpenLDAP Server"
11008
#: serverguide/C/network-auth.xml:20(para)
11010
"LDAP is an acronym for Lightweight Directory Access Protocol, it is a "
11011
"simplified version of the X.500 protocol. The directory setup in this "
11012
"section will be used for authentication. Nevertheless, LDAP can be used in "
11013
"numerous ways: authentication, shared directory (for mail clients), address "
11017
#: serverguide/C/network-auth.xml:28(para)
11019
"To describe LDAP quickly, all information is stored in a tree structure. "
11020
"With <application>OpenLDAP</application> you have freedom to determine the "
11021
"directory arborescence (the Directory Information Tree: the DIT) yourself. "
11022
"We will begin with a basic tree containing two nodes below the root:"
11025
#: serverguide/C/network-auth.xml:37(para)
11026
msgid "\"People\" node where your users will be stored"
11029
#: serverguide/C/network-auth.xml:40(para)
11030
msgid "\"Groups\" node where your groups will be stored"
11033
#: serverguide/C/network-auth.xml:44(para)
11035
"Before beginning, you should determine what the root of your LDAP directory "
11036
"will be. By default, your tree will be determined by your Fully Qualified "
11037
"Domain Name (FQDN). If your domain is example.com (which we will use in this "
11038
"example), your root node will be dc=example,dc=com."
11041
#: serverguide/C/network-auth.xml:54(para)
11043
"First, install the <application>OpenLDAP</application> server daemon "
11044
"<application>slapd</application> and <application>ldap-utils</application>, "
11045
"a package containing LDAP management utilities:"
11048
#: serverguide/C/network-auth.xml:60(command)
11049
msgid "sudo apt-get install slapd ldap-utils"
11052
#: serverguide/C/network-auth.xml:63(para)
11054
"The installation process will prompt you for the LDAP directory admin "
11055
"password and confirmation."
11058
#: serverguide/C/network-auth.xml:68(para)
11060
"By default the directory suffix will match the domain name of the server. "
11061
"For example, if the machine's Fully Qualified Domain Name (FQDN) is "
11062
"ldap.example.com, the default suffix will be "
11063
"<emphasis>dc=example,dc=com</emphasis>. If you require a different suffix, "
11064
"the directory can be reconfigured using <application>dpkg-"
11065
"reconfigure</application>. Enter the following in a terminal prompt:"
11068
#: serverguide/C/network-auth.xml:78(command)
11069
msgid "sudo dpkg-reconfigure slapd"
11072
#: serverguide/C/network-auth.xml:81(para)
11074
"You will then be taken through a menu based configuration dialog, allowing "
11075
"you to configure various <application>slapd</application> options."
11078
#: serverguide/C/network-auth.xml:90(para)
11080
"<application>OpenLDAP</application> uses a separate database which contains "
11081
"the <emphasis>cn=config</emphasis> Directory Information Tree (DIT). The "
11082
"<emphasis>cn=config</emphasis> DIT is used to dynamically configure the "
11083
"<application>slapd</application> daemon, allowing the modification of schema "
11084
"definitions, indexes, ACLs, etc without stopping the service."
11087
#: serverguide/C/network-auth.xml:98(para)
11089
"The <emphasis>cn=config</emphasis> tree can be manipulated using the "
11090
"utilities in the <application>ldap-utils</application> package. For example:"
11093
#: serverguide/C/network-auth.xml:106(para)
11095
"Use <application>ldapsearch</application> to view the tree, entering the "
11096
"admin password set during installation or reconfiguration:"
11099
#: serverguide/C/network-auth.xml:112(command)
11101
"ldapsearch -xLLL -b cn=config -D cn=admin,cn=config -W olcDatabase={1}hdb"
11104
#: serverguide/C/network-auth.xml:116(computeroutput)
11107
"Enter LDAP Password: \n"
11108
"dn: olcDatabase={1}hdb,cn=config\n"
11109
"objectClass: olcDatabaseConfig\n"
11110
"objectClass: olcHdbConfig\n"
11111
"olcDatabase: {1}hdb\n"
11112
"olcDbDirectory: /var/lib/ldap\n"
11113
"olcSuffix: dc=example,dc=com\n"
11114
"olcAccess: {0}to attrs=userPassword,shadowLastChange by "
11115
"dn=\"cn=admin,dc=exampl\n"
11116
" e,dc=com\" write by anonymous auth by self write by * none\n"
11117
"olcAccess: {1}to dn.base=\"\" by * read\n"
11118
"olcAccess: {2}to * by dn=\"cn=admin,dc=example,dc=com\" write by * read\n"
11119
"olcLastMod: TRUE\n"
11120
"olcDbCheckpoint: 512 30\n"
11121
"olcDbConfig: {0}set_cachesize 0 2097152 0\n"
11122
"olcDbConfig: {1}set_lk_max_objects 1500\n"
11123
"olcDbConfig: {2}set_lk_max_locks 1500\n"
11124
"olcDbConfig: {3}set_lk_max_lockers 1500\n"
11125
"olcDbIndex: objectClass eq\n"
11128
#: serverguide/C/network-auth.xml:137(para)
11130
"The output above is the current configuration options for the "
11131
"<emphasis>hdb</emphasis> backend database. Which in this case containes the "
11132
"<emphasis>dc=example,dc=com</emphasis> suffix."
11135
#: serverguide/C/network-auth.xml:146(para)
11137
"Refine the search by supplying a <emphasis "
11138
"role=\"italic\">filter</emphasis>, in this case only show which attributes "
11142
#: serverguide/C/network-auth.xml:152(command)
11144
"ldapsearch -xLLL -b cn=config -D cn=admin,cn=config -W olcDatabase={1}hdb "
11148
#: serverguide/C/network-auth.xml:156(computeroutput)
11151
"Enter LDAP Password: \n"
11152
"dn: olcDatabase={1}hdb,cn=config\n"
11153
"olcDbIndex: objectClass eq\n"
11156
#: serverguide/C/network-auth.xml:165(para)
11158
"As an example of modifying the <emphasis>cn=config</emphasis> tree, add "
11159
"another attribute to the index list using "
11160
"<application>ldapmodify</application>:"
11163
#: serverguide/C/network-auth.xml:171(command) serverguide/C/network-auth.xml:723(command) serverguide/C/network-auth.xml:825(command) serverguide/C/network-auth.xml:848(command) serverguide/C/network-auth.xml:2405(command) serverguide/C/network-auth.xml:2422(command)
11164
msgid "ldapmodify -x -D cn=admin,cn=config -W"
11167
#: serverguide/C/network-auth.xml:175(userinput)
11171
"dn: olcDatabase={1}hdb,cn=config\n"
11172
"add: olcDbIndex\n"
11173
"olcDbIndex: entryUUID eq"
11176
#: serverguide/C/network-auth.xml:175(computeroutput)
11179
"Enter LDAP Password:<placeholder-1/>\n"
11181
"modifying entry \"olcDatabase={1}hdb,cn=config\"\n"
11184
#: serverguide/C/network-auth.xml:184(para)
11186
"Once the modification has completed, press <emphasis>Ctrl+D</emphasis> to "
11187
"exit the utility."
11190
#: serverguide/C/network-auth.xml:191(para)
11192
"<application>ldapmodify</application> can also read the changes from a file. "
11193
"Copy and paste the following into a file named "
11194
"<filename>uid_index.ldif</filename>:"
11197
#: serverguide/C/network-auth.xml:196(programlisting)
11201
"dn: olcDatabase={1}hdb,cn=config\n"
11202
"add: olcDbIndex\n"
11203
"olcDbIndex: uid eq,pres,sub\n"
11206
#: serverguide/C/network-auth.xml:202(para)
11207
msgid "Then execute <application>ldapmodify</application>:"
11210
#: serverguide/C/network-auth.xml:207(command)
11211
msgid "ldapmodify -x -D cn=admin,cn=config -W -f uid_index.ldif"
11214
#: serverguide/C/network-auth.xml:211(computeroutput)
11217
"Enter LDAP Password: \n"
11218
"modifying entry \"olcDatabase={1}hdb,cn=config\"\n"
11221
#: serverguide/C/network-auth.xml:216(para)
11222
msgid "The file method is very useful for large changes."
11225
#: serverguide/C/network-auth.xml:223(para)
11227
"Adding additional <emphasis>schemas</emphasis> to "
11228
"<application>slapd</application> requires the schema to be converted to LDIF "
11229
"format. Fortunately, the <application>slapd</application> program can be "
11230
"used to automate the conversion. The following example will add the "
11231
"<emphasis>misc.schema</emphasis>:"
11234
#: serverguide/C/network-auth.xml:231(para)
11236
"First, create a conversion <filename>schema_convert.conf</filename> file "
11237
"containing the following lines:"
11240
#: serverguide/C/network-auth.xml:236(programlisting)
11244
"include /etc/ldap/schema/core.schema\n"
11245
"include /etc/ldap/schema/collective.schema\n"
11246
"include /etc/ldap/schema/corba.schema\n"
11247
"include /etc/ldap/schema/cosine.schema\n"
11248
"include /etc/ldap/schema/duaconf.schema\n"
11249
"include /etc/ldap/schema/dyngroup.schema\n"
11250
"include /etc/ldap/schema/inetorgperson.schema\n"
11251
"include /etc/ldap/schema/java.schema\n"
11252
"include /etc/ldap/schema/misc.schema\n"
11253
"include /etc/ldap/schema/nis.schema\n"
11254
"include /etc/ldap/schema/openldap.schema\n"
11255
"include /etc/ldap/schema/ppolicy.schema\n"
11258
#: serverguide/C/network-auth.xml:254(para) serverguide/C/network-auth.xml:1304(para)
11259
msgid "Next, create a temporary directory to hold the output:"
11262
#: serverguide/C/network-auth.xml:259(command) serverguide/C/network-auth.xml:1309(command) serverguide/C/network-auth.xml:2334(command)
11263
msgid "mkdir /tmp/ldif_output"
11266
#: serverguide/C/network-auth.xml:265(para)
11268
"Now using <application>slaptest</application> convert the schema files to "
11272
#: serverguide/C/network-auth.xml:270(command) serverguide/C/network-auth.xml:1320(command) serverguide/C/network-auth.xml:2345(command)
11273
msgid "slaptest -f schema_convert.conf -F /tmp/ldif_output"
11276
#: serverguide/C/network-auth.xml:273(para)
11278
"Adjust the configuration file name and temporary directory names if yours "
11279
"are different. Also, it may be worthwhile to keep the "
11280
"<filename>ldif_output</filename> directory around in case you want to add "
11281
"additional schemas in the future."
11284
#: serverguide/C/network-auth.xml:282(para)
11287
"<filename>/tmp/ldif_output/cn=config/cn=schema/cn={8}misc.ldif</filename> "
11288
"file, changing the following attributes:"
11291
#: serverguide/C/network-auth.xml:287(programlisting)
11295
"dn: cn=misc,cn=schema,cn=config\n"
11300
#: serverguide/C/network-auth.xml:293(para) serverguide/C/network-auth.xml:1341(para)
11301
msgid "And remove the following lines from the bottom of the file:"
11304
#: serverguide/C/network-auth.xml:297(programlisting)
11308
"structuralObjectClass: olcSchemaConfig\n"
11309
"entryUUID: 10dae0ea-0760-102d-80d3-f9366b7f7757\n"
11310
"creatorsName: cn=config\n"
11311
"createTimestamp: 20080826021140Z\n"
11312
"entryCSN: 20080826021140.791425Z#000000#000#000000\n"
11313
"modifiersName: cn=config\n"
11314
"modifyTimestamp: 20080826021140Z\n"
11317
#: serverguide/C/network-auth.xml:308(para) serverguide/C/network-auth.xml:1356(para) serverguide/C/network-auth.xml:2381(para)
11319
"The attribute values will vary, just be sure the attributes are removed."
11322
#: serverguide/C/network-auth.xml:316(para) serverguide/C/network-auth.xml:1364(para)
11324
"Finally, using the <application>ldapadd</application> utility, add the new "
11325
"schema to the directory:"
11328
#: serverguide/C/network-auth.xml:322(command)
11330
"ldapadd -x -D cn=admin,cn=config -W -f /tmp/ldif_output/cn\\=config/cn\\"
11331
"=schema/cn\\=\\{8\\}misc.ldif"
11334
#: serverguide/C/network-auth.xml:328(para)
11336
"There should now be a <emphasis>dn: "
11337
"cn={4}misc,cn=schema,cn=config</emphasis> entry in the cn=config tree."
11340
#: serverguide/C/network-auth.xml:337(title)
11341
msgid "Populating LDAP"
11344
#: serverguide/C/network-auth.xml:339(para)
11346
"The directory has been created during installation and reconfiguration, and "
11347
"now it is time to populate it. It will be populated with a \"classical\" "
11348
"scheme that will be compatible with address book applications and with Unix "
11349
"Posix accounts. Posix accounts will allow authentication to various "
11350
"applications, such as web applications, email Mail Transfer Agent (MTA) "
11351
"applications, etc."
11354
#: serverguide/C/network-auth.xml:348(para)
11356
"For external applications to authenticate using LDAP they will each need to "
11357
"be specifically configured to do so. Refer to the individual application "
11358
"documentation for details."
11361
#: serverguide/C/network-auth.xml:355(para)
11363
"LDAP directories can be populated with LDIF (LDAP Directory Interchange "
11364
"Format) files. Copy the following example LDIF file, naming it "
11365
"<filename>example.com.ldif</filename>, somewhere on your system:"
11368
#: serverguide/C/network-auth.xml:361(programlisting)
11372
"dn: ou=people,dc=example,dc=com\n"
11373
"objectClass: organizationalUnit\n"
11376
"dn: ou=groups,dc=example,dc=com\n"
11377
"objectClass: organizationalUnit\n"
11380
"dn: uid=john,ou=people,dc=example,dc=com\n"
11381
"objectClass: inetOrgPerson\n"
11382
"objectClass: posixAccount\n"
11383
"objectClass: shadowAccount\n"
11386
"givenName: John\n"
11388
"displayName: John Doe\n"
11389
"uidNumber: 1000\n"
11390
"gidNumber: 10000\n"
11391
"userPassword: password\n"
11392
"gecos: John Doe\n"
11393
"loginShell: /bin/bash\n"
11394
"homeDirectory: /home/john\n"
11395
"shadowExpire: -1\n"
11397
"shadowWarning: 7\n"
11399
"shadowMax: 999999\n"
11400
"shadowLastChange: 10877\n"
11401
"mail: john.doe@example.com\n"
11402
"postalCode: 31000\n"
11405
"mobile: +33 (0)6 xx xx xx xx\n"
11406
"homePhone: +33 (0)5 xx xx xx xx\n"
11407
"title: System Administrator\n"
11408
"postalAddress: \n"
11411
"dn: cn=example,ou=groups,dc=example,dc=com\n"
11412
"objectClass: posixGroup\n"
11414
"gidNumber: 10000\n"
11417
#: serverguide/C/network-auth.xml:407(para)
11419
"In this example the directory structure, a user, and a group have been "
11420
"setup. In other examples you might see the <emphasis>objectClass: "
11421
"top</emphasis> added in every entry, but that is the default behaviour so "
11422
"you do not have to add it explicitly."
11425
#: serverguide/C/network-auth.xml:414(para)
11427
"To add the entries to the LDAP directory use the "
11428
"<application>ldapadd</application> utility:"
11431
#: serverguide/C/network-auth.xml:420(command)
11432
msgid "ldapadd -x -D cn=admin,dc=example,dc=com -W -f example.com.ldif"
11435
#: serverguide/C/network-auth.xml:423(para)
11437
"We can check that the content has been correctly added with the tools from "
11438
"the <application>ldap-utils</application> package. In order to execute a "
11439
"search of the LDAP directory:"
11442
#: serverguide/C/network-auth.xml:430(command)
11443
msgid "ldapsearch -xLLL -b \"dc=example,dc=com\" uid=john sn givenName cn"
11446
#: serverguide/C/network-auth.xml:431(computeroutput)
11450
"dn: uid=john,ou=people,dc=example,dc=com\n"
11453
"givenName: John\n"
11456
#: serverguide/C/network-auth.xml:439(para)
11457
msgid "Just a quick explanation:"
11460
#: serverguide/C/network-auth.xml:445(para)
11462
"<emphasis>-x:</emphasis> will not use SASL authentication method, which is "
11466
#: serverguide/C/network-auth.xml:451(para)
11467
msgid "<emphasis>-LLL:</emphasis> disable printing LDIF schema information."
11470
#: serverguide/C/network-auth.xml:460(title)
11471
msgid "LDAP replication"
11474
#: serverguide/C/network-auth.xml:462(para)
11476
"LDAP often quickly becomes a highly critical service to the network. "
11477
"Multiple systems will come to depend on LDAP for authentication, "
11478
"authorization, configuration, etc. It is a good idea to setup a redundant "
11479
"system through replication."
11482
#: serverguide/C/network-auth.xml:468(para)
11484
"Replication is achieved using the <emphasis>Syncrepl</emphasis> engine. "
11485
"Syncrepl allows the directory to be synced using either a "
11486
"<emphasis>push</emphasis> or <emphasis>pull</emphasis> based system. In a "
11487
"push based configuration a <quote>primary</quote> server will push directory "
11488
"updates to <quote>secondary</quote> servers, while a pull based approach "
11489
"allows replication servers to sync on a time based interval."
11492
#: serverguide/C/network-auth.xml:476(para)
11494
"The following is an example of a <emphasis>Multi-Master</emphasis> "
11495
"configuration. In this configuration each OpenLDAP server is configured for "
11496
"both <emphasis>push</emphasis> and <emphasis>pull</emphasis> replication."
11499
#: serverguide/C/network-auth.xml:484(para)
11501
"First, configure the server to sync the <emphasis>cn=config</emphasis> "
11502
"database. Copy the following to a file named <filename>syncrepl_cn-"
11503
"config.ldif</filename>:"
11506
#: serverguide/C/network-auth.xml:489(programlisting)
11510
"dn: cn=module{0},cn=config\n"
11511
"changetype: modify\n"
11512
"add: olcModuleLoad\n"
11513
"olcModuleLoad: syncprov\n"
11516
"changetype: modify\n"
11517
"replace: olcServerID\n"
11518
"olcServerID: 1 ldap://ldap01.example.com\n"
11519
"olcServerID: 2 ldap://ldap02.example.com\n"
11521
"dn: olcOverlay=syncprov,olcDatabase={0}config,cn=config\n"
11522
"changetype: add\n"
11523
"objectClass: olcOverlayConfig\n"
11524
"objectClass: olcSyncProvConfig\n"
11525
"olcOverlay: syncprov\n"
11527
"dn: olcDatabase={0}config,cn=config\n"
11528
"changetype: modify\n"
11529
"add: olcSyncRepl\n"
11530
"olcSyncRepl: rid=001 provider=ldap://ldap01.example.com "
11531
"binddn=\"cn=admin,cn=config\" bindmethod=simple\n"
11532
" credentials=secret searchbase=\"cn=config\" type=refreshAndPersist\n"
11533
" retry=\"5 5 300 5\" timeout=1\n"
11534
"olcSyncRepl: rid=002 provider=ldap://ldap02.example.com "
11535
"binddn=\"cn=admin,cn=config\" bindmethod=simple\n"
11536
" credentials=secret searchbase=\"cn=config\" type=refreshAndPersist\n"
11537
" retry=\"5 5 300 5\" timeout=1\n"
11539
"add: olcMirrorMode\n"
11540
"olcMirrorMode: TRUE\n"
11543
#: serverguide/C/network-auth.xml:524(para)
11544
msgid "Edit the file changing:"
11547
#: serverguide/C/network-auth.xml:530(para)
11549
"<emphasis>ldap://ldap01.example.com</emphasis> and "
11550
"<emphasis>ldap://ldap02.example.com</emphasis> to the hostnames of your LDAP "
11554
#: serverguide/C/network-auth.xml:535(para)
11556
"You can have more than two LDAP servers, and when a change is made to one of "
11557
"them it will by synced to the rest. Be sure to increment the "
11558
"<emphasis>olcServerID</emphasis> for each server, and the "
11559
"<emphasis>rid</emphasis> for each <emphasis>olcSyncRepl</emphasis> entry."
11562
#: serverguide/C/network-auth.xml:543(para)
11564
"And adjust <emphasis>credentials=secret</emphasis> to match your admin "
11568
#: serverguide/C/network-auth.xml:553(para)
11570
"Next, add the LDIF file using the <application>ldapmodify</application> "
11574
#: serverguide/C/network-auth.xml:558(command)
11575
msgid "ldapmodify -x -D cn=admin,cn=config -W -f syncrepl_cn-config.ldif"
11578
#: serverguide/C/network-auth.xml:564(para)
11580
"Copy the <filename>syncrepl_cn-config.ldif</filename> file to the next LDAP "
11581
"server and repeat the <application>ldapmodify</application> command above."
11584
#: serverguide/C/network-auth.xml:572(para)
11586
"Because a new module has been added, the <application>slapd</application> "
11587
"daemon, on all replicated servers, needs to be restarted:"
11590
#: serverguide/C/network-auth.xml:578(command) serverguide/C/network-auth.xml:778(command) serverguide/C/network-auth.xml:882(command)
11591
msgid "sudo /etc/init.d/slapd restart"
11594
#: serverguide/C/network-auth.xml:584(para)
11596
"Now that the configuration database is synced between servers, the "
11597
"<emphasis>backend</emphasis> database needs to be synced as well. Copy and "
11598
"paste the following into another LDIF file named "
11599
"<filename>syncrepl_backend.ldif</filename>:"
11602
#: serverguide/C/network-auth.xml:590(programlisting)
11606
"dn: olcDatabase={1}hdb,cn=config\n"
11607
"changetype: modify\n"
11609
"olcRootDN: cn=admin,dc=example,dc=com\n"
11611
"add: olcSyncRepl\n"
11612
"olcSyncRepl: rid=003 provider=ldap://ldap01.example.com "
11613
"binddn=\"cn=admin,dc=example,dc=com\" \n"
11614
" bindmethod=simple credentials=secret searchbase=\"dc=example,dc=com\" "
11615
"type=refreshOnly \n"
11616
" interval=00:00:00:10 retry=\"5 5 300 5\" timeout=1\n"
11617
"olcSyncRepl: rid=004 provider=ldap://ldap02.example.com "
11618
"binddn=\"cn=admin,dc=example,dc=com\" \n"
11619
" bindmethod=simple credentials=secret searchbase=\"dc=example,dc=com\" "
11620
"type=refreshOnly \n"
11621
" interval=00:00:00:10 retry=\"5 5 300 5\" timeout=1\n"
11623
"add: olcMirrorMode\n"
11624
"olcMirrorMode: TRUE\n"
11626
"dn: olcOverlay=syncprov,olcDatabase={1}hdb,cn=config\n"
11627
"changetype: add\n"
11628
"objectClass: olcOverlayConfig\n"
11629
"objectClass: olcSyncProvConfig\n"
11630
"olcOverlay: syncprov\n"
11633
#: serverguide/C/network-auth.xml:617(para)
11634
msgid "Like the previous LDIF file, edit this one changing:"
11637
#: serverguide/C/network-auth.xml:623(para)
11639
"<emphasis>searchbase=\"dc=example,dc=com\"</emphasis> to your directory's "
11643
#: serverguide/C/network-auth.xml:628(para)
11645
"If you use a different admin user, change "
11646
"<emphasis>binddn=\"cn=admin,dc=example,dc=com\"</emphasis>."
11649
#: serverguide/C/network-auth.xml:633(para)
11651
"Also, replace <emphasis>credentials=secret</emphasis> with your admin "
11655
#: serverguide/C/network-auth.xml:642(para)
11656
msgid "Add the LDIF file:"
11659
#: serverguide/C/network-auth.xml:647(command)
11660
msgid "ldapmodify -x -D cn=admin,cn=config -W -f syncrepl_backend.ldif"
11663
#: serverguide/C/network-auth.xml:650(para)
11665
"Because the servers' configuration is already synced there is no need to "
11666
"copy this LDIF file to the other servers."
11669
#: serverguide/C/network-auth.xml:658(para)
11671
"The configuration and backend databases should now sycnc to the other "
11672
"servers. You can add additional servers using the "
11673
"<application>ldapmodify</application> utility as the need arises. See <xref "
11674
"linkend=\"openldap-configuration\"/> for details."
11677
#: serverguide/C/network-auth.xml:668(programlisting)
11679
msgid "127.0.0.1\tldap01.example.com ldap01"
11682
#: serverguide/C/network-auth.xml:664(para)
11684
"The <application>slapd</application> daemon will send log information to "
11685
"<filename>/var/log/syslog</filename> by default. So if all does "
11686
"<emphasis>not</emphasis> go well check there for errors and other "
11687
"troubleshooting information. Also, be sure that each server knows it's Fully "
11688
"Qualified Domain Name (FQDN). This is configured in "
11689
"<filename>/etc/hosts</filename> with a line similar to: <placeholder-1/>."
11692
#: serverguide/C/network-auth.xml:675(title)
11693
msgid "Setting up ACL"
11696
#: serverguide/C/network-auth.xml:677(para)
11698
"Authentication requires access to the password field, that should be not "
11699
"accessible by default. Also, in order for users to change their own "
11700
"password, using <command>passwd</command> or other utilities, "
11701
"<emphasis>shadowLastChange</emphasis> needs to be accessible once a user has "
11705
#: serverguide/C/network-auth.xml:684(para)
11707
"To view the Access Control List (ACL), use the "
11708
"<application>ldapsearch</application> utility:"
11711
#: serverguide/C/network-auth.xml:689(command)
11713
"ldapsearch -xLLL -b cn=config -D cn=admin,cn=config -W olcDatabase=hdb "
11717
#: serverguide/C/network-auth.xml:693(computeroutput)
11720
"Enter LDAP Password: \n"
11721
"dn: olcDatabase={1}hdb,cn=config\n"
11722
"olcAccess: {0}to attrs=userPassword,shadowLastChange by "
11723
"dn=\"cn=admin,dc=exampl\n"
11724
" e,dc=com\" write by anonymous auth by self write by * none\n"
11725
"olcAccess: {1}to dn.base=\"\" by * read\n"
11726
"olcAccess: {2}to * by dn=\"cn=admin,dc=example,dc=com\" write by * read\n"
11729
#: serverguide/C/network-auth.xml:705(title)
11730
msgid "TLS and SSL"
11733
#: serverguide/C/network-auth.xml:707(para)
11735
"When authenticating to an OpenLDAP server it is best to do so using an "
11736
"encrypted session. This can be accomplished using Transport Layer Security "
11737
"(TLS) and/or Secure Sockets Layer (SSL)."
11740
#: serverguide/C/network-auth.xml:712(para)
11742
"The first step in the process is to obtain or create a "
11743
"<emphasis>certificate</emphasis>. See <xref linkend=\"certificates-and-"
11744
"security\"/> and <xref linkend=\"certificate-authority\"/> for details."
11747
#: serverguide/C/network-auth.xml:717(para)
11749
"Once you have a certificate, key, and CA cert installed, use "
11750
"<application>ldapmodify</application> to add the new configuration options:"
11753
#: serverguide/C/network-auth.xml:728(userinput)
11757
"add: olcTLSCACertificateFile\n"
11758
"olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem\n"
11760
"add: olcTLSCertificateFile\n"
11761
"olcTLSCertificateFile: /etc/ssl/certs/server.crt\n"
11763
"add: olcTLSCertificateKeyFile\n"
11764
"olcTLSCertificateKeyFile: /etc/ssl/private/server.key"
11767
#: serverguide/C/network-auth.xml:727(computeroutput)
11770
"Enter LDAP Password:\n"
11771
"<placeholder-1/>\n"
11773
"modifying entry \"cn=config\"\n"
11776
#: serverguide/C/network-auth.xml:743(para)
11778
"Adjust the <filename>server.crt</filename>, <filename>server.key</filename>, "
11779
"and <filename>cacert.pem</filename> names if yours are different."
11782
#: serverguide/C/network-auth.xml:749(para)
11784
"Next, edit <filename>/etc/default/slapd</filename> uncomment the "
11785
"<emphasis>SLAPD_SERVICES</emphasis> option:"
11788
#: serverguide/C/network-auth.xml:753(programlisting)
11792
"SLAPD_SERVICES=\"ldap:/// ldapi:/// ldaps:///\"\n"
11795
#: serverguide/C/network-auth.xml:757(para)
11797
"Now the <emphasis>openldap</emphasis> user needs access to the certificate:"
11800
#: serverguide/C/network-auth.xml:762(command)
11801
msgid "sudo adduser openldap ssl-cert"
11804
#: serverguide/C/network-auth.xml:763(command)
11805
msgid "sudo chgrp ssl-cert /etc/ssl/private/server.key"
11808
#: serverguide/C/network-auth.xml:767(para)
11810
"If the <filename role=\"directory\">/etc/ssl/private</filename> and "
11811
"<filename>/etc/ssl/private/server.key</filename> have different permissions, "
11812
"adjust the commands appropriately."
11815
#: serverguide/C/network-auth.xml:773(para)
11816
msgid "Finally, restart <application>slapd</application>:"
11819
#: serverguide/C/network-auth.xml:781(para)
11821
"The <application>slapd</application> daemon should now be listening for "
11822
"LDAPS connections and be able to use STARTTLS during authentication."
11825
#: serverguide/C/network-auth.xml:787(title)
11826
msgid "TLS Replication"
11829
#: serverguide/C/network-auth.xml:789(para)
11831
"If you have setup <application>Syncrepl</application> between servers, it is "
11832
"prudent to encrypt the replication traffic using <emphasis>Transport Layer "
11833
"Security (TLS)</emphasis>. For details on setting up replication see <xref "
11834
"linkend=\"openldap-server-replication\"/>."
11837
#: serverguide/C/network-auth.xml:795(para)
11839
"After setting up replication, and following the instructions in <xref "
11840
"linkend=\"openldap-tls\"/>, there are a couple of consequences that should "
11844
#: serverguide/C/network-auth.xml:802(para)
11846
"The configuration only needs to be modified on <emphasis>one</emphasis> "
11850
#: serverguide/C/network-auth.xml:807(para)
11852
"The path names for the <emphasis>certificate</emphasis> and "
11853
"<emphasis>key</emphasis> must be the same on all servers."
11856
#: serverguide/C/network-auth.xml:814(para)
11858
"So on each replicated server: install a certificate, edit "
11859
"<filename>/etc/default/slapd</filename>, and restart "
11860
"<application>slapd</application>."
11863
#: serverguide/C/network-auth.xml:819(para)
11865
"Once <emphasis>TLS</emphasis> has been setup on each server, modify the "
11866
"<emphasis>cn=config</emphasis> replication by entering the following in a "
11870
#: serverguide/C/network-auth.xml:830(userinput)
11873
"dn: olcDatabase={0}config,cn=config\n"
11874
"replace: olcSyncrepl\n"
11875
"olcSyncrepl: {0}rid=001 provider=ldap://ldap01.example.com "
11876
"binddn=\"cn=admin,cn\n"
11877
" =config\" bindmethod=simple credentials=secret searchbase=\"cn=config\" "
11879
" shAndPersist retry=\"5 5 300 5\" timeout=1 starttls=yes\n"
11880
"olcSyncrepl: {1}rid=002 provider=ldap://ldap02.example.com "
11881
"binddn=\"cn=admin,cn\n"
11882
" =config\" bindmethod=simple credentials=secret searchbase=\"cn=config\" "
11884
" shAndPersist retry=\"5 5 300 5\" timeout=1 starttls=yes"
11887
#: serverguide/C/network-auth.xml:829(computeroutput)
11890
"Enter LDAP Password: \n"
11891
"<placeholder-1/>\n"
11893
"modifying entry \"olcDatabase={0}config,cn=config\"\n"
11896
#: serverguide/C/network-auth.xml:843(para)
11897
msgid "Now adjust the <emphasis>backend</emphasis> database replication:"
11900
#: serverguide/C/network-auth.xml:853(userinput)
11903
"dn: olcDatabase={1}hdb,cn=config\n"
11904
"replace: olcSyncrepl\n"
11905
"olcSyncrepl: {0}rid=003 provider=ldap://ldap01.example.com "
11906
"binddn=\"cn=admin,dc=example,dc=\n"
11907
" com\" bindmethod=simple credentials=secret searchbase=\"dc=example,dc=com\" "
11909
" efreshOnly interval=00:00:00:10 retry=\"5 5 300 5\" timeout=1 starttls=yes\n"
11910
"olcSyncrepl: {1}rid=004 provider=ldap://ldap02.example.com "
11911
"binddn=\"cn=admin,dc=example,dc=\n"
11912
" com\" bindmethod=simple credentials=secret searchbase=\"dc=example,dc=com\" "
11914
" efreshOnly interval=00:00:00:10 retry=\"5 5 300 5\" timeout=1 starttls=yes"
11917
#: serverguide/C/network-auth.xml:852(computeroutput) serverguide/C/network-auth.xml:2406(computeroutput)
11920
"Enter LDAP Password:\n"
11921
"<placeholder-1/>\n"
11923
"modifying entry \"olcDatabase={1}hdb,cn=config\""
11926
#: serverguide/C/network-auth.xml:865(para)
11928
"If the LDAP server hostname does not match the Fully Qualified Domain Name "
11929
"(FQDN) in the certificate, you may have to edit "
11930
"<filename>/etc/ldap/ldap.conf</filename> and add the following TLS options:"
11933
#: serverguide/C/network-auth.xml:870(programlisting)
11937
"TLS_CERT /etc/ssl/certs/server.crt\n"
11938
"TLS_KEY /etc/ssl/private/server.key\n"
11939
"TLS_CACERT /etc/ssl/certs/cacert.pem\n"
11942
#: serverguide/C/network-auth.xml:877(para)
11944
"Finally, restart <application>slapd</application> on each of the servers:"
11947
#: serverguide/C/network-auth.xml:890(title)
11948
msgid "LDAP Authentication"
11951
#: serverguide/C/network-auth.xml:892(para)
11953
"Once you have a working LDAP server, the <application>auth-client-"
11954
"config</application> and <application>libnss-ldap</application> packages "
11955
"take the pain out of configuring an Ubuntu client to authenticate using "
11956
"LDAP. To install the packages from, a terminal prompt enter:"
11959
#: serverguide/C/network-auth.xml:899(command)
11960
msgid "sudo apt-get install libnss-ldap"
11963
#: serverguide/C/network-auth.xml:902(para)
11965
"During the install a menu dialog will ask you connection details about your "
11969
#: serverguide/C/network-auth.xml:906(para)
11971
"If you make a mistake when entering your information you can execute the "
11972
"dialog again using:"
11975
#: serverguide/C/network-auth.xml:911(command)
11976
msgid "sudo dpkg-reconfigure ldap-auth-config"
11979
#: serverguide/C/network-auth.xml:914(para)
11981
"The results of the dialog can be seen in "
11982
"<filename>/etc/ldap.conf</filename>. If your server requires options not "
11983
"covered in the menu edit this file accordingly."
11986
#: serverguide/C/network-auth.xml:919(para)
11988
"Now that <application>libnss-ldap</application> is configured enable the "
11989
"<application>auth-client-config</application> LDAP profile by entering:"
11992
#: serverguide/C/network-auth.xml:925(command)
11993
msgid "sudo auth-client-config -t nss -p lac_ldap"
11996
#: serverguide/C/network-auth.xml:930(para)
11998
"<emphasis>-t:</emphasis> only modifies "
11999
"<filename>/etc/nsswitch.conf</filename>."
12002
#: serverguide/C/network-auth.xml:935(para)
12003
msgid "<emphasis>-p:</emphasis> name of the profile to enable, disable, etc."
12006
#: serverguide/C/network-auth.xml:940(para)
12008
"<emphasis>lac_ldap:</emphasis> the <application>auth-client-"
12009
"config</application> profile that is part of the <application>ldap-auth-"
12010
"config</application> package."
12013
#: serverguide/C/network-auth.xml:947(para)
12015
"Using the <application>pam-auth-update</application> utility, configure the "
12016
"system to use LDAP for authentication:"
12019
#: serverguide/C/network-auth.xml:952(command)
12020
msgid "sudo pam-auth-update"
12023
#: serverguide/C/network-auth.xml:955(para)
12025
"From the <application>pam-auth-update</application> menu, choose LDAP and "
12026
"any other authentication mechanisms you need."
12029
#: serverguide/C/network-auth.xml:959(para)
12031
"You should now be able to login using user credentials stored in the LDAP "
12035
#: serverguide/C/network-auth.xml:964(para)
12037
"If you are going to use LDAP to store Samba users you will need to configure "
12038
"the server to authenticate using LDAP. See <xref linkend=\"samba-ldap\"/> "
12042
#: serverguide/C/network-auth.xml:972(title)
12043
msgid "User and Group Management"
12046
#: serverguide/C/network-auth.xml:974(para)
12048
"The <application>ldap-utils</application> package comes with multiple "
12049
"utilities to manage the directory, but the long string of options needed, "
12050
"can make them a burden to use. The <application>ldapscripts</application> "
12051
"package contains configurable scripts to easily manage LDAP users and groups."
12054
#: serverguide/C/network-auth.xml:980(para)
12055
msgid "To install the package, from a terminal enter:"
12058
#: serverguide/C/network-auth.xml:985(command)
12059
msgid "sudo apt-get install ldapscripts"
12062
#: serverguide/C/network-auth.xml:988(para)
12064
"Next, edit the config file "
12065
"<filename>/etc/ldapscripts/ldapscripts.conf</filename> uncommenting and "
12066
"changing the following to match your environment:"
12069
#: serverguide/C/network-auth.xml:993(programlisting)
12073
"SERVER=localhost\n"
12074
"BINDDN='cn=admin,dc=example,dc=com'\n"
12075
"BINDPWDFILE=\"/etc/ldapscripts/ldapscripts.passwd\"\n"
12076
"SUFFIX='dc=example,dc=com'\n"
12077
"GSUFFIX='ou=Groups'\n"
12078
"USUFFIX='ou=People'\n"
12079
"MSUFFIX='ou=Computers'\n"
12085
#: serverguide/C/network-auth.xml:1006(para)
12087
"Now, create the <filename>ldapscripts.passwd</filename> file to allow "
12088
"authenticated access to the directory:"
12091
#: serverguide/C/network-auth.xml:1011(command)
12093
"sudo sh -c \"echo -n 'secret' > /etc/ldapscripts/ldapscripts.passwd\""
12096
#: serverguide/C/network-auth.xml:1012(command)
12097
msgid "sudo chmod 400 /etc/ldapscripts/ldapscripts.passwd"
12100
#: serverguide/C/network-auth.xml:1016(para)
12102
"Replace <quote>secret</quote> with the actual password for your LDAP admin "
12106
#: serverguide/C/network-auth.xml:1021(para)
12108
"The <application>ldapscripts</application> are now ready to help manage your "
12109
"directory. The following are some examples of how to use the scripts:"
12112
#: serverguide/C/network-auth.xml:1028(para)
12113
msgid "Create a new user:"
12116
#: serverguide/C/network-auth.xml:1032(command)
12117
msgid "sudo ldapadduser george example"
12120
#: serverguide/C/network-auth.xml:1034(para)
12122
"This will create a user with uid <emphasis role=\"italic\">george</emphasis> "
12123
"and set the user's primary group (gid) to <emphasis "
12124
"role=\"italic\">example</emphasis>"
12127
#: serverguide/C/network-auth.xml:1040(para)
12128
msgid "Change a user's password:"
12131
#: serverguide/C/network-auth.xml:1044(command)
12132
msgid "sudo ldapsetpasswd george"
12135
#: serverguide/C/network-auth.xml:1045(computeroutput)
12137
msgid "Changing password for user uid=george,ou=People,dc=example,dc=com"
12140
#: serverguide/C/network-auth.xml:1046(userinput)
12142
msgid "New Password: "
12145
#: serverguide/C/network-auth.xml:1047(userinput)
12147
msgid "New Password (verify): "
12150
#: serverguide/C/network-auth.xml:1051(para)
12151
msgid "Delete a user:"
12154
#: serverguide/C/network-auth.xml:1055(command)
12155
msgid "sudo ldapdeleteuser george"
12158
#: serverguide/C/network-auth.xml:1060(para)
12159
msgid "Add a group:"
12162
#: serverguide/C/network-auth.xml:1064(command)
12163
msgid "sudo ldapaddgroup qa"
12166
#: serverguide/C/network-auth.xml:1068(para)
12167
msgid "Delete a group:"
12170
#: serverguide/C/network-auth.xml:1072(command)
12171
msgid "sudo ldapdeletegroup qa"
12174
#: serverguide/C/network-auth.xml:1076(para)
12175
msgid "Add a user to a group:"
12178
#: serverguide/C/network-auth.xml:1080(command)
12179
msgid "sudo ldapaddusertogroup george qa"
12182
#: serverguide/C/network-auth.xml:1082(para)
12184
"You should now see a <emphasis>memberUid</emphasis> attribute for the "
12185
"<emphasis role=\"italic\">qa</emphasis> group with a value of <emphasis "
12186
"role=\"italic\">george</emphasis>."
12189
#: serverguide/C/network-auth.xml:1088(para)
12190
msgid "Remove a user from a group:"
12193
#: serverguide/C/network-auth.xml:1092(command)
12194
msgid "sudo ldapdeleteuserfromgroup george qa"
12197
#: serverguide/C/network-auth.xml:1094(para)
12199
"The <emphasis>memberUid</emphasis> attribute should now be removed from the "
12200
"<emphasis role=\"italic\">qa</emphasis> group."
12203
#: serverguide/C/network-auth.xml:1100(para)
12205
"The <application>ldapmodifyuser</application> script allows you to add, "
12206
"remove, or replace a user's attributes. The script uses the same syntax as "
12207
"the <application>ldapmodify</application> utility. For example:"
12210
#: serverguide/C/network-auth.xml:1105(command)
12211
msgid "sudo ldapmodifyuser george"
12214
#: serverguide/C/network-auth.xml:1106(computeroutput)
12217
"# About to modify the following entry :\n"
12218
"dn: uid=george,ou=People,dc=example,dc=com\n"
12219
"objectClass: account\n"
12220
"objectClass: posixAccount\n"
12223
"uidNumber: 1001\n"
12224
"gidNumber: 1001\n"
12225
"homeDirectory: /home/george\n"
12226
"loginShell: /bin/bash\n"
12228
"description: User account\n"
12229
"userPassword:: e1NTSEF9eXFsTFcyWlhwWkF1eGUybVdFWHZKRzJVMjFTSG9vcHk=\n"
12231
"# Enter your modifications here, end with CTRL-D.\n"
12232
"dn: uid=george,ou=People,dc=example,dc=com"
12235
#: serverguide/C/network-auth.xml:1122(userinput)
12239
"gecos: George Carlin"
12242
#: serverguide/C/network-auth.xml:1125(para)
12244
"The user's <emphasis>gecos</emphasis> should now be <quote>George "
12248
#: serverguide/C/network-auth.xml:1130(para)
12250
"Another great feature of <application>ldapscripts</application>, is the "
12251
"template system. Templates allow you to customize the attributes of user, "
12252
"group, and machine objectes. For example, to enable the "
12253
"<emphasis>user</emphasis> template edit "
12254
"<filename>/etc/ldapscripts/ldapscripts.conf</filename> changing:"
12257
#: serverguide/C/network-auth.xml:1137(programlisting)
12261
"UTEMPLATE=\"/etc/ldapscripts/ldapadduser.template\"\n"
12264
#: serverguide/C/network-auth.xml:1141(para)
12266
"There are <emphasis role=\"italic\">sample</emphasis> templates in the "
12267
"<filename>/etc/ldapscripts</filename> directory. Copy or rename the "
12268
"<filename>ldapadduser.template.sample</filename> file to "
12269
"<filename>/etc/ldapscripts/ldapadduser.template</filename>:"
12272
#: serverguide/C/network-auth.xml:1148(command)
12274
"sudo cp /etc/ldapscripts/ldapadduser.template.sample "
12275
"/etc/ldapscripts/ldapadduser.template"
12278
#: serverguide/C/network-auth.xml:1151(para)
12280
"Edit the new template to add the desired attributes. The following will "
12281
"create new user's as with an <emphasis>objectClass</emphasis> of "
12282
"<emphasis>inetOrgPerson</emphasis>:"
12285
#: serverguide/C/network-auth.xml:1156(programlisting)
12289
"dn: uid=<user>,<usuffix>,<suffix>\n"
12290
"objectClass: inetOrgPerson\n"
12291
"objectClass: posixAccount\n"
12292
"cn: <user>\n"
12293
"sn: <ask>\n"
12294
"uid: <user>\n"
12295
"uidNumber: <uid>\n"
12296
"gidNumber: <gid>\n"
12297
"homeDirectory: <home>\n"
12298
"loginShell: <shell>\n"
12299
"gecos: <user>\n"
12300
"description: User account\n"
12301
"title: Employee\n"
12304
#: serverguide/C/network-auth.xml:1172(para)
12306
"Notice the <emphasis><ask></emphasis> option used for the "
12307
"<emphasis>cn</emphasis> value. Using <ask> will configure "
12308
"<application>ldapadduser</application> to prompt you for the attribute value "
12309
"during user creation."
12312
#: serverguide/C/network-auth.xml:1180(para)
12314
"There are more useful scripts in the package, to see a full list enter: "
12315
"<command>dpkg -L ldapscripts | grep bin</command>"
12318
#: serverguide/C/network-auth.xml:1189(para)
12320
"For more information see <ulink url=\"http://www.openldap.org/\">OpenLDAP "
12321
"Home Page</ulink>"
12324
#: serverguide/C/network-auth.xml:1194(para)
12326
"Though starting to show it's age, a great source for in depth LDAP "
12327
"information is O'Reilly's <ulink "
12328
"url=\"http://www.oreilly.com/catalog/ldapsa/\">LDAP System "
12329
"Administration</ulink>"
12332
#: serverguide/C/network-auth.xml:1200(para)
12334
"Packt's <ulink url=\"http://www.packtpub.com/OpenLDAP-Developers-Server-Open-"
12335
"Source-Linux/book\">Mastering OpenLDAP</ulink> is a great reference covering "
12336
"newer versions of OpenLDAP."
12339
#: serverguide/C/network-auth.xml:1206(para)
12341
"For more information on <application>auth-client-config</application> see "
12342
"the man page: <command>man auth-client-config</command>."
12345
#: serverguide/C/network-auth.xml:1211(para)
12347
"For more details regarding the <application>ldapscripts</application> "
12348
"package see the man pages: <command>man ldapscripts</command>, <command>man "
12349
"ldapadduser</command>, <command>man ldapaddgroup</command>, etc."
12352
#: serverguide/C/network-auth.xml:1221(title)
12353
msgid "Samba and LDAP"
12356
#: serverguide/C/network-auth.xml:1223(para)
12358
"This section covers configuring Samba to use LDAP for user, group, and "
12359
"machine account information and authentication. The assumption is, you "
12360
"already have a working OpenLDAP directory installed and the server is "
12361
"configured to use it for authentication. See <xref linkend=\"openldap-"
12362
"server\"/> and <xref linkend=\"openldap-auth-config\"/> for details on "
12363
"setting up OpenLDAP."
12366
#: serverguide/C/network-auth.xml:1232(para)
12368
"There are three packages needed when integrating Samba with LDAP. "
12369
"<application>samba</application>, <application>samba-doc</application>, and "
12370
"<application>smbldap-tools</application> packages . To install the packages, "
12371
"from a terminal enter:"
12374
#: serverguide/C/network-auth.xml:1238(command)
12375
msgid "sudo apt-get install samba samba-doc smbldap-tools"
12378
#: serverguide/C/network-auth.xml:1241(para)
12380
"Strictly speaking the <application>smbldap-tools</application> package isn't "
12381
"needed, but unless you have another package or custom scripts, a method of "
12382
"managing users, groups, and computer accounts is needed."
12385
#: serverguide/C/network-auth.xml:1248(title)
12386
msgid "OpenLDAP Configuration"
12389
#: serverguide/C/network-auth.xml:1250(para)
12391
"In order for Samba to use OpenLDAP as a <emphasis>passdb backend</emphasis>, "
12392
"the user objects in the directory will need additional attributes. This "
12393
"section assumes you want Samba to be configured as a Windows NT domain "
12394
"controller, and will add the necessary LDAP objects and attributes."
12397
#: serverguide/C/network-auth.xml:1258(para)
12399
"The Samba attributes are defined in the <filename>samba.schema</filename> "
12400
"file which is part of the <application>samba-doc</application> package. The "
12401
"schema file needs to be unzipped and copied to "
12402
"<filename>/etc/ldap/schema</filename>. From a terminal prompt enter:"
12405
#: serverguide/C/network-auth.xml:1265(command)
12407
"sudo cp /usr/share/doc/samba-doc/examples/LDAP/samba.schema.gz "
12408
"/etc/ldap/schema/"
12411
#: serverguide/C/network-auth.xml:1266(command)
12412
msgid "sudo gzip -d /etc/ldap/schema/samba.schema.gz"
12415
#: serverguide/C/network-auth.xml:1272(para)
12417
"The <emphasis>samba</emphasis> schema needs to be added to the "
12418
"<emphasis>cn=config</emphasis> tree. The procedure to add a new schema to "
12419
"<application>slapd</application> is also detailed in <xref "
12420
"linkend=\"openldap-configuration\"/>."
12423
#: serverguide/C/network-auth.xml:1280(para) serverguide/C/network-auth.xml:2305(para)
12425
"First, create a configuration file named "
12426
"<filename>schema_convert.conf</filename>, or a similar descriptive name, "
12427
"containing the following lines:"
12430
#: serverguide/C/network-auth.xml:1285(programlisting)
12434
"include /etc/ldap/schema/core.schema\n"
12435
"include /etc/ldap/schema/collective.schema\n"
12436
"include /etc/ldap/schema/corba.schema\n"
12437
"include /etc/ldap/schema/cosine.schema\n"
12438
"include /etc/ldap/schema/duaconf.schema\n"
12439
"include /etc/ldap/schema/dyngroup.schema\n"
12440
"include /etc/ldap/schema/inetorgperson.schema\n"
12441
"include /etc/ldap/schema/java.schema\n"
12442
"include /etc/ldap/schema/misc.schema\n"
12443
"include /etc/ldap/schema/nis.schema\n"
12444
"include /etc/ldap/schema/openldap.schema\n"
12445
"include /etc/ldap/schema/ppolicy.schema\n"
12446
"include /etc/ldap/schema/samba.schema\n"
12449
#: serverguide/C/network-auth.xml:1315(para) serverguide/C/network-auth.xml:2340(para)
12451
"Now use <application>slaptest</application> to convert the schema files:"
12454
#: serverguide/C/network-auth.xml:1323(para) serverguide/C/network-auth.xml:2348(para)
12456
"Change the above file and path names to match your own if they are different."
12459
#: serverguide/C/network-auth.xml:1330(para)
12461
"Edit the generated "
12462
"<filename>/tmp/ldif_output/cn=config/cn=schema/cn={12}samba.ldif</filename> "
12463
"file, changing the following attributes:"
12466
#: serverguide/C/network-auth.xml:1335(programlisting)
12470
"dn: cn=samba,cn=schema,cn=config\n"
12475
#: serverguide/C/network-auth.xml:1345(programlisting)
12479
"structuralObjectClass: olcSchemaConfig\n"
12480
"entryUUID: b53b75ca-083f-102d-9fff-2f64fd123c95\n"
12481
"creatorsName: cn=config\n"
12482
"createTimestamp: 20080827045234Z\n"
12483
"entryCSN: 20080827045234.341425Z#000000#000#000000\n"
12484
"modifiersName: cn=config\n"
12485
"modifyTimestamp: 20080827045234Z\n"
12488
#: serverguide/C/network-auth.xml:1370(command)
12490
"ldapadd -x -D cn=admin,cn=config -W -f /tmp/ldif_output/cn\\=config/cn\\"
12491
"=schema/cn\\=\\{12\\}samba.ldif"
12494
#: serverguide/C/network-auth.xml:1376(para)
12496
"There should now be a <emphasis>dn: "
12497
"cn={X}misc,cn=schema,cn=config</emphasis>, where \"X\" is the next "
12498
"sequential schema, entry in the cn=config tree."
12501
#: serverguide/C/network-auth.xml:1384(para)
12503
"Copy and paste the following into a file named "
12504
"<filename>samba_indexes.ldif</filename>:"
12507
#: serverguide/C/network-auth.xml:1388(programlisting)
12511
"dn: olcDatabase={1}hdb,cn=config\n"
12512
"changetype: modify\n"
12513
"add: olcDbIndex\n"
12514
"olcDbIndex: uidNumber eq\n"
12515
"olcDbIndex: gidNumber eq\n"
12516
"olcDbIndex: loginShell eq\n"
12517
"olcDbIndex: uid eq,pres,sub\n"
12518
"olcDbIndex: memberUid eq,pres,sub\n"
12519
"olcDbIndex: uniqueMember eq,pres\n"
12520
"olcDbIndex: sambaSID eq\n"
12521
"olcDbIndex: sambaPrimaryGroupSID eq\n"
12522
"olcDbIndex: sambaGroupType eq\n"
12523
"olcDbIndex: sambaSIDList eq\n"
12524
"olcDbIndex: sambaDomainName eq\n"
12525
"olcDbIndex: default sub\n"
12528
#: serverguide/C/network-auth.xml:1406(para)
12530
"Using the <application>ldapmodify</application> utility load the new indexes:"
12533
#: serverguide/C/network-auth.xml:1411(command)
12534
msgid "ldapmodify -x -D cn=admin,cn=config -W -f samba_indexes.ldif"
12537
#: serverguide/C/network-auth.xml:1413(para)
12539
"If all went well you should see the new indexes using "
12540
"<application>ldapsearch</application>:"
12543
#: serverguide/C/network-auth.xml:1418(command)
12545
"ldapsearch -xLLL -D cn=admin,cn=config -x -b cn=config -W olcDatabase={1}hdb"
12548
#: serverguide/C/network-auth.xml:1424(para)
12550
"Next, configure the <application>smbldap-tools</application> package to "
12551
"match your environment. The package comes with a configuration script that "
12552
"will ask questions about the needed options. To run the script enter:"
12555
#: serverguide/C/network-auth.xml:1430(command)
12556
msgid "sudo gzip -d /usr/share/doc/smbldap-tools/configure.pl.gz"
12559
#: serverguide/C/network-auth.xml:1431(command)
12560
msgid "sudo perl /usr/share/doc/smbldap-tools/configure.pl"
12563
#: serverguide/C/network-auth.xml:1434(para)
12565
"Once you have answered the questions, there should be <filename>/etc/smbldap-"
12566
"tools/smbldap.conf</filename> and <filename>/etc/smbldap-"
12567
"tools/smbldap_bind.conf</filename> files. These files are generated by the "
12568
"configure script, so if you made any mistakes while executing the script it "
12569
"may be simpler to edit the file appropriately."
12572
#: serverguide/C/network-auth.xml:1444(para)
12574
"The <application>smbldap-populate</application> script will add the "
12575
"necessary users, groups, and LDAP objects required for Samba. It is a good "
12576
"idea to make a backup LDAP Data Interchange Format (LDIF) file with "
12577
"<application>slapcat</application> before executing the command:"
12580
#: serverguide/C/network-auth.xml:1451(command)
12581
msgid "sudo slapcat -l backup.ldif"
12584
#: serverguide/C/network-auth.xml:1457(para)
12586
"Once you have a current backup execute <application>smbldap-"
12587
"populate</application> by entering:"
12590
#: serverguide/C/network-auth.xml:1462(command)
12591
msgid "sudo smbldap-populate"
12594
#: serverguide/C/network-auth.xml:1466(para)
12596
"You can create an LDIF file containing the new Samba objects by executing "
12597
"<command>sudo smbldap-populate -e samba.ldif</command>. This allows you to "
12598
"look over the changes making sure everything is correct."
12601
#: serverguide/C/network-auth.xml:1474(para)
12603
"Your LDAP directory now has the necessary domain information to authenticate "
12607
#: serverguide/C/network-auth.xml:1480(title)
12608
msgid "Samba Configuration"
12611
#: serverguide/C/network-auth.xml:1482(para)
12613
"There a multiple ways to configure Samba for details on some common "
12614
"configurations see <xref linkend=\"windows-networking\"/>. To configure "
12615
"Samba to use LDAP, edit the main Samba configuration file "
12616
"<filename>/etc/samba/smb.conf</filename> commenting the <emphasis>passdb "
12617
"backend</emphasis> option and adding the following:"
12620
#: serverguide/C/network-auth.xml:1488(programlisting)
12624
"# passdb backend = tdbsam\n"
12626
"# LDAP Settings\n"
12627
" passdb backend = ldapsam:ldap://hostname\n"
12628
" ldap suffix = dc=example,dc=com\n"
12629
" ldap user suffix = ou=People\n"
12630
" ldap group suffix = ou=Groups\n"
12631
" ldap machine suffix = ou=Computers\n"
12632
" ldap idmap suffix = ou=Idmap\n"
12633
" ldap admin dn = cn=admin,dc=example,dc=com\n"
12634
" ldap ssl = start tls\n"
12635
" ldap passwd sync = yes\n"
12637
" add machine script = sudo /usr/sbin/smbldap-useradd -t 0 -w \"%u\"\n"
12640
#: serverguide/C/network-auth.xml:1505(para)
12641
msgid "Restart <application>samba</application> to enable the new settings:"
12644
#: serverguide/C/network-auth.xml:1513(para)
12646
"Now Samba needs to know the LDAP admin password. From a terminal prompt "
12650
#: serverguide/C/network-auth.xml:1518(command)
12651
msgid "sudo smbpasswd -w secret"
12654
#: serverguide/C/network-auth.xml:1522(para)
12656
"Replacing <emphasis role=\"italic\">secret</emphasis> with your LDAP admin "
12660
#: serverguide/C/network-auth.xml:1527(para)
12662
"If you currently have users in LDAP, and you want them to authenticate using "
12663
"Samba, they will need some Samba attributes defined in the "
12664
"<filename>samba.schema</filename> file. Add the Samba attributes to existing "
12665
"users using the <application>smbpasswd</application> utility, replacing "
12666
"<emphasis role=\"italic\">username</emphasis> with an actual user:"
12669
#: serverguide/C/network-auth.xml:1535(command)
12670
msgid "sudo smbpasswd -a username"
12673
#: serverguide/C/network-auth.xml:1538(para)
12674
msgid "You will then be asked to enter the user's password."
12677
#: serverguide/C/network-auth.xml:1542(para)
12679
"To add new user, group, and machine accounts use the utilities from the "
12680
"<application>smbldap-tools</application> package. Here are some examples:"
12683
#: serverguide/C/network-auth.xml:1549(para)
12685
"To add a new user to LDAP with Samba attributes enter the following, "
12686
"replacing username with an actual username:"
12689
#: serverguide/C/network-auth.xml:1553(command)
12690
msgid "sudo smbldap-useradd -a -P username"
12693
#: serverguide/C/network-auth.xml:1555(para)
12695
"The <emphasis>-a</emphasis> option adds the Samba attributes, and the "
12696
"<emphasis>-P</emphasis> options calls the <application>smbldap-"
12697
"passwd</application> utility after the user is created allowing you to enter "
12698
"a password for the user."
12701
#: serverguide/C/network-auth.xml:1561(para)
12702
msgid "To remove a user from the directory enter:"
12705
#: serverguide/C/network-auth.xml:1565(command)
12706
msgid "sudo smbldap-userdel username"
12709
#: serverguide/C/network-auth.xml:1567(para)
12711
"The <application>smbldap-userdel</application> utility also has a <emphasis>-"
12712
"r</emphasis> option to remove the user's home directory."
12715
#: serverguide/C/network-auth.xml:1572(para)
12717
"Use <application>smbldap-groupadd</application> to add a group, replacing "
12718
"groupname with an appropriate group:"
12721
#: serverguide/C/network-auth.xml:1576(command)
12722
msgid "sudo smbldap-groupadd -a groupname"
12725
#: serverguide/C/network-auth.xml:1578(para)
12727
"Similar to <application>smbldap-useradd</application>, the <emphasis>-"
12728
"a</emphasis> adds the Samba attributes."
12731
#: serverguide/C/network-auth.xml:1583(para)
12733
"To add a user to a group use <application>smbldap-groupmod</application>:"
12736
#: serverguide/C/network-auth.xml:1587(command)
12737
msgid "sudo smbldap-groupmod -m username groupname"
12740
#: serverguide/C/network-auth.xml:1589(para)
12742
"Be sure to replace <emphasis>username</emphasis> with a real user. Also, the "
12743
"<emphasis>-m</emphasis> option can add more than one user at a time by "
12744
"listing them in <emphasis>comma separated</emphasis> format."
12747
#: serverguide/C/network-auth.xml:1595(para)
12749
"<application>smbldap-groupmod</application> can also be used to remove a "
12750
"user from a group:"
12753
#: serverguide/C/network-auth.xml:1599(command)
12754
msgid "sudo smbldap-groupmod -x username groupname"
12757
#: serverguide/C/network-auth.xml:1603(para)
12759
"Additionally, the <application>smbldap-useradd</application> utility can add "
12760
"Samba machine accounts:"
12763
#: serverguide/C/network-auth.xml:1607(command)
12764
msgid "sudo smbldap-useradd -t 0 -w username"
12767
#: serverguide/C/network-auth.xml:1609(para)
12769
"Replace <emphasis>username</emphasis> with the name of the workstation. The "
12770
"<emphasis>-t 0</emphasis> option creates the machine account without a "
12771
"delay, while the <emphasis>-w</emphasis> option specifies the user as a "
12772
"machine account. Also, note the <emphasis>add machine script</emphasis> "
12773
"option in <filename>/etc/samba/smb.conf</filename> was changed to use "
12774
"<application>smbldap-useradd</application>."
12777
#: serverguide/C/network-auth.xml:1618(para)
12779
"There are more useful utilities and options in the <application>smbldap-"
12780
"tools</application> package. The man page for each utility provides more "
12784
#: serverguide/C/network-auth.xml:1629(para)
12786
"There are multiple places where LDAP and Samba is documented in the <ulink "
12787
"url=\"http://samba.org/samba/docs/man/Samba-HOWTO-Collection/\">Samba HOWTO "
12788
"Collection</ulink>."
12791
#: serverguide/C/network-auth.xml:1635(para)
12793
"Specifically see the <ulink url=\"http://samba.org/samba/docs/man/Samba-"
12794
"HOWTO-Collection/passdb.html\">passdb section</ulink>."
12797
#: serverguide/C/network-auth.xml:1641(para)
12799
"Another good site is <ulink url=\"http://www.iallanis.info/smbldap-"
12800
"tools/docs/samba-ldap-howto/\">Samba OpenLDAP HOWTO</ulink>."
12803
#: serverguide/C/network-auth.xml:1647(para)
12805
"Again, for more information on <application>smbldap-tools</application> see "
12806
"the man pages: <command>man smbldap-useradd</command>, <command>man smbldap-"
12807
"groupadd</command>, <command>man smbldap-populate</command>, etc."
12810
#: serverguide/C/network-auth.xml:1657(title)
12814
#: serverguide/C/network-auth.xml:1659(para)
12816
"<application>Kerberos</application> is a network authentication system based "
12817
"on the principal of a trusted third party. The other two parties being the "
12818
"user and the service the user wishes to authenticate to. Not all services "
12819
"and applications can use Kerberos, but for those that can, it brings the "
12820
"network environment one step closer to being Single Sign On (SSO)."
12823
#: serverguide/C/network-auth.xml:1665(para)
12825
"This section covers installation and configuration of a Kerberos server, and "
12826
"some example client configurations."
12829
#: serverguide/C/network-auth.xml:1672(para)
12831
"If you are new to Kerberos there are a few terms that are good to understand "
12832
"before setting up a Kerberos server. Most of the terms will relate to things "
12833
"you may be familiar with in other environments:"
12836
#: serverguide/C/network-auth.xml:1679(para)
12838
"<emphasis>Principal:</emphasis> any users, computers, and services provided "
12839
"by servers need to be defined as Kerberos Principals."
12842
#: serverguide/C/network-auth.xml:1684(para)
12844
"<emphasis>Instances:</emphasis> are used for service principals and special "
12845
"administrative principals."
12848
#: serverguide/C/network-auth.xml:1689(para)
12850
"<emphasis>Realms:</emphasis> the unique realm of control provided by the "
12851
"Kerberos installation. Usually the DNS domain converted to uppercase "
12855
#: serverguide/C/network-auth.xml:1695(para)
12857
"<emphasis>Key Distribution Center:</emphasis> (KDC) consist of three parts, "
12858
"a database of all principals, the authentication server, and the ticket "
12859
"granting server. For each realm there must be at least one KDC."
12862
#: serverguide/C/network-auth.xml:1701(para)
12864
"<emphasis>Ticket Granting Ticket:</emphasis> issued by the Authentication "
12865
"Server (AS), the Ticket Granting Ticket (TGT) is encrypted in the user's "
12866
"password which is known only to the user and the KDC."
12869
#: serverguide/C/network-auth.xml:1707(para)
12871
"<emphasis>Ticket Granting Server:</emphasis> (TGS) issues service tickets to "
12872
"clients upon request."
12875
#: serverguide/C/network-auth.xml:1712(para)
12877
"<emphasis>Tickets:</emphasis> confirm the identity of the two principals. "
12878
"One principal being a user and the other a service requested by the user. "
12879
"Tickets establish an encryption key used for secure communication during the "
12880
"authenticated session."
12883
#: serverguide/C/network-auth.xml:1718(para)
12885
"<emphasis>Keytab Files:</emphasis> are files extracted from the KDC "
12886
"principal database and contain the encryption key for a service or host."
12889
#: serverguide/C/network-auth.xml:1725(para)
12891
"To put the pieces together, a Realm has at least one KDC, preferably two for "
12892
"redundancy, which contains a database of Principals. When a user principal "
12893
"logs into a workstation, configured for Kerberos authentication, the KDC "
12894
"issues a Ticket Granting Ticket (TGT). If the user supplied credentials "
12895
"match, the user is authenticated and can then request tickets for Kerberized "
12896
"services from the Ticket Granting Server (TGS). The service tickets allow "
12897
"the user to authenticate to the service without entering another username "
12901
#: serverguide/C/network-auth.xml:1734(title)
12902
msgid "Kerberos Server"
12905
#: serverguide/C/network-auth.xml:1738(para)
12907
"Before installing the Kerberos server a properly configured DNS server is "
12908
"needed for your domain. Since the Kerberos Realm by convention matches the "
12909
"domain name, this section uses the <emphasis>example.com</emphasis> domain "
12910
"configured in <xref linkend=\"dns-primarymaster-configuration\"/>."
12913
#: serverguide/C/network-auth.xml:1744(para)
12915
"Also, Kerberos is a time sensitive protocol. So if the local system time "
12916
"between a client machine and the server differs by more than five minutes "
12917
"(by default), the workstation will not be able to authenticate. To correct "
12918
"the problem all hosts should have their time synchronized using the "
12919
"<emphasis>Network Time Protocol (NTP)</emphasis>. For details on setting up "
12920
"NTP see <xref linkend=\"NTP\"/>."
12923
#: serverguide/C/network-auth.xml:1751(para)
12925
"The first step in installing a Kerberos Realm is to install the "
12926
"<application>krb5-kdc</application> and <application>krb5-admin-"
12927
"server</application> packages. From a terminal enter:"
12930
#: serverguide/C/network-auth.xml:1757(command) serverguide/C/network-auth.xml:1932(command)
12931
msgid "sudo apt-get install krb5-kdc krb5-admin-server"
12934
#: serverguide/C/network-auth.xml:1760(para)
12936
"You will be asked at the end of the install to supply a name for the "
12937
"Kerberos and Admin servers, which may or may not be the same server, for the "
12941
#: serverguide/C/network-auth.xml:1765(para)
12943
"Next, create the new realm with the <application>kdb5_newrealm</application> "
12947
#: serverguide/C/network-auth.xml:1770(command)
12948
msgid "sudo krb5_newrealm"
12951
#: serverguide/C/network-auth.xml:1777(para)
12953
"The questions asked during installation are used to configure the "
12954
"<filename>/etc/krb5.conf</filename> file. If you need to adjust the Key "
12955
"Distribution Center (KDC) settings simply edit the file and restart the "
12956
"<application>krb5-kdc</application> daemon."
12959
#: serverguide/C/network-auth.xml:1785(para)
12961
"Now that the KDC running an admin user is needed. It is recommended to use a "
12962
"different username from your everyday username. Using the "
12963
"<application>kadmin.local</application> utility in a terminal prompt enter:"
12966
#: serverguide/C/network-auth.xml:1791(command) serverguide/C/network-auth.xml:2583(command)
12967
msgid "sudo kadmin.local"
12970
#: serverguide/C/network-auth.xml:1792(computeroutput)
12973
"Authenticating as principal root/admin@EXAMPLE.COM with password.\n"
12977
#: serverguide/C/network-auth.xml:1793(userinput)
12979
msgid " addprinc steve/admin"
12982
#: serverguide/C/network-auth.xml:1794(computeroutput)
12985
"WARNING: no policy specified for steve/admin@EXAMPLE.COM; defaulting to no "
12987
"Enter password for principal \"steve/admin@EXAMPLE.COM\": \n"
12988
"Re-enter password for principal \"steve/admin@EXAMPLE.COM\": \n"
12989
"Principal \"steve/admin@EXAMPLE.COM\" created.\n"
12993
#: serverguide/C/network-auth.xml:1798(userinput)
12998
#: serverguide/C/network-auth.xml:1801(para)
13000
"In the the above example <emphasis role=\"italic\">steve</emphasis> is the "
13001
"<emphasis>Principal</emphasis>, <emphasis role=\"italic\">/admin</emphasis> "
13002
"is an <emphasis>Instance</emphasis>, and <emphasis "
13003
"role=\"italic\">@EXAMPLE.COM</emphasis> signifies the realm. The <emphasis "
13004
"role=\"italic\">\"every day\"</emphasis> Principal would be "
13005
"<emphasis>steve@EXAMPLE.COM</emphasis>, and should have only normal user "
13009
#: serverguide/C/network-auth.xml:1809(para)
13011
"Replace <emphasis>EXAMPLE.COM</emphasis> and <emphasis>steve</emphasis> with "
13012
"your Realm and admin username."
13015
#: serverguide/C/network-auth.xml:1817(para)
13017
"Next, the new admin user needs to have the appropriate Access Control List "
13018
"(ACL) permissions. The permissions are configured in the "
13019
"<filename>/etc/krb5kdc/kadm5.acl</filename> file:"
13022
#: serverguide/C/network-auth.xml:1822(programlisting)
13026
"steve/admin@EXAMPLE.COM *\n"
13029
#: serverguide/C/network-auth.xml:1826(para)
13031
"This entry grants <emphasis>steve/admin</emphasis> the ability to perform "
13032
"any operation on all principals in the realm."
13035
#: serverguide/C/network-auth.xml:1833(para)
13037
"Now restart the <application>krb5-admin-server</application> for the new ACL "
13041
#: serverguide/C/network-auth.xml:1838(command)
13042
msgid "sudo /etc/init.d/krb5-admin-server restart"
13045
#: serverguide/C/network-auth.xml:1844(para)
13047
"The new user principal can be tested using the <application>kinit "
13048
"utility</application>:"
13051
#: serverguide/C/network-auth.xml:1849(command)
13052
msgid "kinit steve/admin"
13055
#: serverguide/C/network-auth.xml:1850(computeroutput)
13057
msgid "steve/admin@EXAMPLE.COM's Password:"
13060
#: serverguide/C/network-auth.xml:1853(para)
13062
"After entering the password, use the <application>klist</application> "
13063
"utility to view information about the Ticket Granting Ticket (TGT):"
13066
#: serverguide/C/network-auth.xml:1859(command) serverguide/C/network-auth.xml:2194(command)
13070
#: serverguide/C/network-auth.xml:1860(computeroutput)
13073
"Credentials cache: FILE:/tmp/krb5cc_1000\n"
13074
" Principal: steve/admin@EXAMPLE.COM\n"
13076
" Issued Expires Principal\n"
13077
"Jul 13 17:53:34 Jul 14 03:53:34 krbtgt/EXAMPLE.COM@EXAMPLE.COM"
13080
#: serverguide/C/network-auth.xml:1867(para)
13082
"You may need to add an entry into the <filename>/etc/hosts</filename> for "
13083
"the KDC. For example:"
13086
#: serverguide/C/network-auth.xml:1871(programlisting)
13090
"192.168.0.1 kdc01.example.com kdc01\n"
13093
#: serverguide/C/network-auth.xml:1875(para)
13095
"Replacing <emphasis>192.168.0.1</emphasis> with the IP address of your KDC."
13098
#: serverguide/C/network-auth.xml:1882(para)
13100
"In order for clients to determine the KDC for the Realm some DNS SRV records "
13101
"are needed. Add the following to "
13102
"<filename>/etc/named/db.example.com</filename>:"
13105
#: serverguide/C/network-auth.xml:1887(programlisting)
13109
"_kerberos._udp.EXAMPLE.COM. IN SRV 1 0 88 kdc01.example.com.\n"
13110
"_kerberos._tcp.EXAMPLE.COM. IN SRV 1 0 88 kdc01.example.com.\n"
13111
"_kerberos._udp.EXAMPLE.COM. IN SRV 10 0 88 kdc02.example.com. \n"
13112
"_kerberos._tcp.EXAMPLE.COM. IN SRV 10 0 88 kdc02.example.com. \n"
13113
"_kerberos-adm._tcp.EXAMPLE.COM. IN SRV 1 0 749 kdc01.example.com.\n"
13114
"_kpasswd._udp.EXAMPLE.COM. IN SRV 1 0 464 kdc01.example.com.\n"
13117
#: serverguide/C/network-auth.xml:1897(para)
13119
"Replace <emphasis>EXAMPLE.COM</emphasis>, <emphasis>kdc01</emphasis>, and "
13120
"<emphasis>kdc02</emphasis> with your domain name, primary KDC, and secondary "
13124
#: serverguide/C/network-auth.xml:1903(para)
13126
"See <xref linkend=\"dns\"/> for detailed instructions on setting up DNS."
13129
#: serverguide/C/network-auth.xml:1910(para)
13130
msgid "Your new Kerberos Realm is now ready to authenticate clients."
13133
#: serverguide/C/network-auth.xml:1917(title)
13134
msgid "Secondary KDC"
13137
#: serverguide/C/network-auth.xml:1919(para)
13139
"Once you have one Key Distribution Center (KDC) on your network, it is good "
13140
"practice to have a Secondary KDC in case the primary becomes unavailable."
13143
#: serverguide/C/network-auth.xml:1927(para)
13145
"First, install the packages, and when asked for the Kerberos and Admin "
13146
"server names enter the name of the Primary KDC:"
13149
#: serverguide/C/network-auth.xml:1938(para)
13151
"Once you have the packages installed, create the Secondary KDC's host "
13152
"principal. From a terminal prompt, enter:"
13155
#: serverguide/C/network-auth.xml:1943(command)
13156
msgid "kadmin -q \"addprinc -randkey host/kdc02.example.com\""
13159
#: serverguide/C/network-auth.xml:1947(para)
13161
"After, issuing any <application>kadmin</application> commands you will be "
13162
"prompted for your <emphasis>username/admin@EXAMPLE.COM</emphasis> principal "
13166
#: serverguide/C/network-auth.xml:1956(para)
13167
msgid "Extract the <emphasis>keytab</emphasis> file:"
13170
#: serverguide/C/network-auth.xml:1961(command)
13171
msgid "kadmin -q \"ktadd -k keytab.kdc02 host/kdc02.example.com\""
13174
#: serverguide/C/network-auth.xml:1967(para)
13176
"There should now be a <filename>keytab.kdc02</filename> in the current "
13177
"directory, move the file to <filename>/etc/krb5.keytab</filename>:"
13180
#: serverguide/C/network-auth.xml:1973(command)
13181
msgid "sudo mv keytab.kdc02 /etc/krb5.keytab"
13184
#: serverguide/C/network-auth.xml:1977(para)
13186
"If the path to the <filename>keytab.kdc02</filename> file is different "
13187
"adjust accordingly."
13190
#: serverguide/C/network-auth.xml:1982(para)
13192
"Also, you can list the principals in a Keytab file, which can be useful when "
13193
"troubleshooting, using the <application>klist</application> utility:"
13196
#: serverguide/C/network-auth.xml:1988(command)
13197
msgid "sudo klist -k /etc/krb5.keytab"
13200
#: serverguide/C/network-auth.xml:1994(para)
13202
"Next, there needs to be a <filename>kpropd.acl</filename> file on each KDC "
13203
"that lists all KDCs for the Realm. For example, on both primary and "
13204
"secondary KDC, create <filename>/etc/krb5kdc/kpropd.acl</filename>:"
13207
#: serverguide/C/network-auth.xml:1999(programlisting)
13211
"host/kdc01.example.com@EXAMPLE.COM\n"
13212
"host/kdc02.example.com@EXAMPLE.COM\n"
13215
#: serverguide/C/network-auth.xml:2007(para)
13216
msgid "Create an empty database on the <emphasis>Secondary KDC</emphasis>:"
13219
#: serverguide/C/network-auth.xml:2012(command)
13220
msgid "sudo kdb5_util -s create"
13223
#: serverguide/C/network-auth.xml:2018(para)
13225
"Now start the <application>kpropd</application> daemon, which listens for "
13226
"connections from the <application>kprop</application> utility. "
13227
"<application>kprop</application> is used to transfer dump files:"
13230
#: serverguide/C/network-auth.xml:2025(command)
13231
msgid "sudo kpropd -S"
13234
#: serverguide/C/network-auth.xml:2031(para)
13236
"From a terminal on the <emphasis>Primary KDC</emphasis>, create a dump file "
13237
"of the principal database:"
13240
#: serverguide/C/network-auth.xml:2036(command)
13241
msgid "sudo kdb5_util dump /var/lib/krb5kdc/dump"
13244
#: serverguide/C/network-auth.xml:2042(para)
13246
"Extract the Primary KDC's <emphasis>keytab</emphasis> file and copy it to "
13247
"<filename>/etc/krb5.keytab</filename>:"
13250
#: serverguide/C/network-auth.xml:2047(command)
13251
msgid "kadmin -q \"ktadd -k keytab.kdc01 host/kdc01.example.com\""
13254
#: serverguide/C/network-auth.xml:2048(command)
13255
msgid "sudo mv keytab.kdc01 /etc/kr5b.keytab"
13258
#: serverguide/C/network-auth.xml:2052(para)
13260
"Make sure there is a <emphasis>host</emphasis> for "
13261
"<emphasis>kdc01.example.com</emphasis> before extracting the Keytab."
13264
#: serverguide/C/network-auth.xml:2060(para)
13266
"Using the <application>kprop</application> utility push the database to the "
13270
#: serverguide/C/network-auth.xml:2065(command)
13271
msgid "sudo kprop -r EXAMPLE.COM -f /var/lib/krb5kdc/dump kdc02.example.com"
13274
#: serverguide/C/network-auth.xml:2069(para)
13276
"There should be a <emphasis>SUCCEEDED</emphasis> message if the propagation "
13277
"worked. If there is an error message check "
13278
"<filename>/var/log/syslog</filename> on the secondary KDC for more "
13282
#: serverguide/C/network-auth.xml:2075(para)
13284
"You may also want to create a <application>cron</application> job to "
13285
"periodically update the database on the Secondary KDC. For example, the "
13286
"following will push the database every hour:"
13289
#: serverguide/C/network-auth.xml:2080(programlisting)
13293
"# m h dom mon dow command\n"
13294
"0 * * * * /usr/sbin/kdb5_util dump /var/lib/krb5kdc/dump && "
13295
"/usr/sbin/kprop -r EXAMPLE.COM -f /var/lib/krb5kdc/dump kdc02.example.com\n"
13298
#: serverguide/C/network-auth.xml:2088(para)
13300
"Back on the <emphasis>Secondary KDC</emphasis>, create a "
13301
"<emphasis>stash</emphasis> file to hold the Kerberos master key:"
13304
#: serverguide/C/network-auth.xml:2094(command)
13305
msgid "sudo kdb5_util stash"
13308
#: serverguide/C/network-auth.xml:2100(para)
13310
"Finally, start the <application>krb5-kdc</application> daemon on the "
13314
#: serverguide/C/network-auth.xml:2105(command) serverguide/C/network-auth.xml:2713(command)
13315
msgid "sudo /etc/init.d/krb5-kdc start"
13318
#: serverguide/C/network-auth.xml:2111(para)
13320
"The <emphasis>Secondary KDC</emphasis> should now be able to issue tickets "
13321
"for the Realm. You can test this by stopping the <application>krb5-"
13322
"kdc</application> daemon on the Primary KDC, then use "
13323
"<application>kinit</application> to request a ticket. If all goes well you "
13324
"should receive a ticket from the Secondary KDC."
13327
#: serverguide/C/network-auth.xml:2119(title)
13328
msgid "Kerberos Linux Client"
13331
#: serverguide/C/network-auth.xml:2121(para)
13333
"This section covers configuring a Linux system as a "
13334
"<application>Kerberos</application> client. This will allow access to any "
13335
"kerberized services once a user has successfully logged into the system."
13338
#: serverguide/C/network-auth.xml:2129(para)
13340
"In order to authenticate to a Kerberos Realm, the <application>krb5-"
13341
"user</application> and <application>libpam-krb5</application> packages are "
13342
"needed, along with a few others that are not strictly necessary but make "
13343
"life easier. To install the packages enter the following in a terminal "
13347
#: serverguide/C/network-auth.xml:2136(command)
13349
"sudo apt-get install krb5-user libpam-krb5 libpam-ccreds auth-client-config"
13352
#: serverguide/C/network-auth.xml:2139(para)
13354
"The <application>auth-client-config</application> package allows simple "
13355
"configuration of PAM for authentication from multiple sources, and the "
13356
"<application>libpam-ccreds</application> will cache authentication "
13357
"credentials allowing you to login in case the Key Distribution Center (KDC) "
13358
"is unavailable. This package is also useful for laptops that may "
13359
"authenticate using Kerberos while on the corporate network, but will need to "
13360
"be accessed off the network as well."
13363
#: serverguide/C/network-auth.xml:2150(para)
13364
msgid "To configure the client in a terminal enter:"
13367
#: serverguide/C/network-auth.xml:2155(command)
13368
msgid "sudo dpkg-reconfigure krb5-config"
13371
#: serverguide/C/network-auth.xml:2158(para)
13373
"You will then be prompted to enter the name of the Kerberos Realm. Also, if "
13374
"you don't have DNS configured with Kerberos <emphasis>SRV</emphasis> "
13375
"records, the menu will prompt you for the hostname of the Key Distribution "
13376
"Center (KDC) and Realm Administration server."
13379
#: serverguide/C/network-auth.xml:2164(para)
13381
"The <application>dpkg-reconfigure</application> adds entries to the "
13382
"<filename>/etc/krb5.conf</filename> file for your Realm. You should have "
13383
"entries similar to the following:"
13386
#: serverguide/C/network-auth.xml:2169(programlisting)
13391
" default_realm = EXAMPLE.COM\n"
13394
" EXAMPLE.COM = } \n"
13395
" kdc = 192.168.0.1 \n"
13396
" admin_server = 192.168.0.1\n"
13400
#: serverguide/C/network-auth.xml:2180(para)
13402
"You can test the configuration by requesting a ticket using the "
13403
"<application>kinit</application> utility. For example:"
13406
#: serverguide/C/network-auth.xml:2185(command)
13407
msgid "kinit steve@EXAMPLE.COM"
13410
#: serverguide/C/network-auth.xml:2186(computeroutput)
13412
msgid "Password for steve@EXAMPLE.COM:"
13415
#: serverguide/C/network-auth.xml:2189(para)
13417
"When a ticket has been granted, the details can be viewed using "
13418
"<application>klist</application>:"
13421
#: serverguide/C/network-auth.xml:2195(computeroutput)
13424
"Ticket cache: FILE:/tmp/krb5cc_1000\n"
13425
"Default principal: steve@EXAMPLE.COM\n"
13427
"Valid starting Expires Service principal\n"
13428
"07/24/08 05:18:56 07/24/08 15:18:56 krbtgt/EXAMPLE.COM@EXAMPLE.COM\n"
13429
" renew until 07/25/08 05:18:57\n"
13432
"Kerberos 4 ticket cache: /tmp/tkt1000\n"
13433
"klist: You have no tickets cached"
13436
#: serverguide/C/network-auth.xml:2207(para)
13438
"Next, use the <application>auth-client-config</application> to configure the "
13439
"<application>libpam-krb5</application> module to request a ticket during "
13443
#: serverguide/C/network-auth.xml:2213(command)
13444
msgid "sudo auth-client-config -a -p kerberos_example"
13447
#: serverguide/C/network-auth.xml:2216(para)
13449
"You will should now receive a ticket upon successful login authentication."
13452
#: serverguide/C/network-auth.xml:2227(para)
13454
"For more information on Kerberos see the <ulink "
13455
"url=\"http://web.mit.edu/Kerberos/\">MIT Kerberos</ulink> site."
13458
#: serverguide/C/network-auth.xml:2232(para)
13460
"O'Reilly's <ulink "
13461
"url=\"http://oreilly.com/catalog/9780596004033/\">Kerberos: The Definitive "
13462
"Guide</ulink> is a great reference when setting up Kerberos."
13465
#: serverguide/C/network-auth.xml:2238(para)
13467
"Also, feel free to stop by the <emphasis>#ubuntu-server</emphasis> IRC "
13468
"channel on <ulink url=\"http://freenode.net/\">Freenode</ulink> if you have "
13469
"Kerberos questions."
13472
#: serverguide/C/network-auth.xml:2248(title)
13473
msgid "Kerberos and LDAP"
13476
#: serverguide/C/network-auth.xml:2250(para)
13478
"Replicating a Kerberos principal database between two servers can be "
13479
"complicated, and adds an additional user database to your network. "
13480
"Fortunately, MIT Kerberos can be configured to use an "
13481
"<application>LDAP</application> directory as a principal database. This "
13482
"section covers configuring a primary and secondary kerberos server to use "
13483
"<application>OpenLDAP</application> for the principal database."
13486
#: serverguide/C/network-auth.xml:2258(title)
13487
msgid "Configuring OpenLDAP"
13490
#: serverguide/C/network-auth.xml:2260(para)
13492
"First, the necessary <emphasis>schema</emphasis> needs to be loaded on an "
13493
"<application>OpenLDAP</application> server that has network connectivity to "
13494
"the Primary and Secondary KDCs. The rest of this section assumes that you "
13495
"also have LDAP replication configured between at least two servers. For "
13496
"information on setting up OpenLDAP see <xref linkend=\"openldap-server\"/>."
13499
#: serverguide/C/network-auth.xml:2267(para)
13501
"It is also required to configure OpenLDAP for TLS and SSL connections, so "
13502
"that traffic between the KDC and LDAP server is encrypted. See <xref "
13503
"linkend=\"openldap-tls\"/> for details."
13506
#: serverguide/C/network-auth.xml:2274(para)
13508
"To load the schema into LDAP, on the LDAP server install the "
13509
"<application>krb5-kdc-ldap</application> package. From a terminal enter:"
13512
#: serverguide/C/network-auth.xml:2280(command)
13513
msgid "sudo apt-get install krb5-kdc-ldap"
13516
#: serverguide/C/network-auth.xml:2285(para)
13517
msgid "Next, extract the <filename>kerberos.schema.gz</filename> file:"
13520
#: serverguide/C/network-auth.xml:2290(command)
13521
msgid "sudo gzip -d /usr/share/doc/krb5-kdc-ldap/kerberos.schema.gz"
13524
#: serverguide/C/network-auth.xml:2291(command)
13526
"sudo cp /usr/share/doc/krb5-kdc-ldap/kerberos.schema /etc/ldap/schema/"
13529
#: serverguide/C/network-auth.xml:2297(para)
13531
"The <emphasis>kerberos</emphasis> schema needs to be added to the "
13532
"<emphasis>cn=config</emphasis> tree. The procedure to add a new schema to "
13533
"<application>slapd</application> is also detailed in <xref "
13534
"linkend=\"openldap-configuration\"/>."
13537
#: serverguide/C/network-auth.xml:2310(programlisting)
13541
"include /etc/ldap/schema/core.schema\n"
13542
"include /etc/ldap/schema/collective.schema\n"
13543
"include /etc/ldap/schema/corba.schema\n"
13544
"include /etc/ldap/schema/cosine.schema\n"
13545
"include /etc/ldap/schema/duaconf.schema\n"
13546
"include /etc/ldap/schema/dyngroup.schema\n"
13547
"include /etc/ldap/schema/inetorgperson.schema\n"
13548
"include /etc/ldap/schema/java.schema\n"
13549
"include /etc/ldap/schema/misc.schema\n"
13550
"include /etc/ldap/schema/nis.schema\n"
13551
"include /etc/ldap/schema/openldap.schema\n"
13552
"include /etc/ldap/schema/ppolicy.schema\n"
13553
"include /etc/ldap/schema/kerberos.schema\n"
13556
#: serverguide/C/network-auth.xml:2330(para)
13557
msgid "Create a temporary directory to hold the LDIF files:"
13560
#: serverguide/C/network-auth.xml:2355(para)
13562
"Edit the generated "
13563
"<filename>/tmp/ldif_output/cn=config/cn=schema/cn={12}kerberos.ldif</filename"
13564
"> file, changing the following attributes:"
13567
#: serverguide/C/network-auth.xml:2360(programlisting)
13571
"dn: cn=kerberos,cn=schema,cn=config\n"
13576
#: serverguide/C/network-auth.xml:2366(para)
13577
msgid "And remove the following lines from the end of the file:"
13580
#: serverguide/C/network-auth.xml:2370(programlisting)
13584
"structuralObjectClass: olcSchemaConfig\n"
13585
"entryUUID: 18ccd010-746b-102d-9fbe-3760cca765dc\n"
13586
"creatorsName: cn=config\n"
13587
"createTimestamp: 20090111203515Z\n"
13588
"entryCSN: 20090111203515.326445Z#000000#000#000000\n"
13589
"modifiersName: cn=config\n"
13590
"modifyTimestamp: 20090111203515Z\n"
13593
#: serverguide/C/network-auth.xml:2389(para)
13594
msgid "Load the new schema with <application>ldapadd</application>:"
13597
#: serverguide/C/network-auth.xml:2394(command)
13599
"ldapadd -x -D cn=admin,cn=config -W -f /tmp/ldif_output/cn\\=config/cn\\"
13600
"=schema/cn\\=\\{12\\}kerberos.ldif"
13603
#: serverguide/C/network-auth.xml:2400(para)
13605
"Add an index for the <emphasis>krb5principalname</emphasis> attribute:"
13608
#: serverguide/C/network-auth.xml:2407(userinput)
13611
"dn: olcDatabase={1}hdb,cn=config\n"
13612
"add: olcDbIndex\n"
13613
"olcDbIndex: krbPrincipalName eq,pres,sub"
13616
#: serverguide/C/network-auth.xml:2417(para)
13617
msgid "Finally, update the Access Control Lists (ACL):"
13620
#: serverguide/C/network-auth.xml:2424(userinput)
13623
"dn: olcDatabase={1}hdb,cn=config\n"
13624
"replace: olcAccess\n"
13625
"olcAccess: to attrs=userPassword,shadowLastChange,krbPrincipalKey by "
13626
"dn=\"cn=admin,dc=exampl\n"
13627
" e,dc=com\" write by anonymous auth by self write by * none\n"
13630
"olcAccess: to dn.base=\"\" by * read\n"
13633
"olcAccess: to * by dn=\"cn=admin,dc=example,dc=com\" write by * read"
13636
#: serverguide/C/network-auth.xml:2423(computeroutput)
13639
"Enter LDAP Password: \n"
13640
"<placeholder-1/>\n"
13642
"modifying entry \"olcDatabase={1}hdb,cn=config\"\n"
13645
#: serverguide/C/network-auth.xml:2444(para)
13647
"That's it, your LDAP directory is now ready to serve as a Kerberos principal "
13651
#: serverguide/C/network-auth.xml:2450(title)
13652
msgid "Primary KDC Configuration"
13655
#: serverguide/C/network-auth.xml:2452(para)
13657
"With <application>OpenLDAP</application> configured it is time to configure "
13661
#: serverguide/C/network-auth.xml:2458(para)
13662
msgid "First, install the necessary packages, from a terminal enter:"
13665
#: serverguide/C/network-auth.xml:2463(command) serverguide/C/network-auth.xml:2620(command)
13666
msgid "sudo apt-get install krb5-kdc krb5-admin-server krb5-kdc-ldap"
13669
#: serverguide/C/network-auth.xml:2469(para)
13671
"Now edit <filename>/etc/krb5.conf</filename> adding the following options to "
13672
"under the appropriate sections:"
13675
#: serverguide/C/network-auth.xml:2473(programlisting)
13680
" default_realm = EXAMPLE.COM\n"
13685
" EXAMPLE.COM = {\n"
13686
" kdc = kdc01.example.com\n"
13687
" kdc = kdc02.example.com\n"
13688
" admin_server = kdc01.example.com\n"
13689
" admin_server = kdc02.example.com\n"
13690
" default_domain = example.com\n"
13691
" database_module = openldap_ldapconf\n"
13697
" .example.com = EXAMPLE.COM\n"
13703
" ldap_kerberos_container_dn = dc=example,dc=com\n"
13706
" openldap_ldapconf = {\n"
13707
" db_library = kldap\n"
13708
" ldap_kdc_dn = \"cn=admin,dc=example,dc=com\"\n"
13710
" # this object needs to have read rights on\n"
13711
" # the realm container, principal container and realm sub-"
13713
" ldap_kadmind_dn = \"cn=admin,dc=example,dc=com\"\n"
13715
" # this object needs to have read and write rights on\n"
13716
" # the realm container, principal container and realm sub-"
13718
" ldap_service_password_file = /etc/krb5kdc/service.keyfile\n"
13719
" ldap_servers = ldaps://ldap01.example.com "
13720
"ldaps://ldap02.example.com\n"
13721
" ldap_conns_per_server = 5\n"
13725
#: serverguide/C/network-auth.xml:2518(para)
13727
"Change <emphasis>example.com</emphasis>, "
13728
"<emphasis>dc=example,dc=com</emphasis>, "
13729
"<emphasis>cn=admin,dc=example,dc=com</emphasis>, and "
13730
"<emphasis>ldap01.example.com</emphasis> to the appropriate domain, LDAP "
13731
"object, and LDAP server for your network."
13734
#: serverguide/C/network-auth.xml:2527(para)
13736
"Next, use the <application>kdb5_ldap_util</application> utility to create "
13740
#: serverguide/C/network-auth.xml:2532(command)
13742
"sudo kdb5_ldap_util -D cn=admin,dc=example,dc=com create -subtrees "
13743
"dc=example,dc=com -r EXAMPLE.COM -s -H ldap://ldap01.example.com"
13746
#: serverguide/C/network-auth.xml:2538(para)
13748
"Create a stash of the password used to bind to the LDAP server. This "
13749
"password is used by the <emphasis>ldap_kdc_dn</emphasis> and "
13750
"<emphasis>ldap_kadmin_dn</emphasis> options in "
13751
"<filename>/etc/krb5.conf</filename>:"
13754
#: serverguide/C/network-auth.xml:2544(command) serverguide/C/network-auth.xml:2682(command)
13756
"sudo kdb5_ldap_util -D cn=admin,dc=example,dc=com stashsrvpw -f "
13757
"/etc/krb5kdc/service.keyfile cn=admin,dc=example,dc=com"
13760
#: serverguide/C/network-auth.xml:2550(para)
13761
msgid "Copy the CA certificate from the LDAP server:"
13764
#: serverguide/C/network-auth.xml:2555(command)
13765
msgid "scp ldap01:/etc/ssl/certs/cacert.pem ."
13768
#: serverguide/C/network-auth.xml:2556(command)
13769
msgid "sudo cp cacert.pem /etc/ssl/certs"
13772
#: serverguide/C/network-auth.xml:2559(para)
13774
"And edit <filename>/etc/ldap/ldap.conf</filename> to use the certificate:"
13777
#: serverguide/C/network-auth.xml:2563(programlisting)
13781
"TLS_CACERT /etc/ssl/certs/cacert.pem\n"
13784
#: serverguide/C/network-auth.xml:2568(para)
13786
"The certificate will also need to be copied to the Secondary KDC, to allow "
13787
"the connection to the LDAP servers using LDAPS."
13790
#: serverguide/C/network-auth.xml:2577(para)
13792
"You can now add Kerberos principals to the LDAP database, and they will be "
13793
"copied to any other LDAP servers configured for replication. To add a "
13794
"principal using the <application>kadmin.local</application> utility enter:"
13797
#: serverguide/C/network-auth.xml:2585(userinput)
13799
msgid "addprinc -x dn=\"uid=steve,ou=people,dc=example,dc=com\" steve"
13802
#: serverguide/C/network-auth.xml:2584(computeroutput)
13805
"Authenticating as principal root/admin@EXAMPLE.COM with password.\n"
13806
"kadmin.local: <placeholder-1/>\n"
13807
"WARNING: no policy specified for steve@EXAMPLE.COM; defaulting to no policy\n"
13808
"Enter password for principal \"steve@EXAMPLE.COM\": \n"
13809
"Re-enter password for principal \"steve@EXAMPLE.COM\": \n"
13810
"Principal \"steve@EXAMPLE.COM\" created."
13813
#: serverguide/C/network-auth.xml:2592(para)
13815
"There should now be krbPrincipalName, krbPrincipalKey, krbLastPwdChange, and "
13816
"krbExtraData attributes added to the "
13817
"<emphasis>uid=steve,ou=people,dc=example,dc=com</emphasis> user object. Use "
13818
"the <application>kinit</application> and <application>klist</application> "
13819
"utilities to test that the user is indeed issued a ticket."
13822
#: serverguide/C/network-auth.xml:2599(para)
13824
"If the user object is already created the <emphasis>-x dn=\"...\"</emphasis> "
13825
"option is needed to add the Kerberos attributes. Otherwise a new "
13826
"<emphasis>principal</emphasis> object will be created in the realm subtree."
13829
#: serverguide/C/network-auth.xml:2607(title)
13830
msgid "Secondary KDC Configuration"
13833
#: serverguide/C/network-auth.xml:2609(para)
13835
"Configuring a Secondary KDC using the LDAP backend is similar to configuring "
13836
"one using the normal Kerberos database."
13839
#: serverguide/C/network-auth.xml:2615(para)
13840
msgid "First, install the necessary packages. In a terminal enter:"
13843
#: serverguide/C/network-auth.xml:2626(para)
13845
"Next, edit <filename>/etc/krb5.conf</filename> to use the LDAP backend:"
13848
#: serverguide/C/network-auth.xml:2630(programlisting)
13853
" default_realm = EXAMPLE.COM\n"
13858
" EXAMPLE.COM = {\n"
13859
" kdc = kdc01.example.com\n"
13860
" kdc = kdc02.example.com\n"
13861
" admin_server = kdc01.example.com\n"
13862
" admin_server = kdc02.example.com\n"
13863
" default_domain = example.com\n"
13864
" database_module = openldap_ldapconf\n"
13870
" .example.com = EXAMPLE.COM\n"
13875
" ldap_kerberos_container_dn = dc=example,dc=com\n"
13878
" openldap_ldapconf = {\n"
13879
" db_library = kldap\n"
13880
" ldap_kdc_dn = \"cn=admin,dc=example,dc=com\"\n"
13882
" # this object needs to have read rights on\n"
13883
" # the realm container, principal container and realm sub-"
13885
" ldap_kadmind_dn = \"cn=admin,dc=example,dc=com\"\n"
13887
" # this object needs to have read and write rights on\n"
13888
" # the realm container, principal container and realm sub-"
13890
" ldap_service_password_file = /etc/krb5kdc/service.keyfile\n"
13891
" ldap_servers = ldaps://ldap01.example.com "
13892
"ldaps://ldap02.example.com\n"
13893
" ldap_conns_per_server = 5\n"
13897
#: serverguide/C/network-auth.xml:2677(para)
13898
msgid "Create the stash for the LDAP bind password:"
13901
#: serverguide/C/network-auth.xml:2688(para)
13903
"Now, on the <emphasis>Primary KDC</emphasis> copy the "
13904
"<filename>/etc/krb5kdc/.k5.EXAMPLE.COM</filename><emphasis>Master "
13905
"Key</emphasis> stash to the Secondary KDC. Be sure to copy the file over an "
13906
"encrypted connection such as <application>scp</application>, or on physical "
13910
#: serverguide/C/network-auth.xml:2695(command)
13911
msgid "sudo scp /etc/krb5kdc/.k5.EXAMPLE.COM steve@kdc02.example.com:~"
13914
#: serverguide/C/network-auth.xml:2696(command)
13915
msgid "sudo mv .k5.EXAMPLE.COM /etc/krb5kdc/"
13918
#: serverguide/C/network-auth.xml:2700(para)
13920
"Again, replace <emphasis>EXAMPLE.COM</emphasis> with your actual realm."
13923
#: serverguide/C/network-auth.xml:2708(para)
13924
msgid "Finally, start the <application>krb5-kdc</application> daemon:"
13927
#: serverguide/C/network-auth.xml:2719(para)
13929
"You now have redundant KDCs on your network, and with redundant LDAP servers "
13930
"you should be able to continue to authenticate users if one LDAP server, one "
13931
"Kerberos server, or one LDAP and one Kerberos server become unavailable."
13934
#: serverguide/C/network-auth.xml:2731(para)
13936
"The <ulink url=\"http://web.mit.edu/Kerberos/krb5-1.6/krb5-1.6.3/doc/krb5-"
13937
"admin.html#Configuring-Kerberos-with-OpenLDAP-back_002dend\"> Kerberos Admin "
13938
"Guide</ulink> has some additional details."
13941
#: serverguide/C/network-auth.xml:2737(para)
13943
"For more information on <application>kdb5_ldap_util</application> see <ulink "
13944
"url=\"http://web.mit.edu/Kerberos/krb5-1.6/krb5-1.6.3/doc/krb5-"
13945
"admin.html#Global-Operations-on-the-Kerberos-LDAP-Database\"> Section "
13946
"5.6</ulink> and the <ulink "
13947
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/kdb5_ldap_util.8.htm"
13948
"l\">kdb5_ldap_util man page</ulink>."
13951
#: serverguide/C/network-auth.xml:2745(para)
13953
"Another useful link is the <ulink "
13954
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/krb5.conf.5.html\">k"
13955
"rb5.conf man page</ulink>."
13958
#: serverguide/C/mail.xml:13(title)
13959
msgid "Email Services"
13962
#: serverguide/C/mail.xml:14(para)
13964
"The process of getting an email from one person to another over a network or "
13965
"the Internet involves many systems working together. Each of these systems "
13966
"must be correctly configured for the process to work. The sender uses a "
13967
"<emphasis>Mail User Agent</emphasis> (MUA), or email client, to send the "
13968
"message through one or more <emphasis>Mail Transfer Agents</emphasis> (MTA), "
13969
"the last of which will hand it off to a <emphasis>Mail Delivery "
13970
"Agent</emphasis> (MDA) for delivery to the recipient's mailbox, from which "
13971
"it will be retrieved by the recipient's email client, usually via a POP3 or "
13975
#: serverguide/C/mail.xml:24(title) serverguide/C/mail.xml:623(application) serverguide/C/mail.xml:657(title) serverguide/C/mail.xml:735(title) serverguide/C/mail.xml:1282(title)
13979
#: serverguide/C/mail.xml:25(para)
13981
"<application>Postfix</application> is the default Mail Transfer Agent (MTA) "
13982
"in Ubuntu. It attempts to be fast and easy to administer and secure. It is "
13983
"compatible with the MTA <application>sendmail</application>. This section "
13984
"explains how to install and configure <application>postfix</application>. It "
13985
"also explains how to set it up as an SMTP server using a secure connection "
13986
"(for sending emails securely)."
13989
#: serverguide/C/mail.xml:34(para)
13991
"To install <application>postfix</application> run the following command:"
13994
#: serverguide/C/mail.xml:40(para)
13996
"Simply press return when the installation process asks questions, the "
13997
"configuration will be done in greater detail in the next stage."
14000
#: serverguide/C/mail.xml:45(title)
14001
msgid "Basic Configuration"
14004
#: serverguide/C/mail.xml:46(para)
14006
"To configure <application>postfix</application>, run the following command:"
14009
#: serverguide/C/mail.xml:50(command)
14010
msgid "sudo dpkg-reconfigure postfix"
14013
#: serverguide/C/mail.xml:56(para)
14014
msgid "Internet Site"
14017
#: serverguide/C/mail.xml:57(para)
14018
msgid "mail.example.com"
14021
#: serverguide/C/mail.xml:58(para)
14025
#: serverguide/C/mail.xml:59(para)
14026
msgid "mail.example.com, localhost.localdomain, localhost"
14029
#: serverguide/C/mail.xml:60(para)
14033
#: serverguide/C/mail.xml:61(para)
14034
msgid "127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0/24"
14037
#: serverguide/C/mail.xml:62(para)
14041
#: serverguide/C/mail.xml:63(para)
14045
#: serverguide/C/mail.xml:64(para)
14049
#: serverguide/C/mail.xml:52(para)
14051
"The user interface will be displayed. On each screen, select the following "
14052
"values: <placeholder-1/>"
14055
#: serverguide/C/mail.xml:68(para)
14057
"Replace mail.example.com with your mail server hostname, 192.168.0/24 with "
14058
"the actual network and class range of your mail server, and steve with the "
14059
"appropriate username."
14062
#: serverguide/C/mail.xml:76(title) serverguide/C/mail.xml:357(title)
14063
msgid "SMTP Authentication"
14066
#: serverguide/C/mail.xml:78(para)
14068
"SMTP-AUTH allows a client to identify itself through an authentication "
14069
"mechanism (SASL). Transport Layer Security (TLS) should be used to encrypt "
14070
"the authentication process. Once authenticated the SMTP server will allow "
14071
"the client to relay mail."
14074
#: serverguide/C/mail.xml:84(para)
14076
"Configuring <application>Postfix</application> for SMTP-AUTH is very simple "
14077
"using the <application>dovecot-postfix</application> package. This package "
14078
"will install <application>Dovecot</application> and configure "
14079
"<application>Postfix</application> to use it for both SASL authentication "
14080
"and as a Mail Delivery Agent (MDA). The package also configures "
14081
"<application>Dovecot</application> for IMAP, IMAPS, POP3, and POP3S."
14084
#: serverguide/C/mail.xml:91(para)
14085
msgid "To install the package, from a terminal prompt enter:"
14088
#: serverguide/C/mail.xml:96(command)
14089
msgid "sudo apt-get install dovecot-postfix"
14092
#: serverguide/C/mail.xml:99(para)
14094
"You should now have a working mail server, but there are a few options that "
14095
"you may wish to further customize. For example, the package uses the "
14096
"certificate and key from the <application>ssl-cert</application> package, "
14097
"and in a production environment you should use a certificate and key "
14098
"generated for the host. See <xref linkend=\"certificates-and-security\"/> "
14099
"for more details."
14102
#: serverguide/C/mail.xml:105(para)
14104
"Once you have a customized certificate and key for the host, change the "
14105
"following options in <filename>/etc/postfix/main.cf</filename>:"
14108
#: serverguide/C/mail.xml:109(programlisting)
14112
"smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem\n"
14113
"smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key\n"
14116
#: serverguide/C/mail.xml:114(para)
14117
msgid "Then restart Postfix:"
14120
#: serverguide/C/mail.xml:119(command) serverguide/C/mail.xml:182(command) serverguide/C/mail.xml:775(command) serverguide/C/mail.xml:1333(command)
14121
msgid "sudo /etc/init.d/postfix restart"
14124
#: serverguide/C/mail.xml:125(para)
14126
"SMTP-AUTH configuration is complete. Now it is time to test the setup."
14129
#: serverguide/C/mail.xml:128(para)
14130
msgid "To see if SMTP-AUTH and TLS work properly, run the following command:"
14133
#: serverguide/C/mail.xml:133(command)
14134
msgid "telnet mail.example.com 25"
14137
#: serverguide/C/mail.xml:135(para)
14139
"After you have established the connection to the postfix mail server, type:"
14142
#: serverguide/C/mail.xml:139(screen)
14146
"ehlo mail.example.com\n"
14149
#: serverguide/C/mail.xml:142(para)
14151
"If you see the following lines among others, then everything is working "
14152
"perfectly. Type <command>quit</command> to exit."
14155
#: serverguide/C/mail.xml:146(programlisting)
14160
"250-AUTH LOGIN PLAIN\n"
14161
"250-AUTH=LOGIN PLAIN\n"
14165
#: serverguide/C/mail.xml:156(para)
14167
"This section introduces some common ways to determine the cause if problems "
14171
#: serverguide/C/mail.xml:160(title)
14172
msgid "Escaping chroot"
14175
#: serverguide/C/mail.xml:161(para)
14177
"The Ubuntu <application>postfix</application> package will by default "
14178
"install into a <emphasis>chroot</emphasis> environment for security reasons. "
14179
"This can add greater complexity when troubleshooting problems."
14182
#: serverguide/C/mail.xml:165(para)
14184
"To turn off the chroot operation locate for the following line in the "
14185
"<filename>/etc/postfix/master.cf</filename> configuration file:"
14188
#: serverguide/C/mail.xml:169(screen)
14192
"smtp inet n - - - - smtpd\n"
14195
#: serverguide/C/mail.xml:172(para)
14196
msgid "and modify it as follows:"
14199
#: serverguide/C/mail.xml:175(screen)
14203
"smtp inet n - n - - smtpd\n"
14206
#: serverguide/C/mail.xml:178(para)
14208
"You will then need to restart Postfix to use the new configuration. From a "
14209
"terminal prompt enter:"
14212
#: serverguide/C/mail.xml:186(title)
14216
#: serverguide/C/mail.xml:187(para)
14218
"<application>Postfix</application> sends all log messages to "
14219
"<filename>/var/log/mail.log</filename>. However error and warning messages "
14220
"can sometimes get lost in the normal log output so they are also logged to "
14221
"<filename>/var/log/mail.err</filename> and "
14222
"<filename>/var/log/mail.warn</filename> respectively."
14225
#: serverguide/C/mail.xml:192(para)
14227
"To see messages entered into the logs in real time you can use the "
14228
"<application>tail -f</application> command:"
14231
#: serverguide/C/mail.xml:197(command)
14232
msgid "tail -f /var/log/mail.err"
14235
#: serverguide/C/mail.xml:199(para)
14237
"The amount of detail that is recorded in the logs can be increased. Below "
14238
"are some configuration options for increasing the log level for some of the "
14239
"areas covered above."
14242
#: serverguide/C/mail.xml:205(para)
14244
"To increase <emphasis>TLS</emphasis> activity logging set the "
14245
"<emphasis>smtpd_tls_loglevel</emphasis> option to a value from 1 to 4."
14248
#: serverguide/C/mail.xml:209(command)
14249
msgid "sudo postconf -e 'smtpd_tls_loglevel = 4'"
14252
#: serverguide/C/mail.xml:213(para)
14254
"If you are having trouble sending or receiving mail from a specific domain "
14255
"you can add the domain to the <emphasis>debug_peer_list</emphasis> parameter."
14258
#: serverguide/C/mail.xml:218(command)
14259
msgid "sudo postconf -e 'debug_peer_list = problem.domain'"
14262
#: serverguide/C/mail.xml:222(para)
14264
"You can increase the verbosity of any <application>Postfix</application> "
14265
"daemon process by editing the <filename>/etc/postfix/master.cf</filename> "
14266
"and adding a <emphasis>-v</emphasis> after the entry. For example edit the "
14267
"<emphasis>smtp</emphasis> entry:"
14270
#: serverguide/C/mail.xml:226(programlisting)
14274
"smtp unix - - - - - smtp -v\n"
14277
#: serverguide/C/mail.xml:232(para)
14279
"It is important to note that after making one of the logging changes above "
14280
"the <application>Postfix</application> process will need to be reloaded in "
14281
"order to recognize the new configuration: <command>sudo /etc/init.d/postfix "
14285
#: serverguide/C/mail.xml:239(para)
14287
"To increase the amount of information logged when troubleshooting "
14288
"<emphasis>SASL</emphasis> issues you can set the following options in "
14289
"<filename>/etc/dovecot/dovecot.conf</filename>"
14292
#: serverguide/C/mail.xml:243(programlisting)
14297
"auth_debug_passwords=yes\n"
14300
#: serverguide/C/mail.xml:250(para)
14302
"Just like <application>Postfix</application> if you change a "
14303
"<application>Dovecot</application> configuration the process will need to be "
14304
"reloaded: <command>sudo /etc/init.d/dovecot reload</command>."
14307
#: serverguide/C/mail.xml:256(para)
14309
"Some of the options above can drastically increase the amount of information "
14310
"sent to the log files. Remember to return the log level back to normal after "
14311
"you have corrected the problem. Then reload the appropriate daemon for the "
14312
"new configuration to take affect."
14315
#: serverguide/C/mail.xml:264(para)
14317
"Administering a <application>Postfix</application> server can be a very "
14318
"complicated task. At some point you may need to turn to the Ubuntu community "
14319
"for more experienced help."
14322
#: serverguide/C/mail.xml:268(para)
14324
"A great place to ask for <application>Postfix</application> assistance, and "
14325
"get involved with the Ubuntu Server community, is the <emphasis>#ubuntu-"
14326
"server</emphasis> IRC channel on <ulink "
14327
"url=\"http://freenode.net\">freenode</ulink>. You can also post a message to "
14328
"one of the <ulink "
14329
"url=\"http://www.ubuntu.com/support/community/webforums\">Web Forums</ulink>."
14332
#: serverguide/C/mail.xml:273(para)
14334
"For in depth <application>Postfix</application> information Ubuntu "
14335
"developers highly recommend: <ulink url=\"http://www.postfix-book.com/\">The "
14336
"Book of Postfix</ulink>."
14339
#: serverguide/C/mail.xml:277(para)
14341
"Finally, the <ulink "
14342
"url=\"http://www.postfix.org/documentation.html\">Postfix</ulink> website "
14343
"also has great documentation on all the different configuration options "
14347
#: serverguide/C/mail.xml:286(title) serverguide/C/mail.xml:663(title) serverguide/C/mail.xml:779(title)
14351
#: serverguide/C/mail.xml:287(para)
14353
"<application>Exim4</application> is another Message Transfer Agent (MTA) "
14354
"developed at the University of Cambridge for use on Unix systems connected "
14355
"to the Internet. Exim can be installed in place of "
14356
"<application>sendmail</application>, although the configuration of "
14357
"<application>exim</application> is quite different to that of "
14358
"<application>sendmail</application>."
14361
#: serverguide/C/mail.xml:298(para)
14363
"To install <application>exim4</application>, run the following command: "
14365
"<command>sudo apt-get install exim4</command>\n"
14369
#: serverguide/C/mail.xml:307(para)
14371
"To configure <application>Exim4</application>, run the following command:"
14374
#: serverguide/C/mail.xml:311(command)
14375
msgid "sudo dpkg-reconfigure exim4-config"
14378
#: serverguide/C/mail.xml:313(para)
14380
"The user interface will be displayed. The user interface lets you configure "
14381
"many parameters. For example, In <application>Exim4</application> the "
14382
"configuration files are split among multiple files. If you wish to have them "
14383
"in one file you can configure accordingly in this user interface."
14386
#: serverguide/C/mail.xml:321(para)
14388
"All the parameters you configure in the user interface are stored in "
14389
"<filename>/etc/exim4/update-exim4.conf.conf</filename> file. If you wish to "
14390
"re-configure, either you re-run the configuration wizard or manually edit "
14391
"this file using your favourite editor. Once you configure, you can run the "
14392
"following command to generate the master configuration file:"
14395
#: serverguide/C/mail.xml:332(command) serverguide/C/mail.xml:405(command)
14396
msgid "sudo update-exim4.conf"
14399
#: serverguide/C/mail.xml:334(para)
14401
"The master configuration file, is generated and it is stored in "
14402
"<filename>/var/lib/exim4/config.autogenerated</filename>."
14405
#: serverguide/C/mail.xml:340(para)
14407
"At any time, you should not edit the master configuration file, "
14408
"<filename>/var/lib/exim4/config.autogenerated</filename> manually. It is "
14409
"updated automatically every time you run <command>update-exim4.conf</command>"
14412
#: serverguide/C/mail.xml:348(para)
14414
"You can run the following command to start <application>Exim4</application> "
14418
#: serverguide/C/mail.xml:353(command) serverguide/C/mail.xml:785(command)
14419
msgid "sudo /etc/init.d/exim4 start"
14422
#: serverguide/C/mail.xml:358(para)
14424
"This section covers configuring Exim4 to use SMTP-AUTH with TLS and SASL."
14427
#: serverguide/C/mail.xml:361(para)
14429
"The first step is to create a certificate for use with TLS. Enter the "
14430
"following into a terminal prompt:"
14433
#: serverguide/C/mail.xml:365(command)
14434
msgid "sudo /usr/share/doc/exim4-base/examples/exim-gencert"
14437
#: serverguide/C/mail.xml:367(para)
14439
"Now Exim4 needs to be configured for TLS by editing "
14440
"<filename>/etc/exim4/conf.d/main/03_exim4-config_tlsoptions</filename> add "
14444
#: serverguide/C/mail.xml:371(programlisting)
14448
"MAIN_TLS_ENABLE = yes\n"
14451
#: serverguide/C/mail.xml:374(para)
14453
"Next you need to configure <application>Exim4</application> to use the "
14454
"<application>saslauthd</application> for authentication. Edit "
14455
"<filename>/etc/exim4/conf.d/auth/30_exim4-config_examples</filename> and "
14456
"uncomment the <emphasis>plain_saslauthd_server</emphasis> and "
14457
"<emphasis>login_saslauthd_server</emphasis> sections:"
14460
#: serverguide/C/mail.xml:379(programlisting)
14464
" plain_saslauthd_server:\n"
14465
" driver = plaintext\n"
14466
" public_name = PLAIN\n"
14467
" server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}\n"
14468
" server_set_id = $auth2\n"
14469
" server_prompts = :\n"
14470
" .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS\n"
14471
" server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}\n"
14474
" login_saslauthd_server:\n"
14475
" driver = plaintext\n"
14476
" public_name = LOGIN\n"
14477
" server_prompts = \"Username:: : Password::\"\n"
14478
" # don't send system passwords over unencrypted connections\n"
14479
" server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}\n"
14480
" server_set_id = $auth1\n"
14481
" .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS\n"
14482
" server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}\n"
14486
#: serverguide/C/mail.xml:401(para)
14487
msgid "Finally, update the Exim4 configuration and restart the service:"
14490
#: serverguide/C/mail.xml:406(command)
14491
msgid "sudo /etc/init.d/exim4 restart"
14494
#: serverguide/C/mail.xml:410(title)
14495
msgid "Configuring SASL"
14498
#: serverguide/C/mail.xml:411(para)
14500
"This section provides details on configuring the saslauthd to provide "
14501
"authentication for <application>Exim4</application>."
14504
#: serverguide/C/mail.xml:414(para)
14506
"The first step is to install the sasl2-bin package. From a terminal prompt "
14507
"enter the following:"
14510
#: serverguide/C/mail.xml:418(command)
14511
msgid "sudo apt-get install sasl2-bin"
14514
#: serverguide/C/mail.xml:420(para)
14516
"To configure saslauthd edit the /etc/default/saslauthd configuration file "
14517
"and set START=no to:"
14520
#: serverguide/C/mail.xml:423(programlisting)
14527
#: serverguide/C/mail.xml:426(para)
14529
"Next the <emphasis>Debian-exim</emphasis> user needs to be part of the "
14530
"<emphasis>sasl</emphasis> group in order for Exim4 to use the saslauthd "
14534
#: serverguide/C/mail.xml:431(command)
14535
msgid "sudo adduser Debian-exim sasl"
14538
#: serverguide/C/mail.xml:433(para)
14539
msgid "Now start the <application>saslauthd</application> service:"
14542
#: serverguide/C/mail.xml:437(command)
14543
msgid "sudo /etc/init.d/saslauthd start"
14546
#: serverguide/C/mail.xml:439(para)
14548
"<application>Exim4</application> is now configured with SMTP-AUTH using TLS "
14549
"and SASL authentication."
14552
#: serverguide/C/mail.xml:448(para)
14554
"See <ulink url=\"http://www.exim.org/\">exim.org</ulink> for more "
14558
#: serverguide/C/mail.xml:453(para)
14560
"There is also an <ulink url=\"http://www.uit.co.uk/content/exim-smtp-mail-"
14561
"server\">Exim4 Book</ulink> available."
14564
#: serverguide/C/mail.xml:462(title)
14565
msgid "Dovecot Server"
14568
#: serverguide/C/mail.xml:463(para)
14570
"<application>Dovecot</application> is a Mail Delivery Agent, written with "
14571
"security primarily in mind. It supports the major mailbox formats: mbox or "
14572
"Maildir. This section explain how to set it up as an imap or pop3 server."
14575
#: serverguide/C/mail.xml:471(para)
14577
"To install <application>dovecot</application>, run the following command in "
14578
"the command prompt:"
14581
#: serverguide/C/mail.xml:476(command)
14582
msgid "sudo apt-get install dovecot-imapd dovecot-pop3d"
14585
#: serverguide/C/mail.xml:481(para)
14587
"To configure <application>dovecot</application>, you can edit the file "
14588
"<filename>/etc/dovecot/dovecot.conf</filename>. You can choose the protocol "
14589
"you use. It could be pop3, pop3s (pop3 secure), imap and imaps (imap "
14590
"secure). A description of these protocols is beyond the scope of this guide. "
14591
"For further information, refer to the Wikipedia articles on <ulink "
14592
"url=\"http://en.wikipedia.org/wiki/POP3\">POP3</ulink> and <ulink "
14593
"url=\"http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol\">IMAP</u"
14597
#: serverguide/C/mail.xml:491(para)
14599
"IMAPS and POP3S are more secure that the simple IMAP and POP3 because they "
14600
"use SSL encryption to connect. Once you have chosen the protocol, amend the "
14601
"following line in the file <filename>/etc/dovecot/dovecot.conf</filename>:"
14604
#: serverguide/C/mail.xml:497(programlisting)
14608
"protocols = pop3 pop3s imap imaps\n"
14611
#: serverguide/C/mail.xml:500(para)
14613
"Next, choose the mailbox you would like to use. "
14614
"<application>Dovecot</application> supports <emphasis "
14615
"role=\"strong\">maildir</emphasis> and <emphasis "
14616
"role=\"strong\">mbox</emphasis> formats. These are the most commonly used "
14617
"mailbox formats. They both have their own benefits and are discussed on "
14618
"<ulink url=\"http://wiki.dovecot.org/MailboxFormat\">the Dovecot web "
14622
#: serverguide/C/mail.xml:508(para)
14624
"Once you have chosen your mailbox type, edit the file "
14625
"<filename>/etc/dovecot/dovecot.conf</filename> and change the following line:"
14628
#: serverguide/C/mail.xml:513(programlisting)
14632
"mail_location = maildir:~/Maildir # (for maildir)\n"
14634
"mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)\n"
14637
#: serverguide/C/mail.xml:519(para)
14639
"You should configure your Mail Transport Agent (MTA) to transfer the "
14640
"incoming mail to this type of mailbox if it is different from the one you "
14644
#: serverguide/C/mail.xml:525(para)
14646
"Once you have configured dovecot, restart the "
14647
"<application>dovecot</application> daemon in order to test your setup:"
14650
#: serverguide/C/mail.xml:531(command)
14651
msgid "sudo /etc/init.d/dovecot restart"
14654
#: serverguide/C/mail.xml:534(para)
14656
"If you have enabled imap, or pop3, you can also try to log in with the "
14657
"commands <command>telnet localhost pop3</command> or <command>telnet "
14658
"localhost imap2</command>. If you see something like the following, the "
14659
"installation has been successful:"
14662
#: serverguide/C/mail.xml:541(programlisting)
14666
"bhuvan@rainbow:~$ telnet localhost pop3\n"
14667
"Trying 127.0.0.1...\n"
14668
"Connected to localhost.localdomain.\n"
14669
"Escape character is '^]'.\n"
14670
"+OK Dovecot ready.\n"
14673
#: serverguide/C/mail.xml:550(title)
14674
msgid "Dovecot SSL Configuration"
14677
#: serverguide/C/mail.xml:551(para)
14679
"To configure <application>dovecot</application> to use SSL, you can edit the "
14680
"file <filename>/etc/dovecot/dovecot.conf</filename> and amend following "
14684
#: serverguide/C/mail.xml:556(programlisting)
14688
"ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem\n"
14689
"ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key\n"
14690
"ssl_disable = no\n"
14691
"disable_plaintext_auth = no\n"
14694
#: serverguide/C/mail.xml:562(para)
14696
"You can get the SSL certificate from a Certificate Issuing Authority or you "
14697
"can create self signed SSL certificate. The latter is a good option for "
14698
"email, because SMTP clients rarely complain about \"self-signed "
14699
"certificates\". Please refer to <xref linkend=\"certificates-and-"
14700
"security\"/> for details about how to create self signed SSL certificate. "
14701
"Once you create the certificate, you will have a key file and a certificate "
14702
"file. Please copy them to the location pointed in the "
14703
"<filename>/etc/dovecot/dovecot.conf</filename> configuration file."
14706
#: serverguide/C/mail.xml:577(title)
14707
msgid "Firewall Configuration for an Email Server"
14710
#: serverguide/C/mail.xml:583(para)
14714
#: serverguide/C/mail.xml:584(para)
14715
msgid "IMAPS - 993"
14718
#: serverguide/C/mail.xml:585(para)
14722
#: serverguide/C/mail.xml:586(para)
14723
msgid "POP3S - 995"
14726
#: serverguide/C/mail.xml:578(para)
14728
"To access your mail server from another computer, you must configure your "
14729
"firewall to allow connections to the server on the necessary ports. "
14733
#: serverguide/C/mail.xml:595(para)
14735
"See the <ulink url=\"http://www.dovecot.org/\">Dovecot website</ulink> for "
14736
"more information."
14739
#: serverguide/C/mail.xml:604(title) serverguide/C/mail.xml:681(title) serverguide/C/mail.xml:904(title)
14743
#: serverguide/C/mail.xml:605(para)
14745
"Mailman is an open source program for managing electronic mail discussions "
14746
"and e-newsletter lists. Many open source mailing lists (including all the "
14747
"<ulink url=\"http://lists.ubuntu.com\">Ubuntu mailing lists</ulink>) use "
14748
"Mailman as their mailing list software. It is powerful and easy to install "
14752
#: serverguide/C/mail.xml:615(para)
14754
"Mailman provides a web interface for the administrators and users, using an "
14755
"external mail server to send and receive emails. It works perfectly with the "
14756
"following mail servers:"
14759
#: serverguide/C/mail.xml:626(application)
14763
#: serverguide/C/mail.xml:629(application)
14767
#: serverguide/C/mail.xml:632(application)
14771
#: serverguide/C/mail.xml:637(para)
14773
"We will see how to install and configure Mailman with, the Apache web "
14774
"server, and either the Postfix or Exim mail server. If you wish to install "
14775
"Mailman with a different mail server, please refer to the references section."
14778
#: serverguide/C/mail.xml:644(para)
14780
"You only need to install one mail server and "
14781
"<application>Postfix</application> is the default Ubuntu Mail Transfer Agent."
14784
#: serverguide/C/mail.xml:649(title) serverguide/C/mail.xml:708(title)
14788
#: serverguide/C/mail.xml:650(para)
14790
"To install apache2 you refer to <ulink url=\"./web-servers.xml#http-"
14791
"installation\">HTTPD Installation</ulink> section for details."
14794
#: serverguide/C/mail.xml:658(para)
14796
"For instructions on installing and configuring Postfix refer to <xref "
14797
"linkend=\"postfix\"/>"
14800
#: serverguide/C/mail.xml:664(para)
14801
msgid "To install Exim4 refer to <xref linkend=\"exim4\"/>."
14804
#: serverguide/C/mail.xml:675(application)
14805
msgid "dc_use_split_config='true'"
14808
#: serverguide/C/mail.xml:667(para)
14810
"Once exim4 is installed, the configuration files are stored in the "
14811
"<filename>/etc/exim4</filename> directory. In Ubuntu, by default, the exim4 "
14812
"configuration files are split across different files. You can change this "
14813
"behavior by changing the following variable in the "
14814
"<filename>/etc/exim4/update-exim4.conf</filename> file: <placeholder-1/>"
14817
#: serverguide/C/mail.xml:682(para)
14819
"To install <application>Mailman</application>, run following command at a "
14823
#: serverguide/C/mail.xml:686(command)
14824
msgid "sudo apt-get install mailman"
14827
#: serverguide/C/mail.xml:688(para)
14829
"It copies the installation files in "
14830
"<application>/var/lib/mailman</application> directory. It installs the CGI "
14831
"scripts in <application>/usr/lib/cgi-bin/mailman</application> directory. It "
14832
"creates <emphasis>list</emphasis> linux user. It creates the "
14833
"<emphasis>list</emphasis> linux group. The mailman process will be owned by "
14837
#: serverguide/C/mail.xml:700(para)
14839
"This section assumes you have successfully installed "
14840
"<application>mailman</application>, <application>apache2</application>, and "
14841
"<application>postfix</application> or <application>exim4</application>. Now "
14842
"you just need to configure them."
14845
#: serverguide/C/mail.xml:709(para)
14847
"An example Apache configuration file comes with "
14848
"<application>Mailman</application> and is placed in "
14849
"<filename>/etc/mailman/apache.conf</filename>. In order for Apache to use "
14850
"the config file it needs to be copied to <filename>/etc/apache2/sites-"
14851
"available</filename>:"
14854
#: serverguide/C/mail.xml:715(command)
14856
"sudo cp /etc/mailman/apache.conf /etc/apache2/sites-available/mailman.conf"
14859
#: serverguide/C/mail.xml:717(para)
14861
"This will setup a new Apache <emphasis>VirtualHost</emphasis> for the "
14862
"Mailman administration site. Now enable the new configuration and restart "
14866
#: serverguide/C/mail.xml:722(command)
14867
msgid "sudo a2ensite mailman.conf"
14870
#: serverguide/C/mail.xml:725(para)
14872
"Mailman uses apache2 to render its CGI scripts. The mailman CGI scripts are "
14873
"installed in the <application>/usr/lib/cgi-bin/mailman</application> "
14874
"directory. So, the mailman url will be http://hostname/cgi-bin/mailman/. You "
14875
"can make changes to the <filename>/etc/apache2/sites-"
14876
"available/mailman.conf</filename> file if you wish to change this behavior."
14879
#: serverguide/C/mail.xml:736(para)
14881
"For <application>Postfix</application> integration, we will associate the "
14882
"domain lists.example.com with the mailing lists. Please replace "
14883
"<emphasis>lists.example.com</emphasis> with the domain of your choosing."
14886
#: serverguide/C/mail.xml:740(para)
14888
"You can use the postconf command to add the necessary configuration to "
14889
"<filename>/etc/postfix/main.cf</filename>:"
14892
#: serverguide/C/mail.xml:744(command)
14893
msgid "sudo postconf -e 'relay_domains = lists.example.com'"
14896
#: serverguide/C/mail.xml:745(command)
14897
msgid "sudo postconf -e 'transport_maps = hash:/etc/postfix/transport'"
14900
#: serverguide/C/mail.xml:746(command)
14901
msgid "sudo postconf -e 'mailman_destination_recipient_limit = 1'"
14904
#: serverguide/C/mail.xml:748(para)
14906
"In <filename>/etc/postfix/master.cf</filename> double check that you have "
14907
"the following transport:"
14910
#: serverguide/C/mail.xml:751(programlisting)
14914
"mailman unix - n n - - pipe\n"
14915
" flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py\n"
14916
" ${nexthop} ${user}\n"
14919
#: serverguide/C/mail.xml:756(para)
14921
"It calls the <emphasis>postfix-to-mailman.py</emphasis> script when a mail "
14922
"is delivered to a list."
14925
#: serverguide/C/mail.xml:759(para)
14927
"Associate the domain lists.example.com to the Mailman transport with the "
14928
"transport map. Edit the file <filename>/etc/postfix/transport</filename>:"
14931
#: serverguide/C/mail.xml:762(programlisting)
14935
"lists.example.com mailman:\n"
14938
#: serverguide/C/mail.xml:765(para)
14940
"Now have <application>Postfix</application> build the transport map by "
14941
"entering the following from a terminal prompt:"
14944
#: serverguide/C/mail.xml:769(command)
14945
msgid "sudo postmap -v /etc/postfix/transport"
14948
#: serverguide/C/mail.xml:771(para)
14949
msgid "Then restart Postfix to enable the new configurations:"
14952
#: serverguide/C/mail.xml:780(para)
14954
"Once Exim4 is installed, you can start the Exim server using the following "
14955
"command from a terminal prompt:"
14958
#: serverguide/C/mail.xml:796(para) serverguide/C/mail.xml:811(title)
14962
#: serverguide/C/mail.xml:799(para) serverguide/C/mail.xml:851(title)
14966
#: serverguide/C/mail.xml:802(para) serverguide/C/mail.xml:874(title)
14970
#: serverguide/C/mail.xml:787(para)
14972
"In order to make mailman work with Exim4, you need to configure Exim4. As "
14973
"mentioned earlier, by default, Exim4 uses multiple configuration files of "
14974
"different types. For details, please refer to the <ulink "
14975
"url=\"http://www.exim.org\">Exim</ulink> web site. To run mailman, we should "
14976
"add new a configuration file to the following configuration types: "
14977
"<placeholder-1/> Exim creates a master configuration file by sorting all "
14978
"these mini configuration files. So, the order of these configuration files "
14979
"is very important."
14982
#: serverguide/C/mail.xml:818(programlisting)
14987
"# Home dir for your Mailman installation -- aka Mailman's prefix\n"
14989
"# On Ubuntu this should be \"/var/lib/mailman\"\n"
14990
"# This is normally the same as ~mailman\n"
14991
"MM_HOME=/var/lib/mailman\n"
14993
"# User and group for Mailman, should match your --with-mail-gid\n"
14994
"# switch to Mailman's configure script. Value is normally \"mailman\"\n"
14998
"# Domains that your lists are in - colon separated list\n"
14999
"# you may wish to add these into local_domains as well\n"
15000
"domainlist mm_domains=hostname.com\n"
15002
"# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"
15004
"# These values are derived from the ones above and should not need\n"
15005
"# editing unless you have munged your mailman installation\n"
15007
"# The path of the Mailman mail wrapper script\n"
15008
"MM_WRAP=MM_HOME/mail/mailman\n"
15010
"# The path of the list config file (used as a required file when\n"
15011
"# verifying list addresses)\n"
15012
"MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck\n"
15016
#: serverguide/C/mail.xml:812(para)
15018
"All the configuration files belonging to the main type are stored in the "
15019
"<filename>/etc/exim4/conf.d/main/</filename> directory. You can add the "
15020
"following content to a new file, named <filename>04_exim4-"
15021
"config_mailman</filename>: <placeholder-1/>"
15024
#: serverguide/C/mail.xml:858(programlisting)
15028
" mailman_transport:\n"
15030
" command = MM_WRAP \\\n"
15031
" '${if def:local_part_suffix \\\n"
15032
" {${sg{$local_part_suffix}{-(\\\\w+)(\\\\+.*)?}{\\$1}}} "
15036
" current_directory = MM_HOME\n"
15037
" home_directory = MM_HOME\n"
15039
" group = MM_GID\n"
15042
#: serverguide/C/mail.xml:852(para)
15044
"All the configuration files belonging to transport type are stored in the "
15045
"<filename>/etc/exim4/conf.d/transport/</filename> directory. You can add the "
15046
"following content to a new file named <filename> 40_exim4-"
15047
"config_mailman</filename>: <placeholder-1/>"
15050
#: serverguide/C/mail.xml:879(programlisting)
15054
" mailman_router:\n"
15055
" driver = accept\n"
15056
" require_files = MM_HOME/lists/$local_part/config.pck\n"
15057
" local_part_suffix_optional\n"
15058
" local_part_suffix = -bounces : -bounces+* : \\\n"
15059
" -confirm+* : -join : -leave : \\\n"
15060
" -owner : -request : -admin\n"
15061
" transport = mailman_transport\n"
15064
#: serverguide/C/mail.xml:875(para)
15066
"All the configuration files belonging to router type are stored in the "
15067
"<filename>/etc/exim4/conf.d/router/</filename> directory. You can add the "
15068
"following content in to a new file named <filename>101_exim4-"
15069
"config_mailman</filename>: <placeholder-1/>"
15072
#: serverguide/C/mail.xml:892(para)
15074
"The order of main and transport configuration files can be in any order. "
15075
"But, the order of router configuration files must be the same. This "
15076
"particular file must appear before the <application>200_exim4-"
15077
"config_primary</application> file. These two configuration files contain "
15078
"same type of information. The first file takes the precedence. For more "
15079
"details, please refer to the references section."
15082
#: serverguide/C/mail.xml:905(para)
15084
"Once mailman is installed, you can run it using the following command:"
15087
#: serverguide/C/mail.xml:909(command)
15088
msgid "sudo /etc/init.d/mailman start"
15091
#: serverguide/C/mail.xml:911(para)
15093
"Once mailman is installed, you should create the default mailing list. Run "
15094
"the following command to create the mailing list:"
15097
#: serverguide/C/mail.xml:917(command)
15098
msgid "sudo /usr/sbin/newlist mailman"
15101
#: serverguide/C/mail.xml:920(programlisting)
15105
" Enter the email address of the person running the list: bhuvan at "
15107
" Initial mailman password:\n"
15108
" To finish creating your mailing list, you must edit your "
15109
"<filename>/etc/aliases</filename> (or\n"
15110
" equivalent) file by adding the following lines, and possibly running the\n"
15111
" `newaliases' program:\n"
15113
" ## mailman mailing list\n"
15114
" mailman: \"|/var/lib/mailman/mail/mailman post mailman\"\n"
15115
" mailman-admin: \"|/var/lib/mailman/mail/mailman admin mailman\"\n"
15116
" mailman-bounces: \"|/var/lib/mailman/mail/mailman bounces mailman\"\n"
15117
" mailman-confirm: \"|/var/lib/mailman/mail/mailman confirm mailman\"\n"
15118
" mailman-join: \"|/var/lib/mailman/mail/mailman join mailman\"\n"
15119
" mailman-leave: \"|/var/lib/mailman/mail/mailman leave mailman\"\n"
15120
" mailman-owner: \"|/var/lib/mailman/mail/mailman owner mailman\"\n"
15121
" mailman-request: \"|/var/lib/mailman/mail/mailman request mailman\"\n"
15122
" mailman-subscribe: \"|/var/lib/mailman/mail/mailman subscribe "
15124
" mailman-unsubscribe: \"|/var/lib/mailman/mail/mailman unsubscribe "
15127
" Hit enter to notify mailman owner...\n"
15132
#: serverguide/C/mail.xml:943(para)
15134
"We have configured either Postfix or Exim4 to recognize all emails from "
15135
"mailman. So, it is not mandatory to make any new entries in "
15136
"<filename>/etc/aliases</filename>. If you have made any changes to the "
15137
"configuration files, please ensure that you restart those services before "
15138
"continuing to next section."
15141
#: serverguide/C/mail.xml:962(title)
15142
msgid "Administration"
15145
#: serverguide/C/mail.xml:963(para)
15147
"We assume you have a default installation. The mailman cgi scripts are still "
15148
"in the <application>/usr/lib/cgi-bin/mailman/</application> directory. "
15149
"Mailman provides a web based administration facility. To access this page, "
15150
"point your browser to the following url:"
15153
#: serverguide/C/mail.xml:971(para)
15154
msgid "http://hostname/cgi-bin/mailman/admin"
15157
#: serverguide/C/mail.xml:975(para)
15159
"The default mailing list, <emphasis>mailman</emphasis>, will appear in this "
15160
"screen. If you click the mailing list name, it will ask for your "
15161
"authentication password. If you enter the correct password, you will be able "
15162
"to change administrative settings of this mailing list. You can create a new "
15163
"mailing list using the command line utility "
15164
"(<command>/usr/sbin/newlist</command>). Alternatively, you can create a new "
15165
"mailing list using the web interface."
15168
#: serverguide/C/mail.xml:988(title)
15172
#: serverguide/C/mail.xml:989(para)
15174
"Mailman provides a web based interface for users. To access this page, point "
15175
"your browser to the following url:"
15178
#: serverguide/C/mail.xml:994(para)
15179
msgid "http://hostname/cgi-bin/mailman/listinfo"
15182
#: serverguide/C/mail.xml:998(para)
15184
"The default mailing list, <emphasis>mailman</emphasis>, will appear in this "
15185
"screen. If you click the mailing list name, it will display the subscription "
15186
"form. You can enter your email address, name (optional), and password to "
15187
"subscribe. An email invitation will be sent to you. You can follow the "
15188
"instructions in the email to subscribe."
15191
#: serverguide/C/mail.xml:1010(ulink)
15192
msgid "GNU Mailman - Installation Manual"
15195
#: serverguide/C/mail.xml:1014(ulink)
15196
msgid "HOWTO - Using Exim 4 and Mailman 2.1 together"
15199
#: serverguide/C/mail.xml:1020(title)
15200
msgid "Mail Filtering"
15203
#: serverguide/C/mail.xml:1021(para)
15205
"One of the largest issues with email today is the problem of Unsolicited "
15206
"Bulk Email (UBE). Also known as SPAM, such messages may also carry viruses "
15207
"and other forms of malware. According to some reports these messages make up "
15208
"the bulk of all email traffic on the Internet."
15211
#: serverguide/C/mail.xml:1026(para)
15213
"This section will cover integrating <application>Amavisd-new</application>, "
15214
"<application>Spamassassin</application>, and "
15215
"<application>ClamAV</application> with the "
15216
"<application>Postfix</application> Mail Transport Agent (MTA). "
15217
"<application>Postfix</application> can also check email validity by passing "
15218
"it through external content filters. These filters can sometimes determine "
15219
"if a message is spam without needing to process it with more resource "
15220
"intensive applications. Two common filters are <application>dkim-"
15221
"filter</application> and <application>python-policyd-spf</application>."
15224
#: serverguide/C/mail.xml:1036(para)
15226
"<application>Amavisd-new</application> is a wrapper program that can call "
15227
"any number of content filtering programs for spam detection, antivirus, etc."
15230
#: serverguide/C/mail.xml:1042(para)
15232
"<application>Spamassassin</application> uses a variety of mechanisms to "
15233
"filter email based on the message content."
15236
#: serverguide/C/mail.xml:1047(para)
15238
"<application>ClamAV</application> is an open source antivirus application."
15241
#: serverguide/C/mail.xml:1052(para)
15243
"<application>dkim-filter</application> implements a Sendmail Mail Filter "
15244
"(Milter) for the DomainKeys Identified Mail (DKIM) standard."
15247
#: serverguide/C/mail.xml:1058(para)
15249
"<application>python-policyd-spf</application> enables Sender Policy "
15250
"Framework (SPF) checking with <application>Postfix</application>."
15253
#: serverguide/C/mail.xml:1063(para)
15254
msgid "This is how the pieces fit together:"
15257
#: serverguide/C/mail.xml:1068(para)
15258
msgid "An email message is accepted by <application>Postfix</application>."
15261
#: serverguide/C/mail.xml:1073(para)
15263
"The message is passed through any external filters <application>dkim-"
15264
"filter</application> and <application>python-policyd-spf</application> in "
15268
#: serverguide/C/mail.xml:1079(para)
15269
msgid "<application>Amavisd-new</application> then processes the message."
15272
#: serverguide/C/mail.xml:1084(para)
15274
"<application>ClamAV</application> is used to scan the message. If the "
15275
"message contains a virus <application>Postfix</application> will reject the "
15279
#: serverguide/C/mail.xml:1090(para)
15281
"Clean messages will then be analyzed by "
15282
"<application>Spamassassin</application> to find out if the message is spam. "
15283
"<application>Spamassassin</application> will then add X-Header lines "
15284
"allowing <application>Amavisd-new</application> to further manipulate the "
15288
#: serverguide/C/mail.xml:1097(para)
15290
"For example, if a message has a Spam score of over fifty the message could "
15291
"be automatically dropped from the queue without the recipient ever having to "
15292
"be bothered. Another, way to handle flagged messages is to deliver them to "
15293
"the Mail User Agent (MUA) allowing the user to deal with the message as they "
15297
#: serverguide/C/mail.xml:1104(para)
15299
"See <xref linkend=\"postfix\"/> for instructions on installing and "
15300
"configuring Postfix."
15303
#: serverguide/C/mail.xml:1107(para)
15305
"To install the rest of the applications enter the following from a terminal "
15309
#: serverguide/C/mail.xml:1111(command)
15310
msgid "sudo apt-get install amavisd-new spamassassin clamav-daemon"
15313
#: serverguide/C/mail.xml:1112(command)
15314
msgid "sudo apt-get install dkim-filter python-policyd-spf"
15317
#: serverguide/C/mail.xml:1114(para)
15319
"There are some optional packages that integrate with "
15320
"<application>Spamassassin</application> for better spam detection:"
15323
#: serverguide/C/mail.xml:1118(command)
15324
msgid "sudo apt-get install pyzor razor"
15327
#: serverguide/C/mail.xml:1120(para)
15329
"Along with the main filtering applications compression utilities are needed "
15330
"to process some email attachments:"
15333
#: serverguide/C/mail.xml:1124(command)
15335
"sudo apt-get install arj cabextract cpio lha nomarch pax rar unrar unzip zip "
15339
#: serverguide/C/mail.xml:1129(para)
15340
msgid "Now configure everything to work together and filter email."
15343
#: serverguide/C/mail.xml:1133(title)
15347
#: serverguide/C/mail.xml:1134(para)
15349
"The default behaviour of <application>ClamAV</application> will fit our "
15350
"needs. For more ClamAV configuration options, check the configuration files "
15351
"in <filename>/etc/clamav</filename>."
15354
#: serverguide/C/mail.xml:1139(para)
15356
"Add the <emphasis>clamav</emphasis> user to the <emphasis>amavis</emphasis> "
15357
"group in order for <application>Amavisd-new</application> to have the "
15358
"appropriate access to scan files:"
15361
#: serverguide/C/mail.xml:1144(command)
15362
msgid "sudo adduser clamav amavis"
15365
#: serverguide/C/mail.xml:1148(title)
15366
msgid "Spamassassin"
15369
#: serverguide/C/mail.xml:1149(para)
15371
"Spamassassin automatically detects optional components and will use them if "
15372
"they are present. This means that there is no need to configure "
15373
"<application>pyzor</application> and <application>razor</application>."
15376
#: serverguide/C/mail.xml:1153(para)
15378
"Edit <filename>/etc/default/spamassassin</filename> to activate the "
15379
"<application>Spamassassin</application> daemon. Change "
15380
"<emphasis>ENABLED=0</emphasis> to:"
15383
#: serverguide/C/mail.xml:1157(programlisting)
15390
#: serverguide/C/mail.xml:1160(para)
15391
msgid "Now start the daemon:"
15394
#: serverguide/C/mail.xml:1164(command)
15395
msgid "sudo /etc/init.d/spamassassin start"
15398
#: serverguide/C/mail.xml:1168(title)
15399
msgid "Amavisd-new"
15402
#: serverguide/C/mail.xml:1169(para)
15404
"First activate spam and antivirus detection in <application>Amavisd-"
15405
"new</application> by editing <filename>/etc/amavis/conf.d/15-"
15406
"content_filter_mode</filename>:"
15409
#: serverguide/C/mail.xml:1173(programlisting)
15415
"# You can modify this file to re-enable SPAM checking through spamassassin\n"
15416
"# and to re-enable antivirus checking.\n"
15419
"# Default antivirus checking mode\n"
15420
"# Uncomment the two lines below to enable it\n"
15423
"@bypass_virus_checks_maps = (\n"
15424
" \\%bypass_virus_checks, \\@bypass_virus_checks_acl, \\"
15425
"$bypass_virus_checks_re);\n"
15429
"# Default SPAM checking mode\n"
15430
"# Uncomment the two lines below to enable it\n"
15433
"@bypass_spam_checks_maps = (\n"
15434
" \\%bypass_spam_checks, \\@bypass_spam_checks_acl, \\"
15435
"$bypass_spam_checks_re);\n"
15437
"1; # insure a defined return\n"
15440
#: serverguide/C/mail.xml:1198(para)
15442
"Bouncing spam can be a bad idea as the return address is often faked. "
15443
"Consider editing <filename>/etc/amavis/conf.d/20-debian_defaults</filename> "
15444
"to set <emphasis>$final_spam_destiny</emphasis> to D_DISCARD rather than "
15445
"D_BOUNCE, as follows:"
15448
#: serverguide/C/mail.xml:1203(programlisting)
15452
"$final_spam_destiny = D_DISCARD;\n"
15455
#: serverguide/C/mail.xml:1207(para)
15457
"If the server's <emphasis>hostname</emphasis> is different from the domain's "
15458
"MX record you may need to manually set the <emphasis>$myhostname</emphasis> "
15459
"option. Also, if the server receives mail for multiple domains the "
15460
"<emphasis>@local_domains_acl</emphasis> option will need to be customized. "
15461
"Edit the <filename>/etc/amavis/conf.d/50-user</filename> file:"
15464
#: serverguide/C/mail.xml:1214(programlisting)
15468
"$myhostname = 'mail.example.com';\n"
15469
"@local_domains_acl = ( \"example.com\", \"example.org\" );\n"
15472
#: serverguide/C/mail.xml:1219(para)
15474
"After configuration <application>Amavisd-new</application> needs to be "
15478
#: serverguide/C/mail.xml:1223(command) serverguide/C/mail.xml:1269(command)
15479
msgid "sudo /etc/init.d/amavis restart"
15482
#: serverguide/C/mail.xml:1226(title)
15483
msgid "DKIM Whitelist"
15486
#: serverguide/C/mail.xml:1228(para)
15488
"<application>Amavisd-new</application> can be configured to automatically "
15489
"<emphasis>Whitelist</emphasis> addresses from domains with valid Domain "
15490
"Keys. There are some pre-configured domains in the "
15491
"<filename>/etc/amavis/conf.d/40-policy_banks</filename>."
15494
#: serverguide/C/mail.xml:1234(para)
15495
msgid "There are multiple ways to configure the Whitelist for a domain:"
15498
#: serverguide/C/mail.xml:1240(para)
15500
"<emphasis>'example.com' => 'WHITELIST',</emphasis>: will whitelist any "
15501
"address from the \"example.com\" domain."
15504
#: serverguide/C/mail.xml:1245(para)
15506
"<emphasis>'.example.com' => 'WHITELIST',</emphasis>: will whitelist any "
15507
"address from any <emphasis>subdomains</emphasis> of \"example.com\" that "
15508
"have a valid signature."
15511
#: serverguide/C/mail.xml:1251(para)
15513
"<emphasis>'.example.com/@example.com' => 'WHITELIST',</emphasis>: will "
15514
"whitelist subdomains of \"example.com\" that use the signature of <emphasis "
15515
"role=\"italic\">example.com</emphasis> the parent domain."
15518
#: serverguide/C/mail.xml:1257(para)
15520
"<emphasis>'./@example.com' => 'WHITELIST',</emphasis>: adds addresses "
15521
"that have a valid signature from \"example.com\". This is usually used for "
15522
"discussion groups that sign thier messages."
15525
#: serverguide/C/mail.xml:1264(para)
15527
"A domain can also have multiple Whitelist configurations. After, editing the "
15528
"file restart <application>amaisd-new</application>:"
15531
#: serverguide/C/mail.xml:1273(para)
15533
"In this context, once a domain has been added to the Whitelist the message "
15534
"will not receive any anti-virus or spam filtering. This may or may not be "
15535
"the intended behavior you wish for a domain."
15538
#: serverguide/C/mail.xml:1283(para)
15540
"For <application>Postfix</application> integration, enter the following from "
15541
"a terminal prompt:"
15544
#: serverguide/C/mail.xml:1287(command)
15545
msgid "sudo postconf -e 'content_filter = smtp-amavis:[127.0.0.1]:10024'"
15548
#: serverguide/C/mail.xml:1289(para)
15550
"Next edit <filename>/etc/postfix/master.cf</filename> and add the following "
15551
"to the end of the file:"
15554
#: serverguide/C/mail.xml:1292(programlisting)
15558
"smtp-amavis unix - - - - 2 smtp\n"
15559
" -o smtp_data_done_timeout=1200\n"
15560
" -o smtp_send_xforward_command=yes\n"
15561
" -o disable_dns_lookups=yes\n"
15564
"127.0.0.1:10025 inet n - - - - smtpd\n"
15565
" -o content_filter=\n"
15566
" -o local_recipient_maps=\n"
15567
" -o relay_recipient_maps=\n"
15568
" -o smtpd_restriction_classes=\n"
15569
" -o smtpd_delay_reject=no\n"
15570
" -o smtpd_client_restrictions=permit_mynetworks,reject\n"
15571
" -o smtpd_helo_restrictions=\n"
15572
" -o smtpd_sender_restrictions=\n"
15573
" -o smtpd_recipient_restrictions=permit_mynetworks,reject\n"
15574
" -o smtpd_data_restrictions=reject_unauth_pipelining\n"
15575
" -o smtpd_end_of_data_restrictions=\n"
15576
" -o mynetworks=127.0.0.0/8\n"
15577
" -o smtpd_error_sleep_time=0\n"
15578
" -o smtpd_soft_error_limit=1001\n"
15579
" -o smtpd_hard_error_limit=1000\n"
15580
" -o smtpd_client_connection_count_limit=0\n"
15581
" -o smtpd_client_connection_rate_limit=0\n"
15583
"receive_override_options=no_header_body_checks,no_unknown_recipient_checks\n"
15586
#: serverguide/C/mail.xml:1319(para)
15588
"Also add the following two lines immediately below the "
15589
"<emphasis>\"pickup\"</emphasis> transport service:"
15592
#: serverguide/C/mail.xml:1322(programlisting)
15596
" -o content_filter=\n"
15597
" -o receive_override_options=no_header_body_checks\n"
15600
#: serverguide/C/mail.xml:1326(para)
15602
"This will prevent messages that are generated to report on spam from being "
15603
"classified as spam."
15606
#: serverguide/C/mail.xml:1329(para)
15607
msgid "Now restart <application>Postfix</application>:"
15610
#: serverguide/C/mail.xml:1335(para)
15611
msgid "Content filtering with spam and virus detection is now enabled."
15614
#: serverguide/C/mail.xml:1342(para)
15616
"First, test that the <application>Amavisd-new</application> SMTP is "
15620
#: serverguide/C/mail.xml:1345(programlisting)
15624
"telnet localhost 10024\n"
15625
"Trying 127.0.0.1...\n"
15626
"Connected to localhost.\n"
15627
"Escape character is '^]'.\n"
15628
"220 [127.0.0.1] ESMTP amavisd-new service ready\n"
15632
#: serverguide/C/mail.xml:1353(para)
15634
"In the Header of messages that go through the content filter you should see:"
15637
#: serverguide/C/mail.xml:1356(programlisting)
15642
"X-Virus-Scanned: Debian amavisd-new at example.com\n"
15643
"X-Spam-Status: No, hits=-2.3 tagged_above=-1000.0 required=5.0 tests=AWL, "
15648
#: serverguide/C/mail.xml:1363(para)
15650
"Your output will vary, but the important thing is that there are <emphasis>X-"
15651
"Virus-Scanned</emphasis> and <emphasis>X-Spam-Status</emphasis> entries."
15654
#: serverguide/C/mail.xml:1371(para)
15656
"The best way to figure out why something is going wrong is to check the log "
15660
#: serverguide/C/mail.xml:1376(para)
15662
"For instructions on <application>Postfix</application> logging see the <xref "
15663
"linkend=\"postfix-troubleshooting\"/> section."
15666
#: serverguide/C/mail.xml:1382(para)
15668
"<application>Amavisd-new</application> uses "
15669
"<application>Syslog</application> to send messages to "
15670
"<filename>/var/log/mail.log</filename>. The amount of detail can be "
15671
"increased by adding the <emphasis>$log_level</emphasis> option to "
15672
"<filename>/etc/amavis/conf.d/50-user</filename>, and setting the value from "
15676
#: serverguide/C/mail.xml:1387(programlisting)
15680
"$log_level = 2;\n"
15683
#: serverguide/C/mail.xml:1391(para)
15685
"When the <application>Amavisd-new</application> log output is increased "
15686
"<application>Spamassassin</application> log output is also increased."
15689
#: serverguide/C/mail.xml:1398(para)
15691
"The <application>ClamAV</application> log level can be increased by editing "
15692
"<filename>/etc/clamav/clamd.conf</filename> and setting the following option:"
15695
#: serverguide/C/mail.xml:1402(programlisting)
15699
"LogVerbose true\n"
15702
#: serverguide/C/mail.xml:1405(para)
15704
"By default <application>ClamAV</application> will send log messages to "
15705
"<filename>/var/log/clamav/clamav.log</filename>."
15708
#: serverguide/C/mail.xml:1411(para)
15710
"After changing an applications log settings remember to restart the service "
15711
"for the new settings to take affect. Also, once the issue you are "
15712
"troubleshooting is resolved it is a good idea to change the log settings "
15716
#: serverguide/C/mail.xml:1419(para)
15717
msgid "For more information on filtering mail see the following links:"
15720
#: serverguide/C/mail.xml:1425(ulink)
15721
msgid "Amavisd-new Documentation"
15724
#: serverguide/C/mail.xml:1429(para)
15726
"<ulink url=\"http://www.clamav.org/doc/latest/html/\">ClamAV "
15727
"Documentation</ulink> and <ulink "
15728
"url=\"http://wiki.clamav.net/Main/WebHome\">ClamAV Wiki</ulink>"
15731
#: serverguide/C/mail.xml:1436(ulink)
15732
msgid "Spamassassin Wiki"
15735
#: serverguide/C/mail.xml:1441(ulink)
15736
msgid "Pyzor Homepage"
15739
#: serverguide/C/mail.xml:1446(ulink)
15740
msgid "Razor Homepage"
15743
#: serverguide/C/mail.xml:1451(ulink)
15747
#: serverguide/C/mail.xml:1455(para)
15749
"Also, feel free to ask questions in the <emphasis>#ubuntu-server</emphasis> "
15750
"IRC channel on <ulink url=\"http://freenode.net\">freenode</ulink>."
15753
#: serverguide/C/lamp-applications.xml:13(title)
15754
msgid "LAMP Applications"
15757
#: serverguide/C/lamp-applications.xml:19(para)
15759
"LAMP installations (Linux + Apache + MySQL + PHP) are a popular setup for "
15760
"Ubuntu servers. There is a plethora of Open Source applications written "
15761
"using the LAMP application stack. Some popular LAMP applications are Wiki's, "
15762
"Content Management Systems, and Management Software such as phpMyAdmin."
15765
#: serverguide/C/lamp-applications.xml:26(para)
15767
"One advantage of LAMP is the substantial flexibility for different database, "
15768
"web server, and scripting languages. Popular substitutes for MySQL include "
15769
"Posgresql and SQLite. Python, Perl, and Ruby are also frequently used "
15773
#: serverguide/C/lamp-applications.xml:32(para)
15775
"The traditional way to install most <emphasis>LAMP</emphasis> applications "
15779
#: serverguide/C/lamp-applications.xml:38(para)
15780
msgid "Download an archive containing the application source files."
15783
#: serverguide/C/lamp-applications.xml:43(para)
15785
"Unpack the archive, usually in a directory accessible to a web server."
15788
#: serverguide/C/lamp-applications.xml:48(para)
15790
"Depending on where the source was extracted, configure a web browser to "
15794
#: serverguide/C/lamp-applications.xml:53(para)
15795
msgid "Configure the application to connect to the database."
15798
#: serverguide/C/lamp-applications.xml:58(para)
15800
"Run a script, or browse to a page of the application, to install the "
15801
"database needed by the application."
15804
#: serverguide/C/lamp-applications.xml:63(para)
15806
"Once the steps above, or similar steps, are completed you are ready to begin "
15807
"using the application."
15810
#: serverguide/C/lamp-applications.xml:69(para)
15812
"A disadvantage of using this approach is that the application files are not "
15813
"placed in the file system in a standard way, which can cause confusion as to "
15814
"where the application is installed. Another larger disadvantage is updating "
15815
"the application. When a new version is released, the same process used to "
15816
"install the application is needed to apply updates."
15819
#: serverguide/C/lamp-applications.xml:76(para)
15821
"Fortunately, a number of <emphasis>LAMP</emphasis> applications are already "
15822
"packaged for Ubuntu, and are available for installation in the same way as "
15823
"non-LAMP applications. Depending on the application some extra configuration "
15824
"and setup steps may be needed, however."
15827
#: serverguide/C/lamp-applications.xml:82(para)
15829
"This section covers howto install and configure the Wiki applications "
15830
"<application>MoinMoin</application>, <application>MediaWiki</application>, "
15831
"and the MySQL management application <application>phpMyAdmin</application>."
15834
#: serverguide/C/lamp-applications.xml:88(para)
15836
"A Wiki is a website that allows the visitors to easily add, remove and "
15837
"modify available content easily. The ease of interaction and operation makes "
15838
"Wiki an effective tool for mass collaborative authoring. The term Wiki is "
15839
"also referred to the collaborative software."
15842
#: serverguide/C/lamp-applications.xml:100(title)
15846
#: serverguide/C/lamp-applications.xml:102(para)
15848
"MoinMoin is a Wiki engine implemented in Python, based on the PikiPiki Wiki "
15849
"engine, and licensed under the GNU GPL."
15852
#: serverguide/C/lamp-applications.xml:110(para)
15854
"To install <application>MoinMoin</application>, run the following command in "
15855
"the command prompt:"
15858
#: serverguide/C/lamp-applications.xml:116(command)
15859
msgid "sudo apt-get install python-moinmoin"
15862
#: serverguide/C/lamp-applications.xml:119(para)
15864
"You should also install <application>apache2</application> web server. For "
15865
"installing <application>apache2</application> web server, please refer to "
15866
"<xref linkend=\"http-installation\"/> sub-section in <xref "
15867
"linkend=\"httpd\"/> section."
15870
#: serverguide/C/lamp-applications.xml:130(para)
15872
"For configuring your first Wiki application, please run the following set of "
15873
"commands. Let us assume that you are creating a Wiki named "
15874
"<emphasis>mywiki</emphasis>:"
15877
#: serverguide/C/lamp-applications.xml:137(command)
15878
msgid "cd /usr/share/moin"
15881
#: serverguide/C/lamp-applications.xml:138(command)
15882
msgid "sudo mkdir mywiki"
15885
#: serverguide/C/lamp-applications.xml:139(command)
15886
msgid "sudo cp -R data mywiki"
15889
#: serverguide/C/lamp-applications.xml:140(command)
15890
msgid "sudo cp -R underlay mywiki"
15893
#: serverguide/C/lamp-applications.xml:141(command)
15894
msgid "sudo cp server/moin.cgi mywiki"
15897
#: serverguide/C/lamp-applications.xml:142(command)
15898
msgid "sudo chown -R www-data.www-data mywiki"
15901
#: serverguide/C/lamp-applications.xml:143(command)
15902
msgid "sudo chmod -R ug+rwX mywiki"
15905
#: serverguide/C/lamp-applications.xml:144(command)
15906
msgid "sudo chmod -R o-rwx mywiki"
15909
#: serverguide/C/lamp-applications.xml:147(para)
15911
"Now you should configure <application>MoinMoin</application> to find your "
15912
"new Wiki <emphasis>mywiki</emphasis>. To configure "
15913
"<application>MoinMoin</application>, open "
15914
"<filename>/etc/moin/mywiki.py</filename> file and change the following line:"
15917
#: serverguide/C/lamp-applications.xml:155(programlisting)
15919
msgid "data_dir = '/org/mywiki/data'"
15922
#: serverguide/C/lamp-applications.xml:157(para)
15926
#: serverguide/C/lamp-applications.xml:161(programlisting)
15928
msgid "data_dir = '/usr/share/moin/mywiki/data'"
15931
#: serverguide/C/lamp-applications.xml:163(para)
15933
"Also, below the <emphasis>data_dir</emphasis> option add the "
15934
"<emphasis>data_underlay_dir</emphasis>:"
15937
#: serverguide/C/lamp-applications.xml:167(programlisting)
15941
"data_underlay_dir='/usr/share/moin/mywiki/underlay'\n"
15944
#: serverguide/C/lamp-applications.xml:172(para)
15946
"If the <filename>/etc/moin/mywiki.py</filename> file does not exists, you "
15947
"should copy <filename>/etc/moin/moinmaster.py</filename> file to "
15948
"<filename>/etc/moin/mywiki.py</filename> file and do the above mentioned "
15952
#: serverguide/C/lamp-applications.xml:181(para)
15954
"If you have named your Wiki as <emphasis>my_wiki_name</emphasis> you should "
15955
"insert a line <quote>(\"my_wiki_name\", r\".*\")</quote> in "
15956
"<filename>/etc/moin/farmconfig.py</filename> file after the line "
15957
"<quote>(\"mywiki\", r\".*\")</quote>."
15960
#: serverguide/C/lamp-applications.xml:189(para)
15962
"Once you have configured <application>MoinMoin</application> to find your "
15963
"first Wiki application <emphasis>mywiki</emphasis>, you should configure "
15964
"<application>apache2</application> and make it ready for your Wiki "
15968
#: serverguide/C/lamp-applications.xml:196(para)
15970
"You should add the following lines in <filename>/etc/apache2/sites-"
15971
"available/default</filename> file inside the <quote><VirtualHost "
15972
"*></quote> tag:"
15975
#: serverguide/C/lamp-applications.xml:202(programlisting)
15980
" ScriptAlias /mywiki \"/usr/share/moin/mywiki/moin.cgi\"\n"
15981
" alias /moin_static181 \"/usr/share/moin/htdocs\"\n"
15982
" <Directory /usr/share/moin/htdocs>\n"
15983
" Order allow,deny\n"
15984
" allow from all\n"
15985
" </Directory>\n"
15989
#: serverguide/C/lamp-applications.xml:213(para)
15991
"Once you configure the <application>apache2</application> web server and "
15992
"make it ready for your Wiki application, you should restart it. You can run "
15993
"the following command to restart the <application>apache2</application> web "
15997
#: serverguide/C/lamp-applications.xml:226(title)
15998
msgid "Verification"
16001
#: serverguide/C/lamp-applications.xml:228(para)
16003
"You can verify the Wiki application and see if it works by pointing your web "
16004
"browser to the following URL:"
16007
#: serverguide/C/lamp-applications.xml:232(programlisting)
16011
"http://localhost/mywiki\n"
16014
#: serverguide/C/lamp-applications.xml:236(para)
16016
"You can also run the test command by pointing your web browser to the "
16020
#: serverguide/C/lamp-applications.xml:241(programlisting)
16024
"http://localhost/mywiki?action=test\n"
16027
#: serverguide/C/lamp-applications.xml:245(para)
16029
"For more details, please refer to the <ulink "
16030
"url=\"http://moinmo.in/\">MoinMoin</ulink> web site."
16033
#: serverguide/C/lamp-applications.xml:256(para)
16035
"For more information see the <ulink url=\"http://moinmo.in/\">moinmoin "
16039
#: serverguide/C/lamp-applications.xml:265(title)
16043
#: serverguide/C/lamp-applications.xml:267(para)
16045
"MediaWiki is an web based Wiki software written in the PHP language. It can "
16046
"either use <application>MySQL</application> or "
16047
"<application>PostgreSQL</application> Database Management System."
16050
#: serverguide/C/lamp-applications.xml:277(para)
16052
"Before installing <application>MediaWiki</application> you should also "
16053
"install <application>Apache2</application>, the "
16054
"<application>PHP5</application> scripting language and Database a Management "
16055
"System. <application>MySQL</application> or "
16056
"<application>PostgreSQL</application> are the most common, choose one "
16057
"depending on your need. Please refer to those sections in this manual for "
16058
"installation instructions."
16061
#: serverguide/C/lamp-applications.xml:285(para)
16063
"To install <application>MediaWiki</application>, run the following command "
16064
"in the command prompt:"
16067
#: serverguide/C/lamp-applications.xml:291(command)
16068
msgid "sudo apt-get install mediawiki php5-gd"
16071
#: serverguide/C/lamp-applications.xml:294(para)
16073
"For additional <application>MediaWiki</application> functionality see the "
16074
"<application>mediawiki-extensions</application> package."
16077
#: serverguide/C/lamp-applications.xml:304(para)
16078
msgid "Run the following commands to configure MediaWiki:"
16081
#: serverguide/C/lamp-applications.xml:309(command)
16082
msgid "sudo ln -s /var/lib/mediawiki /var/www/mediawiki"
16085
#: serverguide/C/lamp-applications.xml:312(para)
16086
msgid "Point your web browser to the following URL for MediaWiki setup:"
16089
#: serverguide/C/lamp-applications.xml:321(programlisting)
16093
"http://localhost/mediawiki/config/index.php\n"
16096
#: serverguide/C/lamp-applications.xml:326(para)
16098
"Please read the <quote>Checking environment...</quote> section in this page. "
16099
"You should be able to fix many issues by carefully reading this section."
16102
#: serverguide/C/lamp-applications.xml:366(para)
16104
"For more details, please refer to the <ulink "
16105
"url=\"http://www.mediawiki.org\">MediaWiki</ulink> web site."
16108
#: serverguide/C/lamp-applications.xml:372(para)
16110
"The <ulink url=\"http://www.packtpub.com/Mediawiki/book\">MediaWiki "
16111
"Administrators’ Tutorial Guide</ulink> contains a wealth of information for "
16112
"new MediaWiki administrators."
16115
#: serverguide/C/lamp-applications.xml:382(title)
16119
#: serverguide/C/lamp-applications.xml:384(para)
16121
"<application>phpMyAdmin</application> is a LAMP application specifically "
16122
"written for administering <application>MySQL</application> servers. Written "
16123
"in <application>PHP</application>, and accessed through a web browser, "
16124
"phpMyAdmin provides a graphical interface for database administration tasks."
16127
#: serverguide/C/lamp-applications.xml:393(para)
16129
"Before installing <application>phpMyAdmin</application> you will need access "
16130
"to a <application>MySQL</application> database either on the same host as "
16131
"that phpMyAdmin is installed on, or on a host accessible over the network. "
16132
"For more information see <xref linkend=\"mysql\"/>. From a terminal prompt "
16136
#: serverguide/C/lamp-applications.xml:400(command)
16137
msgid "sudo apt-get install phpmyadmin"
16140
#: serverguide/C/lamp-applications.xml:403(para)
16142
"At the prompt choose which web server to be configured for "
16143
"<application>phpMyAdmin</application>. The rest of this section will use "
16144
"<application>Apache2</application> for the web server."
16147
#: serverguide/C/lamp-applications.xml:408(para)
16149
"In a browser go to <emphasis>http://servername/phpmyadmin</emphasis>, "
16150
"replacing <emphasis role=\"italic\">serveranme</emphasis> with the server's "
16151
"actual hostname. At the login, page enter <emphasis>root</emphasis> for the "
16152
"<emphasis>username</emphasis>, or another <application>MySQL</application> "
16153
"user if you any setup, and enter the <application>MySQL</application> user's "
16157
#: serverguide/C/lamp-applications.xml:415(para)
16159
"Once logged in you can reset the <emphasis>root</emphasis> password if "
16160
"needed, create users, create/destroy databases and tables, etc."
16163
#: serverguide/C/lamp-applications.xml:423(para)
16165
"The configuration files for <application>phpMyAdmin</application> are "
16166
"located in <filename>/etc/phpmyadmin</filename>. The main configuration file "
16167
"is <filename>/etc/phpmyadmin/config.inc.php</filename>. This file contains "
16168
"configuration options that apply globally to "
16169
"<application>phpMyAdmin</application>."
16172
#: serverguide/C/lamp-applications.xml:429(para)
16174
"To use <application>phpMyAdmin</application> to administer a MySQL database "
16175
"hosted on another server, adjust the following in "
16176
"<filename>/etc/phpmyadmin/config.inc.php</filename>:"
16179
#: serverguide/C/lamp-applications.xml:434(programlisting)
16183
"$cfg['Servers'][$i]['host'] = 'db_server';\n"
16186
#: serverguide/C/lamp-applications.xml:439(para)
16188
"Replace <emphasis role=\"italic\">db_server</emphasis> with the actual "
16189
"remote database server name or IP address. Also, be sure that the "
16190
"<application>phpMyAdmin</application> host has permissions to access the "
16194
#: serverguide/C/lamp-applications.xml:445(para)
16196
"Once configured, log out of <application>phpMyAdmin</application> and back "
16197
"in, and you should be accessing the new server."
16200
#: serverguide/C/lamp-applications.xml:449(para)
16202
"The <filename>config.header.inc.php</filename> and "
16203
"<filename>config.footer.inc.php</filename> files are used to add a HTML "
16204
"header and footer to <application>phpMyAdmin</application>."
16207
#: serverguide/C/lamp-applications.xml:454(para)
16209
"Another important configuration file is "
16210
"<filename>/etc/phpmyadmin/apache.conf</filename>, this file is symlinked to "
16211
"<filename>/etc/apache2/conf.d/phpmyadmin.conf</filename>, and is used to "
16212
"configure <application>Apache2</application> to serve the "
16213
"<application>phpMyAdmin</application> site. The file contains directives for "
16214
"loading <application>PHP</application>, directory permissions, etc. For more "
16215
"information on configuring <application>Apache2</application> see <xref "
16216
"linkend=\"httpd\"/>."
16219
#: serverguide/C/lamp-applications.xml:468(para)
16221
"The <application>phpMyAdmin</application> documentation comes installed with "
16222
"the package and can be accessed from the <emphasis>phpMyAdmin "
16223
"Documentation</emphasis> link (a question mark with a box around it) under "
16224
"the phpMyAdmin logo. The official docs can also be access on the <ulink "
16225
"url=\"http://www.phpmyadmin.net/home_page/docs.php\">phpMyAdmin</ulink> site."
16228
#: serverguide/C/lamp-applications.xml:475(para)
16230
"Also, <ulink url=\"http://www.packtpub.com/phpmyadmin-3rd-"
16231
"edition/book\">Mastering phpMyAdmin</ulink> is a great resource."
16234
#: serverguide/C/jeos.xml:28(para)
16236
"While installing from the Server Edition ISO (pressing "
16237
"<emphasis>F4</emphasis> on the first screen will allow you to pick \"Minimal "
16238
"installation\", which is the package selection equivalent to JeOS)"
16241
#: serverguide/C/jeos.xml:211(para)
16243
"Because of the nature of operations performed by vmbuilder, it needs to have "
16244
"root priviledge, hence the use of sudo."
16247
#: serverguide/C/jeos.xml:321(programlisting)
16251
" <interface type='bridge'>\n"
16252
" <source network='br0'/>\n"
16253
" </interface>\n"
16256
#: serverguide/C/jeos.xml:499(para)
16258
"Another convenient tool that we want to have on our appliance is OpenSSH, as "
16259
"it will provide our admins to access to access the appliance remotely. "
16260
"However, pushing in the wild an appliance with a pre-installed OpenSSH "
16261
"server is a big security risk as all these server will share the same secret "
16262
"key, making it very easy for hackers to target our appliance with all the "
16263
"tools they need to crack it open in a breeze. As for the user password, we "
16264
"will instead rely on a script that will install OpenSSH the first time a "
16265
"user logs in so that the key generated will be different for each appliance. "
16266
"For this we'll use a <emphasis>--firstboot</emphasis> script, as it does not "
16267
"need any user interaction."
16270
#: serverguide/C/introduction.xml:14(para)
16271
msgid "Welcome to the <emphasis>Ubuntu Server Guide</emphasis>!"
16274
#: serverguide/C/introduction.xml:15(para)
16276
"Here you can find information on how to install and configure various server "
16277
"applications. It is a step-by-step, task-oriented guide for configuring and "
16278
"customizing your system."
16281
#: serverguide/C/introduction.xml:19(para)
16283
"This guide assumes you have a basic understanding of your Ubuntu system. "
16284
"Some installation details are covered in <xref linkend=\"installation\"/>, "
16285
"but if you need detailed instructions installing Ubuntu please refer to the "
16286
"<ulink url=\"https://help.ubuntu.com/9.04/installation-guide/\">Ubuntu "
16287
"Installation Guide</ulink>."
16290
#: serverguide/C/introduction.xml:25(para)
16292
"A HTML version of the manual is available online at <ulink "
16293
"url=\"http://help.ubuntu.com\">the Ubuntu Documentation website</ulink>. The "
16294
"HTML files are also available in the <application>ubuntu-"
16295
"serverguide</application> package. See <xref linkend=\"package-"
16296
"management\"/> for details on installing packages."
16299
#: serverguide/C/introduction.xml:32(para)
16301
"If you choose to install the <application>ubuntu-serverguide</application> "
16302
"you can view this document from a console by:"
16305
#: serverguide/C/introduction.xml:36(command)
16306
msgid "w3m /usr/share/ubuntu-serverguide/html/en_GB/index.html"
16309
#: serverguide/C/introduction.xml:39(para)
16310
msgid "Replace <emphasis>en_GB</emphasis> with your language localization."
16313
#: serverguide/C/introduction.xml:53(title)
16317
#: serverguide/C/introduction.xml:55(para)
16319
"There a couple of different ways that Ubuntu Server Edition is supported, "
16320
"commercial support and community support. The main commercial support (and "
16321
"development funding) is available from Canonical Ltd. They supply reasonably "
16322
"priced support contracts on a per desktop or per server basis. For more "
16323
"information see the <ulink "
16324
"url=\"http://www.canonical.com/services/support\">Canonical Services</ulink> "
16328
#: serverguide/C/introduction.xml:62(para)
16330
"Community support is also provided by dedicated individuals, and companies, "
16331
"that wish to make Ubuntu the best distribution possible. Support is provided "
16332
"through multiple mailing lists, IRC channels, forums, blogs, wikis, etc. The "
16333
"large amount of information available can be overwhelming, but a good search "
16334
"engine query can usually provide an answer to your questions. See the <ulink "
16335
"url=\"http://www.ubuntu.com/support\">Ubuntu Support</ulink> page for more "
16339
#: serverguide/C/installation.xml:14(para)
16341
"This chapter provides a quick overview of installing Ubuntu 9.04 Server "
16342
"Edition. For more detailed instructions, please refer to the <ulink "
16343
"url=\"https://help.ubuntu.com/9.04/installation-guide/\">Ubuntu Installation "
16347
#: serverguide/C/installation.xml:19(title)
16348
msgid "Preparing to Install"
16351
#: serverguide/C/installation.xml:20(para)
16353
"This section explains various aspects to consider before starting the "
16357
#: serverguide/C/installation.xml:24(title)
16358
msgid "System Requirements"
16361
#: serverguide/C/installation.xml:25(para)
16363
"Ubuntu 9.04 Server Edition supports two (2) major architectures: Intel x86 "
16364
"and AMD64. The table below lists recommended hardware specifications. "
16365
"Depending on your needs, you might manage with less than this. However, most "
16366
"users risk being frustrated if they ignore these suggestions."
16369
#: serverguide/C/installation.xml:27(title)
16370
msgid "Recommended Minimum Requirements"
16373
#: serverguide/C/installation.xml:35(para)
16374
msgid "Install Type"
16377
#: serverguide/C/installation.xml:36(para)
16381
#: serverguide/C/installation.xml:37(para)
16382
msgid "Hard Drive Space"
16385
#: serverguide/C/installation.xml:40(para)
16386
msgid "Base System"
16389
#: serverguide/C/installation.xml:41(para)
16390
msgid "All Tasks Installed"
16393
#: serverguide/C/installation.xml:46(para)
16397
#: serverguide/C/installation.xml:47(para)
16398
msgid "128 megabytes"
16401
#: serverguide/C/installation.xml:48(para)
16402
msgid "500 megabytes"
16405
#: serverguide/C/installation.xml:49(para)
16409
#: serverguide/C/installation.xml:54(para)
16411
"The Server Edition provides a common base for all sorts of server "
16412
"applications. It is a minimalist design providing a platform for the desired "
16413
"services, such as file/print services, web hosting, email hosting, etc."
16416
#: serverguide/C/installation.xml:62(title)
16417
msgid "Server and Desktop Differences"
16420
#: serverguide/C/installation.xml:63(para)
16422
"There are a few differences between the <emphasis>Ubuntu Server "
16423
"Edition</emphasis> and the <emphasis>Ubuntu Desktop Edition</emphasis>. It "
16424
"should be noted that both editions use the same "
16425
"<application>apt</application> repositories. Making it just as easy to "
16426
"install a <emphasis role=\"italic\">server</emphasis> application on the "
16427
"Desktop Edition as it is on the Server Edition."
16430
#: serverguide/C/installation.xml:69(para)
16432
"The differences between the two editions are the lack of an X window "
16433
"environment in the Server Edition, the installation process, and different "
16437
#: serverguide/C/installation.xml:76(title)
16438
msgid "Kernel Differences:"
16441
#: serverguide/C/installation.xml:79(para)
16443
"The Server Edition uses the <emphasis>Deadline</emphasis> I/O scheduler "
16444
"instead of the <emphasis>CFQ</emphasis> scheduler used by the Desktop "
16448
#: serverguide/C/installation.xml:85(para)
16449
msgid "<emphasis>Preemption</emphasis> is turned off in the Server Edition."
16452
#: serverguide/C/installation.xml:90(para)
16454
"The timer interrupt is 100 Hz in the Server Edition and 250 Hz in the "
16458
#: serverguide/C/installation.xml:96(para)
16460
"When running a 64-bit version of Ubuntu on 64-bit processors you are not "
16461
"limited by memory addressing space."
16464
#: serverguide/C/installation.xml:101(para)
16466
"To see all kernel configuration options you can look through "
16467
"<filename>/boot/config-2.6.27-server</filename>. Also, <ulink "
16468
"url=\"http://www.kroah.com/lkn/\">Linux Kernel in a Nutshell</ulink> is a "
16469
"great resource on the options available."
16472
#: serverguide/C/installation.xml:110(title)
16476
#: serverguide/C/installation.xml:113(para)
16478
"Before installing <application>Ubuntu Server Edition</application> you "
16479
"should make sure all data on the system is backed up. See <xref "
16480
"linkend=\"backups\"/> for backup options."
16483
#: serverguide/C/installation.xml:117(para)
16485
"If this is not the first time an operating system has been installed on your "
16486
"computer, it is likely you will need to re-partition your disk to make room "
16490
#: serverguide/C/installation.xml:121(para)
16492
"Any time you partition your disk, you should be prepared to lose everything "
16493
"on the disk should you make a mistake or something goes wrong during "
16494
"partitioning. The programs used in installation are quite reliable, most "
16495
"have seen years of use, but they also perform destructive actions."
16498
#: serverguide/C/installation.xml:133(title)
16499
msgid "Installing from CD"
16502
#: serverguide/C/installation.xml:134(para)
16504
"The basic steps to install Ubuntu Server Edition from CD are the same for "
16505
"installing any operating system from CD. Unlike the <emphasis>Desktop "
16506
"Edition</emphasis> the <emphasis>Server Edition</emphasis> does not include "
16507
"a graphical installation program. Instead the Server Edition uses a console "
16508
"menu based process."
16511
#: serverguide/C/installation.xml:141(para)
16513
"First, download and burn the appropriate ISO file from the <ulink "
16514
"url=\"http://www.ubuntu.com/getubuntu/download\"> Ubuntu web site</ulink>."
16517
#: serverguide/C/installation.xml:147(para)
16518
msgid "Boot the system from the CD-ROM drive."
16521
#: serverguide/C/installation.xml:152(para)
16523
"At the boot prompt you will be asked to select the language. Afterwards the "
16524
"installation process begins by asking for your keyboard layout."
16527
#: serverguide/C/installation.xml:158(para)
16529
"The installer then discovers your hardware configuration, and configures the "
16530
"network settings using DHCP. If you do not wish to use DHCP at the next "
16531
"screen choose \"Go Back\", and you have the option to \"Configure the "
16532
"network manually\"."
16535
#: serverguide/C/installation.xml:165(para)
16536
msgid "Next, the installer asks for the system's hostname and Time Zone."
16539
#: serverguide/C/installation.xml:170(para)
16541
"You can then choose from several options to configure the hard drive layout. "
16542
"For advanced disk options see <xref linkend=\"advanced-installation\"/>."
16545
#: serverguide/C/installation.xml:176(para)
16546
msgid "The Ubuntu base system is then installed."
16549
#: serverguide/C/installation.xml:181(para)
16551
"A new user is setup, this user will have <emphasis>root</emphasis> access "
16552
"through the <application>sudo</application> utility."
16555
#: serverguide/C/installation.xml:187(para)
16557
"After the user is setup, you will be asked to encrypt your <filename "
16558
"role=\"directory\">home</filename> directory."
16561
#: serverguide/C/installation.xml:193(para)
16563
"The next step in the installation process is to decide how you want to "
16564
"update the system. There are three options:"
16567
#: serverguide/C/installation.xml:199(para)
16569
"<emphasis>No automatic updates</emphasis>: this requires an administrator to "
16570
"log into the machine and manually install updates."
16573
#: serverguide/C/installation.xml:205(para)
16575
"<emphasis>Install security updates Automatically</emphasis>: will install "
16576
"the <application>unattended-upgrades</application> package, which will "
16577
"install security updates without the intervention of an administrator. For "
16578
"more details see <xref linkend=\"automatic-updates\"/>."
16581
#: serverguide/C/installation.xml:212(para)
16583
"<emphasis>Manage the system with Landscape</emphasis>: Landscape is a paid "
16584
"service provided by Canonical to help manager your Ubuntu machines. See the "
16585
"<ulink url=\"http://www.canonical.com/projects/landscape\">Landscape</ulink> "
16586
"site for details."
16589
#: serverguide/C/installation.xml:221(para)
16591
"You now have the option to install, or not install, several package tasks. "
16592
"See <xref linkend=\"install-tasks\"/> for details. Also, there is an option "
16593
"to launch <application>aptitude</application> to choose specific packages to "
16594
"install. For more information see <xref linkend=\"aptitude\"/>."
16597
#: serverguide/C/installation.xml:229(para)
16598
msgid "Finally, the last step before rebooting is to set the clock to UTC."
16601
#: serverguide/C/installation.xml:235(para)
16603
"If at any point during installation you are not satisfied by the default "
16604
"setting, use the \"Go Back\" function at any prompt to be brought to a "
16605
"detailed installation menu that will allow you to modify the default "
16609
#: serverguide/C/installation.xml:240(para)
16611
"At some point during the installation process you may want to read the help "
16612
"screen provided by the installation system. To do this, press F1."
16615
#: serverguide/C/installation.xml:245(para)
16617
"Once again, for detailed instructions see the <ulink "
16618
"url=\"https://help.ubuntu.com/9.04/installation-guide/\"> Ubuntu "
16619
"Installation Guide</ulink>."
16622
#: serverguide/C/installation.xml:251(title)
16623
msgid "Package Tasks"
16626
#: serverguide/C/installation.xml:252(para)
16628
"During the Server Edition installation you have the option of installing "
16629
"additional packages from the CD. The packages are grouped by the type of "
16630
"service they provide."
16633
#: serverguide/C/installation.xml:258(para)
16634
msgid "DNS server: Selects the BIND DNS server and its documentation."
16637
#: serverguide/C/installation.xml:263(para)
16638
msgid "LAMP server: Selects a ready-made Linux/Apache/MySQL/PHP server."
16641
#: serverguide/C/installation.xml:268(para)
16643
"Mail server: This task selects a variety of package useful for a general "
16644
"purpose mail server system."
16647
#: serverguide/C/installation.xml:273(para)
16648
msgid "OpenSSH server: Selects packages needed for an OpenSSH server."
16651
#: serverguide/C/installation.xml:278(para)
16653
"PostgreSQL database: This task selects client and server packages for the "
16654
"PostgreSQL database."
16657
#: serverguide/C/installation.xml:283(para)
16658
msgid "Print server: This task sets up your system to be a print server."
16661
#: serverguide/C/installation.xml:288(para)
16663
"Samba File server: This task sets up your system to be a Samba file server, "
16664
"which is especially suitable in networks with both Windows and Linux systems."
16667
#: serverguide/C/installation.xml:294(para)
16669
"Tomcat server: Installs the Apache Tomcat and needed dependencies Java, gcj, "
16673
#: serverguide/C/installation.xml:299(para)
16675
"Virtual machine host: Includes packages needed to run KVM virtual machines."
16678
#: serverguide/C/installation.xml:304(para)
16680
"Installing the package groups is accomplished using the "
16681
"<application>tasksel</application> utility. One of the important difference "
16682
"between Ubuntu (or Debian) and other GNU/Linux distribution is that, when "
16683
"installed, a package is also configured to reasonable defaults, eventually "
16684
"prompting you for additional required information. Likewise, when installing "
16685
"a task, the packages are not only installed, but also configured to provided "
16686
"a fully integrated service."
16689
#: serverguide/C/installation.xml:311(para)
16691
"Once the installation process has finished you can view a list of available "
16692
"tasks by entering the following from a terminal prompt:"
16695
#: serverguide/C/installation.xml:316(command)
16696
msgid "tasksel --list-tasks"
16699
#: serverguide/C/installation.xml:319(para)
16701
"The output will list tasks from other Ubuntu based distributions such as "
16702
"Kubuntu and Edubuntu. Note that you can also invoke the "
16703
"<command>tasksel</command> command by itself, which will bring up a menu of "
16704
"the different tasks available."
16707
#: serverguide/C/installation.xml:325(para)
16709
"You can view a list of which packages are installed with each task using the "
16710
"<emphasis>--task-packages</emphasis> option. For example, to list the "
16711
"packages installed with the <emphasis>DNS Server</emphasis> task enter the "
16715
#: serverguide/C/installation.xml:330(command)
16716
msgid "tasksel --task-packages dns-server"
16719
#: serverguide/C/installation.xml:332(para)
16720
msgid "The output of the command should list:"
16723
#: serverguide/C/installation.xml:335(programlisting)
16731
#: serverguide/C/installation.xml:339(para)
16733
"Also, if you did not install one of the tasks during the installation "
16734
"process, but for example you decide to make your new LAMP server a DNS "
16735
"server as well. Simply insert the installation CD and from a terminal:"
16738
#: serverguide/C/installation.xml:344(command)
16739
msgid "sudo tasksel install dns-server"
16742
#: serverguide/C/installation.xml:349(title)
16746
#: serverguide/C/installation.xml:350(para)
16748
"There are several ways to upgrade from one Ubuntu release to another. This "
16749
"section gives an overview of the recommended upgrade method."
16752
#: serverguide/C/installation.xml:354(title) serverguide/C/installation.xml:369(command)
16753
msgid "do-release-upgrade"
16756
#: serverguide/C/installation.xml:355(para)
16758
"The recommended way to upgrade a Server Edition installation is to use the "
16759
"<application>do-release-upgrade</application> utility. Part of the "
16760
"<emphasis>update-manager-core</emphasis> package, it does not have any "
16761
"graphical dependencies and is installed by default."
16764
#: serverguide/C/installation.xml:360(para)
16766
"Debian based systems can also be upgraded by using <command>apt-get dist-"
16767
"upgrade</command>. However, using <application>do-release-"
16768
"upgrade</application> is recommended because it has the ability to handle "
16769
"system configuration changes sometimes needed between releases."
16772
#: serverguide/C/installation.xml:365(para)
16773
msgid "To upgrade to a newer release, from a terminal prompt enter:"
16776
#: serverguide/C/installation.xml:371(para)
16778
"It is also possible to use <application>do-release-upgrade</application> to "
16779
"upgrade to a development version of Ubuntu. To accomplish this use the "
16780
"<emphasis>-d</emphasis> switch:"
16783
#: serverguide/C/installation.xml:376(command)
16784
msgid "do-release-upgrade -d"
16787
#: serverguide/C/installation.xml:379(para)
16789
"Upgrading to a development release is <emphasis>not</emphasis> recommended "
16790
"for production environments."
16793
#: serverguide/C/installation.xml:386(title)
16794
msgid "Advanced Installation"
16797
#: serverguide/C/installation.xml:389(title)
16798
msgid "Software RAID"
16801
#: serverguide/C/installation.xml:391(para)
16803
"RAID is a method of configuring multiple hard drives to act as one, reducing "
16804
"the probability of catastrophic data loss in case of drive failure. RAID is "
16805
"implemented in either software (where the operating system knows about both "
16806
"drives and actively maintains both of them) or hardware (where a special "
16807
"controller makes the OS think there's only one drive and maintains the "
16808
"drives 'invisibly')."
16811
#: serverguide/C/installation.xml:398(para)
16813
"The RAID software included with current versions of Linux (and Ubuntu) is "
16814
"based on the <application>'mdadm'</application> driver and works very well, "
16815
"better even than many so-called 'hardware' RAID controllers. This section "
16816
"will guide you through installing Ubuntu Server Edition using two RAID1 "
16817
"partitions on two physical hard drives, one for <emphasis>/</emphasis> and "
16818
"another for <emphasis>swap</emphasis>."
16821
#: serverguide/C/installation.xml:408(para) serverguide/C/installation.xml:925(para)
16823
"Follow the installation steps until you get to the <emphasis>Partition "
16824
"disks</emphasis> step, then:"
16827
#: serverguide/C/installation.xml:415(para)
16828
msgid "Select <emphasis>Manual</emphasis> as the partition method."
16831
#: serverguide/C/installation.xml:422(para)
16833
"Select the first hard drive, and agree to <emphasis>\"Create a new empty "
16834
"partition table on this device?\"</emphasis>."
16837
#: serverguide/C/installation.xml:426(para)
16839
"Repeat this step for each drive you wish to be part of the RAID array."
16842
#: serverguide/C/installation.xml:433(para)
16844
"Select the <emphasis>\"FREE SPACE\"</emphasis> on the first drive then "
16845
"select <emphasis>\"Create a new partition\"</emphasis>."
16848
#: serverguide/C/installation.xml:440(para)
16850
"Next, select the <emphasis>Size</emphasis> of the partition. This partition "
16851
"will be the <emphasis>swap</emphasis> partition, and a general rule for swap "
16852
"size is twice that of RAM. Enter the partition size, then choose "
16853
"<emphasis>Primary</emphasis>, then <emphasis>Beginning</emphasis>."
16856
#: serverguide/C/installation.xml:449(para)
16858
"Select the <emphasis>\"Use as:\"</emphasis> line at the top. By default this "
16859
"is <emphasis role=\"italic\">\"Ext3 journaling file system\"</emphasis>, "
16860
"change that to <emphasis>\"physical volume for RAID\"</emphasis> then "
16861
"<emphasis>\"Done setting up partition\"</emphasis>."
16864
#: serverguide/C/installation.xml:458(para)
16866
"For the <emphasis>/</emphasis> partition once again select <emphasis>\"Free "
16867
"Space\"</emphasis> on the first drive then <emphasis>\"Create a new "
16868
"partition\"</emphasis>."
16871
#: serverguide/C/installation.xml:466(para)
16873
"Use the rest of the free space on the drive and choose "
16874
"<emphasis>Continue</emphasis>, then <emphasis>Primary</emphasis>."
16877
#: serverguide/C/installation.xml:473(para)
16879
"As with the swap partition, select the <emphasis>\"Use as:\"</emphasis> line "
16880
"at the top, changing it to <emphasis>\"physical volume for RAID\"</emphasis> "
16881
"then choose <emphasis>\"Done setting up partition\"</emphasis>."
16884
#: serverguide/C/installation.xml:481(para)
16885
msgid "Repeat steps three through eight for the other disk and partitions."
16888
#: serverguide/C/installation.xml:490(title)
16889
msgid "RAID Configuration"
16892
#: serverguide/C/installation.xml:492(para)
16893
msgid "With the partitions setup the arrays are ready to be configured:"
16896
#: serverguide/C/installation.xml:499(para)
16898
"Back in the main \"Partition Disks\" page, select <emphasis>\"Configure "
16899
"Software RAID\"</emphasis> at the top."
16902
#: serverguide/C/installation.xml:506(para)
16903
msgid "Select <emphasis>\"yes\"</emphasis> to write the changes to disk."
16906
#: serverguide/C/installation.xml:513(para)
16907
msgid "Choose <emphasis>\"Create MD drive\"</emphasis>."
16910
#: serverguide/C/installation.xml:520(para)
16912
"For this example, select <emphasis>\"RAID1\"</emphasis>, but if you are "
16913
"using a different setup choose the appropriate type (RAID0 RAID1 RAID5)."
16916
#: serverguide/C/installation.xml:526(para)
16918
"In order to use <emphasis>RAID5</emphasis> you need at least "
16919
"<emphasis>three</emphasis> drives. Using RAID0 or RAID1 only "
16920
"<emphasis>two</emphasis> drives are required."
16923
#: serverguide/C/installation.xml:535(para)
16925
"Enter the number of active devices <emphasis>\"2\"</emphasis>, or the amount "
16926
"of hard drives you have, for the array. Then select "
16927
"<emphasis>\"Continue\"</emphasis>."
16930
#: serverguide/C/installation.xml:543(para)
16932
"Next, enter the number of spare devices <emphasis>\"0\"</emphasis> by "
16933
"default, then choose <emphasis>\"Continue\"</emphasis>."
16936
#: serverguide/C/installation.xml:550(para)
16938
"Choose which partitions to use. Generally they will be sda1, sdb1, sdc1, "
16939
"etc. The numbers will usually match and the different letters correspond to "
16940
"different hard drives."
16943
#: serverguide/C/installation.xml:555(para)
16945
"For the <emphasis>swap</emphasis> partition choose <emphasis>sda1</emphasis> "
16946
"and <emphasis>sdb1</emphasis>. Select <emphasis>\"Continue\"</emphasis> to "
16947
"go to the next step."
16950
#: serverguide/C/installation.xml:563(para)
16952
"Repeat steps <emphasis>three</emphasis> through <emphasis>seven</emphasis> "
16953
"for the <emphasis>/</emphasis> partition choosing <emphasis>sda2</emphasis> "
16954
"and <emphasis>sdb2</emphasis>."
16957
#: serverguide/C/installation.xml:571(para)
16958
msgid "Once done select <emphasis>\"Finish\"</emphasis>."
16961
#: serverguide/C/installation.xml:581(title)
16965
#: serverguide/C/installation.xml:583(para)
16967
"There should now be a list of hard drives and RAID devices. The next step is "
16968
"to format and set the mount point for the RAID devices. Treat the RAID "
16969
"device as a local hard drive, format and mount accordingly."
16972
#: serverguide/C/installation.xml:591(para)
16973
msgid "Select the <emphasis>RAID1 device #0</emphasis> partition."
16976
#: serverguide/C/installation.xml:598(para)
16978
"Choose <emphasis>\"Use as:\"</emphasis>. Then select <emphasis>\"swap "
16979
"area\"</emphasis>, then <emphasis>\"Done setting up partition\"</emphasis>."
16982
#: serverguide/C/installation.xml:606(para)
16983
msgid "Next, select the <emphasis>RAID1 device #1</emphasis> partition."
16986
#: serverguide/C/installation.xml:613(para)
16988
"Choose <emphasis>\"Use as:\"</emphasis>. Then select <emphasis>\"Ext3 "
16989
"journaling file system\"</emphasis>."
16992
#: serverguide/C/installation.xml:620(para)
16994
"Then select the <emphasis>\"Mount point\"</emphasis> and choose "
16995
"<emphasis>\"/ - the root file system\"</emphasis>. Change any of the other "
16996
"options as appropriate, then select <emphasis>\"Done setting up "
16997
"partition\"</emphasis>."
17000
#: serverguide/C/installation.xml:628(para)
17002
"Finally, select <emphasis>\"Finish partitioning and write changes to "
17003
"disk\"</emphasis>."
17006
#: serverguide/C/installation.xml:635(para)
17008
"If you choose to place the root partition on a RAID array, the installer "
17009
"will then ask if you would like to boot in a <emphasis>degraded</emphasis> "
17010
"state. See <xref linkend=\"raid-degraded\"/> for further details."
17013
#: serverguide/C/installation.xml:640(para)
17014
msgid "The installation process will then continue normally."
17017
#: serverguide/C/installation.xml:646(title)
17018
msgid "Degraded RAID"
17021
#: serverguide/C/installation.xml:648(para)
17023
"At some point in the life of the computer a disk failure event may occur. "
17024
"When this happens, using Software RAID, the operating system will place the "
17025
"array into what is known as a <emphasis>degraded</emphasis> state."
17028
#: serverguide/C/installation.xml:653(para)
17030
"If the array has become degraded, due to the chance of data corruption, by "
17031
"default Ubuntu Server Edition will boot to <emphasis>initramfs</emphasis> "
17032
"after thirty seconds. Once the initramfs has booted there is a fifteen "
17033
"second prompt giving you the option to go ahead and boot the system, or "
17034
"attempt manual recover. Booting to the initramfs prompt may or may not be "
17035
"the desired behavior, especially if the machine is in a remote location. "
17036
"Booting to a degraded array can be configured several ways:"
17039
#: serverguide/C/installation.xml:664(para)
17041
"The <application>dpkg-reconfigure</application> utility can be used to "
17042
"configure the default behavior, and during the process you will be queried "
17043
"about additional settings related to the array. Such as monitoring, email "
17044
"alerts, etc. To reconfigure <application>mdadm</application> enter the "
17048
#: serverguide/C/installation.xml:671(command)
17049
msgid "sudo dpkg-reconfigure mdadm"
17052
#: serverguide/C/installation.xml:677(para)
17054
"The <command>dpkg-reconfigure mdadm</command> process will change the "
17055
"<filename>/etc/initramfs-tools/conf.d/mdadm</filename> configuration file. "
17056
"The file has the advantage of being able to pre-configure the system's "
17057
"behavior, and can also be manually edited:"
17060
#: serverguide/C/installation.xml:683(programlisting)
17064
"BOOT_DEGRADED=true\n"
17067
#: serverguide/C/installation.xml:688(para)
17068
msgid "The configuration file can be overridden by using a Kernel argument."
17071
#: serverguide/C/installation.xml:696(para)
17073
"Using a Kernel argument will allow the system to boot to a degraded array as "
17077
#: serverguide/C/installation.xml:702(para)
17079
"When the server is booting press <emphasis>ESC</emphasis> to open the "
17080
"<application>Grub</application> menu."
17083
#: serverguide/C/installation.xml:707(para)
17084
msgid "Press <emphasis>\"e\"</emphasis> to edit your Kernel command options."
17087
#: serverguide/C/installation.xml:712(para)
17089
"Press the <emphasis>DOWN</emphasis> arrow to highlight the kernel line."
17092
#: serverguide/C/installation.xml:717(para)
17094
"Press the <emphasis>\"e\"</emphasis> key again to edit the kernel line."
17097
#: serverguide/C/installation.xml:722(para)
17099
"Add <emphasis>\"bootdegraded=true\"</emphasis> (without the quotes) to the "
17103
#: serverguide/C/installation.xml:727(para)
17104
msgid "Press <emphasis>\"ENTER\"</emphasis>."
17107
#: serverguide/C/installation.xml:732(para)
17108
msgid "Finally, press <emphasis>\"b\"</emphasis> to boot the system."
17111
#: serverguide/C/installation.xml:741(para)
17113
"Once the system has booted you can either repair the array see <xref "
17114
"linkend=\"raid-maintenance\"/> for details, or copy important data to "
17115
"another machine due to major hardware failure."
17118
#: serverguide/C/installation.xml:748(title)
17119
msgid "RAID Maintenance"
17122
#: serverguide/C/installation.xml:750(para)
17124
"The <application>mdadm</application> utility can be used to view the status "
17125
"of an array, add disks to an array, remove disks, etc:"
17128
#: serverguide/C/installation.xml:757(para)
17129
msgid "To view the status of an array, from a terminal prompt enter:"
17132
#: serverguide/C/installation.xml:761(command)
17133
msgid "sudo mdadm -D /dev/md0"
17136
#: serverguide/C/installation.xml:764(para)
17138
"The <emphasis>-D</emphasis> tells <application>mdadm</application> to "
17139
"display <emphasis>detailed</emphasis> information about the "
17140
"<filename>/dev/md0</filename> device. Replace <filename>/dev/md0</filename> "
17141
"with the appropriate RAID device."
17144
#: serverguide/C/installation.xml:770(para)
17145
msgid "To view the status of a disk in an array:"
17148
#: serverguide/C/installation.xml:774(command)
17149
msgid "sudo mdadm -E /dev/sda1"
17152
#: serverguide/C/installation.xml:776(para)
17154
"The output if very similar to the <command>mdadm -D</command> command, "
17155
"adjust <filename>/dev/sda1</filename> for each disk."
17158
#: serverguide/C/installation.xml:781(para)
17159
msgid "If a disk fails and needs to be removed from an array enter:"
17162
#: serverguide/C/installation.xml:785(command)
17163
msgid "sudo mdadm --remove /dev/md0 /dev/sda1"
17166
#: serverguide/C/installation.xml:787(para)
17168
"Change <filename>/dev/md0</filename> and <filename>/dev/sda1</filename> to "
17169
"the appropriate RAID device and disk."
17172
#: serverguide/C/installation.xml:792(para)
17173
msgid "Similarly, to add a new disk:"
17176
#: serverguide/C/installation.xml:796(command)
17177
msgid "sudo mdadm --add /dev/md0 /dev/sda1"
17180
#: serverguide/C/installation.xml:801(para)
17182
"Sometimes a disk can change to a <emphasis>faulty</emphasis> state even "
17183
"though there is nothing physically wrong with the drive. It is usually "
17184
"worthwhile to remove the drive from the array then re-add it. This will "
17185
"cause the drive to re-sync with the array. If the drive will not sync with "
17186
"the array, it is a good indication of hardware failure."
17189
#: serverguide/C/installation.xml:807(para)
17191
"The <filename>/proc/mdstat</filename> file also contains useful information "
17192
"about the system's RAID devices:"
17195
#: serverguide/C/installation.xml:812(command)
17196
msgid "cat /proc/mdstat"
17199
#: serverguide/C/installation.xml:813(computeroutput)
17202
"Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] "
17204
"md0 : active raid1 sda1[0] sdb1[1]\n"
17205
" 10016384 blocks [2/2] [UU]\n"
17207
"unused devices: <none>"
17210
#: serverguide/C/installation.xml:820(para)
17212
"The following command is great for watching the status of a syncing drive:"
17215
#: serverguide/C/installation.xml:825(command)
17216
msgid "watch -n1 cat /proc/mdstat"
17219
#: serverguide/C/installation.xml:828(para)
17221
"Press <emphasis>Ctrl+c</emphasis> to stop the "
17222
"<application>watch</application> command."
17225
#: serverguide/C/installation.xml:832(para)
17227
"If you do need to replace a faulty drive, after the drive has been replaced "
17228
"and synced, <application>grub</application> will need to be installed. To "
17229
"install <application>grub</application> on the new drive, enter the "
17233
#: serverguide/C/installation.xml:838(command)
17234
msgid "sudo grub-install /dev/md0"
17237
#: serverguide/C/installation.xml:841(para)
17239
"Replace <filename>/dev/md0</filename> with the appropriate array device name."
17242
#: serverguide/C/installation.xml:849(para)
17244
"The topic of RAID arrays is a complex one due to the plethora of ways RAID "
17245
"can be configured. Please see the following links for more information:"
17248
#: serverguide/C/installation.xml:857(ulink)
17249
msgid "Software RAID HOWTO"
17252
#: serverguide/C/installation.xml:862(ulink)
17253
msgid "Managing RAID on Linux"
17256
#: serverguide/C/installation.xml:869(title)
17257
msgid "Logical Volume Manager (LVM)"
17260
#: serverguide/C/installation.xml:871(para)
17262
"Logical Volume Manger, or <emphasis>LVM</emphasis>, allows administrators to "
17263
"create <emphasis>logical</emphasis> volumes out of one or multiple physical "
17264
"hard disks. LVM volumes can be created on both software RAID partitions and "
17265
"standard partitions residing on a single disk. Volumes can also be extended, "
17266
"giving greater flexibility to systems as requirements change."
17269
#: serverguide/C/installation.xml:880(para)
17271
"A side effect of LVM's power and flexibility is a greater degree of "
17272
"complication. Before diving into the LVM installation process, it is best to "
17273
"get familiar with some terms."
17276
#: serverguide/C/installation.xml:887(para)
17278
"<emphasis>Volume Group (VG):</emphasis> contains one or several Logical "
17282
#: serverguide/C/installation.xml:892(para)
17284
"<emphasis>Logical Volume (LV):</emphasis> is similar to a partition in a non-"
17285
"LVM system. Multiple Physical Volumes (PV) can make up one LV, on top of "
17286
"which resides the actual EXT3, XFS, JFS, etc filesystem."
17289
#: serverguide/C/installation.xml:898(para)
17291
"<emphasis>Physical Volume (PV):</emphasis> physical hard disk or software "
17292
"RAID partition. The Volume Group can be extended by adding more PVs."
17295
#: serverguide/C/installation.xml:909(para)
17297
"As an example this section covers installing Ubuntu Server Edition with "
17298
"<filename role=\"directory\">/srv</filename> mounted on a LVM volume. During "
17299
"the initial install only one Physical Volume (PV) will be part of the Volume "
17300
"Group (VG). Another PV will be added after install to demonstrate how a VG "
17304
#: serverguide/C/installation.xml:915(para)
17306
"There are several installation options for LVM, <emphasis>\"Guided - use the "
17307
"entire disk and setup LVM\"</emphasis> which will also allow you to assign a "
17308
"portion of the available space to LVM, <emphasis>\"Guided - use entire and "
17309
"setup encrypted LVM\"</emphasis>, or <emphasis>Manually</emphasis> setup the "
17310
"partitions and configure LVM. At this time the only way to configure a "
17311
"system with both LVM and standard partitions, during installation, is to use "
17312
"the Manual approach."
17315
#: serverguide/C/installation.xml:932(para)
17317
"At the <emphasis>\"Partition Disks</emphasis> screen choose "
17318
"<emphasis>\"Manual\"</emphasis>."
17321
#: serverguide/C/installation.xml:939(para)
17323
"Select the hard disk and on the next screen choose \"yes\" to "
17324
"<emphasis>\"Create a new empty partition table on this device\"</emphasis>."
17327
#: serverguide/C/installation.xml:946(para)
17329
"Next, create standard <emphasis>/boot</emphasis>, <emphasis>swap</emphasis>, "
17330
"and <emphasis>/</emphasis> partitions with whichever filesystem you prefer."
17333
#: serverguide/C/installation.xml:954(para)
17335
"For the LVM <emphasis>/srv</emphasis>, create a new "
17336
"<emphasis>Logical</emphasis> partition. Then change <emphasis>\"Use "
17337
"as\"</emphasis> to <emphasis>\"physical volume for LVM\"</emphasis> then "
17338
"<emphasis>\"Done setting up the partition\"</emphasis>."
17341
#: serverguide/C/installation.xml:962(para)
17343
"Now select <emphasis>\"Configure the Logical Volume Manager\"</emphasis> at "
17344
"the top, and choose <emphasis>\"Yes\"</emphasis> to write the changes to "
17348
#: serverguide/C/installation.xml:970(para)
17350
"For the <emphasis>\"LVM configuration action\"</emphasis> on the next "
17351
"screen, choose <emphasis>\"Create volume group\"</emphasis>. Enter a name "
17352
"for the VG such as <emphasis>vg01</emphasis>, or something more descriptive. "
17353
"After entering a name, select the partition configured for LVM, and choose "
17354
"<emphasis>\"Continue\"</emphasis>."
17357
#: serverguide/C/installation.xml:979(para)
17359
"Back at the <emphasis>\"LVM configuration action\"</emphasis> screen, select "
17360
"<emphasis>\"Create logical volume\"</emphasis>. Select the newly created "
17361
"volume group, and enter a name for the new LV, for example "
17362
"<emphasis>srv</emphasis> since that is the intended mount point. Then choose "
17363
"a size, which may be the full partition because it can always be extended "
17364
"later. Choose <emphasis>\"Finish\"</emphasis> and you should be back at the "
17365
"main <emphasis>\"Partition Disks\"</emphasis> screen."
17368
#: serverguide/C/installation.xml:989(para)
17370
"Now add a filesystem to the new LVM. Select the partition under "
17371
"<emphasis>\"LVM VG vg01, LV srv\"</emphasis>, or whatever name you have "
17372
"chosen, the choose <emphasis>Use as</emphasis>. Setup a file system as "
17373
"normal selecting <emphasis>/srv</emphasis> as the mount point. Once done, "
17374
"select <emphasis>\"Done setting up the partition\"</emphasis>."
17377
#: serverguide/C/installation.xml:998(para)
17379
"Finally, select <emphasis>\"Finish partitioning and write changes to "
17380
"disk\"</emphasis>. Then confirm the changes and continue with the rest of "
17381
"the installation."
17384
#: serverguide/C/installation.xml:1006(para)
17385
msgid "There are some useful utilities to view information about LVM:"
17388
#: serverguide/C/installation.xml:1011(para)
17390
"<emphasis>vgdisplay:</emphasis> shows information about Volume Groups."
17393
#: serverguide/C/installation.xml:1012(para)
17395
"<emphasis>lvdisplay:</emphasis> has information about Logical Volumes."
17398
#: serverguide/C/installation.xml:1013(para)
17400
"<emphasis>pvdisplay:</emphasis> similarly displays information about "
17401
"Physical Volumes."
17404
#: serverguide/C/installation.xml:1018(title)
17405
msgid "Extending Volume Groups"
17408
#: serverguide/C/installation.xml:1020(para)
17410
"Continuing with <emphasis>srv</emphasis> as an LVM volume example, this "
17411
"section covers adding a second hard disk, creating a Physical Volume (PV), "
17412
"adding it to the volume group (VG), extending the logical volume <filename "
17413
"role=\"directory\">srv</filename> and finally extending the filesystem. This "
17414
"example assumes a second hard disk has been added to the system. This hard "
17415
"disk will be named <filename>/dev/sdb</filename> in our example. BEWARE: "
17416
"make sure you don't already have an existing <filename>/dev/sdb</filename> "
17417
"before issuing the commands below. You could lose some data if you issue "
17418
"those commands on a non-empty disk. In our example we will use the entire "
17419
"disk as a physical volume (you could choose to create partitions and use "
17420
"them as different physical volumes)"
17423
#: serverguide/C/installation.xml:1032(para)
17424
msgid "First, create the physical volume, in a terminal execute:"
17427
#: serverguide/C/installation.xml:1037(command)
17428
msgid "sudo pvcreate /dev/sdb"
17431
#: serverguide/C/installation.xml:1043(para)
17432
msgid "Now extend the Volume Group (VG):"
17435
#: serverguide/C/installation.xml:1048(command)
17436
msgid "sudo vgextend vg01 /dev/sdb"
17439
#: serverguide/C/installation.xml:1054(para)
17441
"Use <application>vgdisplay</application> to find out the free physical "
17442
"extents - Free PE / size (the size you can allocate). We will assume a free "
17443
"size of 511 PE (equivalent to 2GB with a PE size of 4MB) and we will use the "
17444
"whole free space available. Use your own PE and/or free space."
17447
#: serverguide/C/installation.xml:1060(para)
17449
"The Logical Volume (LV) can now be extended by different methods, we will "
17450
"only see how to use the PE to extend the LV:"
17453
#: serverguide/C/installation.xml:1065(command)
17454
msgid "sudo lvextend /dev/vg01/srv -l +511"
17457
#: serverguide/C/installation.xml:1068(para)
17459
"The <emphasis>-l</emphasis> option allows the LV to be extended using PE. "
17460
"The <emphasis>-L</emphasis> option allows the LV to be extended using Meg, "
17461
"Gig, Tera, etc bytes."
17464
#: serverguide/C/installation.xml:1076(para)
17466
"Even though you are supposed to be able to <emphasis>expand</emphasis> an "
17467
"ext3 or ext4 filesystem without unmounting it first, it may be a good "
17468
"pratice to unmount it anyway and check the filesystem, so that you don't "
17469
"mess up the day you want to reduce a logical volume (in that case unmounting "
17470
"first is compulsory)."
17473
#: serverguide/C/installation.xml:1082(para)
17475
"The following commands are for an <emphasis>EXT3</emphasis> or "
17476
"<emphasis>EXT4</emphasis> filesystem. If you are using another filesystem "
17477
"there may be other utilities available."
17480
#: serverguide/C/installation.xml:1089(command)
17481
msgid "sudo e2fsck -f /dev/vg01/srv"
17484
#: serverguide/C/installation.xml:1092(para)
17486
"The <emphasis>-f</emphasis> option of <application>e2fsck</application> "
17487
"forces checking even if the system seems clean."
17490
#: serverguide/C/installation.xml:1099(para)
17491
msgid "Finally, resize the filesystem:"
17494
#: serverguide/C/installation.xml:1104(command)
17495
msgid "sudo resize2fs /dev/vg01/srv"
17498
#: serverguide/C/installation.xml:1110(para)
17499
msgid "Now mount the partition and check its size."
17502
#: serverguide/C/installation.xml:1115(command)
17503
msgid "mount /dev/vg01/srv /srv && df -h /srv"
17506
#: serverguide/C/installation.xml:1127(para)
17508
"See the <ulink url=\"http://tldp.org/HOWTO/LVM-HOWTO/index.html\">LVM "
17509
"HOWTO</ulink> for more information."
17512
#: serverguide/C/installation.xml:1132(para)
17514
"Another good article is <ulink "
17515
"url=\"http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-"
17516
"space-with-lvm.html\">Managing Disk Space with LVM</ulink> on O'Reilly's "
17517
"linuxdevcenter.com site."
17520
#: serverguide/C/installation.xml:1139(para)
17522
"For more information on <application>fdisk</application> see the <ulink "
17523
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/fdisk.8.html\">fdisk"
17524
" man page</ulink>."
17527
#: serverguide/C/file-server.xml:13(title)
17528
msgid "File Servers"
17531
#: serverguide/C/file-server.xml:15(para)
17533
"If you have more than one computer on a single network. At some point you "
17534
"will probably need to share files between them. In this section we cover "
17535
"installing and configuring FTP, NFS, and CUPS."
17538
#: serverguide/C/file-server.xml:22(title)
17542
#: serverguide/C/file-server.xml:24(para)
17544
"File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading "
17545
"files between computers. FTP works on a client/server model. The server "
17546
"component is called an <emphasis>FTP daemon</emphasis>. It continuously "
17547
"listens for FTP requests from remote clients. When a request is received, it "
17548
"manages the login and sets up the connection. For the duration of the "
17549
"session it executes any of commands sent by the FTP client."
17552
#: serverguide/C/file-server.xml:33(para)
17553
msgid "Access to an FTP server can be managed in two ways:"
17556
#: serverguide/C/file-server.xml:37(para)
17560
#: serverguide/C/file-server.xml:40(para)
17561
msgid "Authenticated"
17564
#: serverguide/C/file-server.xml:43(para)
17566
"In the Anonymous mode, remote clients can access the FTP server by using the "
17567
"default user account called \"anonymous\" or \"ftp\" and sending an email "
17568
"address as the password. In the Authenticated mode a user must have an "
17569
"account and a password. User access to the FTP server directories and files "
17570
"is dependent on the permissions defined for the account used at login. As a "
17571
"general rule, the FTP daemon will hide the root directory of the FTP server "
17572
"and change it to the FTP Home directory. This hides the rest of the file "
17573
"system from remote sessions."
17576
#: serverguide/C/file-server.xml:55(title)
17577
msgid "vsftpd - FTP Server Installation"
17580
#: serverguide/C/file-server.xml:57(para)
17582
"vsftpd is an FTP daemon available in Ubuntu. It is easy to install, set up, "
17583
"and maintain. To install <application>vsftpd</application> you can run the "
17584
"following command:"
17587
#: serverguide/C/file-server.xml:65(command)
17588
msgid "sudo apt-get install vsftpd"
17591
#: serverguide/C/file-server.xml:71(title)
17592
msgid "Anonymous FTP Configuration"
17595
#: serverguide/C/file-server.xml:73(para)
17597
"By default <application>vsftpd</application> is configured to only allow "
17598
"anonymous download. During installation a <emphasis>ftp</emphasis> user is "
17599
"created with a home directory of <filename>/home/ftp</filename>. This is the "
17600
"default FTP directory."
17603
#: serverguide/C/file-server.xml:80(para)
17605
"If you wish to change this location, to <filename>/srv/ftp</filename> for "
17606
"example, simply create a directory in another location and change the "
17607
"<emphasis>ftp</emphasis> user's home directory:"
17610
#: serverguide/C/file-server.xml:87(command)
17611
msgid "sudo mkdir /srv/ftp"
17614
#: serverguide/C/file-server.xml:88(command)
17615
msgid "sudo usermod -d /srv/ftp ftp"
17618
#: serverguide/C/file-server.xml:91(para)
17619
msgid "After making the change restart <application>vsftpd</application>:"
17622
#: serverguide/C/file-server.xml:96(command) serverguide/C/file-server.xml:124(command) serverguide/C/file-server.xml:189(command) serverguide/C/file-server.xml:237(command)
17623
msgid "sudo /etc/init.d/vsftpd restart"
17626
#: serverguide/C/file-server.xml:99(para)
17628
"Finally, copy any files and directories you would like to make available "
17629
"through anonymous FTP to <filename>/srv/ftp</filename>."
17632
#: serverguide/C/file-server.xml:106(title)
17633
msgid "User Authenticated FTP Configuration"
17636
#: serverguide/C/file-server.xml:108(para)
17638
"To configure <application>vsftpd</application> to authenticate system users "
17639
"and allow them to upload files edit <filename>/etc/vsftpd.conf</filename>:"
17642
#: serverguide/C/file-server.xml:114(programlisting)
17646
"local_enable=YES\n"
17647
"write_enable=YES\n"
17650
#: serverguide/C/file-server.xml:119(para)
17651
msgid "Now restart <application>vsftpd</application>:"
17654
#: serverguide/C/file-server.xml:127(para)
17656
"Now when system users login to FTP they will start in their "
17657
"<emphasis>home</emphasis> directories where they can download, upload, "
17658
"create directories, etc."
17661
#: serverguide/C/file-server.xml:133(para)
17663
"Similarly, by default, the anonymous users are not allowed to upload files "
17664
"to FTP server. To change this setting, you should uncomment the following "
17665
"line, and restart <application>vsftpd</application>:"
17668
#: serverguide/C/file-server.xml:140(programlisting)
17672
"anon_upload_enable=YES\n"
17675
#: serverguide/C/file-server.xml:145(para)
17677
"Enabling anonymous FTP upload can be an extreme security risk. It is best to "
17678
"not enable anonymous upload on servers accessed directly from the Internet."
17681
#: serverguide/C/file-server.xml:151(para)
17683
"The configuration file consists of many configuration parameters. The "
17684
"information about each parameter is available in the configuration file. "
17685
"Alternatively, you can refer to the man page, <command>man 5 "
17686
"vsftpd.conf</command> for details of each parameter."
17689
#: serverguide/C/file-server.xml:162(title)
17690
msgid "Securing FTP"
17693
#: serverguide/C/file-server.xml:164(para)
17695
"There are options in <filename>/etc/vsftpd.conf</filename> to help make "
17696
"<application>vsftpd</application> more secure. For example users can be "
17697
"limited to their home directories by uncommenting:"
17700
#: serverguide/C/file-server.xml:170(programlisting)
17704
"chroot_local_user=YES\n"
17707
#: serverguide/C/file-server.xml:174(para)
17709
"You can also limit a specific list of users to just their home directories:"
17712
#: serverguide/C/file-server.xml:178(programlisting)
17716
"chroot_list_enable=YES\n"
17717
"chroot_list_file=/etc/vsftpd.chroot_list\n"
17720
#: serverguide/C/file-server.xml:183(para)
17722
"After uncommenting the above options, create a "
17723
"<filename>/etc/vsftpd.chroot_list</filename> containing a list of users one "
17724
"per line. Then restart <application>vsftpd</application>:"
17727
#: serverguide/C/file-server.xml:192(para)
17729
"Also, the <filename>/etc/ftpusers</filename> file is a list of users that "
17730
"are <emphasis>disallowed</emphasis> FTP access. The default list includes "
17731
"root, daemon, nobody, etc. To disable FTP access for additional users simply "
17732
"add them to the list."
17735
#: serverguide/C/file-server.xml:199(para)
17737
"FTP can also be encrypted using <emphasis>FTPS</emphasis>. Different from "
17738
"<emphasis>SFTP</emphasis>, <emphasis>FTPS</emphasis> is FTP over Secure "
17739
"Socket Layer (SSL). <emphasis>SFTP</emphasis> is a FTP like session over an "
17740
"encrypted <emphasis>SSH</emphasis> connection. A major difference is that "
17741
"users of SFTP need to have a <emphasis>shell</emphasis> account on the "
17742
"system, instead of a <emphasis>nologin</emphasis> shell. Providing all users "
17743
"with a shell may not be ideal for some environments, such as a shared web "
17747
#: serverguide/C/file-server.xml:208(para)
17749
"To configure <emphasis>FTPS</emphasis>, edit "
17750
"<filename>/etc/vsftpd.conf</filename> and at the bottom add:"
17753
#: serverguide/C/file-server.xml:212(programlisting)
17760
#: serverguide/C/file-server.xml:216(para)
17761
msgid "Also, notice the certificate and key related options:"
17764
#: serverguide/C/file-server.xml:220(programlisting)
17768
"rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem\n"
17769
"rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key\n"
17772
#: serverguide/C/file-server.xml:225(para)
17774
"By default these options are set the the certificate and key provided by the "
17775
"<application>ssl-cert</application> package. In a production environment "
17776
"these should be replaced with a certificate and key generated for the "
17777
"specific host. For more information on certificates see <xref "
17778
"linkend=\"certificates-and-security\"/>."
17781
#: serverguide/C/file-server.xml:231(para)
17783
"Now restart <application>vsftpd</application>, and non-anonymous users will "
17784
"be forced to use <emphasis>FTPS</emphasis>:"
17787
#: serverguide/C/file-server.xml:240(para)
17789
"To allow users with a shell of <filename>/usr/sbin/nologin</filename> access "
17790
"to FTP, but have no shell access, edit <filename>/etc/shells</filename> "
17791
"adding the <emphasis>nologin</emphasis> shell:"
17794
#: serverguide/C/file-server.xml:245(programlisting)
17798
"# /etc/shells: valid login shells\n"
17811
"/usr/bin/screen\n"
17812
"/usr/sbin/nologin\n"
17815
#: serverguide/C/file-server.xml:263(para)
17817
"This is necessary because, by default <application>vsftpd</application> uses "
17818
"PAM for authentication, and the <filename>/etc/pam.d/vsftpd</filename> "
17819
"configuration file contains:"
17822
#: serverguide/C/file-server.xml:268(programlisting)
17826
"auth required pam_shells.so\n"
17829
#: serverguide/C/file-server.xml:272(para)
17831
"The <emphasis>shells</emphasis> PAM module restricts access to shells listed "
17832
"in the <filename>/etc/shells</filename> file."
17835
#: serverguide/C/file-server.xml:277(para)
17837
"Most popular FTP clients can be configured connect using FTPS. The "
17838
"<application>lftp</application> command line FTP client has the ability to "
17839
"use FTPS as well."
17842
#: serverguide/C/file-server.xml:288(para)
17844
"See the <ulink url=\"http://vsftpd.beasts.org/vsftpd_conf.html\">vsftpd "
17845
"website</ulink> for more information."
17848
#: serverguide/C/file-server.xml:293(para)
17850
"For detailed <filename>/etc/vsftpd.conf</filename> options see the <ulink "
17851
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/vsftpd.conf.5.html\""
17852
">vsftpd.conf man page</ulink>."
17855
#: serverguide/C/file-server.xml:299(para)
17857
"The CodeGurus article <ulink "
17858
"url=\"http://www.codeguru.com/csharp/.net/net_general/internet/article.php/c1"
17859
"4329\"> FTPS vs. SFTP: What to Choose</ulink> has useful information "
17860
"contrasting FTPS and SFTP."
17863
#: serverguide/C/file-server.xml:310(title)
17864
msgid "Network File System (NFS)"
17867
#: serverguide/C/file-server.xml:311(para)
17869
"NFS allows a system to share directories and files with others over a "
17870
"network. By using NFS, users and programs can access files on remote systems "
17871
"almost as if they were local files."
17874
#: serverguide/C/file-server.xml:317(para)
17875
msgid "Some of the most notable benefits that NFS can provide are:"
17878
#: serverguide/C/file-server.xml:323(para)
17880
"Local workstations use less disk space because commonly used data can be "
17881
"stored on a single machine and still remain accessible to others over the "
17885
#: serverguide/C/file-server.xml:328(para)
17887
"There is no need for users to have separate home directories on every "
17888
"network machine. Home directories could be set up on the NFS server and made "
17889
"available throughout the network."
17892
#: serverguide/C/file-server.xml:334(para)
17894
"Storage devices such as floppy disks, CDROM drives, and USB Thumb drives can "
17895
"be used by other machines on the network. This may reduce the number of "
17896
"removable media drives throughout the network."
17899
#: serverguide/C/file-server.xml:344(para)
17901
"At a terminal prompt enter the following command to install the NFS Server:"
17904
#: serverguide/C/file-server.xml:350(command)
17905
msgid "sudo apt-get install nfs-kernel-server"
17908
#: serverguide/C/file-server.xml:356(para)
17910
"You can configure the directories to be exported by adding them to the "
17911
"<filename>/etc/exports</filename> file. For example:"
17914
#: serverguide/C/file-server.xml:361(screen)
17918
"/ubuntu *(ro,sync,no_root_squash)\n"
17919
"/home *(rw,sync,no_root_squash)\n"
17922
#: serverguide/C/file-server.xml:367(para)
17924
"You can replace * with one of the hostname formats. Make the hostname "
17925
"declaration as specific as possible so unwanted systems cannot access the "
17929
#: serverguide/C/file-server.xml:373(para)
17931
"To start the NFS server, you can run the following command at a terminal "
17935
#: serverguide/C/file-server.xml:378(command)
17936
msgid "sudo /etc/init.d/nfs-kernel-server start"
17939
#: serverguide/C/file-server.xml:383(title)
17940
msgid "NFS Client Configuration"
17943
#: serverguide/C/file-server.xml:384(para)
17945
"Use the <application>mount</application> command to mount a shared NFS "
17946
"directory from another machine, by typing a command line similar to the "
17947
"following at a terminal prompt:"
17950
#: serverguide/C/file-server.xml:390(command)
17951
msgid "sudo mount example.hostname.com:/ubuntu /local/ubuntu"
17954
#: serverguide/C/file-server.xml:394(para)
17956
"The mount point directory <filename>/local/ubuntu</filename> must exist. "
17957
"There should be no files or subdirectories in the "
17958
"<filename>/local/ubuntu</filename> directory."
17961
#: serverguide/C/file-server.xml:401(para)
17963
"An alternate way to mount an NFS share from another machine is to add a line "
17964
"to the <filename>/etc/fstab</filename> file. The line must state the "
17965
"hostname of the NFS server, the directory on the server being exported, and "
17966
"the directory on the local machine where the NFS share is to be mounted."
17969
#: serverguide/C/file-server.xml:409(para)
17971
"The general syntax for the line in <filename>/etc/fstab</filename> file is "
17975
#: serverguide/C/file-server.xml:415(programlisting)
17979
"example.hostname.com:/ubuntu /local/ubuntu nfs "
17980
"rsize=8192,wsize=8192,timeo=14,intr\n"
17983
#: serverguide/C/file-server.xml:419(para)
17985
"If you have trouble mounting an NFS share, make sure the <application>nfs-"
17986
"common</application> package is installed on your client. To install "
17987
"<application>nfs-common</application> enter the following command at the "
17988
"terminal prompt: <screen>\n"
17989
"<command>sudo apt-get install nfs-common</command>\n"
17993
#: serverguide/C/file-server.xml:432(ulink)
17994
msgid "Linux NFS faq"
17997
#: serverguide/C/file-server.xml:437(title)
17998
msgid "CUPS - Print Server"
18001
#: serverguide/C/file-server.xml:438(para)
18003
"The primary mechanism for Ubuntu printing and print services is the "
18004
"<emphasis role=\"bold\">Common UNIX Printing System</emphasis> (CUPS). This "
18005
"printing system is a freely available, portable printing layer which has "
18006
"become the new standard for printing in most Linux distributions."
18009
#: serverguide/C/file-server.xml:445(para)
18011
"CUPS manages print jobs and queues and provides network printing using the "
18012
"standard Internet Printing Protocol (IPP), while offering support for a very "
18013
"large range of printers, from dot-matrix to laser and many in between. CUPS "
18014
"also supports PostScript Printer Description (PPD) and auto-detection of "
18015
"network printers, and features a simple web-based configuration and "
18016
"administration tool."
18019
#: serverguide/C/file-server.xml:455(para)
18021
"To install CUPS on your Ubuntu computer, simply use "
18022
"<application>sudo</application> with the <application>apt-get</application> "
18023
"command and give the packages to install as the first parameter. A complete "
18024
"CUPS install has many package dependencies, but they may all be specified on "
18025
"the same command line. Enter the following at a terminal prompt to install "
18029
#: serverguide/C/file-server.xml:460(command)
18030
msgid "sudo apt-get install cupsys"
18033
#: serverguide/C/file-server.xml:463(para)
18035
"Upon authenticating with your user password, the packages should be "
18036
"downloaded and installed without error. Upon the conclusion of installation, "
18037
"the CUPS server will be started automatically."
18040
#: serverguide/C/file-server.xml:468(para)
18042
"For troubleshooting purposes, you can access CUPS server errors via the "
18043
"error log file at: <filename>/var/log/cups/error_log</filename>. If the "
18044
"error log does not show enough information to troubleshoot any problems you "
18045
"encounter, the verbosity of the CUPS log can be increased by changing the "
18046
"<emphasis role=\"bold\">LogLevel</emphasis> directive in the configuration "
18047
"file (discussed below) to \"debug\" or even \"debug2\", which logs "
18048
"everything, from the default of \"info\". If you make this change, remember "
18049
"to change it back once you've solved your problem, to prevent the log file "
18050
"from becoming overly large."
18053
#: serverguide/C/file-server.xml:481(para)
18055
"The Common UNIX Printing System server's behavior is configured through the "
18056
"directives contained in the file <filename>/etc/cups/cupsd.conf</filename>. "
18057
"The CUPS configuration file follows the same syntax as the primary "
18058
"configuration file for the Apache HTTP server, so users familiar with "
18059
"editing Apache's configuration file should feel at ease when editing the "
18060
"CUPS configuration file. Some examples of settings you may wish to change "
18061
"initially will be presented here."
18064
#: serverguide/C/file-server.xml:491(para)
18066
"Prior to editing the configuration file, you should make a copy of the "
18067
"original file and protect it from writing, so you will have the original "
18068
"settings as a reference, and to reuse as necessary."
18071
#: serverguide/C/file-server.xml:495(para)
18073
"Copy the <filename>/etc/cups/cupsd.conf</filename> file and protect it from "
18074
"writing with the following commands, issued at a terminal prompt:"
18077
#: serverguide/C/file-server.xml:501(command)
18078
msgid "sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original"
18081
#: serverguide/C/file-server.xml:502(command)
18082
msgid "sudo chmod a-w /etc/cups/cupsd.conf.original"
18085
#: serverguide/C/file-server.xml:507(para)
18087
"<emphasis role=\"bold\">ServerAdmin</emphasis>: To configure the email "
18088
"address of the designated administrator of the CUPS server, simply edit the "
18089
"<filename>/etc/cups/cupsd.conf</filename> configuration file with your "
18090
"preferred text editor, and modify the <emphasis "
18091
"role=\"italics\">ServerAdmin</emphasis> line accordingly. For example, if "
18092
"you are the Administrator for the CUPS server, and your e-mail address is "
18093
"'bjoy@somebigco.com', then you would modify the ServerAdmin line to appear "
18097
#: serverguide/C/file-server.xml:518(screen)
18101
"ServerAdmin bjoy@somebigco.com\n"
18104
#: serverguide/C/file-server.xml:524(para)
18106
"For more examples of configuration directives in the CUPS server "
18107
"configuration file, view the associated system manual page by entering the "
18108
"following command at a terminal prompt:"
18111
#: serverguide/C/file-server.xml:531(command)
18112
msgid "man cupsd.conf"
18115
#: serverguide/C/file-server.xml:535(para)
18117
"Whenever you make changes to the <filename>/etc/cups/cupsd.conf</filename> "
18118
"configuration file, you'll need to restart the CUPS server by typing the "
18119
"following command at a terminal prompt:"
18122
#: serverguide/C/file-server.xml:541(command)
18123
msgid "sudo /etc/init.d/cupsys restart"
18126
#: serverguide/C/file-server.xml:544(para)
18128
"Some other configuration for the CUPS server is done in the file "
18129
"<filename>/etc/cups/cups.d/ports.conf</filename>:"
18132
#: serverguide/C/file-server.xml:547(para)
18134
"<emphasis role=\"bold\">Listen</emphasis>: By default on Ubuntu, the CUPS "
18135
"server installation listens only on the loopback interface at IP address "
18136
"<emphasis>127.0.0.1</emphasis>. In order to instruct the CUPS server to "
18137
"listen on an actual network adapter's IP address, you must specify either a "
18138
"hostname, the IP address, or optionally, an IP address/port pairing via the "
18139
"addition of a Listen directive. For example, if your CUPS server resides on "
18140
"a local network at the IP address <emphasis "
18141
"role=\"italics\">192.168.10.250</emphasis> and you'd like to make it "
18142
"accessible to the other systems on this subnetwork, you would edit the "
18143
"<filename>/etc/cups/cupsd.conf</filename> and add a Listen directive, as "
18147
#: serverguide/C/file-server.xml:561(screen)
18151
"Listen 127.0.0.1:631 # existing loopback Listen\n"
18152
"Listen /var/run/cups/cups.sock # existing socket Listen\n"
18153
"Listen 192.168.10.250:631 # Listen on the LAN interface, Port 631 "
18157
#: serverguide/C/file-server.xml:567(para)
18159
"In the example above, you may comment out or remove the reference to the "
18160
"Loopback address (127.0.0.1) if you do not wish <application>cupsd "
18161
"</application> to listen on that interface, but would rather have it only "
18162
"listen on the Ethernet interfaces of the Local Area Network (LAN). To enable "
18163
"listening for all network interfaces for which a certain hostname is bound, "
18164
"including the Loopback, you could create a Listen entry for the hostname "
18165
"<emphasis>socrates</emphasis> as such:"
18168
#: serverguide/C/file-server.xml:577(screen)
18172
"Listen socrates:631 # Listen on all interfaces for the hostname 'socrates'\n"
18175
#: serverguide/C/file-server.xml:581(para)
18177
"or by omitting the Listen directive and using <emphasis>Port</emphasis> "
18181
#: serverguide/C/file-server.xml:583(screen)
18185
"Port 631 # Listen on port 631 on all interfaces\n"
18188
#: serverguide/C/file-server.xml:594(ulink)
18189
msgid "CUPS Website"
18192
#: serverguide/C/dns.xml:13(title)
18193
msgid "Domain Name Service (DNS)"
18196
#: serverguide/C/dns.xml:14(para)
18198
"Domain Name Service (DNS) is an Internet service that maps IP addresses and "
18199
"fully qualified domain names (FQDN) to one another. In this way, DNS "
18200
"alleviates the need to remember IP addresses. Computers that run DNS are "
18201
"called <emphasis>name servers</emphasis>. Ubuntu ships with "
18202
"<application>BIND</application> (Berkley Internet Naming Daemon), the most "
18203
"common program used for maintaining a name server on Linux."
18206
#: serverguide/C/dns.xml:24(para)
18208
"At a terminal prompt, enter the following command to install "
18209
"<application>dns</application>:"
18212
#: serverguide/C/dns.xml:28(command)
18213
msgid "sudo apt-get install bind9"
18216
#: serverguide/C/dns.xml:30(para)
18218
"A very useful package for testing and troubleshooting DNS issues is the "
18219
"dnsutils package. To install <application>dnsutils</application> enter the "
18223
#: serverguide/C/dns.xml:35(command)
18224
msgid "sudo apt-get install dnsutils"
18227
#: serverguide/C/dns.xml:40(para)
18229
"There a many ways to configure <application>BIND9</application>. Some of the "
18230
"most common configurations are a caching nameserver, primary master, and a "
18231
"as a secondary master."
18234
#: serverguide/C/dns.xml:46(para)
18236
"When configured as a caching nameserver BIND9 will find the answer to name "
18237
"queries and remember the answer when the domain is queried again."
18240
#: serverguide/C/dns.xml:52(para)
18242
"As a primary master server BIND9 reads the data for a zone from a file on "
18243
"it's host and is authoritative for that zone."
18246
#: serverguide/C/dns.xml:57(para)
18248
"In a secondary master configuration BIND9 gets the zone data from another "
18249
"nameserver authoritative for the zone."
18252
#: serverguide/C/dns.xml:65(para)
18254
"The DNS configuration files are stored in the <filename>/etc/bind</filename> "
18255
"directory. The primary configuration file is "
18256
"<filename>/etc/bind/named.conf</filename>."
18259
#: serverguide/C/dns.xml:72(para)
18261
"The <emphasis>include</emphasis> line specifies the filename which contains "
18262
"the DNS options. The <emphasis>directory</emphasis> line in the "
18263
"<filename>/etc/bind/named.conf.options</filename> file tells DNS where to "
18264
"look for files. All files BIND uses will be relative to this directory."
18267
#: serverguide/C/dns.xml:80(para)
18269
"The file named <filename>/etc/bind/db.root</filename> describes the root "
18270
"nameservers in the world. The servers change over time, so the "
18271
"<filename>/etc/bind/db.root</filename> file must be maintained now and then. "
18272
"This is usually done as updates to the <application>bind9</application> "
18273
"package. The <emphasis>zone</emphasis> section defines a master server, and "
18274
"it is stored in a file mentioned in the <emphasis>file</emphasis> option."
18277
#: serverguide/C/dns.xml:90(para)
18279
"It is possible to configure the same server to be a caching name server, "
18280
"primary master, and secondary master. A server can be the Start of Authority "
18281
"(SOA) for one zone, while providing secondary service for another zone. All "
18282
"the while providing caching services for hosts on the local LAN."
18285
#: serverguide/C/dns.xml:98(title)
18286
msgid "Caching Nameserver"
18289
#: serverguide/C/dns.xml:99(para)
18291
"The default configuration is setup to act as a caching server. All that is "
18292
"required is simply adding the IP Addresses of your ISP's DNS servers. Simply "
18293
"uncomment and edit the following in "
18294
"<filename>/etc/bind/named.conf.options</filename>:"
18297
#: serverguide/C/dns.xml:103(programlisting)
18307
#: serverguide/C/dns.xml:110(para)
18309
"Replace <emphasis>1.2.3.4</emphasis> and <emphasis>5.6.7.8</emphasis> with "
18310
"the IP Adresses of actual nameservers."
18313
#: serverguide/C/dns.xml:114(para)
18315
"Now restart the DNS server, to enable the new configuration. From a terminal "
18319
#: serverguide/C/dns.xml:118(command) serverguide/C/dns.xml:194(command) serverguide/C/dns.xml:253(command) serverguide/C/dns.xml:312(command) serverguide/C/dns.xml:561(command)
18320
msgid "sudo /etc/init.d/bind9 restart"
18323
#: serverguide/C/dns.xml:120(para)
18325
"See <xref linkend=\"dns-testing-dig\"/> for information on testing a caching "
18329
#: serverguide/C/dns.xml:125(title)
18330
msgid "Primary Master"
18333
#: serverguide/C/dns.xml:126(para)
18335
"In this section <application>BIND9</application> will be configured as the "
18336
"Primary Master for the domain <emphasis>example.com</emphasis>. Simply "
18337
"replace <emphasis role=\"italic\">example.com</emphasis> with your FQDN "
18338
"(Fully Qualified Domain Name)."
18341
#: serverguide/C/dns.xml:132(title)
18342
msgid "Forward Zone File"
18345
#: serverguide/C/dns.xml:133(para)
18347
"To add a DNS zone to BIND9, turning BIND9 into a Primary Master server, the "
18348
"first step is to edit <filename>/etc/bind/named.conf.local</filename>:"
18351
#: serverguide/C/dns.xml:137(programlisting)
18355
"zone \"example.com\" {\n"
18357
" file \"/etc/bind/db.example.com\";\n"
18361
#: serverguide/C/dns.xml:143(para)
18363
"Now use an existing zone file as a template to create the "
18364
"<filename>/etc/bind/db.example.com</filename> file:"
18367
#: serverguide/C/dns.xml:147(command)
18368
msgid "sudo cp /etc/bind/db.local /etc/bind/db.example.com"
18371
#: serverguide/C/dns.xml:149(para)
18373
"Edit the new zone file <filename>/etc/bind/db.example.com</filename> change "
18374
"<emphasis>localhost.</emphasis> to the FQDN of your server, leaving the "
18375
"additional \".\" at the end. Change <emphasis>127.0.0.1</emphasis> to the "
18376
"nameserver's IP Address and <emphasis>root.localhost</emphasis> to a valid "
18377
"email address, but with a \".\" instead of the usual \"@\" symbol, again "
18378
"leaving the \".\" at the end."
18381
#: serverguide/C/dns.xml:155(para)
18383
"Also, create an <emphasis>A record</emphasis> for <emphasis "
18384
"role=\"italic\">ns.example.com</emphasis>. The name server in this example:"
18387
#: serverguide/C/dns.xml:159(programlisting)
18392
"; BIND data file for local loopback interface\n"
18395
"@ IN SOA ns.example.com. root.example.com. (\n"
18397
" 604800 ; Refresh\n"
18399
" 2419200 ; Expire\n"
18400
" 604800 ) ; Negative Cache TTL\n"
18402
"@ IN NS ns.example.com.\n"
18403
"@ IN A 127.0.0.1\n"
18405
"ns IN A 192.168.1.10\n"
18408
#: serverguide/C/dns.xml:176(para)
18410
"You must increment the <emphasis>Serial Number</emphasis> every time you "
18411
"make changes to the zone file. If you make multiple changes before "
18412
"restarting BIND9, simply increment the Serial once."
18415
#: serverguide/C/dns.xml:180(para)
18417
"Now, you can add DNS records to the bottom of the zone file. See <xref "
18418
"linkend=\"dns-record-types\"/> for details."
18421
#: serverguide/C/dns.xml:184(para)
18423
"Many admins like to use the last date edited as the serial of a zone, such "
18424
"as <emphasis>2007010100</emphasis> which is yyyymmddss (where "
18425
"<emphasis>ss</emphasis> is the Serial Number)"
18428
#: serverguide/C/dns.xml:189(para)
18430
"Once you have made a change to the zone file "
18431
"<application>BIND9</application> will need to be restarted for the changes "
18435
#: serverguide/C/dns.xml:198(title)
18436
msgid "Reverse Zone File"
18439
#: serverguide/C/dns.xml:199(para)
18441
"Now that the zone is setup and resolving names to IP Adresses a "
18442
"<emphasis>Reverse zone</emphasis> is also required. A Reverse zone allows "
18443
"DNS to resolve an address to a name."
18446
#: serverguide/C/dns.xml:203(para)
18447
msgid "Edit /etc/bind/named.conf.local and add the following:"
18450
#: serverguide/C/dns.xml:206(programlisting)
18454
"zone \"1.168.192.in-addr.arpa\" {\n"
18457
" file \"/etc/bind/db.192\";\n"
18461
#: serverguide/C/dns.xml:214(para)
18463
"Replace <emphasis>1.168.192</emphasis> with the first three octets of "
18464
"whatever network you are using. Also, name the zone file "
18465
"<filename>/etc/bind/db.192</filename> appropriately. It should match the "
18466
"first octet of your network."
18469
#: serverguide/C/dns.xml:219(para)
18470
msgid "Now create the <filename>/etc/bind/db.192</filename> file:"
18473
#: serverguide/C/dns.xml:223(command)
18474
msgid "sudo cp /etc/bind/db.127 /etc/bind/db.192"
18477
#: serverguide/C/dns.xml:225(para)
18479
"Next edit <filename>/etc/bind/db.192</filename> changing the basically the "
18480
"same options as <filename>/etc/bind/db.example.com</filename>:"
18483
#: serverguide/C/dns.xml:229(programlisting)
18488
"; BIND reverse data file for local loopback interface\n"
18491
"@ IN SOA ns.example.com. root.example.com. (\n"
18493
" 604800 ; Refresh\n"
18495
" 2419200 ; Expire\n"
18496
" 604800 ) ; Negative Cache TTL\n"
18499
"10 IN PTR ns.example.com.\n"
18502
#: serverguide/C/dns.xml:244(para)
18504
"The <emphasis>Serial Number</emphasis> in the Reverse zone needs to be "
18505
"incremented on each changes as well. For each <emphasis>A record</emphasis> "
18506
"you configure in <filename>/etc/bind/db.example.com</filename> you need to "
18507
"create a <emphasis>PTR record</emphasis> in "
18508
"<filename>/etc/bind/db.192</filename>."
18511
#: serverguide/C/dns.xml:249(para)
18513
"After creating the reverse zone file restart "
18514
"<application>BIND9</application>:"
18517
#: serverguide/C/dns.xml:258(title)
18518
msgid "Secondary Master"
18521
#: serverguide/C/dns.xml:259(para)
18523
"Once a <emphasis>Primary Master</emphasis> has been configured a "
18524
"<emphasis>Secondary Master</emphasis> is needed in order to maintain the "
18525
"availability of the domain should the Primary become unavailable."
18528
#: serverguide/C/dns.xml:263(para)
18530
"First, on the Primary Master server, the zone transfer needs to be allowed. "
18531
"Add the <emphasis>allow-transfer</emphasis> option to the example Forward "
18532
"and Reverse zone definitions in "
18533
"<filename>/etc/bind/named.conf.local</filename>:"
18536
#: serverguide/C/dns.xml:267(programlisting)
18540
"zone \"example.com\" {\n"
18542
"\tfile \"/etc/bind/db.example.com\";\n"
18543
" allow-transfer { 192.168.1.11; };\n"
18546
"zone \"1.168.192.in-addr.arpa\" {\n"
18549
" file \"/etc/bind/db.192\";\n"
18550
"\tallow-transfer { 192.168.1.11; };\n"
18554
#: serverguide/C/dns.xml:282(para)
18556
"Replace <emphasis>192.168.1.11</emphasis> with the IP Address of your "
18557
"Secondary nameserver."
18560
#: serverguide/C/dns.xml:286(para)
18562
"Next, on the Secondary Master, install the <application>bind9</application> "
18563
"package the same way as on the Primary. Then edit the "
18564
"<filename>/etc/bind/named.conf.local</filename> and add the following "
18565
"declarations for the Forward and Reverse zones:"
18568
#: serverguide/C/dns.xml:290(programlisting)
18572
"zone \"example.com\" {\n"
18574
" file \"/var/cache/bind/db.example.com\";\n"
18575
" masters { 192.168.1.10; };\n"
18578
"zone \"1.168.192.in-addr.arpa\" {\n"
18580
" file \"/var/cache/bind/db.192\";\n"
18581
" masters { 192.168.1.10; };\n"
18585
#: serverguide/C/dns.xml:304(para)
18587
"Replace <emphasis>192.168.1.10</emphasis> with the IP Address of your "
18588
"Primary nameserver."
18591
#: serverguide/C/dns.xml:308(para)
18592
msgid "Restart <application>BIND9</application> on the Secondary Master:"
18595
#: serverguide/C/dns.xml:314(para)
18597
"In <filename>/var/log/syslog</filename> you should see something similar to:"
18600
#: serverguide/C/dns.xml:317(programlisting)
18604
"slave zone \"example.com\" (IN) loaded (serial 6)\n"
18605
"slave zone \"100.18.172.in-addr.arpa\" (IN) loaded (serial 3)\n"
18608
#: serverguide/C/dns.xml:322(para)
18610
"Note: A zone is only transferred if the <emphasis>Serial Number</emphasis> "
18611
"on the Primary is larger than the one on the Secondary."
18614
#: serverguide/C/dns.xml:328(para)
18616
"The default directory for non-authoritative zone files is "
18617
"<filename>/var/cache/bind/</filename>. This directory is also configured in "
18618
"<application>AppArmor</application> to allow the "
18619
"<application>named</application> daemon to write to. For more information on "
18620
"AppArmor see <xref linkend=\"apparmor\"/>."
18623
#: serverguide/C/dns.xml:339(para)
18625
"This section covers ways to help determine the cause when problems happen "
18626
"with DNS and <application>BIND9</application>."
18629
#: serverguide/C/dns.xml:345(title)
18630
msgid "resolv.conf"
18633
#: serverguide/C/dns.xml:346(para)
18635
"The first step in testing <application>BIND9</application> is to add the "
18636
"nameserver's IP Address to a hosts resolver. The Primary nameserver should "
18637
"be configured as well as another host to double check things. Simply edit "
18638
"<filename>/etc/resolv.conf</filename> and add the following:"
18641
#: serverguide/C/dns.xml:351(programlisting)
18645
"nameserver\t192.168.1.10\n"
18646
"nameserver\t192.168.1.11\n"
18649
#: serverguide/C/dns.xml:356(para)
18651
"You should also add the IP Address of the Secondary nameserver in case the "
18652
"Primary becomes unavailable."
18655
#: serverguide/C/dns.xml:362(title)
18659
#: serverguide/C/dns.xml:363(para)
18661
"If you installed the <application>dnsutils</application> package you can "
18662
"test your setup using the DNS lookup utility <application>dig</application>:"
18665
#: serverguide/C/dns.xml:369(para)
18667
"After installing <application>BIND9</application> use "
18668
"<application>dig</application> against the loopback interface to make sure "
18669
"it is listening on port 53. From a terminal prompt:"
18672
#: serverguide/C/dns.xml:374(command)
18673
msgid "dig -x 127.0.0.1"
18676
#: serverguide/C/dns.xml:376(para)
18677
msgid "You should see lines similar to the following in the command output:"
18680
#: serverguide/C/dns.xml:379(programlisting)
18684
";; Query time: 1 msec\n"
18685
";; SERVER: 192.168.1.10#53(192.168.1.10)\n"
18688
#: serverguide/C/dns.xml:385(para)
18690
"If you have configured <application>BIND9</application> as a "
18691
"<emphasis>Caching</emphasis> nameserver \"dig\" an outside domain to check "
18695
#: serverguide/C/dns.xml:390(command)
18696
msgid "dig ubuntu.com"
18699
#: serverguide/C/dns.xml:392(para)
18700
msgid "Note the query time toward the end of the command output:"
18703
#: serverguide/C/dns.xml:395(programlisting)
18707
";; Query time: 49 msec\n"
18710
#: serverguide/C/dns.xml:398(para)
18711
msgid "After a second dig there should be improvement:"
18714
#: serverguide/C/dns.xml:401(programlisting)
18718
";; Query time: 1 msec\n"
18721
#: serverguide/C/dns.xml:408(title)
18725
#: serverguide/C/dns.xml:410(para)
18727
"Now to demonstrate how applications make use of DNS to resolve a host name "
18728
"use the <application>ping</application> utility to send an ICMP echo "
18729
"request. From a terminal prompt enter:"
18732
#: serverguide/C/dns.xml:416(command)
18733
msgid "ping example.com"
18736
#: serverguide/C/dns.xml:418(para)
18738
"This tests if the nameserver can resolve the name "
18739
"<emphasis>ns.example.com</emphasis> to an IP Address. The command output "
18743
#: serverguide/C/dns.xml:422(programlisting)
18747
"PING ns.example.com (192.168.1.10) 56(84) bytes of data.\n"
18748
"64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.800 ms\n"
18749
"64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.813 ms\n"
18752
#: serverguide/C/dns.xml:429(title)
18753
msgid "named-checkzone"
18756
#: serverguide/C/dns.xml:430(para)
18758
"A great way to test your zone files is by using the <application>named-"
18759
"checkzone</application> utility installed with the "
18760
"<application>bind9</application> package. This utility allows you to make "
18761
"sure the configuration is correct before restarting "
18762
"<application>BIND9</application> and making the changes live."
18765
#: serverguide/C/dns.xml:437(para)
18767
"To test our example Forward zone file enter the following from a command "
18771
#: serverguide/C/dns.xml:441(command)
18772
msgid "named-checkzone example.com /etc/bind/db.example.com"
18775
#: serverguide/C/dns.xml:443(para)
18777
"If everything is configured correctly you should see output similar to:"
18780
#: serverguide/C/dns.xml:446(programlisting)
18784
"zone example.com/IN: loaded serial 6\n"
18788
#: serverguide/C/dns.xml:452(para)
18789
msgid "Similarly, to test the Reverse zone file enter the following:"
18792
#: serverguide/C/dns.xml:456(command)
18793
msgid "named-checkzone example.com /etc/bind/db.192"
18796
#: serverguide/C/dns.xml:458(para)
18797
msgid "The output should be similar to:"
18800
#: serverguide/C/dns.xml:461(programlisting)
18804
"zone example.com/IN: loaded serial 3\n"
18808
#: serverguide/C/dns.xml:468(para)
18810
"The <emphasis>Serial Number</emphasis> of your zone file will probably be "
18814
#: serverguide/C/dns.xml:475(title)
18818
#: serverguide/C/dns.xml:476(para)
18820
"<application>BIND9</application> has a wide variety of logging configuration "
18821
"options available. There are two main options. The "
18822
"<emphasis>channel</emphasis> option configures where logs go, and the the "
18823
"<emphasis>category</emphasis> option determines what information to log."
18826
#: serverguide/C/dns.xml:480(para)
18827
msgid "If no logging option is configured the default option is:"
18830
#: serverguide/C/dns.xml:483(programlisting)
18835
" category default { default_syslog; default_debug; };\n"
18836
" category unmatched { null; };\n"
18840
#: serverguide/C/dns.xml:489(para)
18842
"This section covers configuring <application>BIND9</application> to send "
18843
"<emphasis>debug</emphasis> messages related to DNS queries to a separate "
18847
#: serverguide/C/dns.xml:494(para)
18849
"First, we need to configure a channel to specify which file to send the "
18850
"messages to. Edit <filename>/etc/bind/named.conf.local</filename> and add "
18854
#: serverguide/C/dns.xml:498(programlisting)
18859
" channel query.log { \n"
18860
" file \"/var/log/query.log\";\n"
18861
" severity debug 3; \n"
18866
#: serverguide/C/dns.xml:508(para)
18867
msgid "Next, configure a category to send all DNS queries to the query file:"
18870
#: serverguide/C/dns.xml:511(programlisting)
18875
" channel query.log { \n"
18876
" file \"/var/log/query.log\"; \n"
18877
" severity debug 3; \n"
18879
" <emphasis>category queries { query.log; };</emphasis> \n"
18883
#: serverguide/C/dns.xml:523(para)
18885
"Note: the <emphasis>debug</emphasis> option can be set from 1 to 3. If a "
18886
"level isn't specified level 1 is the default."
18889
#: serverguide/C/dns.xml:529(para)
18891
"Since the <emphasis>named daemon</emphasis> runs as the "
18892
"<emphasis>bind</emphasis> user the <filename>/var/log/query.log</filename> "
18893
"file must be created and the ownership changed:"
18896
#: serverguide/C/dns.xml:534(command)
18897
msgid "sudo touch /var/log/query.log"
18900
#: serverguide/C/dns.xml:535(command)
18901
msgid "sudo chown bind /var/log/query.log"
18904
#: serverguide/C/dns.xml:539(para)
18906
"Before <application>named</application> daemon can write to the new log file "
18907
"the <application>AppArmor</application> profile must be updated. First, edit "
18908
"<filename>/etc/apparmor.d/usr.sbin.named</filename> and add:"
18911
#: serverguide/C/dns.xml:543(programlisting)
18915
"/var/log/query.log w,\n"
18918
#: serverguide/C/dns.xml:546(para)
18919
msgid "Next, reload the profile:"
18922
#: serverguide/C/dns.xml:550(command)
18923
msgid "cat /etc/apparmor.d/usr.sbin.named | sudo apparmor_parser -r"
18926
#: serverguide/C/dns.xml:552(para)
18928
"For more information on <application>AppArmor</application> see <xref "
18929
"linkend=\"apparmor\"/>"
18932
#: serverguide/C/dns.xml:557(para)
18934
"Now restart <application>BIND9</application> for the changes to take effect:"
18937
#: serverguide/C/dns.xml:565(para)
18939
"You should see the file <filename>/var/log/query.log</filename> fill with "
18940
"query information. This is a simple example of the "
18941
"<application>BIND9</application> logging options. For coverage of advanced "
18942
"options see <xref linkend=\"dns-more-info\"/>."
18945
#: serverguide/C/dns.xml:574(title)
18946
msgid "Common Record Types"
18949
#: serverguide/C/dns.xml:575(para)
18950
msgid "This section covers some of the most common DNS record types."
18953
#: serverguide/C/dns.xml:580(para)
18955
"<emphasis>A</emphasis> record: This record maps an IP Address to a hostname."
18958
#: serverguide/C/dns.xml:583(programlisting)
18962
"www IN A 192.168.1.12\n"
18965
#: serverguide/C/dns.xml:588(para)
18967
"<emphasis>CNAME</emphasis> record: Used to create an alias to an existing A "
18968
"record. You cannot create a CNAME record pointing to another CNAME record."
18971
#: serverguide/C/dns.xml:591(programlisting)
18975
"web IN CNAME www\n"
18978
#: serverguide/C/dns.xml:596(para)
18980
"<emphasis>MX</emphasis> record: Used to define where email should be sent "
18981
"to. Must point to an A record, not a CNAME."
18984
#: serverguide/C/dns.xml:599(programlisting)
18988
" IN MX mail.example.com.\n"
18989
"mail IN A 192.168.1.13\n"
18992
#: serverguide/C/dns.xml:605(para)
18994
"<emphasis>NS</emphasis> record: Used to define which servers serve copies of "
18995
"a zone. It must point to an A record, not a CNAME. This is where Primary and "
18996
"Secondary servers are defined."
18999
#: serverguide/C/dns.xml:609(programlisting)
19003
" IN NS ns.example.com.\n"
19004
"\tIN NS ns2.example.com.\n"
19005
"ns IN A 192.168.1.10\n"
19006
"ns2\tIN A\t 192.168.1.11\n"
19009
#: serverguide/C/dns.xml:619(title)
19010
msgid "More Information"
19013
#: serverguide/C/dns.xml:620(para)
19015
"The <ulink url=\"http://www.tldp.org/HOWTO/DNS-HOWTO.html\">DNS "
19016
"HOWTO</ulink> explains more advanced options for configuring BIND9."
19019
#: serverguide/C/dns.xml:623(para)
19021
"For in depth coverage of <emphasis>DNS</emphasis> and "
19022
"<application>BIND9</application> see <ulink "
19023
"url=\"http://www.bind9.net/\">Bind9.net</ulink>."
19026
#: serverguide/C/dns.xml:626(para)
19028
"<ulink url=\"http://www.oreilly.com/catalog/dns5/index.html\">DNS and "
19029
"BIND</ulink> is a popular book now in it's fifth edition."
19032
#: serverguide/C/dns.xml:629(para)
19034
"A great place to ask for <application>BIND9</application> assistance, and "
19035
"get involved with the Ubuntu Server community, is the <emphasis>#ubuntu-"
19036
"server</emphasis> IRC channel on <ulink "
19037
"url=\"http://freenode.net\">freenode</ulink>."
19040
#: serverguide/C/databases.xml:13(title)
19044
#: serverguide/C/databases.xml:14(para)
19045
msgid "Ubuntu provides two popular database servers. They are:"
19048
#: serverguide/C/databases.xml:22(application) serverguide/C/databases.xml:152(title)
19052
#: serverguide/C/databases.xml:25(para)
19054
"They are available in the main repository. This section explains how to "
19055
"install and configure these database servers."
19058
#: serverguide/C/databases.xml:32(para)
19060
"MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. "
19061
"It is intended for mission-critical, heavy-load production systems as well "
19062
"as for embedding into mass-deployed software."
19065
#: serverguide/C/databases.xml:41(para)
19066
msgid "To install MySQL, run the following command from a terminal prompt:"
19069
#: serverguide/C/databases.xml:46(command)
19070
msgid "sudo apt-get install mysql-server"
19073
#: serverguide/C/databases.xml:48(para)
19075
"During the installation process you will be prompted to enter a password for "
19076
"the <application>MySQL</application> root user."
19079
#: serverguide/C/databases.xml:53(para)
19081
"Once the installation is complete, the MySQL server should be started "
19082
"automatically. You can run the following command from a terminal prompt to "
19083
"check whether the MySQL server is running:"
19086
#: serverguide/C/databases.xml:61(command)
19087
msgid "sudo netstat -tap | grep mysql"
19090
#: serverguide/C/databases.xml:70(programlisting)
19094
"tcp 0 0 localhost:mysql *:* LISTEN "
19098
#: serverguide/C/databases.xml:74(para)
19100
"If the server is not running correctly, you can type the following command "
19104
#: serverguide/C/databases.xml:79(command) serverguide/C/databases.xml:104(command)
19105
msgid "sudo /etc/init.d/mysql restart"
19108
#: serverguide/C/databases.xml:85(para)
19110
"You can edit the <filename>/etc/mysql/my.cnf</filename> file to configure "
19111
"the basic settings -- log file, port number, etc. For example, to configure "
19112
"<application>MySQL</application> to listen for connections from network "
19113
"hosts, change the <emphasis>bind_address</emphasis> directive to the "
19114
"server's IP address:"
19117
#: serverguide/C/databases.xml:91(programlisting)
19121
"bind-address = 192.168.0.5\n"
19124
#: serverguide/C/databases.xml:95(para)
19125
msgid "Replace 192.168.0.5 with the appropriate address."
19128
#: serverguide/C/databases.xml:99(para)
19130
"After making a change to <filename>/etc/mysql/my.cnf</filename> the "
19131
"<application>mysql</application> daemon will need to be restarted:"
19134
#: serverguide/C/databases.xml:107(para)
19136
"If you would like to change the "
19137
"<application>MySQL</application><emphasis>root</emphasis> password, in a "
19141
#: serverguide/C/databases.xml:113(command)
19142
msgid "sudo dpkg-reconfigure mysql-server-5.0"
19145
#: serverguide/C/databases.xml:116(para)
19147
"The <application>mysql</application> daemon will be stopped, and you will be "
19148
"prompted to enter a new password."
19151
#: serverguide/C/databases.xml:125(para)
19153
"See the <ulink url=\"http://www.mysql.com/\">MySQL Home Page</ulink> for "
19154
"more information."
19157
#: serverguide/C/databases.xml:130(para)
19159
"The <emphasis>MySQL Handbook</emphasis> is also available in the "
19160
"<application>mysql-doc-5.0</application> package. To install the package "
19161
"enter the following in a terminal:"
19164
#: serverguide/C/databases.xml:135(command)
19165
msgid "sudo apt-get install mysql-doc-5.0"
19168
#: serverguide/C/databases.xml:137(para)
19170
"The documentation is in HTML format, to view them enter "
19171
"<command>file:///usr/share/doc/mysql-doc-5.0/refman-5.0-en.html-"
19172
"chapter/index.html</command> in your browser's address bar."
19175
#: serverguide/C/databases.xml:143(para) serverguide/C/databases.xml:285(para)
19177
"For general SQL information see <ulink "
19178
"url=\"http://www.informit.com/store/product.aspx?isbn=0768664128\">Using SQL "
19179
"Special Edition</ulink> by Rafe Colburn."
19182
#: serverguide/C/databases.xml:153(para)
19184
"PostgreSQL is an object-relational database system that has the features of "
19185
"traditional commercial database systems with enhancements to be found in "
19186
"next-generation DBMS systems."
19189
#: serverguide/C/databases.xml:160(para)
19191
"To install PostgreSQL, run the following command in the command prompt:"
19194
#: serverguide/C/databases.xml:167(command)
19195
msgid "sudo apt-get install postgresql"
19198
#: serverguide/C/databases.xml:171(para)
19200
"Once the installation is complete, you should configure the PostgreSQL "
19201
"server based on your needs, although the default configuration is viable."
19204
#: serverguide/C/databases.xml:179(para)
19206
"By default, connection via TCP/IP is disabled. PostgreSQL supports multiple "
19207
"client authentication methods. By default, IDENT authentication method is "
19208
"used for <application>postgres</application> and local users. Please refer "
19209
"<ulink url=\"http://www.postgresql.org/docs/8.3/static/admin.html\"> the "
19210
"PostgreSQL Administrator's Guide</ulink>."
19213
#: serverguide/C/databases.xml:186(para)
19215
"The following discussion assumes that you wish to enable TCP/IP connections "
19216
"and use the MD5 method for client authentication. PostgreSQL configuration "
19217
"files are stored in the "
19218
"<filename>/etc/postgresql/<version>/main</filename> directory. For "
19219
"example, if you install PostgreSQL 8.3, the configuration files are stored "
19220
"in the <filename>/etc/postgresql/8.3/main</filename> directory."
19223
#: serverguide/C/databases.xml:196(para)
19225
"To configure <emphasis>ident</emphasis> authentication, add entries to the "
19226
"<filename>/etc/postgresql/8.3/main/pg_ident.conf</filename> file."
19229
#: serverguide/C/databases.xml:203(para)
19231
"To enable TCP/IP connections, edit the file "
19232
"<filename>/etc/postgresql/8.3/main/postgresql.conf</filename>"
19235
#: serverguide/C/databases.xml:205(para)
19237
"Locate the line <emphasis>#listen_addresses = 'localhost'</emphasis> and "
19241
#: serverguide/C/databases.xml:208(programlisting)
19245
"listen_addresses = 'localhost'\n"
19248
#: serverguide/C/databases.xml:212(para)
19250
"To allow other computers to connect to your "
19251
"<application>PostgreSQL</application> server replace 'localhost' with the "
19252
"<emphasis>IP Address</emphasis> of your server."
19255
#: serverguide/C/databases.xml:217(para)
19257
"You may also edit all other parameters, if you know what you are doing! For "
19258
"details, refer to the configuration file or to the PostgreSQL documentation."
19261
#: serverguide/C/databases.xml:222(para)
19263
"Now that we can connect to our <application>PostgreSQL</application> server, "
19264
"the next step is to set a password for the <emphasis>postgres</emphasis> "
19265
"user. Run the following command at a terminal prompt to connect to the "
19266
"default PostgreSQL template database:"
19269
#: serverguide/C/databases.xml:229(command)
19270
msgid "sudo -u postgres psql template1"
19273
#: serverguide/C/databases.xml:231(para)
19275
"The above command connects to PostgreSQL database "
19276
"<emphasis>template1</emphasis> as user <emphasis>postgres</emphasis>. Once "
19277
"you connect to the PostgreSQL server, you will be at a SQL prompt. You can "
19278
"run the following SQL command at the <application>psql</application> prompt "
19279
"to configure the password for the user <emphasis "
19280
"role=\"italics\">postgres</emphasis>."
19283
#: serverguide/C/databases.xml:239(command)
19284
msgid "ALTER USER postgres with encrypted password 'your_password';"
19287
#: serverguide/C/databases.xml:241(para)
19289
"After configuring the password, edit the file "
19290
"<filename>/etc/postgresql/8.3/main/pg_hba.conf</filename> to use "
19291
"<emphasis>MD5</emphasis> authentication with the "
19292
"<emphasis>postgres</emphasis> user:"
19295
#: serverguide/C/databases.xml:247(programlisting)
19299
"local all postgres md5 sameuser\n"
19302
#: serverguide/C/databases.xml:251(para)
19304
"Finally, you should restart the <application>PostgreSQL</application> "
19305
"service to initialize the new configuration. From a terminal prompt enter "
19306
"the following to restart <application>PostgreSQL</application>:"
19309
#: serverguide/C/databases.xml:257(command)
19310
msgid "sudo /etc/init.d/postgresql-8.3 restart"
19313
#: serverguide/C/databases.xml:260(para)
19315
"The above configuration is not complete by any means. Please refer <ulink "
19316
"url=\"http://www.postgresql.org/docs/8.3/static/admin.html\"> the PostgreSQL "
19317
"Administrator's Guide</ulink> to configure more parameters."
19320
#: serverguide/C/databases.xml:271(para)
19322
"As mentioned above the <ulink "
19323
"url=\"http://www.postgresql.org/docs/8.3/static/admin.html\">Administrator's "
19324
"Guide</ulink> is an excellent resource. The guide is also available in the "
19325
"<application>postgresql-doc-8.3</application> package. Execute the following "
19326
"in a terminal to install the package:"
19329
#: serverguide/C/databases.xml:277(command)
19330
msgid "sudo apt-get install postgresql-doc-8.3"
19333
#: serverguide/C/databases.xml:279(para)
19335
"To view the guide enter <command>file:///usr/share/doc/postgresql-doc-"
19336
"8.3/html/index.html</command> into the address bar of your browser."
19339
#: serverguide/C/clustering.xml:13(title)
19343
#: serverguide/C/clustering.xml:16(title)
19347
#: serverguide/C/clustering.xml:18(para)
19349
"Distributed Replicated Block Device (DRBD) mirrors block devices between "
19350
"multiple hosts. The replication is transparent to other applications on the "
19351
"host systems. Any block device hard disks, partitions, RAID devices, logical "
19352
"volumes, etc can be mirrored."
19355
#: serverguide/C/clustering.xml:24(para)
19357
"To get started using <application>drbd</application>, first install the "
19358
"necessary packages. From a terminal enter:"
19361
#: serverguide/C/clustering.xml:29(command)
19362
msgid "sudo apt-get install drbd8-utils"
19365
#: serverguide/C/clustering.xml:32(para)
19367
"This section covers setting up a <application>drbd</application> to "
19368
"replicate a separate <filename>/srv</filename> partition, with an "
19369
"<application>ext3</application> filesystem between two hosts. The partition "
19370
"size is not particularly relevant, but both partitions need to be the same "
19374
#: serverguide/C/clustering.xml:41(para)
19376
"The two hosts in this example will be called <emphasis>drbd01</emphasis> and "
19377
"<emphasis>drbd02</emphasis>. They will need to have name resolution "
19378
"configured either through DNS or the <filename>/etc/hosts</filename> file. "
19379
"See <xref linkend=\"dns\"/> for details."
19382
#: serverguide/C/clustering.xml:49(para)
19384
"To configure <application>drbd</application>, on the first host edit "
19385
"<filename>/etc/drbd.conf</filename>:"
19388
#: serverguide/C/clustering.xml:53(programlisting)
19392
"global { usage-count no; }\n"
19393
"common { syncer { rate 100M; } }\n"
19397
" wfc-timeout 15;\n"
19398
" degr-wfc-timeout 60;\n"
19401
" cram-hmac-alg sha1;\n"
19402
" shared-secret \"secret\";\n"
19403
" allow-two-primaries;\n"
19406
" device /dev/drbd0;\n"
19407
" disk /dev/sdb1;\n"
19408
" address 192.168.0.1:7788;\n"
19409
" meta-disk internal;\n"
19412
" device /dev/drbd0;\n"
19413
" disk /dev/sdb1;\n"
19414
" address 192.168.0.2:7788;\n"
19415
" meta-disk internal;\n"
19420
#: serverguide/C/clustering.xml:83(para)
19422
"There are many other options in <filename>/etc/drbd.conf</filename>, but for "
19423
"this example their default values are fine."
19426
#: serverguide/C/clustering.xml:91(para)
19427
msgid "Now copy <filename>/etc/drbd.conf</filename> to the second host:"
19430
#: serverguide/C/clustering.xml:96(command)
19431
msgid "scp /etc/drbd.conf drbd02:~"
19434
#: serverguide/C/clustering.xml:102(para)
19436
"And, on <emphasis>drbd02</emphasis> move the file to "
19437
"<filename>/etc</filename>:"
19440
#: serverguide/C/clustering.xml:107(command)
19441
msgid "sudo mv drbd.conf /etc/"
19444
#: serverguide/C/clustering.xml:113(para)
19446
"Next, on both hosts, start the <application>drbd</application> daemon:"
19449
#: serverguide/C/clustering.xml:118(command)
19450
msgid "sudo /etc/init.d/drbd start"
19453
#: serverguide/C/clustering.xml:124(para)
19455
"Now using the <application>drbdadm</application> utility initialize the meta "
19456
"data storage. On each server execute:"
19459
#: serverguide/C/clustering.xml:130(command)
19460
msgid "sudo drbdadm create-md r0"
19463
#: serverguide/C/clustering.xml:136(para)
19465
"On the <emphasis>drbd01</emphasis>, or whichever host you wish to be the "
19466
"primary, enter the following:"
19469
#: serverguide/C/clustering.xml:141(command)
19470
msgid "sudo drbdadm -- --overwrite-data-of-peer primary all"
19473
#: serverguide/C/clustering.xml:147(para)
19475
"After executing the above command, the data will start syncing with the "
19476
"secondary host. To watch the progresss, on <emphasis>drbd02</emphasis> enter "
19480
#: serverguide/C/clustering.xml:153(command)
19481
msgid "watch -n1 cat /proc/drbd"
19484
#: serverguide/C/clustering.xml:156(para)
19485
msgid "To stop watching the output press <emphasis>Ctrl+c</emphasis>."
19488
#: serverguide/C/clustering.xml:163(para)
19490
"Finally, add a filesystem to <filename>/dev/drbd0</filename> and mount it:"
19493
#: serverguide/C/clustering.xml:168(command)
19494
msgid "sudo mkfs.ext3 /dev/drbd0"
19497
#: serverguide/C/clustering.xml:169(command) serverguide/C/clustering.xml:217(command)
19498
msgid "sudo mount /dev/drbd0 /srv"
19501
#: serverguide/C/clustering.xml:179(para)
19503
"To test that the data is actually syncing between the hosts copy some files "
19504
"on the <emphasis>drbd01</emphasis>, the primary, to "
19505
"<filename>/srv</filename>:"
19508
#: serverguide/C/clustering.xml:188(para)
19509
msgid "Next, unmount <filename>/srv</filename>:"
19512
#: serverguide/C/clustering.xml:196(para)
19514
"<emphasis>Demote</emphasis> the <emphasis>primary</emphasis> server to the "
19515
"<emphasis>secondary</emphasis> role:"
19518
#: serverguide/C/clustering.xml:201(command)
19519
msgid "sudo drbdadm secondary r0"
19522
#: serverguide/C/clustering.xml:204(para)
19524
"Now on the the <emphasis>secondary</emphasis> server "
19525
"<emphasis>promote</emphasis> it to the <emphasis>primary</emphasis> role:"
19528
#: serverguide/C/clustering.xml:209(command)
19529
msgid "sudo drbdadm primary r0"
19532
#: serverguide/C/clustering.xml:212(para)
19533
msgid "Lastly, mount the partition:"
19536
#: serverguide/C/clustering.xml:220(para)
19538
"Using <emphasis>ls</emphasis> you should see "
19539
"<filename>/srv/default</filename> copied from the former "
19540
"<emphasis>primary</emphasis> host <emphasis>drbd01</emphasis>."
19543
#: serverguide/C/clustering.xml:231(para)
19545
"For more information on <application>DRBD</application> see the <ulink "
19546
"url=\"http://www.drbd.org/\">DRBD web site</ulink>."
19549
#: serverguide/C/clustering.xml:236(para)
19552
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man5/drbd.conf.5.html\">d"
19553
"rbd.conf man page</ulink> contains details on the options not covered in "
19557
#: serverguide/C/clustering.xml:242(para)
19559
"Also, see the <ulink "
19560
"url=\"http://manpages.ubuntu.com/manpages/jaunty/en/man8/drbdadm.8.html\">drb"
19561
"dadm man page</ulink>."
19564
#: serverguide/C/backups.xml:13(title)
19568
#: serverguide/C/backups.xml:14(para)
19570
"There are many ways to backup an Ubuntu installation. The most important "
19571
"thing about backups is to develop a <emphasis>backup plan</emphasis> "
19572
"consisting of what to backup, where to back it up to, and how to restore it."
19575
#: serverguide/C/backups.xml:18(para)
19577
"The following sections discuss various ways of accomplishing these tasks."
19580
#: serverguide/C/backups.xml:22(title)
19581
msgid "Shell Scripts"
19584
#: serverguide/C/backups.xml:23(para)
19586
"One of the simplest ways to backup a system is using a <emphasis>shell "
19587
"script</emphasis>. For example, a script can be used to configure which "
19588
"directories to backup, and use those directories as arguments to the "
19589
"<application>tar</application> utility creating an archive file. The archive "
19590
"file can then be moved or copied to another location. The archive can also "
19591
"be created on a remote file system such as an <emphasis>NFS</emphasis> mount."
19594
#: serverguide/C/backups.xml:29(para)
19596
"The <application>tar</application> utility creates one archive file out of "
19597
"many files or directories. <application>tar</application> can also filter "
19598
"the files through compression utilities reducing the size of the archive "
19602
#: serverguide/C/backups.xml:35(title)
19603
msgid "Simple Shell Script"
19606
#: serverguide/C/backups.xml:36(para)
19608
"The following shell script uses <application>tar</application> to create an "
19609
"archive file on a remotely mounted NFS file system. The archive filename is "
19610
"determined using additional command line utilities."
19613
#: serverguide/C/backups.xml:40(programlisting)
19618
"####################################\n"
19620
"# Backup to NFS mount script.\n"
19622
"####################################\n"
19624
"# What to backup. \n"
19625
"backup_files=\"/home /var/spool/mail /etc /root /boot /opt\"\n"
19627
"# Where to backup to.\n"
19628
"dest=\"/mnt/backup\"\n"
19630
"# Create archive filename.\n"
19631
"day=$(date +%A)\n"
19632
"hostname=$(hostname -s)\n"
19633
"archive_file=\"$hostname-$day.tgz\"\n"
19635
"# Print start status message.\n"
19636
"echo \"Backing up $backup_files to $dest/$archive_file\"\n"
19640
"# Backup the files using tar.\n"
19641
"tar czf $dest/$archive_file $backup_files\n"
19643
"# Print end status message.\n"
19645
"echo \"Backup finished\"\n"
19648
"# Long listing of files in $dest to check file sizes.\n"
19652
#: serverguide/C/backups.xml:77(para)
19654
"<emphasis>$backup_files:</emphasis> a variable listing which directories you "
19655
"would like to backup. The list should be customized to fit your needs."
19658
#: serverguide/C/backups.xml:83(para)
19660
"<emphasis>$day:</emphasis> a variable holding the day of the week (Monday, "
19661
"Tuesday, Wednesday, etc). This is used to create an archive file for each "
19662
"day of the week, giving a backup history of seven days. There are other ways "
19663
"to accomplish this including other ways using the "
19664
"<application>date</application> utility."
19667
#: serverguide/C/backups.xml:90(para)
19669
"<emphasis>$hostname:</emphasis> variable containing the "
19670
"<emphasis>short</emphasis> hostname of the system. Using the hostname in the "
19671
"archive filename gives you the option of placing daily archive files from "
19672
"multiple systems in the same directory."
19675
#: serverguide/C/backups.xml:97(para)
19676
msgid "<emphasis>$archive_file:</emphasis> the full archive filename."
19679
#: serverguide/C/backups.xml:102(para)
19681
"<emphasis>$dest:</emphasis> destination of the archive file. The directory "
19682
"needs to be created and in this case <emphasis>mounted</emphasis> before "
19683
"executing the backup script. See <xref linkend=\"network-file-system\"/> for "
19684
"details using <emphasis>NFS</emphasis>."
19687
#: serverguide/C/backups.xml:109(para)
19689
"<emphasis>status messages:</emphasis> optional messages printed to the "
19690
"console using the <application>echo</application> utility."
19693
#: serverguide/C/backups.xml:115(para)
19695
"<emphasis>tar czf $dest/$archive_file $backup_files:</emphasis> the "
19696
"<application>tar</application> command used to create the archive file."
19699
#: serverguide/C/backups.xml:121(para)
19700
msgid "<emphasis>c:</emphasis> creates an archive."
19703
#: serverguide/C/backups.xml:126(para)
19705
"<emphasis>z:</emphasis> filter the archive through the "
19706
"<application>gzip</application> utility compressing the archive."
19709
#: serverguide/C/backups.xml:131(para)
19711
"<emphasis>f:</emphasis> use archive file. Otherwise the "
19712
"<application>tar</application> output will be sent to STDOUT."
19715
#: serverguide/C/backups.xml:138(para)
19717
"<emphasis>ls -lh $dest:</emphasis> optional statement prints a <emphasis>-"
19718
"l</emphasis> long listing in <emphasis>-h</emphasis> human readable format "
19719
"of the destination directory. This is useful for a quick file size check of "
19720
"the archive file. This check should not replace testing the archive file."
19723
#: serverguide/C/backups.xml:145(para)
19725
"This is a simple example of a backup shell script. There are large amount of "
19726
"options that can be included in a backup script. See <xref linkend=\"backup-"
19727
"shellscript-references\"/> for links to resources providing more in depth "
19728
"shell scripting information."
19731
#: serverguide/C/backups.xml:152(title)
19732
msgid "Executing the Script"
19735
#: serverguide/C/backups.xml:154(title)
19736
msgid "Executing from a Terminal"
19739
#: serverguide/C/backups.xml:155(para)
19741
"The simplest way of executing the above backup script is to copy and paste "
19742
"the contents into a file. <filename>backup.sh</filename> for example. Then "
19743
"from a terminal prompt:"
19746
#: serverguide/C/backups.xml:160(command)
19747
msgid "sudo bash backup.sh"
19750
#: serverguide/C/backups.xml:162(para)
19752
"This is a great way to test the script to make sure everything works as "
19756
#: serverguide/C/backups.xml:167(title)
19757
msgid "Executing with cron"
19760
#: serverguide/C/backups.xml:168(para)
19762
"The <application>cron</application> utility can be used to automate the "
19763
"script execution. The <application>cron</application> daemon allows the "
19764
"execution of scripts, or commands, at a specified time and date."
19767
#: serverguide/C/backups.xml:172(para)
19769
"<application>cron</application> is configured through entries in a "
19770
"<filename>crontab</filename> file. <filename>crontab</filename> files are "
19771
"separated into fields:"
19774
#: serverguide/C/backups.xml:176(programlisting)
19778
"# m h dom mon dow command\n"
19781
#: serverguide/C/backups.xml:181(para)
19783
"<emphasis>m:</emphasis> minute the command executes on between 0 and 59."
19786
#: serverguide/C/backups.xml:186(para)
19788
"<emphasis>h:</emphasis> hour the command executes on between 0 and 23."
19791
#: serverguide/C/backups.xml:191(para)
19792
msgid "<emphasis>dom:</emphasis> day of month the command executes on."
19795
#: serverguide/C/backups.xml:196(para)
19797
"<emphasis>mon:</emphasis> the month the command executes on between 1 and 12."
19800
#: serverguide/C/backups.xml:201(para)
19802
"<emphasis>dow:</emphasis> the day of the week the command executes on "
19803
"between 0 and 7. Sunday may be specified by using 0 or 7, both values are "
19807
#: serverguide/C/backups.xml:206(para)
19808
msgid "<emphasis>command:</emphasis> the command to execute."
19811
#: serverguide/C/backups.xml:211(para)
19813
"To add or change entries in a <filename>crontab</filename> file the "
19814
"<application>crontab -e</application> command should be used. Also, the "
19815
"contents of a <filename>crontab</filename> file can be viewed using the "
19816
"<application>crontab -l</application> command."
19819
#: serverguide/C/backups.xml:215(para)
19821
"To execute the <application>backup.sh</application> script listed above "
19822
"using <application>cron</application>. Enter the following from a terminal "
19826
#: serverguide/C/backups.xml:220(command)
19827
msgid "sudo crontab -e"
19830
#: serverguide/C/backups.xml:223(para)
19832
"Using <application>sudo</application> with the <application>crontab -"
19833
"e</application> command edits the <emphasis>root</emphasis> user's crontab. "
19834
"This is necessary if you are backing up directories only the root user has "
19838
#: serverguide/C/backups.xml:228(para)
19839
msgid "Add the following entry to the <filename>crontab</filename> file:"
19842
#: serverguide/C/backups.xml:231(programlisting)
19846
"# m h dom mon dow command\n"
19847
"0 0 * * * bash /usr/local/bin/backup.sh\n"
19850
#: serverguide/C/backups.xml:235(para)
19852
"The <application>backup.sh</application> script will now be executed every "
19856
#: serverguide/C/backups.xml:239(para)
19858
"The <application>backup.sh</application> script will need to be copied to "
19859
"the <filename>/usr/local/bin/</filename> directory in order for this entry "
19860
"to execute properly. The script can reside anywhere on the file system "
19861
"simply change the script path appropriately."
19864
#: serverguide/C/backups.xml:244(para)
19866
"For more in depth <application>crontab</application> options see <xref "
19867
"linkend=\"backup-shellscript-references\"/>."
19870
#: serverguide/C/backups.xml:250(title)
19871
msgid "Restoring from the Archive"
19874
#: serverguide/C/backups.xml:251(para)
19876
"Once an archive has been created it is important to test the archive. The "
19877
"archive can be tested by listing the files it contains, but the best test is "
19878
"to <emphasis>restore</emphasis> a file from the archive."
19881
#: serverguide/C/backups.xml:257(para)
19882
msgid "To see a listing of the archive contents. From a terminal prompt:"
19885
#: serverguide/C/backups.xml:261(command)
19886
msgid "tar -tzvf /mnt/backup/host-Monday.tgz"
19889
#: serverguide/C/backups.xml:265(para)
19890
msgid "To restore a file from the archive to a different directory enter:"
19893
#: serverguide/C/backups.xml:269(command)
19894
msgid "tar -xzvf /mnt/backup/host-Monday.tgz -C /tmp etc/hosts"
19897
#: serverguide/C/backups.xml:271(para)
19899
"The <emphasis>-C</emphasis> option to <application>tar</application> "
19900
"redirects the extracted files to the specified directory. The above example "
19901
"will extract the <filename>/etc/hosts</filename> file to "
19902
"<filename>/tmp/etc/hosts</filename>. <application>tar</application> "
19903
"recreates the directory structure that it contains."
19906
#: serverguide/C/backups.xml:276(para)
19908
"Also, notice the leading <emphasis>\"/\"</emphasis> is left off the path of "
19909
"the file to restore."
19912
#: serverguide/C/backups.xml:281(para)
19913
msgid "To restore all files in the archive enter the following:"
19916
#: serverguide/C/backups.xml:285(command)
19920
#: serverguide/C/backups.xml:286(command)
19921
msgid "sudo tar -xzvf /mnt/backup/host-Monday.tgz"
19924
#: serverguide/C/backups.xml:291(para)
19925
msgid "This will overwrite the files currently on the file system."
19928
#: serverguide/C/backups.xml:300(para)
19930
"For more information on shell scripting see the <ulink "
19931
"url=\"http://tldp.org/LDP/abs/html/\">Advanced Bash-Scripting Guide</ulink>"
19934
#: serverguide/C/backups.xml:305(para)
19936
"The book <ulink url=\"http://safari.samspublishing.com/0672323583\">Teach "
19937
"Yourself Shell Programming in 24 Hours</ulink> is available online and a "
19938
"great resource for shell scripting."
19941
#: serverguide/C/backups.xml:311(para)
19943
"The <ulink url=\"https://help.ubuntu.com/community/CronHowto\">CronHowto "
19944
"Wiki Page</ulink> contains details on advanced "
19945
"<application>cron</application> options."
19948
#: serverguide/C/backups.xml:318(para)
19950
"See the <ulink url=\"http://www.gnu.org/software/tar/manual/index.html\">GNU "
19951
"tar Manual</ulink> for more <application>tar</application> options."
19954
#: serverguide/C/backups.xml:324(para)
19956
"The Wikipedia <ulink "
19957
"url=\"http://en.wikipedia.org/wiki/Backup_rotation_scheme\">Backup Rotation "
19958
"Scheme</ulink> article contains information on other backup rotation schemes."
19961
#: serverguide/C/backups.xml:330(para)
19963
"The shell script uses <application>tar</application> to create the archive, "
19964
"but there many other command line utilities that can be used. For example:"
19967
#: serverguide/C/backups.xml:336(para)
19969
"<ulink url=\"http://www.gnu.org/software/cpio/\">cpio</ulink>: used to copy "
19970
"files to and from archives."
19973
#: serverguide/C/backups.xml:341(para)
19975
"<ulink url=\"http://www.gnu.org/software/coreutils/\">dd</ulink>: part of "
19976
"the <application>coreutils</application> package. A low level utility that "
19977
"can copy data from one format to another"
19980
#: serverguide/C/backups.xml:347(para)
19982
"<ulink url=\"http://www.rsnapshot.org/\">rsnapshot</ulink>: a file system "
19983
"snap shot utility used to create copies of an entire file system."
19986
#: serverguide/C/backups.xml:358(title)
19987
msgid "Archive Rotation"
19990
#: serverguide/C/backups.xml:359(para)
19992
"The shell script in section <xref linkend=\"backup-shellscripts\"/> only "
19993
"allows for seven different archives. For a server whose data doesn't change "
19994
"often this may be enough. If the server has a large amount of data a more "
19995
"robust rotation scheme should be used."
19998
#: serverguide/C/backups.xml:365(title)
19999
msgid "Rotating NFS Archives"
20002
#: serverguide/C/backups.xml:366(para)
20004
"In this section the shell script will be slightly modified to implement a "
20005
"grandfather-father-son rotation scheme (monthly-weekly-daily):"
20008
#: serverguide/C/backups.xml:372(para)
20010
"The rotation will do a <emphasis>daily</emphasis> backup Sunday through "
20014
#: serverguide/C/backups.xml:377(para)
20016
"On Saturday a <emphasis>weekly</emphasis> backup is done giving you four "
20017
"weekly backups a month."
20020
#: serverguide/C/backups.xml:382(para)
20022
"The <emphasis>monthly</emphasis> backup is done on the first of the month "
20023
"rotating two monthly backups based on if the month is odd or even."
20026
#: serverguide/C/backups.xml:388(para)
20027
msgid "Here is the new script:"
20030
#: serverguide/C/backups.xml:391(programlisting)
20035
"####################################\n"
20037
"# Backup to NFS mount script with\n"
20038
"# grandfather-father-son rotation.\n"
20040
"####################################\n"
20042
"# What to backup. \n"
20043
"backup_files=\"/home /var/spool/mail /etc /root /boot /opt\"\n"
20045
"# Where to backup to.\n"
20046
"dest=\"/mnt/backup\"\n"
20048
"# Setup variables for the archive filename.\n"
20049
"day=$(date +%A)\n"
20050
"hostname=$(hostname -s)\n"
20052
"# Find which week of the month 1-4 it is.\n"
20053
"day_num=$(date +%d)\n"
20054
"if (( $day_num <= 7 )); then\n"
20055
" week_file=\"$hostname-week1.tgz\"\n"
20056
"elif (( $day_num > 7 && $day_num <= 14 )); then\n"
20057
" week_file=\"$hostname-week2.tgz\"\n"
20058
"elif (( $day_num > 14 && $day_num <= 21 )); then\n"
20059
" week_file=\"$hostname-week3.tgz\"\n"
20060
"elif (( $day_num > 21 && $day_num < 32 )); then\n"
20061
" week_file=\"$hostname-week4.tgz\"\n"
20064
"# Find if the Month is odd or even.\n"
20065
"month_num=$(date +%m)\n"
20066
"month=$(expr $month_num % 2)\n"
20067
"if [ $month -eq 0 ]; then\n"
20068
" month_file=\"$hostname-month2.tgz\"\n"
20070
" month_file=\"$hostname-month1.tgz\"\n"
20073
"# Create archive filename.\n"
20074
"if [ $day_num == 1 ]; then\n"
20075
"\tarchive_file=$month_file\n"
20076
"elif [ $day != \"Saturday\" ]; then\n"
20077
" archive_file=\"$hostname-$day.tgz\"\n"
20079
"\tarchive_file=$week_file\n"
20082
"# Print start status message.\n"
20083
"echo \"Backing up $backup_files to $dest/$archive_file\"\n"
20087
"# Backup the files using tar.\n"
20088
"tar czf $dest/$archive_file $backup_files\n"
20090
"# Print end status message.\n"
20092
"echo \"Backup finished\"\n"
20095
"# Long listing of files in $dest to check file sizes.\n"
20099
#: serverguide/C/backups.xml:456(para)
20101
"The script can be executed using the same methods as in <xref "
20102
"linkend=\"backup-executing-shellscript\"/>."
20105
#: serverguide/C/backups.xml:459(para)
20107
"It is good practice to take backup media off site in case of a disaster. In "
20108
"the shell script example the backup media is another server providing an NFS "
20109
"share. In all likelihood taking the NFS server to another location would not "
20110
"be practical. Depending upon connection speeds it may be an option to copy "
20111
"the archive file over a WAN link to a server in another location."
20114
#: serverguide/C/backups.xml:465(para)
20116
"Another option is to copy the archive file to an external hard drive which "
20117
"can then be taken off site. Since the price of external hard drives continue "
20118
"to decrease it may be cost affective to use two drives for each archive "
20119
"level. This would allow you to have one external drive attached to the "
20120
"backup server and one in another location."
20123
#: serverguide/C/backups.xml:472(title)
20124
msgid "Tape Drives"
20127
#: serverguide/C/backups.xml:473(para)
20129
"A tape drive attached to the server can be used instead of a NFS share. "
20130
"Using a tape drive simplifies archive rotation, and taking the media off "
20134
#: serverguide/C/backups.xml:477(para)
20136
"When using a tape drive the filename portions of the script aren't needed "
20137
"because the date is sent directly to the tape device. Some commands to "
20138
"manipulate the tape are needed. This is accomplished using "
20139
"<application>mt</application>, a magnetic tape control utility part of the "
20140
"<application>cpio</application> package."
20143
#: serverguide/C/backups.xml:482(para)
20144
msgid "Here is the shell script modified to use a tape drive:"
20147
#: serverguide/C/backups.xml:485(programlisting)
20152
"####################################\n"
20154
"# Backup to tape drive script.\n"
20156
"####################################\n"
20158
"# What to backup. \n"
20159
"backup_files=\"/home /var/spool/mail /etc /root /boot /opt\"\n"
20161
"# Where to backup to.\n"
20162
"dest=\"/dev/st0\"\n"
20164
"# Print start status message.\n"
20165
"echo \"Backing up $backup_files to $dest\"\n"
20169
"# Make sure the tape is rewound.\n"
20170
"mt -f $dest rewind\n"
20172
"# Backup the files using tar.\n"
20173
"tar czf $dest $backup_files\n"
20175
"# Rewind and eject the tape.\n"
20176
"mt -f $dest rewoffl\n"
20178
"# Print end status message.\n"
20180
"echo \"Backup finished\"\n"
20184
#: serverguide/C/backups.xml:519(para)
20186
"The default device name for a SCSI tape drive is "
20187
"<filename>/dev/st0</filename>. Use the appropriate device path for your "
20191
#: serverguide/C/backups.xml:524(para)
20193
"Restoring from a tape drive is basically the same as restoring from a file. "
20194
"Simply rewind the tape and use the device path instead of a file path. For "
20195
"example to restore the <filename>/etc/hosts</filename> file to "
20196
"<filename>/tmp/etc/hosts</filename>:"
20199
#: serverguide/C/backups.xml:529(command)
20200
msgid "mt -f /dev/st0 rewind"
20203
#: serverguide/C/backups.xml:530(command)
20204
msgid "tar -xzf /dev/st0 -C /tmp etc/hosts"
20207
#: serverguide/C/backups.xml:535(title)
20211
#: serverguide/C/backups.xml:536(para)
20213
"<application>Bacula</application> is a backup program enabling you to "
20214
"backup, restore, and verify data across your network. There are Bacula "
20215
"clients for Linux, Windows, and Mac OSX. Making it a cross platform network "
20219
#: serverguide/C/backups.xml:542(para)
20221
"<application>Bacula</application> is made up of several components and "
20222
"services used to manage which files to backup and where to back them up to:"
20225
#: serverguide/C/backups.xml:548(para)
20227
"<application>Bacula Director:</application> a service that controls all "
20228
"backup, restore, verify, and archive operations."
20231
#: serverguide/C/backups.xml:553(para)
20233
"<application>Bacula Console:</application> an application allowing "
20234
"communication with the Director. There are three versions of the Console:"
20237
#: serverguide/C/backups.xml:558(para)
20238
msgid "Text based command line version."
20241
#: serverguide/C/backups.xml:559(para)
20242
msgid "Gnome based GTK+ Graphical User Interface (GUI) interface."
20245
#: serverguide/C/backups.xml:560(para)
20246
msgid "wxWidgets GUI interface."
20249
#: serverguide/C/backups.xml:564(para)
20251
"<application>Bacula File:</application> also known as the "
20252
"<application>Bacula Client</application> program. This application is "
20253
"installed on machines to be backed up, and is responsible for the data "
20254
"requested by the Director."
20257
#: serverguide/C/backups.xml:570(para)
20259
"<application>Bacula Storage:</application> the programs that perform the "
20260
"storage and recovery of data to the physical media."
20263
#: serverguide/C/backups.xml:575(para)
20265
"<application>Bacula Catalog:</application> is responsible for maintaining "
20266
"the file indexes and volume databases for all files backed up, enabling "
20267
"quick location and restoration of archived files. The Catalog supports three "
20268
"different databases MySQL, PostgreSQL, and SQLite."
20271
#: serverguide/C/backups.xml:581(para)
20273
"<application>Bacula Monitor:</application> allows the monitoring of the "
20274
"Director, File daemons, and Storage daemons. Currently the Monitor is only "
20275
"available as a GTK+ GUI application."
20278
#: serverguide/C/backups.xml:587(para)
20280
"These services and applications can be run on multiple servers and clients, "
20281
"or they can be installed on one machine if backing up a single disk or "
20285
#: serverguide/C/backups.xml:594(para)
20287
"There are multiple packages containing the different "
20288
"<application>Bacula</application> components. To install Bacula, from a "
20289
"terminal prompt enter:"
20292
#: serverguide/C/backups.xml:599(command)
20293
msgid "sudo apt-get install bacula"
20296
#: serverguide/C/backups.xml:601(para)
20298
"By default installing the <application>bacula</application> package will use "
20299
"a <application>MySQL</application> database for the Catalog. If you want to "
20300
"use SQLite or PostgreSQL, for the Catalog, install <application>bacula-"
20301
"director-sqlite3</application> or <application>bacula-director-"
20302
"pgsql</application> respectively."
20305
#: serverguide/C/backups.xml:607(para)
20307
"During the install process you will be asked to supply credentials for the "
20308
"database <emphasis>administrator</emphasis> and the "
20309
"<emphasis>bacula</emphasis> database <emphasis>owner</emphasis>. The "
20310
"database administrator will need to have the appropriate rights to create a "
20311
"database, see <xref linkend=\"mysql\"/> for more information."
20314
#: serverguide/C/backups.xml:617(para)
20316
"<application>Bacula</application> configuration files are formatted based on "
20317
"<emphasis>resources</emphasis> comprising of <emphasis>directives</emphasis> "
20318
"surrounded by <quote>{}</quote> braces. Each Bacula component has an "
20319
"individual file in the <filename role=\"directory\">/etc/bacula</filename> "
20323
#: serverguide/C/backups.xml:622(para)
20325
"The various <application>Bacula</application> components must authorize "
20326
"themselves to each other. This is accomplished using the "
20327
"<emphasis>password</emphasis> directive. For example, the "
20328
"<emphasis>Storage</emphasis> resource password in the "
20329
"<filename>/etc/bacula/bacula-dir.conf</filename> file must match the "
20330
"<emphasis>Director</emphasis> resource password in "
20331
"<filename>/etc/bacula/bacula-sd.conf</filename>."
20334
#: serverguide/C/backups.xml:628(para)
20336
"By default the backup job named <emphasis>Client1</emphasis> is configured "
20337
"to archive the <application>Bacula</application> Catalog. If you plan on "
20338
"using the server to backup more than one client you should change the name "
20339
"of this job to something more descriptive. To change the name edit "
20340
"<filename>/etc/bacula/bacula-dir.conf</filename>:"
20343
#: serverguide/C/backups.xml:633(programlisting)
20348
"# Define the main nightly save backup job\n"
20349
"# By default, this job will back up to disk in \n"
20351
" Name = \"BackupServer\"\n"
20352
" JobDefs = \"DefaultJob\"\n"
20353
" Write Bootstrap = \"/var/lib/bacula/Client1.bsr\"\n"
20357
#: serverguide/C/backups.xml:644(para)
20359
"The example above changes the job name to <emphasis>BackupServer</emphasis> "
20360
"matching the machine's host name. Replace <quote>BackupServer</quote> with "
20361
"your appropriate hostname, or other descriptive name."
20364
#: serverguide/C/backups.xml:649(para)
20366
"The <emphasis>Console</emphasis> can be used to query the "
20367
"<emphasis>Director</emphasis> about jobs, but to use the Console with a "
20368
"<emphasis>non-root</emphasis> user, the user needs to be in the "
20369
"<emphasis>bacula</emphasis> group. To add a user to the bacula group enter "
20370
"the following from a terminal:"
20373
#: serverguide/C/backups.xml:655(command)
20374
msgid "sudo adduser $username bacula"
20377
#: serverguide/C/backups.xml:658(para)
20379
"Replace <emphasis>$username</emphasis> with the actual username. Also, if "
20380
"you are adding the current user to the group you should log out and back in "
20381
"for the new permissions to take effect."
20384
#: serverguide/C/backups.xml:665(title)
20385
msgid "Localhost Backup"
20388
#: serverguide/C/backups.xml:666(para)
20390
"This section describes how to backup specified directories on a single host "
20391
"to a local tape drive."
20394
#: serverguide/C/backups.xml:671(para)
20396
"First, the <emphasis>Storage</emphasis> device needs to be configured. Edit "
20397
"<filename>/etc/bacula/bacula-sd.conf</filename> add:"
20400
#: serverguide/C/backups.xml:674(programlisting)
20405
" Name = \"Tape Drive\"\n"
20406
" Device Type = tape\n"
20407
" Media Type = DDS-4\n"
20408
" Archive Device = /dev/st0\n"
20409
" Hardware end of medium = No;\n"
20410
" AutomaticMount = yes; # when device opened, read it\n"
20411
" AlwaysOpen = Yes;\n"
20412
" RemovableMedia = yes;\n"
20413
" RandomAccess = no;\n"
20414
" Alert Command = \"sh -c 'tapeinfo -f %c | grep TapeAlert'\"\n"
20418
#: serverguide/C/backups.xml:688(para)
20420
"The example is for a <emphasis>DDS-4</emphasis> tape drive. Adjust the Media "
20421
"Type and Archive Device to match your hardware."
20424
#: serverguide/C/backups.xml:691(para)
20425
msgid "You could also uncomment one of the other examples in the file."
20428
#: serverguide/C/backups.xml:696(para)
20430
"After editing <filename>/etc/bacula/bacula-sd.conf</filename> the "
20431
"<application>Storage</application> daemon will need to be restarted:"
20434
#: serverguide/C/backups.xml:701(command)
20435
msgid "sudo /etc/init.d/bacula-sd restart"
20438
#: serverguide/C/backups.xml:705(para)
20440
"Now add a <emphasis>Storage</emphasis> resource in "
20441
"<filename>/etc/bacula/bacula-dir.conf</filename> to use the new Device:"
20444
#: serverguide/C/backups.xml:708(programlisting)
20448
"# Definition of \"Tape Drive\" storage device\n"
20450
" Name = TapeDrive\n"
20451
" # Do not use \"localhost\" here \n"
20452
" Address = backupserver # N.B. Use a fully qualified name "
20455
" Password = \"Cv70F6pf1t6pBopT4vQOnigDrR0v3LT3Cgkiyj\"\n"
20456
" Device = \"Tape Drive\"\n"
20457
" Media Type = tape\n"
20461
#: serverguide/C/backups.xml:720(para)
20463
"The <emphasis>Address</emphasis> directive needs to be the Fully Qualified "
20464
"Domain Name (FQDN) of the server. Change <emphasis>backupserver</emphasis> "
20465
"to the actual host name."
20468
#: serverguide/C/backups.xml:724(para)
20470
"Also, make sure the <emphasis>Password</emphasis> directive matches the "
20471
"password string in <filename>/etc/bacula/bacula-sd.conf</filename>."
20474
#: serverguide/C/backups.xml:730(para)
20476
"Create a new <emphasis>FileSet</emphasis>, which will determine what "
20477
"directories to backup, by adding:"
20480
#: serverguide/C/backups.xml:733(programlisting)
20484
"# LocalhostBacup FileSet.\n"
20486
" Name = \"LocalhostFiles\"\n"
20489
" signature = MD5\n"
20490
" compression=GZIP\n"
20498
#: serverguide/C/backups.xml:747(para)
20500
"This <emphasis>FileSet</emphasis> will backup the <filename "
20501
"role=\"directory\">/etc</filename> and <filename "
20502
"role=\"directory\">/home</filename> directories. The "
20503
"<emphasis>Options</emphasis> resource directives configure the FileSet to "
20504
"create a MD5 signature for each file backed up, and to compress the files "
20508
#: serverguide/C/backups.xml:754(para)
20509
msgid "Next, create a new <emphasis>Schedule</emphasis> for the backup job:"
20512
#: serverguide/C/backups.xml:757(programlisting)
20516
"# LocalhostBackup Schedule -- Daily.\n"
20518
" Name = \"LocalhostDaily\"\n"
20519
" Run = Full daily at 00:01\n"
20523
#: serverguide/C/backups.xml:764(para)
20525
"The job will run every day at 00:01 or 12:01 am. There are many other "
20526
"scheduling options available."
20529
#: serverguide/C/backups.xml:769(para)
20530
msgid "Finally create the <emphasis>Job</emphasis>:"
20533
#: serverguide/C/backups.xml:772(programlisting)
20537
"# Localhost backup.\n"
20539
" Name = \"LocalhostBackup\"\n"
20540
" JobDefs = \"DefaultJob\"\n"
20543
" FileSet = \"LocalhostFiles\"\n"
20544
" Schedule = \"LocalhostDaily\"\n"
20545
" Storage = TapeDrive\n"
20546
" Write Bootstrap = \"/var/lib/bacula/LocalhostBackup.bsr\"\n"
20550
#: serverguide/C/backups.xml:785(para)
20552
"The job will do a <emphasis>Full</emphasis> backup every day to the tape "
20556
#: serverguide/C/backups.xml:790(para)
20558
"Each tape used will need to have a <emphasis>Label</emphasis>. If the "
20559
"current tape does not have a label <application>Bacula</application> will "
20560
"send an email letting you know. To label a tape using the "
20561
"<application>Console</application> enter the following from a terminal:"
20564
#: serverguide/C/backups.xml:796(command)
20568
#: serverguide/C/backups.xml:800(para)
20569
msgid "At the Bacula Console prompt enter:"
20572
#: serverguide/C/backups.xml:804(command)
20576
#: serverguide/C/backups.xml:808(para)
20578
"You will then be prompted for the <emphasis>Storage</emphasis> resource:"
20581
#: serverguide/C/backups.xml:818(userinput)
20586
#: serverguide/C/backups.xml:812(computeroutput)
20590
"Automatically selected Catalog: MyCatalog\n"
20591
"Using Catalog \"MyCatalog\"\n"
20592
"The defined Storage resources are:\n"
20595
"Select Storage resource (1-2):<placeholder-1/>\n"
20598
#: serverguide/C/backups.xml:823(para)
20599
msgid "Enter the new <emphasis>Volume</emphasis> name:"
20602
#: serverguide/C/backups.xml:828(userinput)
20607
#: serverguide/C/backups.xml:827(computeroutput)
20611
"Enter new Volume name: <placeholder-1/>\n"
20617
#: serverguide/C/backups.xml:833(para)
20618
msgid "Replace <emphasis>Sunday</emphasis> with the desired label."
20621
#: serverguide/C/backups.xml:838(para)
20622
msgid "Now, select the <emphasis>Pool</emphasis>:"
20625
#: serverguide/C/backups.xml:843(userinput)
20630
#: serverguide/C/backups.xml:842(computeroutput)
20634
"Select the Pool (1-2): <placeholder-1/>\n"
20635
"Connecting to Storage daemon TapeDrive at backupserver:9103 ...\n"
20636
"Sending label command for Volume \"Sunday\" Slot 0 ...\n"
20639
#: serverguide/C/backups.xml:850(para)
20641
"Congratulations, you have now configured <emphasis>Bacula</emphasis> to "
20642
"backup the localhost to an attached tape drive."
20645
#: serverguide/C/backups.xml:858(para)
20647
"For more <emphasis>Bacula</emphasis> configuration options refer to the "
20648
"<ulink url=\"http://www.bacula.org/en/rel-manual/index.html\">Bacula User's "
20652
#: serverguide/C/backups.xml:864(para)
20654
"The <ulink url=\"http://www.bacula.org/\">Bacula Home Page</ulink> contains "
20655
"the latest Bacula news and developments."
20658
#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2.
20659
#: serverguide/C/backups.xml:0(None)
20660
msgid "translator-credits"
20662
"Launchpad Contributions:\n"
20663
" Randall https://launchpad.net/~randall-songshu\n"
20664
" kiersie https://launchpad.net/~ckiers\n"
20666
"Launchpad Contributions:\n"
20667
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20670
"Launchpad Contributions:\n"
20671
" Balaam's Miracle https://launchpad.net/~balaam-balaamsmiracle\n"
20672
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20675
"Launchpad Contributions:\n"
20676
" Balaam's Miracle https://launchpad.net/~balaam-balaamsmiracle\n"
20677
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20680
"Launchpad Contributions:\n"
20681
" Balaam's Miracle https://launchpad.net/~balaam-balaamsmiracle\n"
20682
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20684
" Linus Torvalds https://launchpad.net/~tiemenwebbink\n"
20685
" Mike Morraye https://launchpad.net/~mike-morraye-be\n"
20687
"Launchpad Contributions:\n"
20688
" Balaam's Miracle https://launchpad.net/~balaam-balaamsmiracle\n"
20689
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20691
" Linus Torvalds https://launchpad.net/~tiemenwebbink\n"
20692
" Mike Morraye https://launchpad.net/~mike-morraye-be\n"
20694
"Launchpad Contributions:\n"
20695
" Balaam's Miracle https://launchpad.net/~balaam-balaamsmiracle\n"
20696
" Launchpad Translations Administrators https://launchpad.net/~rosetta-"
20698
" Mike Morraye https://launchpad.net/~mike-morraye-be\n"
20699
" TWeberink https://launchpad.net/~tiemenwebbink-deactivatedaccount"