From owner-freebsd-doc@FreeBSD.ORG Thu May 26 09:20:07 2011 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFB0106566C for ; Thu, 26 May 2011 09:20:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 105A38FC12 for ; Thu, 26 May 2011 09:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4Q9K6RK011112 for ; Thu, 26 May 2011 09:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4Q9K6H1011111; Thu, 26 May 2011 09:20:06 GMT (envelope-from gnats) Resent-Date: Thu, 26 May 2011 09:20:06 GMT Resent-Message-Id: <201105260920.p4Q9K6H1011111@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Niclas Zeising Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 456D4106566B for ; Thu, 26 May 2011 09:18:30 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (unknown [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 640328FC16 for ; Thu, 26 May 2011 09:18:27 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 140794001A for ; Thu, 26 May 2011 11:18:26 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id DF7D440007; Thu, 26 May 2011 11:18:25 +0200 (CEST) Received: from mx.daemonic.se (h-90-99.A163.priv.bahnhof.se [79.136.90.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id A3BDC4001A for ; Thu, 26 May 2011 11:18:15 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 5B95F119C04 for ; Thu, 26 May 2011 11:18:15 +0200 (CEST) Received: from vincent.daemonic.se (login.daemonic.se [IPv6:2001:470:dca9:0:1::10]) by mail.daemonic.se (Postfix) with ESMTPS id 2160A12B2DA for ; Thu, 26 May 2011 11:18:15 +0200 (CEST) Received: (from zeising@localhost) by vincent.daemonic.se (8.14.4/8.14.4/Submit) id p4Q9IEG9079073; Thu, 26 May 2011 11:18:14 +0200 (CEST) (envelope-from zeising) Message-Id: <201105260918.p4Q9IEG9079073@vincent.daemonic.se> Date: Thu, 26 May 2011 11:18:14 +0200 (CEST) From: Niclas Zeising To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: docs/157337: [PATCH] Indentation changes to network servers chapter. X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Niclas Zeising List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 09:20:07 -0000 >Number: 157337 >Category: docs >Synopsis: [PATCH] Indentation changes to network servers chapter. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu May 26 09:20:06 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Niclas Zeising >Release: FreeBSD 8.2-RELEASE amd64 >Organization: >Environment: System: FreeBSD vincent.daemonic.se 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Wed Apr 20 17:22:47 CEST 2011 root@vincent.daemonic.se:/usr/obj/usr/src/sys/VINCENT amd64 >Description: A huge patch to make whitespace and indentation consistent throughout the networks chapter. >How-To-Repeat: N/A >Fix: Attached patch makes indentation consistent. It changes spaces->tabs where appropriate, and makes stuff on the same level have the same indentation. --- network-servers.chapter.sgml-whitespace.diff begins here --- Index: chapter.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml,v retrieving revision 1.133 diff -u -d -r1.133 chapter.sgml --- chapter.sgml 25 May 2011 16:55:01 -0000 1.133 +++ chapter.sgml 26 May 2011 08:52:39 -0000 @@ -8,7 +8,7 @@ - Murray + Murray Stokely Reorganized by @@ -92,8 +92,8 @@ - Know how to install additional third-party - software (). + Know how to install additional third-party + software (). @@ -102,11 +102,11 @@ - - Chern - Lee - Contributed by - + + Chern + Lee + Contributed by + @@ -185,7 +185,7 @@ modify its behaviour. The full list of options reads: inetd + [-p filename] [-R rate] [-s maximum] [configuration file] Options can be passed to inetd using the inetd_flags option in @@ -396,7 +396,7 @@ limits the number of children that can be started on behalf on any single IP address at any moment. These options are useful to prevent intentional or unintentional - excessive resource consumption and Denial of Service (DoS) + excessive resource consumption and Denial of Service (DoS) attacks to a machine. In this field, either of or @@ -528,18 +528,18 @@ - - Tom - Rhodes - Reorganized and enhanced by - + + Tom + Rhodes + Reorganized and enhanced by + - - Bill - Swingle + + Bill + Swingle Written by - + Network File System (NFS) @@ -583,29 +583,29 @@ How <acronym>NFS</acronym> Works NFS consists of at least two main - parts: a server and one or more clients. The client remotely - accesses the data that is stored on the server machine. In - order for this to function properly a few processes have to be - configured and running. + parts: a server and one or more clients. The client remotely + accesses the data that is stored on the server machine. In + order for this to function properly a few processes have to be + configured and running. The server has to be running the following daemons: - NFS - server + NFS + server - file server - UNIX clients + file server + UNIX clients rpcbind - mountd + mountd - nfsd + nfsd @@ -623,8 +623,8 @@ nfsd The NFS daemon which services - requests from the NFS - clients. + requests from the NFS + clients. mountd @@ -635,79 +635,79 @@ rpcbind This daemon allows NFS clients to discover which port - the NFS server is using. + the NFS server is using. The client can also run a daemon, known as - nfsiod. The - nfsiod daemon services the requests - from the NFS server. This is optional, and - improves performance, but is not required for normal and - correct operation. See the &man.nfsiod.8; manual page for - more information. + nfsiod. The + nfsiod daemon services the requests + from the NFS server. This is optional, and + improves performance, but is not required for normal and + correct operation. See the &man.nfsiod.8; manual page for + more information. Configuring <acronym>NFS</acronym> - NFS - configuration + NFS + configuration NFS configuration is a relatively - straightforward process. The processes that need to be - running can all start at boot time with a few modifications to - your /etc/rc.conf file. + straightforward process. The processes that need to be + running can all start at boot time with a few modifications to + your /etc/rc.conf file. On the NFS server, make sure that the - following options are configured in the - /etc/rc.conf file: + following options are configured in the + /etc/rc.conf file: rpcbind_enable="YES" nfs_server_enable="YES" mountd_flags="-r" mountd runs automatically - whenever the NFS server is enabled. + whenever the NFS server is enabled. On the client, make sure this option is present in - /etc/rc.conf: + /etc/rc.conf: nfs_client_enable="YES" The /etc/exports file specifies which - file systems NFS should export (sometimes - referred to as share). Each line in - /etc/exports specifies a file system to be - exported and which machines have access to that file system. - Along with what machines have access to that file system, - access options may also be specified. There are many such - options that can be used in this file but only a few will be - mentioned here. You can easily discover other options by - reading over the &man.exports.5; manual page. + file systems NFS should export (sometimes + referred to as share). Each line in + /etc/exports specifies a file system to be + exported and which machines have access to that file system. + Along with what machines have access to that file system, + access options may also be specified. There are many such + options that can be used in this file but only a few will be + mentioned here. You can easily discover other options by + reading over the &man.exports.5; manual page. Here are a few example /etc/exports entries: - NFS - export examples + NFS + export examples The following examples give an idea of how to export - file systems, although the settings may be different depending - on your environment and network configuration. For instance, - to export the /cdrom directory to three - example machines that have the same domain name as the server - (hence the lack of a domain name for each) or have entries in - your /etc/hosts file. The - flag makes the exported file system - read-only. With this flag, the remote system will not be able - to write any changes to the exported file system. + file systems, although the settings may be different depending + on your environment and network configuration. For instance, + to export the /cdrom directory to three + example machines that have the same domain name as the server + (hence the lack of a domain name for each) or have entries in + your /etc/hosts file. The + flag makes the exported file system + read-only. With this flag, the remote system will not be able + to write any changes to the exported file system. /cdrom -ro host1 host2 host3 @@ -755,7 +755,7 @@ One file system, /usr, has two lines specifying exports to the same host, client. - The correct format for this situation is: + The correct format for this situation is: /usr/src /usr/ports client @@ -785,7 +785,7 @@ &prompt.root; kill -HUP `cat /var/run/mountd.pid` or by invoking the mountd &man.rc.8; script - with the appropriate parameter: + with the appropriate parameter: &prompt.root; /etc/rc.d/mountd onereload @@ -793,9 +793,9 @@ information about using rc scripts. Alternatively, a reboot will make FreeBSD set everything - up properly. A reboot is not necessary though. - Executing the following commands as root - should start everything up. + up properly. A reboot is not necessary though. + Executing the following commands as root + should start everything up. On the NFS server: @@ -813,10 +813,10 @@ name will be client. If you only want to temporarily mount a remote file system or would rather test the configuration, just execute a command like this as root on the - client: + client: - NFS - mounting + NFS + mounting &prompt.root; mount server:/home /mnt @@ -824,7 +824,7 @@ on the server at /mnt on the client. If everything is set up correctly you should be able to enter /mnt on the client and see all the files - that are on the server. + that are on the server. If you want to automatically mount a remote file system each time the computer boots, add the file system to the @@ -833,7 +833,7 @@ server:/home /mnt nfs rw 0 0 The &man.fstab.5; manual page lists all the available - options. + options. @@ -867,14 +867,14 @@ Practical Uses NFS has many practical uses. Some of - the more common ones are listed below: + the more common ones are listed below: - NFS - uses + NFS + uses - + Set several machines to share a CDROM or other media among them. This is cheaper and often a more convenient method to install software on multiple machines. @@ -891,10 +891,10 @@ Several machines could have a common - /usr/ports/distfiles directory. That - way, when you need to install a port on several machines, - you can quickly access the source without downloading it - on each machine. + /usr/ports/distfiles directory. That + way, when you need to install a port on several machines, + you can quickly access the source without downloading it + on each machine. @@ -918,8 +918,12 @@ Automatic Mounts with <application>amd</application> - amd - automatic mounter daemon + + amd + + + automatic mounter daemon + &man.amd.8; (the automatic mounter daemon) automatically mounts a @@ -929,7 +933,7 @@ amd. Using amd provides a simple alternative to permanent mounts, as permanent mounts are usually listed in - /etc/fstab. + /etc/fstab. amd operates by attaching itself as an NFS server to the /host and @@ -974,9 +978,9 @@ amd_enable="YES" Additionally, custom flags can be passed to - amd from the - amd_flags option. By default, - amd_flags is set to: + amd from the + amd_flags option. By default, + amd_flags is set to: amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" @@ -991,13 +995,13 @@ - - - John - Lind - Contributed by - - + + + John + Lind + Contributed by + + Problems Integrating with Other Systems @@ -1111,11 +1115,11 @@ - - Bill - Swingle + + Bill + Swingle Written by - + @@ -1133,24 +1137,41 @@ What Is It? - NIS - Solaris - HP-UX - AIX - Linux - NetBSD - OpenBSD + + NIS + + + Solaris + + + HP-UX + + + AIX + + + Linux + + + NetBSD + + + OpenBSD + NIS, - which stands for Network Information Services, was developed - by Sun Microsystems to centralize administration of &unix; - (originally &sunos;) systems. It has now essentially become - an industry standard; all major &unix; like systems - (&solaris;, HP-UX, &aix;, Linux, NetBSD, OpenBSD, FreeBSD, - etc) support NIS. + which stands for Network Information Services, was developed + by Sun Microsystems to centralize administration of &unix; + (originally &sunos;) systems. It has now essentially become + an industry standard; all major &unix; like systems + (&solaris;, HP-UX, &aix;, Linux, NetBSD, OpenBSD, FreeBSD, + etc) support NIS. - yellow pagesNIS + + yellow pages + NIS + NIS was formerly known as Yellow Pages, but because of trademark @@ -1158,8 +1179,8 @@ often seen and used. - NIS - domains + NIS + domains It is a RPC-based client/server system that allows a group @@ -1169,20 +1190,22 @@ and add, remove or modify configuration data from a single location. - Windows NT + + Windows NT + It is similar to the &windowsnt; domain system; although - the internal implementation of the two are not at all similar, - the basic functionality can be compared. + the internal implementation of the two are not at all similar, + the basic functionality can be compared. Terms/Processes You Should Know There are several terms and several important user - processes that you will come across when attempting to - implement NIS on FreeBSD, whether you are trying to create an - NIS server or act as an NIS client: + processes that you will come across when attempting to + implement NIS on FreeBSD, whether you are trying to create an + NIS server or act as an NIS client: rpcbind @@ -1236,6 +1259,7 @@ ypserv + Should only be running on NIS servers; this is the NIS server process itself. If &man.ypserv.8; dies, then the server will no longer be able to @@ -1252,6 +1276,7 @@ rpc.yppasswdd + Another process that should only be running on NIS master servers; this is a daemon that will allow NIS clients to change their NIS passwords. If this daemon @@ -1286,52 +1311,52 @@ bound to instead. - Machine Types + Machine Types - + NIS master server - - A NIS master server. This - server, analogous to a &windowsnt; primary domain - controller, maintains the files used by all of the NIS - clients. The passwd, - group, and other various files used - by the NIS clients live on the master server. + + A NIS master server. This + server, analogous to a &windowsnt; primary domain + controller, maintains the files used by all of the NIS + clients. The passwd, + group, and other various files used + by the NIS clients live on the master server. - It is possible for one machine to be an NIS - master server for more than one NIS domain. However, - this will not be covered in this introduction, which - assumes a relatively small-scale NIS - environment. - + It is possible for one machine to be an NIS + master server for more than one NIS domain. However, + this will not be covered in this introduction, which + assumes a relatively small-scale NIS + environment. + NIS slave server - - NIS slave servers. Similar to - the &windowsnt; backup domain controllers, NIS slave - servers maintain copies of the NIS master's data files. - NIS slave servers provide the redundancy, which is - needed in important environments. They also help to - balance the load of the master server: NIS Clients - always attach to the NIS server whose response they get - first, and this includes slave-server-replies. - + + NIS slave servers. Similar to + the &windowsnt; backup domain controllers, NIS slave + servers maintain copies of the NIS master's data files. + NIS slave servers provide the redundancy, which is + needed in important environments. They also help to + balance the load of the master server: NIS Clients + always attach to the NIS server whose response they get + first, and this includes slave-server-replies. + NIS client - - NIS clients. NIS clients, like - most &windowsnt; workstations, authenticate against the - NIS server (or the &windowsnt; domain controller in the - &windowsnt; workstations case) to log on. - - + + NIS clients. NIS clients, like + most &windowsnt; workstations, authenticate against the + NIS server (or the &windowsnt; domain controller in the + &windowsnt; workstations case) to log on. + + @@ -1339,79 +1364,79 @@ Using NIS/YP This section will deal with setting up a sample NIS - environment. + environment. - Planning + Planning - Let us assume that you are the administrator of a small - university lab. This lab, which consists of 15 FreeBSD - machines, currently has no centralized point of - administration; each machine has its own - /etc/passwd and - /etc/master.passwd. These files are - kept in sync with each other only through manual - intervention; currently, when you add a user to the lab, you - must run adduser on all 15 machines. - Clearly, this has to change, so you have decided to convert - the lab to use NIS, using two of the machines as - servers. + Let us assume that you are the administrator of a small + university lab. This lab, which consists of 15 FreeBSD + machines, currently has no centralized point of + administration; each machine has its own + /etc/passwd and + /etc/master.passwd. These files are + kept in sync with each other only through manual + intervention; currently, when you add a user to the lab, you + must run adduser on all 15 machines. + Clearly, this has to change, so you have decided to convert + the lab to use NIS, using two of the machines as + servers. - Therefore, the configuration of the lab now looks something - like: + Therefore, the configuration of the lab now looks something + like: - - - - - Machine name - IP address - Machine role - - - - - ellington - 10.0.0.2 - NIS master - - - coltrane - 10.0.0.3 - NIS slave - - - basie - 10.0.0.4 - Faculty workstation - - - bird - 10.0.0.5 - Client machine - - - cli[1-11] - 10.0.0.[6-17] - Other client machines - - - - + + + + + Machine name + IP address + Machine role + + + + + ellington + 10.0.0.2 + NIS master + + + coltrane + 10.0.0.3 + NIS slave + + + basie + 10.0.0.4 + Faculty workstation + + + bird + 10.0.0.5 + Client machine + + + cli[1-11] + 10.0.0.[6-17] + Other client machines + + + + - If you are setting up a NIS scheme for the first time, it + If you are setting up a NIS scheme for the first time, it is a good idea to think through how you want to go about it. No matter what the size of your network, there are a few decisions that need to be made. - - Choosing a NIS Domain Name + + Choosing a NIS Domain Name NIS domainname - This might not be the domainname that + This might not be the domainname that you are used to. It is more accurately called the NIS domainname. When a client broadcasts its requests for info, it includes the name of the NIS @@ -1431,16 +1456,18 @@ assume you have chosen the name test-domain. - SunOS - However, some operating systems (notably &sunos;) use - their NIS domain name as their Internet domain name. If one - or more machines on your network have this restriction, you - must use the Internet domain name as - your NIS domain name. - + + SunOS + + However, some operating systems (notably &sunos;) use + their NIS domain name as their Internet domain name. If one + or more machines on your network have this restriction, you + must use the Internet domain name as + your NIS domain name. + - - Physical Server Requirements + + Physical Server Requirements There are several things to keep in mind when choosing a machine to use as a NIS server. One of the unfortunate @@ -1459,11 +1486,11 @@ the NIS server becomes unavailable, it will affect all of your NIS clients adversely. - + - NIS Servers + NIS Servers The canonical copies of all NIS information are stored on a single machine called the NIS master server. The @@ -1485,7 +1512,7 @@ database file and transmitting data from the database back to the client. - + Setting Up a NIS Master Server NIS @@ -1498,93 +1525,95 @@ /etc/rc.conf, and FreeBSD will do the rest for you. - - - nisdomainname="test-domain" - This line will set the NIS domainname to - test-domain - upon network setup (e.g. after reboot). - - - nis_server_enable="YES" - This will tell FreeBSD to start up the NIS server processes - when the networking is next brought up. - - - nis_yppasswdd_enable="YES" - This will enable the rpc.yppasswdd - daemon which, as mentioned above, will allow users to - change their NIS password from a client machine. - - + + + nisdomainname="test-domain" + This line will set the NIS domainname to + test-domain + upon network setup (e.g. after reboot). + + + nis_server_enable="YES" + This will tell FreeBSD to start up the NIS server processes + when the networking is next brought up. + + + nis_yppasswdd_enable="YES" + This will enable the rpc.yppasswdd + daemon which, as mentioned above, will allow users to + change their NIS password from a client machine. + + - - Depending on your NIS setup, you may need to add - further entries. See the section about NIS - servers that are also NIS clients, below, for - details. - + + Depending on your NIS setup, you may need to add + further entries. See the section about NIS + servers that are also NIS clients, below, for + details. + - After setting up the above entries, run the command - /etc/netstart as superuser. It will - set up everything for you, using the values you defined in - /etc/rc.conf. As a last step, before + After setting up the above entries, run the command + /etc/netstart as superuser. It will + set up everything for you, using the values you defined in + /etc/rc.conf. As a last step, before initializing the NIS maps, start the ypserv daemon manually: &prompt.root; /etc/rc.d/ypserv start - + - - Initializing the NIS Maps - - NIS - maps - - The NIS maps are database files, - that are kept in the /var/yp - directory. They are generated from configuration files in - the /etc directory of the NIS master, - with one exception: the - /etc/master.passwd file. This is for - a good reason, you do not want to propagate passwords to - your root and other administrative - accounts to all the servers in the NIS domain. Therefore, - before we initialize the NIS maps, you should: + + Initializing the NIS Maps + + NIS + maps + + The NIS maps are database files, + that are kept in the /var/yp + directory. They are generated from configuration files in + the /etc directory of the NIS master, + with one exception: the + /etc/master.passwd file. This is for + a good reason, you do not want to propagate passwords to + your root and other administrative + accounts to all the servers in the NIS domain. Therefore, + before we initialize the NIS maps, you should: - &prompt.root; cp /etc/master.passwd /var/yp/master.passwd + &prompt.root; cp /etc/master.passwd /var/yp/master.passwd &prompt.root; cd /var/yp &prompt.root; vi master.passwd - You should remove all entries regarding system - accounts (bin, - tty, kmem, - games, etc), as well as any accounts - that you do not want to be propagated to the NIS clients - (for example root and any other UID 0 - (superuser) accounts). + You should remove all entries regarding system + accounts (bin, + tty, kmem, + games, etc), as well as any accounts + that you do not want to be propagated to the NIS clients + (for example root and any other UID 0 + (superuser) accounts). - Make sure the - /var/yp/master.passwd is neither group - nor world readable (mode 600)! Use the - chmod command, if appropriate. + Make sure the + /var/yp/master.passwd is neither group + nor world readable (mode 600)! Use the + chmod command, if appropriate. - Tru64 UNIX + + Tru64 UNIX + - When you have finished, it is time to initialize the - NIS maps! FreeBSD includes a script named - ypinit to do this for you (see its - manual page for more information). Note that this script - is available on most &unix; Operating Systems, but not on - all. On Digital UNIX/Compaq Tru64 UNIX it is called - ypsetup. Because we are generating - maps for an NIS master, we are going to pass the - option to ypinit. - To generate the NIS maps, assuming you already performed - the steps above, run: + When you have finished, it is time to initialize the + NIS maps! FreeBSD includes a script named + ypinit to do this for you (see its + manual page for more information). Note that this script + is available on most &unix; Operating Systems, but not on + all. On Digital UNIX/Compaq Tru64 UNIX it is called + ypsetup. Because we are generating + maps for an NIS master, we are going to pass the + option to ypinit. + To generate the NIS maps, assuming you already performed + the steps above, run: - ellington&prompt.root; ypinit -m test-domain + ellington&prompt.root; ypinit -m test-domain Server Type: MASTER Domain: test-domain Creating an YP server will require that you answer a few questions. Questions will all be asked at the beginning of the procedure. @@ -1608,25 +1637,25 @@ NIS Map update completed. ellington has been setup as an YP master server without any errors. - ypinit should have created - /var/yp/Makefile from - /var/yp/Makefile.dist. - When created, this file assumes that you are operating - in a single server NIS environment with only FreeBSD - machines. Since test-domain has - a slave server as well, you must edit - /var/yp/Makefile: + ypinit should have created + /var/yp/Makefile from + /var/yp/Makefile.dist. + When created, this file assumes that you are operating + in a single server NIS environment with only FreeBSD + machines. Since test-domain has + a slave server as well, you must edit + /var/yp/Makefile: - ellington&prompt.root; vi /var/yp/Makefile + ellington&prompt.root; vi /var/yp/Makefile You should comment out the line that says NOPUSH = "True" (if it is not commented out already). - + - + Setting up a NIS Slave Server NIS @@ -1634,14 +1663,14 @@ Setting up an NIS slave server is even more simple than setting up the master. Log on to the slave server and edit the - file /etc/rc.conf as you did before. - The only difference is that we now must use the - option when running ypinit. - The option requires the name of the NIS - master be passed to it as well, so our command line looks - like: + file /etc/rc.conf as you did before. + The only difference is that we now must use the + option when running ypinit. + The option requires the name of the NIS + master be passed to it as well, so our command line looks + like: - coltrane&prompt.root; ypinit -s ellington test-domain + coltrane&prompt.root; ypinit -s ellington test-domain Server Type: SLAVE Domain: test-domain Master: ellington @@ -1718,13 +1747,13 @@ is especially important on busy networks where map updates might not always complete. - Now, run the command /etc/netstart on the - slave server as well, which again starts the NIS server. + Now, run the command /etc/netstart on the + slave server as well, which again starts the NIS server. - NIS Clients + NIS Clients An NIS client establishes what is called a binding to a particular NIS server using the @@ -1761,9 +1790,9 @@ Edit the file /etc/rc.conf and - add the following lines in order to set the NIS domainname - and start ypbind upon network - startup: + add the following lines in order to set the NIS domainname + and start ypbind upon network + startup: nisdomainname="test-domain" nis_client_enable="YES" @@ -1774,7 +1803,7 @@ server, remove all user accounts from your /etc/master.passwd file and use vipw to add the following line to - the end of the file: + the end of the file: +::::::::: @@ -1784,20 +1813,20 @@ many ways to configure your NIS client by changing this line. See the netgroups section below for more information. - For more detailed reading see O'Reilly's book on + For more detailed reading see O'Reilly's book on Managing NFS and NIS. - - You should keep at least one local account (i.e. - not imported via NIS) in your - /etc/master.passwd and this - account should also be a member of the group - wheel. If there is something - wrong with NIS, this account can be used to log in - remotely, become root, and fix things. - - + + You should keep at least one local account (i.e. + not imported via NIS) in your + /etc/master.passwd and this + account should also be a member of the group + wheel. If there is something + wrong with NIS, this account can be used to log in + remotely, become root, and fix things. + + To import all possible group entries from the NIS @@ -1869,35 +1898,37 @@ /var/yp/securenets. - While both of these access control mechanisms provide some - security, they, like the privileged port test, are - vulnerable to IP spoofing attacks. All - NIS-related traffic should be blocked at your firewall. + While both of these access control mechanisms provide some + security, they, like the privileged port test, are + vulnerable to IP spoofing attacks. All + NIS-related traffic should be blocked at your firewall. - Servers using /var/yp/securenets - may fail to serve legitimate NIS clients with archaic TCP/IP - implementations. Some of these implementations set all - host bits to zero when doing broadcasts and/or fail to - observe the subnet mask when calculating the broadcast - address. While some of these problems can be fixed by - changing the client configuration, other problems may force - the retirement of the client systems in question or the - abandonment of /var/yp/securenets. + Servers using /var/yp/securenets + may fail to serve legitimate NIS clients with archaic TCP/IP + implementations. Some of these implementations set all + host bits to zero when doing broadcasts and/or fail to + observe the subnet mask when calculating the broadcast + address. While some of these problems can be fixed by + changing the client configuration, other problems may force + the retirement of the client systems in question or the + abandonment of /var/yp/securenets. - Using /var/yp/securenets on a - server with such an archaic implementation of TCP/IP is a - really bad idea and will lead to loss of NIS functionality - for large parts of your network. + Using /var/yp/securenets on a + server with such an archaic implementation of TCP/IP is a + really bad idea and will lead to loss of NIS functionality + for large parts of your network. - TCP Wrappers - The use of the TCP Wrapper - package increases the latency of your NIS server. The - additional delay may be long enough to cause timeouts in - client programs, especially in busy networks or with slow - NIS servers. If one or more of your client systems - suffers from these symptoms, you should convert the client - systems in question into NIS slave servers and force them - to bind to themselves. + + TCP Wrappers + + The use of the TCP Wrapper + package increases the latency of your NIS server. The + additional delay may be long enough to cause timeouts in + client programs, especially in busy networks or with slow + NIS servers. If one or more of your client systems + suffers from these symptoms, you should convert the client + systems in question into NIS slave servers and force them + to bind to themselves. @@ -1905,28 +1936,28 @@ Barring Some Users from Logging On In our lab, there is a machine basie that - is supposed to be a faculty only workstation. We do not want - to take this machine out of the NIS domain, yet the - passwd file on the master NIS server - contains accounts for both faculty and students. What can we - do? + is supposed to be a faculty only workstation. We do not want + to take this machine out of the NIS domain, yet the + passwd file on the master NIS server + contains accounts for both faculty and students. What can we + do? There is a way to bar specific users from logging on to a - machine, even if they are present in the NIS database. To do - this, all you must do is add - -username to the - end of the /etc/master.passwd file on the - client machine, where username is - the username of the user you wish to bar from logging in. - This should preferably be done using vipw, - since vipw will sanity check your changes - to /etc/master.passwd, as well as - automatically rebuild the password database when you finish - editing. For example, if we wanted to bar user - bill from logging on to - basie we would: + machine, even if they are present in the NIS database. To do + this, all you must do is add + -username to the + end of the /etc/master.passwd file on the + client machine, where username is + the username of the user you wish to bar from logging in. + This should preferably be done using vipw, + since vipw will sanity check your changes + to /etc/master.passwd, as well as + automatically rebuild the password database when you finish + editing. For example, if we wanted to bar user + bill from logging on to + basie we would: - basie&prompt.root; vipw + basie&prompt.root; vipw [add -bill to the end, exit] vipw: rebuilding the database... vipw: done @@ -1956,165 +1987,167 @@ - - - Udo - Erdelhoff - Contributed by - - + + + Udo + Erdelhoff + Contributed by + + Using Netgroups - netgroups + + netgroups + The method shown in the previous section works reasonably - well if you need special rules for a very small number of - users and/or machines. On larger networks, you - will forget to bar some users from logging - onto sensitive machines, or you may even have to modify each - machine separately, thus losing the main benefit of NIS: - centralized administration. + well if you need special rules for a very small number of + users and/or machines. On larger networks, you + will forget to bar some users from logging + onto sensitive machines, or you may even have to modify each + machine separately, thus losing the main benefit of NIS: + centralized administration. The NIS developers' solution for this problem is called - netgroups. Their purpose and semantics - can be compared to the normal groups used by &unix; file - systems. The main differences are the lack of a numeric ID - and the ability to define a netgroup by including both user - accounts and other netgroups. + netgroups. Their purpose and semantics + can be compared to the normal groups used by &unix; file + systems. The main differences are the lack of a numeric ID + and the ability to define a netgroup by including both user + accounts and other netgroups. Netgroups were developed to handle large, complex networks - with hundreds of users and machines. On one hand, this is - a Good Thing if you are forced to deal with such a situation. - On the other hand, this complexity makes it almost impossible to - explain netgroups with really simple examples. The example - used in the remainder of this section demonstrates this - problem. + with hundreds of users and machines. On one hand, this is + a Good Thing if you are forced to deal with such a situation. + On the other hand, this complexity makes it almost impossible to + explain netgroups with really simple examples. The example + used in the remainder of this section demonstrates this + problem. Let us assume that your successful introduction of NIS in - your laboratory caught your superiors' interest. Your next - job is to extend your NIS domain to cover some of the other - machines on campus. The two tables contain the names of the - new users and new machines as well as brief descriptions of - them. + your laboratory caught your superiors' interest. Your next + job is to extend your NIS domain to cover some of the other + machines on campus. The two tables contain the names of the + new users and new machines as well as brief descriptions of + them. - - - - User Name(s) - Description - - + + + + User Name(s) + Description + + - - - alpha, beta - Normal employees of the IT department - + + + alpha, beta + Normal employees of the IT department + - - charlie, delta - The new apprentices of the IT department - + + charlie, delta + The new apprentices of the IT department + - - echo, foxtrott, golf, ... - Ordinary employees - + + echo, foxtrott, golf, ... + Ordinary employees + - - able, baker, ... - The current interns - - - + + able, baker, ... + The current interns + + + - - - - Machine Name(s) - Description - - + + + + Machine Name(s) + Description + + - - - + + + - war, death, - famine, - pollution - Your most important servers. Only the IT - employees are allowed to log onto these - machines. - - + war, death, + famine, + pollution + Your most important servers. Only the IT + employees are allowed to log onto these + machines. + + - pride, greed, - envy, wrath, - lust, sloth - Less important servers. All members of the IT - department are allowed to login onto these - machines. - + pride, greed, + envy, wrath, + lust, sloth + Less important servers. All members of the IT + department are allowed to login onto these + machines. + - - one, two, - three, four, - ... + + one, two, + three, four, + ... - Ordinary workstations. Only the - real employees are allowed to use - these machines. - + Ordinary workstations. Only the + real employees are allowed to use + these machines. + - - trashcan - A very old machine without any critical data. - Even the intern is allowed to use this box. - - - + + trashcan + A very old machine without any critical data. + Even the intern is allowed to use this box. + + + If you tried to implement these restrictions by separately - blocking each user, you would have to add one - -user line to - each system's passwd for each user who is - not allowed to login onto that system. If you forget just one - entry, you could be in trouble. It may be feasible to do this - correctly during the initial setup, however you - will eventually forget to add the lines - for new users during day-to-day operations. After all, Murphy - was an optimist. + blocking each user, you would have to add one + -user line to + each system's passwd for each user who is + not allowed to login onto that system. If you forget just one + entry, you could be in trouble. It may be feasible to do this + correctly during the initial setup, however you + will eventually forget to add the lines + for new users during day-to-day operations. After all, Murphy + was an optimist. Handling this situation with netgroups offers several - advantages. Each user need not be handled separately; you - assign a user to one or more netgroups and allow or forbid - logins for all members of the netgroup. If you add a new - machine, you will only have to define login restrictions for - netgroups. If a new user is added, you will only have to add - the user to one or more netgroups. Those changes are - independent of each other: no more for each combination - of user and machine do... If your NIS setup is planned - carefully, you will only have to modify exactly one central - configuration file to grant or deny access to machines. + advantages. Each user need not be handled separately; you + assign a user to one or more netgroups and allow or forbid + logins for all members of the netgroup. If you add a new + machine, you will only have to define login restrictions for + netgroups. If a new user is added, you will only have to add + the user to one or more netgroups. Those changes are + independent of each other: no more for each combination + of user and machine do... If your NIS setup is planned + carefully, you will only have to modify exactly one central + configuration file to grant or deny access to machines. The first step is the initialization of the NIS map - netgroup. FreeBSD's &man.ypinit.8; does not create this map by - default, but its NIS implementation will support it once it has - been created. To create an empty map, simply type + netgroup. FreeBSD's &man.ypinit.8; does not create this map by + default, but its NIS implementation will support it once it has + been created. To create an empty map, simply type ellington&prompt.root; vi /var/yp/netgroup and start adding content. For our example, we need at - least four netgroups: IT employees, IT apprentices, normal - employees and interns. + least four netgroups: IT employees, IT apprentices, normal + employees and interns. IT_EMP (,alpha,test-domain) (,beta,test-domain) IT_APP (,charlie,test-domain) (,delta,test-domain) @@ -2123,85 +2156,87 @@ INTERNS (,able,test-domain) (,baker,test-domain) IT_EMP, IT_APP etc. - are the names of the netgroups. Each bracketed group adds - one or more user accounts to it. The three fields inside a - group are: + are the names of the netgroups. Each bracketed group adds + one or more user accounts to it. The three fields inside a + group are: - - The name of the host(s) where the following items are - valid. If you do not specify a hostname, the entry is - valid on all hosts. If you do specify a hostname, you - will enter a realm of darkness, horror and utter confusion. - + + The name of the host(s) where the following items are + valid. If you do not specify a hostname, the entry is + valid on all hosts. If you do specify a hostname, you + will enter a realm of darkness, horror and utter confusion. + - - The name of the account that belongs to this - netgroup. - + + The name of the account that belongs to this + netgroup. + - - The NIS domain for the account. You can import - accounts from other NIS domains into your netgroup if you - are one of the unlucky fellows with more than one NIS - domain. - + + The NIS domain for the account. You can import + accounts from other NIS domains into your netgroup if you + are one of the unlucky fellows with more than one NIS + domain. + Each of these fields can contain wildcards. See - &man.netgroup.5; for details. + &man.netgroup.5; for details. - netgroups - Netgroup names longer than 8 characters should not be - used, especially if you have machines running other - operating systems within your NIS domain. The names are - case sensitive; using capital letters for your netgroup - names is an easy way to distinguish between user, machine - and netgroup names. + + netgroups + + Netgroup names longer than 8 characters should not be + used, especially if you have machines running other + operating systems within your NIS domain. The names are + case sensitive; using capital letters for your netgroup + names is an easy way to distinguish between user, machine + and netgroup names. - Some NIS clients (other than FreeBSD) cannot handle - netgroups with a large number of entries. For example, some - older versions of &sunos; start to cause trouble if a netgroup - contains more than 15 entries. You can - circumvent this limit by creating several sub-netgroups with - 15 users or less and a real netgroup that consists of the - sub-netgroups: + Some NIS clients (other than FreeBSD) cannot handle + netgroups with a large number of entries. For example, some + older versions of &sunos; start to cause trouble if a netgroup + contains more than 15 entries. You can + circumvent this limit by creating several sub-netgroups with + 15 users or less and a real netgroup that consists of the + sub-netgroups: - BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...] + BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...] BIGGRP2 (,joe16,domain) (,joe17,domain) [...] BIGGRP3 (,joe31,domain) (,joe32,domain) BIGGROUP BIGGRP1 BIGGRP2 BIGGRP3 - You can repeat this process if you need more than 225 - users within a single netgroup. + You can repeat this process if you need more than 225 + users within a single netgroup. Activating and distributing your new NIS map is - easy: + easy: ellington&prompt.root; cd /var/yp ellington&prompt.root; make This will generate the three NIS maps - netgroup, - netgroup.byhost and - netgroup.byuser. Use &man.ypcat.1; to - check if your new NIS maps are available: + netgroup, + netgroup.byhost and + netgroup.byuser. Use &man.ypcat.1; to + check if your new NIS maps are available: ellington&prompt.user; ypcat -k netgroup ellington&prompt.user; ypcat -k netgroup.byhost ellington&prompt.user; ypcat -k netgroup.byuser The output of the first command should resemble the - contents of /var/yp/netgroup. The second - command will not produce output if you have not specified - host-specific netgroups. The third command can be used to - get the list of netgroups for a user. + contents of /var/yp/netgroup. The second + command will not produce output if you have not specified + host-specific netgroups. The third command can be used to + get the list of netgroups for a user. The client setup is quite simple. To configure the server - war, you only have to start - &man.vipw.8; and replace the line + war, you only have to start + &man.vipw.8; and replace the line +::::::::: @@ -2210,9 +2245,9 @@ +@IT_EMP::::::::: Now, only the data for the users defined in the netgroup - IT_EMP is imported into - war's password database and only - these users are allowed to login. + IT_EMP is imported into + war's password database and only + these users are allowed to login. Unfortunately, this limitation also applies to the ~ function of the shell and all routines @@ -2227,97 +2262,97 @@ servers. This can be achieved by adding another line to - /etc/master.passwd. This line should - contain: + /etc/master.passwd. This line should + contain: +:::::::::/sbin/nologin, meaning - Import all entries but replace the shell with - /sbin/nologin in the imported - entries. You can replace any field in the - passwd entry by placing a default value in - your /etc/master.passwd. + Import all entries but replace the shell with + /sbin/nologin in the imported + entries. You can replace any field in the + passwd entry by placing a default value in + your /etc/master.passwd. - Make sure that the line - +:::::::::/sbin/nologin is placed after - +@IT_EMP:::::::::. Otherwise, all user - accounts imported from NIS will have /sbin/nologin as their - login shell. + Make sure that the line + +:::::::::/sbin/nologin is placed after + +@IT_EMP:::::::::. Otherwise, all user + accounts imported from NIS will have /sbin/nologin as their + login shell. After this change, you will only have to change one NIS - map if a new employee joins the IT department. You could use - a similar approach for the less important servers by replacing - the old +::::::::: in their local version - of /etc/master.passwd with something like - this: + map if a new employee joins the IT department. You could use + a similar approach for the less important servers by replacing + the old +::::::::: in their local version + of /etc/master.passwd with something like + this: +@IT_EMP::::::::: +@IT_APP::::::::: +:::::::::/sbin/nologin The corresponding lines for the normal workstations - could be: + could be: +@IT_EMP::::::::: +@USERS::::::::: +:::::::::/sbin/nologin And everything would be fine until there is a policy - change a few weeks later: The IT department starts hiring - interns. The IT interns are allowed to use the normal - workstations and the less important servers; and the IT - apprentices are allowed to login onto the main servers. You - add a new netgroup IT_INTERN, add the new - IT interns to this netgroup and start to change the - configuration on each and every machine... As the old saying - goes: Errors in centralized planning lead to global - mess. + change a few weeks later: The IT department starts hiring + interns. The IT interns are allowed to use the normal + workstations and the less important servers; and the IT + apprentices are allowed to login onto the main servers. You + add a new netgroup IT_INTERN, add the new + IT interns to this netgroup and start to change the + configuration on each and every machine... As the old saying + goes: Errors in centralized planning lead to global + mess. NIS' ability to create netgroups from other netgroups can - be used to prevent situations like these. One possibility - is the creation of role-based netgroups. For example, you - could create a netgroup called - BIGSRV to define the login - restrictions for the important servers, another netgroup - called SMALLSRV for the less - important servers and a third netgroup called - USERBOX for the normal - workstations. Each of these netgroups contains the netgroups - that are allowed to login onto these machines. The new - entries for your NIS map netgroup should look like this: + be used to prevent situations like these. One possibility + is the creation of role-based netgroups. For example, you + could create a netgroup called + BIGSRV to define the login + restrictions for the important servers, another netgroup + called SMALLSRV for the less + important servers and a third netgroup called + USERBOX for the normal + workstations. Each of these netgroups contains the netgroups + that are allowed to login onto these machines. The new + entries for your NIS map netgroup should look like this: BIGSRV IT_EMP IT_APP SMALLSRV IT_EMP IT_APP ITINTERN USERBOX IT_EMP ITINTERN USERS This method of defining login restrictions works - reasonably well if you can define groups of machines with - identical restrictions. Unfortunately, this is the exception - and not the rule. Most of the time, you will need the ability - to define login restrictions on a per-machine basis. + reasonably well if you can define groups of machines with + identical restrictions. Unfortunately, this is the exception + and not the rule. Most of the time, you will need the ability + to define login restrictions on a per-machine basis. Machine-specific netgroup definitions are the other - possibility to deal with the policy change outlined above. In - this scenario, the /etc/master.passwd of - each box contains two lines starting with +. - The first of them adds a netgroup with the accounts allowed to - login onto this machine, the second one adds all other - accounts with /sbin/nologin as shell. It - is a good idea to use the ALL-CAPS version of - the machine name as the name of the netgroup. In other words, - the lines should look like this: + possibility to deal with the policy change outlined above. In + this scenario, the /etc/master.passwd of + each box contains two lines starting with +. + The first of them adds a netgroup with the accounts allowed to + login onto this machine, the second one adds all other + accounts with /sbin/nologin as shell. It + is a good idea to use the ALL-CAPS version of + the machine name as the name of the netgroup. In other words, + the lines should look like this: +@BOXNAME::::::::: +:::::::::/sbin/nologin Once you have completed this task for all your machines, - you will not have to modify the local versions of - /etc/master.passwd ever again. All - further changes can be handled by modifying the NIS map. Here - is an example of a possible netgroup map for this - scenario with some additional goodies: + you will not have to modify the local versions of + /etc/master.passwd ever again. All + further changes can be handled by modifying the NIS map. Here + is an example of a possible netgroup map for this + scenario with some additional goodies: # Define groups of users first IT_EMP (,alpha,test-domain) (,beta,test-domain) @@ -2356,60 +2391,60 @@ # [...more groups to follow] If you are using some kind of database to manage your user - accounts, you should be able to create the first part of the - map with your database's report tools. This way, new users - will automatically have access to the boxes. + accounts, you should be able to create the first part of the + map with your database's report tools. This way, new users + will automatically have access to the boxes. One last word of caution: It may not always be advisable - to use machine-based netgroups. If you are deploying a couple of - dozen or even hundreds of identical machines for student labs, - you should use role-based netgroups instead of machine-based - netgroups to keep the size of the NIS map within reasonable - limits. + to use machine-based netgroups. If you are deploying a couple of + dozen or even hundreds of identical machines for student labs, + you should use role-based netgroups instead of machine-based + netgroups to keep the size of the NIS map within reasonable + limits. Important Things to Remember There are still a couple of things that you will need to do - differently now that you are in an NIS environment. + differently now that you are in an NIS environment. - - Every time you wish to add a user to the lab, you - must add it to the master NIS server only, - and you must remember to rebuild the NIS - maps. If you forget to do this, the new user will - not be able to login anywhere except on the NIS master. - For example, if we needed to add a new user - jsmith to the lab, we would: + + Every time you wish to add a user to the lab, you + must add it to the master NIS server only, + and you must remember to rebuild the NIS + maps. If you forget to do this, the new user will + not be able to login anywhere except on the NIS master. + For example, if we needed to add a new user + jsmith to the lab, we would: - &prompt.root; pw useradd jsmith + &prompt.root; pw useradd jsmith &prompt.root; cd /var/yp &prompt.root; make test-domain - You could also run adduser jsmith instead - of pw useradd jsmith. - - - Keep the administration accounts out of the - NIS maps. You do not want to be propagating - administrative accounts and passwords to machines that - will have users that should not have access to those - accounts. - - - Keep the NIS master and slave secure, and - minimize their downtime. If somebody either - hacks or simply turns off these machines, they have - effectively rendered many people without the ability to - login to the lab. + You could also run adduser jsmith instead + of pw useradd jsmith. + + + Keep the administration accounts out of the + NIS maps. You do not want to be propagating + administrative accounts and passwords to machines that + will have users that should not have access to those + accounts. + + + Keep the NIS master and slave secure, and + minimize their downtime. If somebody either + hacks or simply turns off these machines, they have + effectively rendered many people without the ability to + login to the lab. - This is the chief weakness of any centralized administration - system. If you do - not protect your NIS servers, you will have a lot of angry - users! - + This is the chief weakness of any centralized administration + system. If you do + not protect your NIS servers, you will have a lot of angry + users! + @@ -2453,8 +2488,8 @@ You can force a host to bind to a particular server by running ypbind with the flag. If you do not want to do this manually each time you - reboot your NIS server, you can add the following lines to - your /etc/rc.conf: + reboot your NIS server, you can add the following lines to + your /etc/rc.conf: nis_client_enable="YES" # run client stuff as well nis_client_flags="-S NIS domain,server" @@ -2465,7 +2500,7 @@ Password Formats - NIS + NIS password formats One of the most common issues that people run into when trying @@ -2497,11 +2532,13 @@ &prompt.root; cap_mkdb /etc/login.conf - The format of passwords already in - /etc/master.passwd will not be updated - until a user changes his password for the first time - after the login capability database is - rebuilt. + + The format of passwords already in + /etc/master.passwd will not be updated + until a user changes his password for the first time + after the login capability database is + rebuilt. + Next, in order to ensure that passwords are encrypted with the format that you have chosen, you should also check that @@ -2527,11 +2564,11 @@ - - Greg - Sutter + + Greg + Sutter Written by - + Automatic Network Configuration (DHCP) @@ -2539,16 +2576,16 @@ What Is DHCP? - Dynamic Host Configuration Protocol - DHCP + Dynamic Host Configuration Protocol + DHCP - Internet Systems Consortium (ISC) + Internet Systems Consortium (ISC) DHCP, the Dynamic Host Configuration Protocol, describes - the means by which a system can connect to a network and obtain the - necessary information for communication upon that network. FreeBSD + the means by which a system can connect to a network and obtain the + necessary information for communication upon that network. FreeBSD uses the OpenBSD dhclient taken from OpenBSD 3.7. All information here regarding dhclient is for @@ -2559,20 +2596,23 @@ What This Section Covers - This section describes both the client-side components of the ISC and OpenBSD DHCP client and - server-side components of the ISC DHCP system. The - client-side program, dhclient, comes - integrated within FreeBSD, and the server-side portion is - available from the net/isc-dhcp31-server port. The - &man.dhclient.8;, &man.dhcp-options.5;, and - &man.dhclient.conf.5; manual pages, in addition to the - references below, are useful resources. + This section describes both the client-side components + of the ISC and OpenBSD DHCP client and + server-side components of the ISC DHCP system. The + client-side program, dhclient, comes + integrated within FreeBSD, and the server-side portion is + available from the net/isc-dhcp31-server port. The + &man.dhclient.8;, &man.dhcp-options.5;, and + &man.dhclient.conf.5; manual pages, in addition to the + references below, are useful resources. How It Works - UDP + + UDP + When dhclient, the DHCP client, is executed on the client machine, it begins broadcasting requests for configuration information. By default, these @@ -2586,132 +2626,136 @@ network can be automatically reclaimed. DHCP clients can obtain a great deal of information from - the server. An exhaustive list may be found in - &man.dhcp-options.5;. + the server. An exhaustive list may be found in + &man.dhcp-options.5;. FreeBSD Integration &os; fully integrates the OpenBSD DHCP client, - dhclient. DHCP client support is provided - within both the installer and the base system, obviating the need - for detailed knowledge of network configurations on any network - that runs a DHCP server. - - sysinstall - + dhclient. DHCP client support is provided + within both the installer and the base system, obviating the need + for detailed knowledge of network configurations on any network + that runs a DHCP server. + + sysinstall + - DHCP is supported by - sysinstall. When configuring a - network interface within - sysinstall, the second question - asked is: Do you want to try DHCP configuration of - the interface?. Answering affirmatively will - execute dhclient, and if successful, will - fill in the network configuration information - automatically. + DHCP is supported by + sysinstall. When configuring a + network interface within + sysinstall, the second question + asked is: Do you want to try DHCP configuration of + the interface?. Answering affirmatively will + execute dhclient, and if successful, will + fill in the network configuration information + automatically. - There are two things you must do to have your system use - DHCP upon startup: - - DHCP - requirements - - - - Make sure that the bpf - device is compiled into your kernel. To do this, add - device bpf to your kernel - configuration file, and rebuild the kernel. For more - information about building kernels, see . The - bpf device is already part of - the GENERIC kernel that is supplied - with FreeBSD, so if you do not have a custom kernel, you - should not need to create one in order to get DHCP - working. - - For those who are particularly security conscious, - you should be warned that bpf - is also the device that allows packet sniffers to work - correctly (although they still have to be run as - root). bpf - is required to use DHCP, but if - you are very sensitive about security, you probably - should not add bpf to your - kernel in the expectation that at some point in the - future you will be using DHCP. - - - - Edit your /etc/rc.conf to - include the following: + There are two things you must do to have your system use + DHCP upon startup: + + DHCP + requirements + + + + Make sure that the bpf + device is compiled into your kernel. To do this, add + device bpf to your kernel + configuration file, and rebuild the kernel. For more + information about building kernels, see . The + bpf device is already part of + the GENERIC kernel that is supplied + with FreeBSD, so if you do not have a custom kernel, you + should not need to create one in order to get DHCP + working. + + For those who are particularly security conscious, + you should be warned that bpf + is also the device that allows packet sniffers to work + correctly (although they still have to be run as + root). bpf + is required to use DHCP, but if + you are very sensitive about security, you probably + should not add bpf to your + kernel in the expectation that at some point in the + future you will be using DHCP. + + + + Edit your /etc/rc.conf to + include the following: - ifconfig_fxp0="DHCP" + ifconfig_fxp0="DHCP" - - Be sure to replace fxp0 with the - designation for the interface that you wish to dynamically - configure, as described in - . - + + Be sure to replace fxp0 with the + designation for the interface that you wish to dynamically + configure, as described in + . + - If you are using a different location for - dhclient, or if you wish to pass additional - flags to dhclient, also include the - following (editing as necessary): + If you are using a different location for + dhclient, or if you wish to pass additional + flags to dhclient, also include the + following (editing as necessary): - dhclient_program="/sbin/dhclient" + dhclient_program="/sbin/dhclient" dhclient_flags="" - - + + - - DHCP - server - - The DHCP server, dhcpd, is included - as part of the net/isc-dhcp31-server port in the ports - collection. This port contains the ISC DHCP server and - documentation. + + DHCP + server + + The DHCP server, dhcpd, is included + as part of the net/isc-dhcp31-server port in the ports + collection. This port contains the ISC DHCP server and + documentation. Files - DHCP - configuration files + DHCP + configuration files - /etc/dhclient.conf - dhclient requires a configuration file, - /etc/dhclient.conf. Typically the file - contains only comments, the defaults being reasonably sane. This - configuration file is described by the &man.dhclient.conf.5; - manual page. - + + /etc/dhclient.conf + dhclient requires a configuration file, + /etc/dhclient.conf. Typically the file + contains only comments, the defaults being reasonably sane. This + configuration file is described by the &man.dhclient.conf.5; + manual page. + - /sbin/dhclient - dhclient is statically linked and - resides in /sbin. The &man.dhclient.8; - manual page gives more information about - dhclient. - + + /sbin/dhclient + dhclient is statically linked and + resides in /sbin. The &man.dhclient.8; + manual page gives more information about + dhclient. + - /sbin/dhclient-script - dhclient-script is the FreeBSD-specific - DHCP client configuration script. It is described in - &man.dhclient-script.8;, but should not need any user - modification to function properly. - + + /sbin/dhclient-script + dhclient-script is the FreeBSD-specific + DHCP client configuration script. It is described in + &man.dhclient-script.8;, but should not need any user + modification to function properly. + - /var/db/dhclient.leases - The DHCP client keeps a database of valid leases in this - file, which is written as a log. &man.dhclient.leases.5; - gives a slightly longer description. - + + /var/db/dhclient.leases + The DHCP client keeps a database of valid leases in this + file, which is written as a log. &man.dhclient.leases.5; + gives a slightly longer description. + @@ -2719,9 +2763,9 @@ Further Reading The DHCP protocol is fully described in - RFC 2131. - An informational resource has also been set up at - . + RFC 2131. + An informational resource has also been set up at + . @@ -2761,18 +2805,18 @@ supplied with FreeBSD, so you do not need to create a custom kernel in order to get DHCP working. - - Those who are particularly security conscious - should note that bpf - is also the device that allows packet sniffers to work - correctly (although such programs still need privileged - access). bpf - is required to use DHCP, but if - you are very sensitive about security, you probably - should not include bpf in your - kernel purely because you expect to use DHCP at some - point in the future. - + + Those who are particularly security conscious + should note that bpf + is also the device that allows packet sniffers to work + correctly (although such programs still need privileged + access). bpf + is required to use DHCP, but if + you are very sensitive about security, you probably + should not include bpf in your + kernel purely because you expect to use DHCP at some + point in the future. + The next thing that you will need to do is edit the sample dhcpd.conf which was installed by the @@ -2909,7 +2953,8 @@ configuration files - /usr/local/sbin/dhcpd + + /usr/local/sbin/dhcpd dhcpd is statically linked and resides in /usr/local/sbin. The &man.dhcpd.8; manual page installed with the @@ -2917,7 +2962,8 @@ dhcpd. - /usr/local/etc/dhcpd.conf + + /usr/local/etc/dhcpd.conf dhcpd requires a configuration file, /usr/local/etc/dhcpd.conf before it will start providing service to clients. This file needs to @@ -2928,14 +2974,16 @@ by the port. - /var/db/dhcpd.leases + + /var/db/dhcpd.leases The DHCP server keeps a database of leases it has issued in this file, which is written as a log. The manual page &man.dhcpd.leases.5;, installed by the port gives a slightly longer description. - /usr/local/sbin/dhcrelay + + /usr/local/sbin/dhcrelay dhcrelay is used in advanced environments where one DHCP server forwards a request from a client to another DHCP server on a separate network. If you @@ -2954,11 +3002,11 @@ - - Chern - Lee - Contributed by - + + Chern + Lee + Contributed by + Tom @@ -2975,7 +3023,9 @@ Overview - BIND + + BIND + &os; utilizes, by default, a version of BIND (Berkeley Internet Name Domain), which is the most common implementation @@ -2997,7 +3047,9 @@ installation provides enhanced security features, a new file system layout and automated &man.chroot.8; configuration. - DNS + + DNS + DNS is coordinated across the Internet through a somewhat complex system of authoritative root, Top Level Domain (TLD), and other smaller-scale @@ -3015,9 +3067,15 @@ To understand this document, some terms related to DNS must be understood. - resolver - reverse DNS - root zone + + resolver + + + reverse DNS + + + root zone + @@ -3246,8 +3304,8 @@ &prompt.root; /etc/rc.d/named onestart To ensure the named daemon is - started at boot each time, put the following line into the - /etc/rc.conf: + started at boot each time, put the following line into the + /etc/rc.conf: named_enable="YES" @@ -3666,63 +3724,74 @@ ; Aliases www IN CNAME example.org. - Note that every hostname ending in a . is an - exact hostname, whereas everything without a trailing - . is relative to the origin. For example, - ns1 is translated into - ns1.example.org. + Note that every hostname ending in a . is an + exact hostname, whereas everything without a trailing + . is relative to the origin. For example, + ns1 is translated into + ns1.example.org. - The format of a zone file follows: + The format of a zone file follows: - recordname IN recordtype value + recordname IN recordtype value DNS records - The most commonly used DNS records: + The most commonly used DNS records: SOA - start of zone authority + + start of zone authority + NS - an authoritative name server + + an authoritative name server + A - a host address + + a host address + CNAME - the canonical name for an alias + + the canonical name for an alias + MX - mail exchanger + + mail exchanger + PTR - a domain name pointer (used in reverse DNS) - + + a domain name pointer (used in reverse DNS) + - example.org. IN SOA ns1.example.org. admin.example.org. ( + example.org. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial 10800 ; Refresh after 3 hours 3600 ; Retry after 1 hour @@ -3777,62 +3846,61 @@ - IN NS ns1.example.org. + IN NS ns1.example.org. - This is an NS entry. Every name server that is going to reply - authoritatively for the zone must have one of these entries. + This is an NS entry. Every name server that is going to reply + authoritatively for the zone must have one of these entries. - localhost IN A 127.0.0.1 + localhost IN A 127.0.0.1 ns1 IN A 192.168.1.2 ns2 IN A 192.168.1.3 mx IN A 192.168.1.4 mail IN A 192.168.1.5 - The A record indicates machine names. As seen above, - ns1.example.org would resolve - to 192.168.1.2. + The A record indicates machine names. As seen above, + ns1.example.org would resolve + to 192.168.1.2. - IN A 192.168.1.1 + IN A 192.168.1.1 This line assigns IP address 192.168.1.1 to the current origin, in this case example.org. - www IN CNAME @ + www IN CNAME @ - The canonical name record is usually used for giving aliases - to a machine. In the example, www is - aliased to the master machine whose name happens - to be the same as the domain name - example.org - (192.168.1.1). - CNAMEs can never be used together with another kind of record + The canonical name record is usually used for giving aliases + to a machine. In the example, www is + aliased to the master machine whose name happens + to be the same as the domain name + example.org + (192.168.1.1). + CNAMEs can never be used together with another kind of record for the same hostname. MX record - IN MX 10 mail.example.org. + IN MX 10 mail.example.org. - The MX record indicates which mail - servers are responsible for handling incoming mail for the - zone. mail.example.org is the - hostname of a mail server, and 10 is the priority of - that mail server. + The MX record indicates which mail + servers are responsible for handling incoming mail for the + zone. mail.example.org is the + hostname of a mail server, and 10 is the priority of + that mail server. - One can have several mail servers, with priorities of 10, - 20 and so on. A mail server attempting to deliver to example.org would first try the - highest priority MX (the record with the lowest priority + One can have several mail servers, with priorities of 10, + 20 and so on. A mail server attempting to deliver to example.org would first try the + highest priority MX (the record with the lowest priority number), then the second highest, etc, until the mail can be properly delivered. - For in-addr.arpa zone files (reverse DNS), the same format is - used, except with PTR entries instead of - A or CNAME. + For in-addr.arpa zone files (reverse DNS), the same format is + used, except with PTR entries instead of A or CNAME. - $TTL 3600 + $TTL 3600 1.168.192.in-addr.arpa. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial @@ -3850,8 +3918,8 @@ 4 IN PTR mx.example.org. 5 IN PTR mail.example.org. - This file gives the proper IP address to hostname - mappings for the above fictitious domain. + This file gives the proper IP address to hostname + mappings for the above fictitious domain. It is worth noting that all names on the right side of a PTR record need to be fully qualified (i.e., end in @@ -3862,60 +3930,60 @@ Caching Name Server - BIND - caching name server + BIND + caching name server A caching name server is a name server whose primary role is to resolve recursive queries. It simply asks queries of its - own, and remembers the answers for later use. + own, and remembers the answers for later use. <acronym - role="Doman Name Security Extensions">DNSSEC</acronym> + role="Doman Name Security Extensions">DNSSEC - BIND - DNS security extensions + BIND + DNS security extensions Domain Name System Security Extensions, or DNSSEC for short, is a - suite of specifications to protect resolving name servers from forged - DNS data, such as spoofed DNS - records. By using digital signatures, a resolver can verify the - integrity of the record. Note that DNSSEC only provides - integrity via digitally signing the Resource Records (RRs). It provides neither - confidentiality nor protection against false end-user assumptions. - This means that it cannot protect against people going to example.net instead of example.com. The only thing - DNSSEC does is authenticate that the data has not - been compromised in transit. The security of DNS is - an important step in securing the Internet in general. For more - in-depth details of how DNSSEC works, the relevant - RFCs are a good place to start. See the list in - . + role="Domain Name Security Extensions">DNSSEC for short, is a + suite of specifications to protect resolving name servers from forged + DNS data, such as spoofed DNS + records. By using digital signatures, a resolver can verify the + integrity of the record. Note that DNSSEC only provides + integrity via digitally signing the Resource Records (RRs). It provides neither + confidentiality nor protection against false end-user assumptions. + This means that it cannot protect against people going to example.net instead of example.com. The only thing + DNSSEC does is authenticate that the data has not + been compromised in transit. The security of DNS is + an important step in securing the Internet in general. For more + in-depth details of how DNSSEC works, the relevant + RFCs are a good place to start. See the list in + . The following sections will demonstrate how to enable - DNSSEC for an authoritative DNS - server and a recursive (or caching) DNS server - running BIND 9. While all versions of - BIND 9 support DNSSEC, it is - necessary to have at least version 9.6.2 in order to be able to use the - signed root zone when validating DNS queries. This - is because earlier versions lack the required algorithms to enable - validation using the root zone key. It is strongly recommended to use - the latest version of BIND 9.7 or later to take - advantage of automatic key updating for the root key, as well as other - features to automatically keep zones signed and signatures up to date. - Where configurations differ between 9.6.2 and 9.7 and later, - differences will be pointed out. + DNSSEC for an authoritative DNS + server and a recursive (or caching) DNS server + running BIND 9. While all versions of + BIND 9 support DNSSEC, it is + necessary to have at least version 9.6.2 in order to be able to use the + signed root zone when validating DNS queries. This + is because earlier versions lack the required algorithms to enable + validation using the root zone key. It is strongly recommended to use + the latest version of BIND 9.7 or later to take + advantage of automatic key updating for the root key, as well as other + features to automatically keep zones signed and signatures up to date. + Where configurations differ between 9.6.2 and 9.7 and later, + differences will be pointed out. - Recursive <acronym>DNS</acronym> server configuration + Recursive <acronym>DNS</acronym> server configuration Enabling DNSSEC validation of queries performed by a recursive DNS server requires a few @@ -3959,8 +4027,7 @@ role="Key Signing Key">KSK). The second key, with value 256, is a subordinate key, commonly called a Zone Signing Key (ZSK). More on the - different key types later in the . + different key types later in . Now the key must be verified and formatted so that BIND can use it. To verify the key, generate a @@ -4202,8 +4269,8 @@ Security Although BIND is the most common implementation of DNS, - there is always the issue of security. Possible and - exploitable security holes are sometimes found. + there is always the issue of security. Possible and + exploitable security holes are sometimes found. While &os; automatically drops @@ -4228,8 +4295,8 @@ Further Reading BIND/named manual pages: - &man.rndc.8; &man.named.8; &man.named.conf.5; &man.nsupdate.8; - &man.dnssec-signzone.8; &man.dnssec-keygen.8; + &man.rndc.8; &man.named.8; &man.named.conf.5; &man.nsupdate.8; + &man.dnssec-signzone.8; &man.dnssec-keygen.8; @@ -4243,8 +4310,8 @@ - O'Reilly - DNS and BIND 5th Edition + O'Reilly + DNS and BIND 5th Edition @@ -4290,9 +4357,9 @@ - RFC 5011 - - Automated Updates of DNS Security (DNSSEC - Trust Anchors + RFC 5011 + - Automated Updates of DNS Security (DNSSEC + Trust Anchors @@ -4310,40 +4377,48 @@ Apache HTTP Server - web servers - setting up - Apache + + web servers + setting up + + + Apache + Overview &os; is used to run some of the busiest web sites in the - world. The majority of web servers on the Internet are using - the Apache HTTP Server. - Apache software packages should be - included on your FreeBSD installation media. If you did not - install Apache when you first - installed FreeBSD, then you can install it from the www/apache13 or www/apache22 port. + world. The majority of web servers on the Internet are using + the Apache HTTP Server. + Apache software packages should be + included on your FreeBSD installation media. If you did not + install Apache when you first + installed FreeBSD, then you can install it from the www/apache13 or www/apache22 port. Once Apache has been installed - successfully, it must be configured. + successfully, it must be configured. - This section covers version 1.3.X of the - Apache HTTP Server as that is the - most widely used version for &os;. Apache 2.X introduces many - new technologies but they are not discussed here. For more - information about Apache 2.X, please see . + + This section covers version 1.3.X of the + Apache HTTP Server as that is the + most widely used version for &os;. Apache 2.X introduces many + new technologies but they are not discussed here. For more + information about Apache 2.X, please see . + Configuration - Apache - configuration file + + Apache + configuration file + The main Apache HTTP Server configuration file is installed as @@ -4421,17 +4496,19 @@ Running <application>Apache</application> - Apache - starting or stopping + + Apache + starting or stopping + Apache does not run from the - inetd super server as many other - network servers do. It is configured to run standalone for - better performance for incoming HTTP requests from client web - browsers. A shell script wrapper is included to make - starting, stopping, and restarting the server as simple as - possible. To start up Apache for - the first time, just run: + inetd super server as many other + network servers do. It is configured to run standalone for + better performance for incoming HTTP requests from client web + browsers. A shell script wrapper is included to make + starting, stopping, and restarting the server as simple as + possible. To start up Apache for + the first time, just run: &prompt.root; /usr/local/sbin/apachectl start @@ -4440,7 +4517,7 @@ &prompt.root; /usr/local/sbin/apachectl stop After making changes to the configuration file for any - reason, you will need to restart the server: + reason, you will need to restart the server: &prompt.root; /usr/local/sbin/apachectl restart @@ -4453,8 +4530,8 @@ &man.apachectl.8; manual page. To launch Apache at system - startup, add the following line to - /etc/rc.conf: + startup, add the following line to + /etc/rc.conf: apache_enable="YES" @@ -4471,10 +4548,10 @@ apache_flags="" Now that the web server is running, you can view your web - site by pointing a web browser to - http://localhost/. The default web page - that is displayed is - /usr/local/www/data/index.html. + site by pointing a web browser to + http://localhost/. The default web page + that is displayed is + /usr/local/www/data/index.html. @@ -4488,16 +4565,16 @@ different domains to share the same IP address. To setup Apache to use - Name-based Virtual Hosting add an entry like the following to - your httpd.conf: + Name-based Virtual Hosting add an entry like the following to + your httpd.conf: NameVirtualHost * - If your webserver was named www.domain.tld and - you wanted to setup a virtual domain for - www.someotherdomain.tld then you would add - the following entries to - httpd.conf: + If your webserver was named www.domain.tld + and you wanted to setup a virtual domain for + www.someotherdomain.tld then you would add + the following entries to + httpd.conf: <VirtualHost *> ServerName www.domain.tld @@ -4510,41 +4587,50 @@ </VirtualHost> Replace the addresses with the addresses you want to use - and the path to the documents with what you are using. + and the path to the documents with what you are using. For more information about setting up virtual hosts, - please consult the official Apache - documentation at: . + please consult the official Apache + documentation at: . Apache Modules - Apache - modules + + Apache + modules + - There are many different Apache modules available to add - functionality to the basic server. The FreeBSD Ports - Collection provides an easy way to install - Apache together with some of the - more popular add-on modules. + There are many different Apache + modules available to add + functionality to the basic server. The FreeBSD Ports + Collection provides an easy way to install + Apache together with some of the + more popular add-on modules. - mod_ssl + mod_ssl - web servers - secure - SSL - cryptography + + web servers + secure + + + SSL + + + cryptography + - The mod_ssl module uses the OpenSSL library to provide - strong cryptography via the Secure Sockets Layer (SSL v2/v3) - and Transport Layer Security (TLS v1) protocols. This - module provides everything necessary to request a signed - certificate from a trusted certificate signing authority so - that you can run a secure web server on &os;. + The mod_ssl module uses the OpenSSL library to provide + strong cryptography via the Secure Sockets Layer (SSL v2/v3) + and Transport Layer Security (TLS v1) protocols. This + module provides everything necessary to request a signed + certificate from a trusted certificate signing authority so + that you can run a secure web server on &os;. If you have not yet installed Apache, then a version of Apache @@ -4560,61 +4646,67 @@ - Language Bindings + Language Bindings - There are Apache modules for most major scripting - languages. These modules typically make it possible to - write Apache modules entirely in - a scripting language. They are also often used as a - persistent interpreter embedded into the server that avoids - the overhead of starting an external interpreter and the - startup-time penalty for dynamic websites, as described in - the next section. + There are Apache modules for most major scripting + languages. These modules typically make it possible to + write Apache modules entirely in + a scripting language. They are also often used as a + persistent interpreter embedded into the server that avoids + the overhead of starting an external interpreter and the + startup-time penalty for dynamic websites, as described in + the next section. Dynamic Websites - web servers - dynamic + + web servers + dynamic + In the last decade, more businesses have turned to the - Internet in order to enhance their revenue and increase - exposure. This has also increased the need for interactive - web content. While some companies, such as µsoft;, - have introduced solutions into their proprietary products, - the open source community answered the call. Modern options - for dynamic web content include Django, Ruby on Rails, - mod_perl, and - mod_php. + Internet in order to enhance their revenue and increase + exposure. This has also increased the need for interactive + web content. While some companies, such as µsoft;, + have introduced solutions into their proprietary products, + the open source community answered the call. Modern options + for dynamic web content include Django, Ruby on Rails, + mod_perl, and + mod_php. - Django + Django - Python - Django + + Python + + + Django + - Django is a BSD licensed framework designed to allow - developers to write high performance, elegant web - applications quickly. It provides an object-relational - mapper so that data types are developed as Python objects, - and a rich dynamic database-access API is provided for those - objects without the developer ever having to write SQL. It - also provides an extensible template system so that the - logic of the application is separated from the HTML - presentation. + Django is a BSD licensed framework designed to allow + developers to write high performance, elegant web + applications quickly. It provides an object-relational + mapper so that data types are developed as Python objects, + and a rich dynamic database-access API is provided for those + objects without the developer ever having to write SQL. It + also provides an extensible template system so that the + logic of the application is separated from the HTML + presentation. - Django depends on mod_python, - Apache, and an SQL database - engine of your choice. The FreeBSD Port will install all of - these pre-requisites for you with the appropriate flags. + Django depends on mod_python, + Apache, and an SQL database + engine of your choice. The FreeBSD Port will install all of + these pre-requisites for you with the appropriate flags. Installing Django with Apache2, mod_python3, and PostgreSQL &prompt.root; cd /usr/ports/www/py-django; make all install clean -DWITH_MOD_PYTHON3 -DWITH_POSTGRESQL - + Once Django and these pre-requisites are installed, you will need to create a Django project directory and then @@ -4624,12 +4716,12 @@ Apache Configuration for Django/mod_python - You will need to add a line to the apache - httpd.conf file to configure Apache - to pass requests for certain URLs to your web - application: + You will need to add a line to the apache + httpd.conf file to configure Apache + to pass requests for certain URLs to your web + application: - <Location "/"> + <Location "/"> SetHandler python-program PythonPath "['/dir/to/your/django/packages/'] + sys.path" PythonHandler django.core.handlers.modpython @@ -4641,9 +4733,11 @@ - Ruby on Rails + Ruby on Rails - Ruby on Rails + + Ruby on Rails + Ruby on Rails is another open source web framework that provides a full development stack and is optimized to make @@ -4651,18 +4745,18 @@ powerful applications quickly. It can be installed easily from the ports system. - &prompt.root; cd /usr/ports/www/rubygem-rails; make all install clean + &prompt.root; cd /usr/ports/www/rubygem-rails; make all install clean - mod_perl + mod_perl - mod_perl - Perl - + mod_perl + Perl + - The Apache/Perl integration project brings together the + The Apache/Perl integration project brings together the full power of the Perl programming language and the Apache HTTP Server. With the mod_perl module it is possible to write Apache modules entirely in Perl. In addition, the @@ -4670,22 +4764,22 @@ overhead of starting an external interpreter and the penalty of Perl start-up time. - mod_perl is available a few - different ways. To use mod_perl - remember that mod_perl 1.0 only - works with Apache 1.3 and - mod_perl 2.0 only works with - Apache 2.X. - mod_perl 1.0 is available in - www/mod_perl and a - statically compiled version is available in - www/apache13-modperl. - mod_perl 2.0 is available in - www/mod_perl2. - + mod_perl is available a few + different ways. To use mod_perl + remember that mod_perl 1.0 only + works with Apache 1.3 and + mod_perl 2.0 only works with + Apache 2.X. + mod_perl 1.0 is available in + www/mod_perl and a + statically compiled version is available in + www/apache13-modperl. + mod_perl 2.0 is available in + www/mod_perl2. + - - + + Tom @@ -4693,21 +4787,21 @@ Written by - - mod_php + + mod_php - mod_php - PHP - + mod_php + PHP + PHP, also known as PHP: - Hypertext Preprocessor is a general-purpose scripting - language that is especially suited for Web development. - Capable of being embedded into HTML its - syntax draws upon C, &java;, and Perl with the intention of - allowing web developers to write dynamically generated - webpages quickly. + Hypertext Preprocessor is a general-purpose scripting + language that is especially suited for Web development. + Capable of being embedded into HTML its + syntax draws upon C, &java;, and Perl with the intention of + allowing web developers to write dynamically generated + webpages quickly. To gain support for PHP5 for the Apache web server, begin by @@ -4745,13 +4839,13 @@ This will install and configure the modules required - to support dynamic PHP applications. Check - to ensure the following sections have been added to + to support dynamic PHP applications. Check + to ensure the following sections have been added to /usr/local/etc/apache/httpd.conf: LoadModule php5_module libexec/apache/libphp5.so - AddModule mod_php5.c + AddModule mod_php5.c <IfModule mod_php5.c> DirectoryIndex index.php index.html </IfModule> @@ -4760,10 +4854,10 @@ AddType application/x-httpd-php-source .phps </IfModule> - Once completed, a simple call to the - apachectl command for a graceful - restart is needed to load the PHP - module: + Once completed, a simple call to the + apachectl command for a graceful + restart is needed to load the PHP + module: &prompt.root; apachectl graceful @@ -4772,27 +4866,24 @@ the selected OPTIONS are saved automatically by the &os; Ports framework. - The PHP support in &os; is extremely - modular so the base install is very limited. It is very easy - to add support using the - lang/php5-extensions port. - This port provides a menu driven interface to - PHP extension installation. - Alternatively, individual extensions can be installed using - the appropriate port. + The PHP support in &os; is extremely + modular so the base install is very limited. It is very easy + to add support using the + lang/php5-extensions port. + This port provides a menu driven interface to + PHP extension installation. + Alternatively, individual extensions can be installed using + the appropriate port. For instance, to add support for the MySQL database server to PHP5, simply install the port databases/php5-mysql. - - After installing an extension, the - Apache server must be reloaded to - pick up the new configuration changes: + + After installing an extension, the + Apache server must be reloaded to + pick up the new configuration changes: &prompt.root; apachectl graceful @@ -4811,7 +4902,9 @@ File Transfer Protocol (FTP) - FTP servers + + FTP servers + Overview @@ -4874,16 +4967,16 @@ for anonymous users. Once the FTP server has been configured properly, it must - be enabled in /etc/inetd.conf. All that - is required here is to remove the comment symbol - # from in front of the existing - ftpd line : + be enabled in /etc/inetd.conf. All that + is required here is to remove the comment symbol + # from in front of the existing + ftpd line : ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l As explained in , - the inetd configuration must be reloaded - after this configuration file is changed. Please refer to + the inetd configuration must be reloaded + after this configuration file is changed. Please refer to for details on enabling inetd on your system. @@ -4909,16 +5002,20 @@ Maintaining - syslog - log files - FTP + + syslog + + + log files + FTP + The ftpd daemon uses - &man.syslog.3; to log messages. By default, the system log - daemon will put messages related to FTP in the - /var/log/xferlog file. The location of - the FTP log can be modified by changing the following line in - /etc/syslog.conf: + &man.syslog.3; to log messages. By default, the system log + daemon will put messages related to FTP in the + /var/log/xferlog file. The location of + the FTP log can be modified by changing the following line in + /etc/syslog.conf: ftp.info /var/log/xferlog @@ -4928,13 +5025,13 @@ Be aware of the potential problems involved with running - an anonymous FTP server. In particular, you should think - twice about allowing anonymous users to upload files. You may - find that your FTP site becomes a forum for the trade of - unlicensed commercial software or worse. If you do need to - allow anonymous FTP uploads, then you should set up the - permissions so that these files can not be read by other - anonymous users until they have been reviewed. + an anonymous FTP server. In particular, you should think + twice about allowing anonymous users to upload files. You may + find that your FTP site becomes a forum for the trade of + unlicensed commercial software or worse. If you do need to + allow anonymous FTP uploads, then you should set up the + permissions so that these files can not be read by other + anonymous users until they have been reviewed. @@ -4951,8 +5048,12 @@ File and Print Services for µsoft.windows; clients (Samba) - Samba server - Microsoft Windows + + Samba server + + + Microsoft Windows + file server Windows clients @@ -4966,16 +5067,16 @@ Overview Samba is a popular open source - software package that provides file and print services for - µsoft.windows; clients. Such clients can connect to and - use FreeBSD filespace as if it was a local disk drive, or - FreeBSD printers as if they were local printers. + software package that provides file and print services for + µsoft.windows; clients. Such clients can connect to and + use FreeBSD filespace as if it was a local disk drive, or + FreeBSD printers as if they were local printers. Samba software packages should - be included on your FreeBSD installation media. If you did - not install Samba when you first - installed FreeBSD, then you can install it from the net/samba34 port or package. + be included on your FreeBSD installation media. If you did + not install Samba when you first + installed FreeBSD, then you can install it from the net/samba34 port or package. @@ -4985,21 +5086,21 @@ Configuration A default Samba configuration - file is installed as - /usr/local/share/examples/samba34/smb.conf.default. This - file must be copied to - /usr/local/etc/smb.conf and customized - before Samba can be used. + file is installed as + /usr/local/share/examples/samba34/smb.conf.default. + This file must be copied to + /usr/local/etc/smb.conf and customized + before Samba can be used. The smb.conf file contains runtime - configuration information for - Samba, such as definitions of the - printers and file system shares that you would - like to share with &windows; clients. The - Samba package includes a web based - tool called swat which provides a - simple way of configuring the smb.conf - file. + configuration information for + Samba, such as definitions of the + printers and file system shares that you would + like to share with &windows; clients. The + Samba package includes a web based + tool called swat which provides a + simple way of configuring the smb.conf + file. Using the Samba Web Administration Tool (SWAT) @@ -5011,9 +5112,9 @@ used to configure Samba: swat stream tcp nowait/400 root /usr/local/sbin/swat swat - As explained in , - the inetd configuration must be reloaded after this configuration - file is changed. + As explained in , + the inetd configuration must be reloaded after this configuration + file is changed. Once swat has been enabled in inetd.conf, you can use a browser to @@ -5052,7 +5153,9 @@ netbios name - NetBIOS + + NetBIOS + This sets the NetBIOS name by which a Samba server @@ -5089,35 +5192,41 @@ The two most common options here are - security = share and security - = user. If your clients use usernames that - are the same as their usernames on your &os; machine - then you will want to use user level security. This - is the default security policy and it requires clients - to first log on before they can access shared - resources. + security = share and security + = user. If your clients use usernames that + are the same as their usernames on your &os; machine + then you will want to use user level security. This + is the default security policy and it requires clients + to first log on before they can access shared + resources. In share level security, client do not need to log - onto the server with a valid username and password - before attempting to connect to a shared resource. - This was the default security model for older versions - of Samba. + onto the server with a valid username and password + before attempting to connect to a shared resource. + This was the default security model for older versions + of Samba. passdb backend - NIS+ - LDAP - SQL database + + NIS+ + + + LDAP + + + SQL database + Samba has several - different backend authentication models. You can - authenticate clients with LDAP, NIS+, a SQL database, - or a modified password file. The default - authentication method is smbpasswd, + different backend authentication models. You can + authenticate clients with LDAP, NIS+, a SQL database, + or a modified password file. The default + authentication method is smbpasswd, and that is all that will be covered here. @@ -5183,23 +5292,23 @@ information about using rc scripts. Samba actually consists of - three separate daemons. You should see that both the - nmbd and smbd daemons - are started by the samba script. If - you enabled winbind name resolution services in - smb.conf, then you will also see that - the winbindd daemon is started. + three separate daemons. You should see that both the + nmbd and smbd daemons + are started by the samba script. If + you enabled winbind name resolution services in + smb.conf, then you will also see that + the winbindd daemon is started. You can stop Samba at any time - by typing : + by typing : &prompt.root; /usr/local/etc/rc.d/samba stop Samba is a complex software - suite with functionality that allows broad integration with - µsoft.windows; networks. For more information about - functionality beyond the basic installation described here, - please see . + suite with functionality that allows broad integration with + µsoft.windows; networks. For more information about + functionality beyond the basic installation described here, + please see . @@ -5216,7 +5325,9 @@ Clock Synchronization with NTP - NTP + + NTP + Overview @@ -5283,7 +5394,9 @@ Basic Configuration - ntpdate + + ntpdate + If you only wish to synchronize your clock when the machine boots up, you can use &man.ntpdate.8;. This may be @@ -5363,7 +5476,7 @@ server, add the following line to /etc/ntp.conf: - restrict default ignore + restrict default ignore This will also prevent access from your server to @@ -5373,12 +5486,12 @@ &man.ntp.conf.5; manual for more information. - If you only want to allow machines within your own + If you only want to allow machines within your own network to synchronize their clocks with your server, but ensure they are not allowed to configure the server or used as peers to synchronize against, add - restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap + restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap instead, where 192.168.1.0 is an IP address on your network and - - Tom - Rhodes - Contributed by - + + Tom + Rhodes + Contributed by + @@ -5535,7 +5648,7 @@ Once added, all facility messages will - be logged to the file specified previously, + be logged to the file specified previously, /var/log/logclient.log. The server machine must also have the following listing --- network-servers.chapter.sgml-whitespace.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: