home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / samba-1.9.18p7.tar.gz / samba-1.9.18p7.tar / samba-1.9.18p7 / docs / UNIX_INSTALL.txt < prev    next >
Text File  |  1998-05-12  |  13KB  |  349 lines

  1. !==
  2. !== UNIX_INSTALL.txt for Samba release 1.9.18p7 13 May 1998
  3. !==
  4. Contributor:    Andrew Tridgell <samba-bugs@samba.anu.edu.au>
  5. Date:        Unknown
  6. Status:        Current
  7. Updated:    August 25, 1997
  8.  
  9. Subject:    HOW TO INSTALL AND TEST SAMBA
  10. ===============================================================================
  11.  
  12.  
  13. STEP 0. Read the man pages. They contain lots of useful info that will
  14. help to get you started. If you don't know how to read man pages then
  15. try something like:
  16.  
  17.     nroff -man smbd.8 | more
  18.  
  19. Unfortunately, having said this, the man pages are sadly out of date and
  20. really need more effort to maintain them. Other sources of information 
  21. are pointed to by the Samba web site, http://samba.anu.edu.au/samba.
  22.  
  23. STEP 1. Building the binaries
  24.  
  25. To do this, first edit the file source/Makefile. You will find that
  26. the Makefile has an entry for most unixes and you need to uncomment
  27. the one that matches your operating system.
  28.  
  29. You should also edit the section at the top of the Makefile which
  30. determines where things will be installed. You need to get this right
  31. before compilation as Samba needs to find some things at runtime
  32. (smbrun in particular). There are also settings for where you want
  33. your log files etc. Make sure you get these right, and that the
  34. directories exist.
  35.  
  36. Then type "make". This will create the binaries.
  37.  
  38. Once it's successfully compiled you can use "make install" to install
  39. the binaries and manual pages. You can separately install the binaries
  40. and/or man pages using "make installbin" and "make installman".
  41.  
  42. Note that if you are upgrading for a previous version of Samba you
  43. might like to know that the old versions of the binaries will be
  44. renamed with a ".old" extension. You can go back to the previous
  45. version with "make revert" if you find this version a disaster!
  46.  
  47. STEP 2. The all important step
  48.  
  49. At this stage you must fetch yourself a coffee or other drink you find
  50. stimulating. Getting the rest of the install right can sometimes be
  51. tricky, so you will probably need it.
  52.  
  53. If you have installed samba before then you can skip this step. 
  54.  
  55. STEP 3. Create the smb configuration file. 
  56.  
  57. There are sample configuration files in the examples subdirectory in
  58. the distribution. I suggest you read them carefully so you can see how
  59. the options go together in practice. See the man page for all the
  60. options.
  61.  
  62. The simplest useful configuration file would be something like this:
  63.  
  64.    workgroup = MYGROUP
  65.  
  66.    [homes]
  67.       guest ok = no
  68.       read only = no
  69.  
  70. which would allow connections by anyone with an account on the server,
  71. using either their login name or "homes" as the service name. (Note
  72. that I also set the workgroup that Samba is part of. See BROWSING.txt
  73. for defails)
  74.  
  75. Note that "make install" will not install a smb.conf file. You need to
  76. create it yourself. You will also need to create the path you specify
  77. in the Makefile for the logs etc, such as /usr/local/samba.
  78.  
  79. Make sure you put the smb.conf file in the same place you specified in
  80. the Makefile.
  81.  
  82. STEP 4. Test your config file with testparm
  83.  
  84. It's important that you test the validity of your smb.conf file using
  85. the testparm program. If testparm runs OK then it will list the loaded
  86. services. If not it will give an error message.
  87.  
  88. Make sure it runs OK and that the services look resonable before
  89. proceeding. 
  90.  
  91. STEP 5. Starting the smbd and nmbd. 
  92.  
  93. You must choose to start smbd and nmbd either as daemons or from
  94. inetd. Don't try to do both!  Either you can put them in inetd.conf
  95. and have them started on demand by inetd, or you can start them as
  96. daemons either from the command line or in /etc/rc.local. See the man
  97. pages for details on the command line options. Take particular care 
  98. to read the bit about what user you need to be in order to start Samba.
  99. In many cases you must be root.
  100.  
  101. The main advantage of starting smbd and nmbd as a daemon is that they
  102. will respond slightly more quickly to an initial connection
  103. request. This is, however, unlilkely to be a problem.
  104.  
  105. Step 5a. Starting from inetd.conf
  106.  
  107. NOTE; The following will be different if you use NIS or NIS+ to
  108. distributed services maps.
  109.  
  110. Look at your /etc/services. What is defined at port 139/tcp. If
  111. nothing is defined then add a line like this:
  112.  
  113. netbios-ssn     139/tcp
  114.  
  115. similarly for 137/udp you should have an entry like:
  116.  
  117. netbios-ns    137/udp
  118.  
  119. Next edit your /etc/inetd.conf and add two lines something like this:
  120.  
  121. netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
  122. netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
  123.  
  124. The exact syntax of /etc/inetd.conf varies between unixes. Look at the
  125. other entries in inetd.conf for a guide.
  126.  
  127. NOTE: Some unixes already have entries like netbios_ns (note the
  128. underscore) in /etc/services. You must either edit /etc/services or
  129. /etc/inetd.conf to make them consistant.
  130.  
  131. NOTE: On many systems you may need to use the "interfaces" option in
  132. smb.conf to specify the IP address and netmask of your interfaces. Run
  133. ifconfig as root if you don't know what the broadcast is for your
  134. net. nmbd tries to determine it at run time, but fails on some
  135. unixes. See the section on "testing nmbd" for a method of finding if
  136. you need to do this.
  137.  
  138. !!!WARNING!!! Many unixes only accept around 5 parameters on the
  139. command line in inetd. This means you shouldn't use spaces between the
  140. options and arguments, or you should use a script, and start the
  141. script from inetd.
  142.  
  143. Restart inetd, perhaps just send it a HUP. If you have installed an
  144. earlier version of nmbd then you may need to kill nmbd as well.
  145.  
  146. Step 5b. Alternative: starting it as a daemon
  147.  
  148. To start the server as a daemon you should create a script something
  149. like this one, perhaps calling it "startsmb"
  150.  
  151. #!/bin/sh
  152. /usr/local/samba/bin/smbd -D 
  153. /usr/local/samba/bin/nmbd -D 
  154.  
  155. then make it executable with "chmod +x startsmb"
  156.  
  157. You can then run startsmb by hand or execute it from /etc/rc.local
  158.  
  159. To kill it send a kill signal to the processes nmbd and smbd.
  160.  
  161. NOTE: If you use the SVR4 style init system then you may like to look
  162. at the examples/svr4-startup script to make Samba fit into that system.
  163.  
  164.  
  165. STEP 6. Try listing the shares available on your server
  166.  
  167. smbclient -L yourhostname 
  168.  
  169. Your should get back a list of shares available on your server. If you
  170. don't then something is incorrectly setup. Note that this method can
  171. also be used to see what shares are available on other LanManager
  172. clients (such as WfWg).
  173.  
  174. If you choose user level security then you may find that Samba requests
  175. a password before it will list the shares. See the smbclient docs for
  176. details. (you can force it to list the shares without a password by
  177. adding the option -U% to the command line. This will not work with
  178. non-Samba servers)
  179.  
  180. STEP 7. try connecting with the unix client. eg:
  181.  
  182. smbclient '\\yourhostname\aservice'
  183.  
  184. Typically the "yourhostname" would be the name of the host where you
  185. installed smbd. The "aservice" is any service you have defined in the
  186. smb.conf file. Try your user name if you just have a [homes] section
  187. in smb.conf.
  188.  
  189. For example if your unix host is bambi and your login name is fred you
  190. would type:
  191.  
  192. smbclient '\\bambi\fred'
  193.  
  194. NOTE: The number of slashes to use depends on the type of shell you
  195. use. You may need '\\\\bambi\\fred' with some shells.
  196.  
  197. STEP 8. Try connecting from a dos/WfWg/Win95/NT/os-2 client. Try
  198. mounting disks. eg:
  199.  
  200. net use d: \\servername\service
  201.  
  202. Try printing. eg:
  203.  
  204. net use lpt1: \\servername\spoolservice
  205. print filename
  206.  
  207. Celebrate, or send me a bug report!
  208.  
  209. WHAT IF IT DOESN'T WORK?
  210. ========================
  211.  
  212. If nothing works and you start to think "who wrote this pile of trash"
  213. then I suggest you do step 2 again (and again) till you calm down.
  214.  
  215. Then you might read the file DIAGNOSIS.txt and the FAQ. If you are
  216. still stuck then try the mailing list or newsgroup (look in the README
  217. for details). Samba has been successfully installed at thousands of
  218. sites worldwide, so maybe someone else has hit your problem and has
  219. overcome it. You could also use the WWW site to scan back issues of
  220. the samba-digest.
  221.  
  222. When you fix the problem PLEASE send me some updates to the
  223. documentation (or source code) so that the next person will find it
  224. easier. 
  225.  
  226. DIAGNOSING PROBLEMS
  227. ===================
  228.  
  229. If you have instalation problems then go to DIAGNOSIS.txt to try to
  230. find the problem.
  231.  
  232. SCOPE IDs
  233. =========
  234.  
  235. By default Samba uses a blank scope ID. This means all your windows
  236. boxes must also have a blank scope ID. If you really want to use a
  237. non-blank scope ID then you will need to use the -i <scope> option to
  238. nmbd, smbd, and smbclient. All your PCs will need to have the same
  239. setting for this to work. I do not recommend scope IDs.
  240.  
  241.  
  242. CHOOSING THE PROTOCOL LEVEL
  243. ===========================
  244.  
  245. The SMB protocol has many dialects. Currently Samba supports 5, called
  246. CORE, COREPLUS, LANMAN1, LANMAN2 and NT1.
  247.  
  248. You can choose what maximum protocol to support in the smb.conf
  249. file. The default is NT1 and that is the best for the vast majority of
  250. sites.
  251.  
  252. In older versions of Samba you may have found it necessary to use
  253. COREPLUS. The limitations that led to this have mostly been fixed. It
  254. is now less likely that you will want to use less than LANMAN1. The
  255. only remaining advantage of COREPLUS is that for some obscure reason
  256. WfWg preserves the case of passwords in this protocol, whereas under
  257. LANMAN1, LANMAN2 or NT1 it uppercases all passwords before sending them,
  258. forcing you to use the "password level=" option in some cases.
  259.  
  260. The main advantage of LANMAN2 and NT1 is support for long filenames with some
  261. clients (eg: smbclient, Windows NT or Win95). 
  262.  
  263. See the smb.conf manual page for more details.
  264.  
  265. Note: To support print queue reporting you may find that you have to
  266. use TCP/IP as the default protocol under WfWg. For some reason if you
  267. leave Netbeui as the default it may break the print queue reporting on
  268. some systems. It is presumably a WfWg bug.
  269.  
  270.  
  271. PRINTING FROM UNIX TO A CLIENT PC
  272. =================================
  273.  
  274. To use a printer that is available via a smb-based server from a unix
  275. host you will need to compile the smbclient program. You then need to
  276. install the script "smbprint". Read the instruction in smbprint for
  277. more details.
  278.  
  279. There is also a SYSV style script that does much the same thing called
  280. smbprint.sysv. It contains instructions.
  281.  
  282.  
  283. LOCKING
  284. =======
  285.  
  286. One area which sometimes causes trouble is locking.
  287.  
  288. There are two types of locking which need to be performed by a SMB
  289. server. The first is "record locking" which allows a client to lock a
  290. range of bytes in a open file. The second is the "deny modes" that are
  291. specified when a file is open.
  292.  
  293. Samba supports "record locking" using the fcntl() unix system
  294. call. This is often implemented using rpc calls to a rpc.lockd process
  295. running on the system that owns the filesystem. Unfortunately many
  296. rpc.lockd implementations are very buggy, particularly when made to
  297. talk to versions from other vendors. It is not uncommon for the
  298. rpc.lockd to crash.
  299.  
  300. There is also a problem translating the 32 bit lock requests generated
  301. by PC clients to 31 bit requests supported by most
  302. unixes. Unfortunately many PC applications (typically OLE2
  303. applications) use byte ranges with the top bit set as semaphore
  304. sets. Samba attempts translation to support these types of
  305. applications, and the translation has proved to be quite successful.
  306.  
  307. Strictly a SMB server should check for locks before every read and
  308. write call on a file. Unfortunately with the way fcntl() works this
  309. can be slow and may overstress the rpc.lockd. It is also almost always
  310. unnecessary as clients are supposed to independently make locking
  311. calls before reads and writes anyway if locking is important to
  312. them. By default Samba only makes locking calls when explicitly asked
  313. to by a client, but if you set "strict locking = yes" then it will
  314. make lock checking calls on every read and write. 
  315.  
  316. You can also disable by range locking completely using "locking =
  317. no". This is useful for those shares that don't support locking or
  318. don't need it (such as cdroms). In this case Samba fakes the return
  319. codes of locking calls to tell clients that everything is OK.
  320.  
  321. The second class of locking is the "deny modes". These are set by an
  322. application when it opens a file to determine what types of access
  323. should be allowed simultaneously with its open. A client may ask for
  324. DENY_NONE, DENY_READ, DENY_WRITE or DENY_ALL. There are also special
  325. compatability modes called DENY_FCB and DENY_DOS.
  326.  
  327. You can disable share modes using "share modes = no". This may be
  328. useful on a heavily loaded server as the share modes code is very
  329. slow. See also the FAST_SHARE_MODES option in the Makefile for a way
  330. to do full share modes very fast using shared memory (if your OS
  331. supports it).
  332.  
  333.  
  334. MAPPING USERNAMES
  335. =================
  336.  
  337. If you have different usernames on the PCs and the unix server then
  338. take a look at the "username map" option. See the smb.conf man page
  339. for details.
  340.  
  341.  
  342. OTHER CHARACTER SETS
  343. ====================
  344.  
  345. If you have problems using filenames with accented characters in them
  346. (like the German, French or Scandinavian character sets) then I
  347. recommmend you look at the "valid chars" option in smb.conf and also
  348. take a look at the validchars package in the examples directory.
  349.