1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4
<!ENTITY % globalent SYSTEM "../../libs/global.ent">
6
<!ENTITY % gnome-menus-C SYSTEM "../../libs/gnome-menus-C.ent">
8
<!ENTITY % xinclude SYSTEM "../../libs/xinclude.mod">
10
<!ENTITY language "&EnglishAmerican;">
12
<chapter id="file-servers" status="review">
13
<title>File Servers</title>
16
If you have more than one computer on a single network. At some point you will probably
17
need to share files between them. In this section we cover installing and configuring
20
<sect1 id="ftp-server" status="review">
21
<title>FTP Server</title>
22
<para>File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading
23
files between computers. FTP works on a client/server model. The server component is
24
called an <emphasis>FTP daemon</emphasis>. It continuously listens for FTP requests
25
from remote clients. When a request is received, it manages the login and sets up
26
the connection. For the duration of the session it executes any of commands sent by
27
the FTP client.</para>
28
<para>Access to an FTP server can be managed in two ways:</para>
29
<itemizedlist spacing="compact">
31
<para>Anonymous</para>
34
<para>Authenticated</para>
37
<para>In the Anonymous mode, remote clients can access the FTP server by using the
38
default user account called "anonymous" or "ftp" and
39
sending an email address as the password. In the Authenticated mode a user must
40
have an account and a password. User access to the FTP server directories and files is
41
dependent on the permissions defined for the account used at login. As a general
42
rule, the FTP daemon will hide the root directory of the FTP server and change it to
43
the FTP Home directory. This hides the rest of the file system from remote
45
<sect2 id="vsftpd-ftp-server-installation" status="review">
46
<title>vsftpd - FTP Server Installation</title>
47
<para>vsftpd is an FTP daemon available in
48
Ubuntu. It is easy to install, set up, and
49
maintain. To install <application>vsftpd</application> you
50
can run the following command:
51
<screen> <command>sudo apt-get install vsftpd</command> </screen>
55
<sect2 id="vsftpd-ftp-server-configuration" status="review">
56
<title>vsftpd - FTP Server Configuration</title>
58
You can edit the vsftpd configuration file,
59
<filename>/etc/vsftpd.conf</filename>, to
60
change the default settings.
62
By default only anonymous FTP is
63
allowed. If you wish to disable this option, you
64
should change the following line:
76
By default, local system users are not allowed to
77
login to FTP server. To change this setting, you
78
should uncomment the following line:
84
By default, users are allowed to download files
85
from FTP server. They are not allowed to upload
86
files to FTP server. To change this setting, you
87
should uncomment the following line:
93
Similarly, by default, the anonymous users are not
94
allowed to upload files to FTP server. To change
95
this setting, you should uncomment the following
99
#anon_upload_enable=YES
102
The configuration file consists of many
103
configuration parameters. The information about
104
each parameter is available in the configuration
105
file. Alternatively, you can refer to the man
106
page, <command>man 5 vsftpd.conf</command> for
107
details of each parameter.
110
Once you configure <application>vsftpd</application> you
111
can start the daemon. You can run following command to
112
run the <application>vsftpd</application> daemon:
115
<command>sudo /etc/init.d/vsftpd start</command>
118
Please note that the defaults in the configuration file are
119
set as they are for security reasons. Each of the above
120
changes makes the system a little less secure, so make them
121
only if you need them.
125
<sect1 id="network-file-system" status="review">
126
<title>Network File System (NFS)</title>
128
NFS allows a system to share directories and files with others
129
over a network. By using NFS, users and programs can access
130
files on remote systems almost as if they were local files.
134
Some of the most notable benefits that NFS can provide are:
139
<para>Local workstations use less disk space because commonly used data
140
can be stored on a single machine and still remain accessible to others
141
over the network.</para>
144
<para>There is no need for users to have separate home directories on
145
every network machine. Home directories could be set up on the NFS
146
server and made available throughout the network.</para>
150
<para>Storage devices such as floppy disks, CDROM drives, and USB
151
Thumb drives can be used by other machines on the network. This may
152
reduce the number of removable media drives throughout the
157
<sect2 id="nfs-installation" status="review">
158
<title>Installation</title>
161
At a terminal prompt enter the following command to install the NFS
166
<command>sudo apt-get install nfs-kernel-server</command>
170
<sect2 id="nfs-configuration" status="review">
171
<title>Configuration</title>
173
You can configure the directories to be exported by adding them to
174
the <filename>/etc/exports</filename> file. For example:
178
/ubuntu *(ro,sync,no_root_squash)
179
/home *(rw,sync,no_root_squash)
184
You can replace * with one of the hostname formats. Make the
185
hostname declaration as specific as possible so unwanted
186
systems cannot access the NFS mount.
190
To start the NFS server, you can run the following command at a terminal prompt:
194
<command>sudo /etc/init.d/nfs-kernel-server start</command>
198
<sect2 id="nfs-client-configuration" status="review">
199
<title>NFS Client Configuration</title>
201
Use the <application>mount</application> command to mount a shared NFS directory from
202
another machine, by typing a command line similar to the following at a terminal prompt:
206
<command>sudo mount example.hostname.com:/ubuntu /local/ubuntu</command>
211
The mount point directory <filename>/local/ubuntu</filename> must
212
exist. There should be no files or subdirectories in the
213
<filename>/local/ubuntu</filename> directory.
218
An alternate way to mount an NFS share from another machine is to
219
add a line to the <filename>/etc/fstab</filename> file. The line must state the
220
hostname of the NFS server, the directory on the server being
221
exported, and the directory on the local machine where the NFS
222
share is to be mounted.
226
The general syntax for the line in <filename>/etc/fstab</filename>
232
example.hostname.com:/ubuntu /local/ubuntu nfs rsize=8192,wsize=8192,timeo=14,intr
236
If you have trouble mounting an NFS share, make sure the <application>nfs-common</application> package is
237
installed on your client. To install
238
<application>nfs-common</application> enter the following
239
command at the terminal
242
<command>sudo apt-get install nfs-common</command>
246
<sect2 id="nfs-references" status="review">
247
<title>References</title>
248
<para><ulink url="http://nfs.sourceforge.net/">Linux NFS faq</ulink></para>
252
<sect1 id="cups" status="review">
253
<title>CUPS - Print Server</title>
255
The primary mechanism for Ubuntu printing and print services is the
256
<emphasis role="bold">Common UNIX Printing System</emphasis> (CUPS).
257
This printing system is a freely available, portable printing layer
258
which has become the new standard for printing in most Linux
262
CUPS manages print jobs and queues and provides network printing using
263
the standard Internet Printing Protocol (IPP), while offering support
264
for a very large range of printers, from dot-matrix to laser and many
265
in between. CUPS also supports PostScript Printer Description (PPD) and
266
auto-detection of network printers, and features a simple web-based
267
configuration and administration tool.
269
<sect2 id="cups-installation" status="review">
270
<title>Installation</title>
272
To install CUPS on your Ubuntu computer, simply use <application>sudo</application> with the <application>apt-get</application> command and give the packages to install as the first parameter. A complete CUPS install has many package dependencies, but they may all be specified on the same command line. Enter the following at a terminal prompt to install CUPS:
276
<command>sudo apt-get install cupsys</command>
280
Upon authenticating with your user password, the packages should be downloaded
281
and installed without error. Upon the conclusion of installation, the CUPS server
282
will be started automatically.
285
For troubleshooting purposes, you can access CUPS
286
server errors via the error log file at: <filename>/var/log/cups/error_log</filename>.
287
If the error log does not show enough information to troubleshoot any problems you
288
encounter, the verbosity of the CUPS log can be increased by changing the <emphasis
289
role="bold">LogLevel</emphasis> directive in the configuration file (discussed below)
290
to "debug" or even "debug2", which logs everything, from the default of "info". If
291
you make this change, remember to change it back once you've solved your problem, to
292
prevent the log file from becoming overly large.
295
<sect2 id="cups-configuration" status="review">
296
<title>Configuration</title>
298
The Common UNIX Printing System server's behavior is configured through the
299
directives contained in the file <filename>/etc/cups/cupsd.conf</filename>.
300
The CUPS configuration file follows the same syntax as the primary configuration
301
file for the Apache HTTP server, so users familiar with editing Apache's
302
configuration file should feel at ease when editing the CUPS configuration
303
file. Some examples of settings you may wish to change initially will be
307
<para>Prior to editing the configuration file, you should make a copy of
308
the original file and protect it from writing, so you will have the original
309
settings as a reference, and to reuse as necessary.
311
<para>Copy the <filename>/etc/cups/cupsd.conf</filename> file and protect it
312
from writing with the following commands, issued at a terminal prompt:
317
<command>sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original</command>
318
<command>sudo chmod a-w /etc/cups/cupsd.conf.original</command>
324
<emphasis role="bold">ServerAdmin</emphasis>: To configure the email
325
address of the designated administrator of the CUPS server, simply
326
edit the <filename>/etc/cups/cupsd.conf</filename> configuration file
327
with your preferred text editor, and modify the <emphasis
328
role="italics">ServerAdmin</emphasis> line accordingly. For example,
329
if you are the Administrator for the CUPS server, and your e-mail
330
address is 'bjoy@somebigco.com', then you would modify the ServerAdmin
331
line to appear as such:
335
ServerAdmin bjoy@somebigco.com
341
For more examples of configuration directives in the CUPS server
342
configuration file, view the associated system manual page by entering the
343
following command at a terminal prompt:
347
<command>man cupsd.conf</command>
352
Whenever you make changes to the <filename>/etc/cups/cupsd.conf</filename> configuration file, you'll need to restart the CUPS server by typing the following command at a terminal prompt:
357
<command>sudo /etc/init.d/cupsys restart</command>
360
<para>Some other configuration for the CUPS server is done in the file <filename>/etc/cups/cups.d/ports.conf</filename>:</para>
364
<emphasis role="bold">Listen</emphasis>: By default on Ubuntu, the CUPS
365
server installation listens only on the loopback interface at IP address
366
<emphasis>127.0.0.1</emphasis>. In order to instruct the
367
CUPS server to listen on an actual network adapter's IP address, you must
368
specify either a hostname, the IP address, or optionally, an IP
369
address/port pairing via the addition of a Listen directive. For example,
370
if your CUPS server resides on a local network at the IP address <emphasis
371
role="italics">192.168.10.250</emphasis> and you'd like to make it
372
accessible to the other systems on this subnetwork, you would edit the
373
<filename>/etc/cups/cupsd.conf</filename> and add a Listen
378
Listen 127.0.0.1:631 # existing loopback Listen
379
Listen /var/run/cups/cups.sock # existing socket Listen
380
Listen 192.168.10.250:631 # Listen on the LAN interface, Port 631 (IPP)
384
In the example above, you may comment out or remove the reference to the
385
Loopback address (127.0.0.1) if you do not wish <application>cupsd
386
</application> to listen on that interface, but would rather have it only
387
listen on the Ethernet interfaces of the Local Area Network (LAN). To enable
388
listening for all network interfaces for which a certain hostname is bound,
389
including the Loopback, you could create a Listen entry for the hostname
390
<emphasis>socrates</emphasis> as such:
394
Listen socrates:631 # Listen on all interfaces for the hostname 'socrates'
397
<para>or by omitting the Listen directive and using <emphasis>Port</emphasis> instead, as in:</para>
400
Port 631 # Listen on port 631 on all interfaces
407
<sect2 id="cups-references" status="review">
408
<title>References</title>
410
<ulink url="http://www.cups.org/">CUPS Website</ulink>