/[gentoo]/xml/htdocs/doc/en/quick-samba-howto.xml
Gentoo

Diff of /xml/htdocs/doc/en/quick-samba-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.3
1<?xml version = '1.0' encoding = 'UTF-8'?> 1<?xml version = '1.0' encoding = 'UTF-8'?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<guide link="quick-samba-howto.xml"> 3<guide link="quick-samba-howto.xml">
4<title>Gentoo Samba3/CUPS/clamav HOWTO</title> 4<title>Gentoo Samba3/CUPS/Clam AV HOWTO</title>
5<author title="Author"> 5<author title="Author">
6 <mail link="daff at dword dot org">Andreas "daff" Ntaflos</mail> 6 <mail link="daff at dword dot org">Andreas "daff" Ntaflos</mail>
7</author> 7</author>
8<author title="Author"> 8<author title="Author">
9 <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail> 9 <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail>
10</author> 10</author>
11 11
12<abstract> 12<abstract>
13Setup, install and configure a Samba Server under Gentoo that shares 13Setup, install and configure a Samba Server under Gentoo that shares
14files, printers without the need to install drivers and provides 14files, printers without the need to install drivers and provides
15automatic virus scanning. 15automatic virus scanning.
16</abstract> 16</abstract>
17 17
18<!-- The content of this document is licensed under the CC-BY-SA license --> 18<!-- The content of this document is licensed under the CC-BY-SA license -->
19<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 19<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
20<license/> 20<license/>
21 21
22<version>1.2</version> 22<version>1.3</version>
23<date>May 13, 2004</date> 23<date>May 18, 2004</date>
24 24
25<chapter> 25<chapter>
26<title>Introduction to this HOWTO</title> 26<title>Introduction to this HOWTO</title>
27<section> 27<section>
28<title>Purpose</title> 28<title>Purpose</title>
29<body> 29<body>
30 30
31<p> 31<p>
32This HOWTO is designed to help you move a network from many different 32This HOWTO is designed to help you move a network from many different
33clients speaking different languages, to many different manchines that 33clients speaking different languages, to many different manchines that
34speak a common language. The ultimate goal is to help differing 34speak a common language. The ultimate goal is to help differing
35architechures and technologies, come together in a productive, 35architectures and technologies, come together in a productive,
36happily coexistant environment. 36happily coexisting environment.
37</p> 37</p>
38 38
39<p> 39<p>
40Following the directions outlined in this HOWTO should give you an 40Following the directions outlined in this HOWTO should give you an
41excellent step towards a peaceful cohabitation between Windows, and 41excellent step towards a peaceful cohabitation between Windows, and
42virtually all known variations of *nix. 42virtually all known variations of *nix.
43</p> 43</p>
44 44
45<p> 45<p>
46This HOWTO originally started not as a HOWTO, but as a FAQ. It was 46This HOWTO originally started not as a HOWTO, but as a FAQ. It was
47intended to explore the functionality and power of the Gentoo system, 47intended to explore the functionality and power of the Gentoo system,
48portage and the flexibility of USE flags. Like so many other projects, 48portage and the flexibility of USE flags. Like so many other projects,
49it was quickly discovered what was missing in the Gentoo realm: there 49it was quickly discovered what was missing in the Gentoo realm: there
50weren't any Samba HOWTO's catered for Gentoo users. These users are 50weren't any Samba HOWTO's catered for Gentoo users. These users are
51more demanding than most; they require performance, flexibility and 51more demanding than most; they require performance, flexibility and
299 </li> 299 </li>
300</ul> 300</ul>
301 301
302</body> 302</body>
303</section> 303</section>
304</chapter> 304</chapter>
305<chapter> 305<chapter>
306<title>Server Software Installation</title> 306<title>Server Software Installation</title>
307<section> 307<section>
308<title>Emerging Samba</title> 308<title>Emerging Samba</title>
309<body> 309<body>
310 310
311<p> 311<p>
312First of all: be sure that all your hostnames resolve correctly. 312First of all: be sure that all your hostnames resolve correctly.
313Either have a working domain name system running on your network 313Either have a working domain name system running on your network
314or appropriate entries in your /etc/hosts file. cupsaddsmb often 314or appropriate entries in your <path>/etc/hosts</path> file.
315borks if hostnames don't point to the correct machines. 315<c>cupsaddsmb</c> often borks if hostnames don't point to the correct
316machines.
316</p> 317</p>
317 318
318<p> 319<p>
319Hopefully now you can make an assessment of what you'll actually need in 320Hopefully now you can make an assessment of what you'll actually need in
320order to use Samba with your particular setup. The setup used for this 321order to use Samba with your particular setup. The setup used for this
321HOWTO is: 322HOWTO is:
322</p> 323</p>
323 324
324<ul> 325<ul>
325 <li>oav</li> 326 <li>oav</li>
326 <li>cups</li> 327 <li>cups</li>
327 <li>readline</li> 328 <li>readline</li>
328 <li>pam</li> 329 <li>pam</li>
329</ul> 330</ul>
330 331
338# <i>USE=&quot;oav readline cups pam -python -ldap -kerberos -xml -acl -mysql&quot; emerge net-fs/samba</i> 339# <i>USE=&quot;oav readline cups pam -python -ldap -kerberos -xml -acl -mysql&quot; emerge net-fs/samba</i>
339</pre> 340</pre>
340 341
341<note> 342<note>
342The following archs will need to add <e>~</e> to their <e>KEYWORDS</e>: x86, 343The following archs will need to add <e>~</e> to their <e>KEYWORDS</e>: x86,
343ppc, sparc, hppa, ia64 and alpha 344ppc, sparc, hppa, ia64 and alpha
344</note> 345</note>
345 346
346<p> 347<p>
347This will emerge Samba and CUPS (if CUPS is not already emerged). 348This will emerge Samba and CUPS (if CUPS is not already emerged).
348</p> 349</p>
349 350
350</body> 351</body>
351</section> 352</section>
352<section> 353<section>
353<title>Emerging clam-av</title> 354<title>Emerging Clam AV</title>
354<body> 355<body>
355 356
356<p> 357<p>
357Because the oav USE flag only provides an interface to allow on access 358Because the <e>oav</e> USE flag only provides an interface to allow on access
358virus scanning, the actual virus scanner must be emerged. The scanner 359virus scanning, the actual virus scanner must be emerged. The scanner
359used in this HOWTO is <e>net-mail/clamav</e>. 360used in this HOWTO is Clam AV.
360</p> 361</p>
361 362
362<pre caption="Emerge clam-av"> 363<pre caption="Emerge clam-av">
363# <i>emerge net-mail/clamav</i> 364# <i>emerge net-mail/clamav</i>
364</pre> 365</pre>
365 366
366</body> 367</body>
367</section> 368</section>
368<section> 369<section>
369<title>Emerging foomatic</title> 370<title>Emerging foomatic</title>
370<body> 371<body>
371 372
372<pre caption="Emerge foomatic"> 373<pre caption="Emerge foomatic">
373# <i>emerge net-print/foomatic</i> 374# <i>emerge net-print/foomatic</i>
374</pre> 375</pre>
389 390
390</body> 391</body>
391</section> 392</section>
392</chapter> 393</chapter>
393<chapter> 394<chapter>
394<title>Server Configuration</title> 395<title>Server Configuration</title>
395<section> 396<section>
396<title>Configuring Samba</title> 397<title>Configuring Samba</title>
397<body> 398<body>
398 399
399<p> 400<p>
400The main Samba configuration file is <path>/etc/samba/smb.conf</path>. 401The main Samba configuration file is <path>/etc/samba/smb.conf</path>.
401It is divided in sections indicated by [sectionname]. Comments are either 402It is divided in sections indicated by [sectionname]. Comments are either
402# or ;. A sample <path>smb.conf</path> is included below with comments and 403# or ;. A sample <path>smb.conf</path> is included below with comments and
403suggestions for modifications. If more details are required, see the 404suggestions for modifications. If more details are required, see the
404man page for <path>smb.conf</path>, the installed smb.conf.example, the Samba 405man page for <path>smb.conf</path>, the installed
405Web site or any of the numerous Samba books available. 406<path>smb.conf.example</path>, the Samba Web site or any of the
407numerous Samba books available.
406</p> 408</p>
407 409
408<pre caption="A Sample /etc/samba/smb.conf"> 410<pre caption="A Sample /etc/samba/smb.conf">
409[global] 411[global]
410<comment># Replace MYWORKGROUPNAME with your workgroup/domain</comment> 412<comment># Replace MYWORKGROUPNAME with your workgroup/domain</comment>
411workgroup = <comment>MYWORKGROUPNAME</comment> 413workgroup = <comment>MYWORKGROUPNAME</comment>
412<comment># Of course this has no REAL purpose other than letting 414<comment># Of course this has no REAL purpose other than letting
413# everyone know its not Windows! 415# everyone know its not Windows!
414# %v prints the version of Samba we are using.</comment> 416# %v prints the version of Samba we are using.</comment>
415server string = Samba Server %v 417server string = Samba Server %v
416<comment># We are going to use cups, so we are going to put it in here ;-)</comment> 418<comment># We are going to use cups, so we are going to put it in here ;-)</comment>
417printcap name = cups 419printcap name = cups
418printing = cups 420printing = cups
419load printers = yes 421load printers = yes
420<comment># We want a log file and we do not want it to get bigger than 50kb.</comment> 422<comment># We want a log file and we do not want it to get bigger than 50kb.</comment>
481# be the only printer admin)</comment> 483# be the only printer admin)</comment>
482printer admin = <i>root</i> 484printer admin = <i>root</i>
483 485
484<comment># We create a new share that we can read/write to from anywhere 486<comment># We create a new share that we can read/write to from anywhere
485# This is kind of like a public temp share, anyone can do what 487# This is kind of like a public temp share, anyone can do what
486# they want here.</comment> 488# they want here.</comment>
487[public] 489[public]
488comment = Public Files 490comment = Public Files
489browseable = yes 491browseable = yes
490public = yes 492public = yes
491create mode = 0766 493create mode = 0766
492guest ok = yes 494guest ok = yes
493path = /home/samba/public 495path = /home/samba/public
494</pre> 496</pre>
495 497
496<p> 498<warn>
497There are several warnings that we should put here:
498</p>
499 499
500<ul>
501 <li>
502 If you like to use Samba's guest account to do anything concerning 500If you like to use Samba's guest account to do anything concerning
503 printing from Windows clients: don't 501printing from Windows clients: don't set <c>guest only = yes</c> in
504 </li> 502the <c>[global]</c> section. The guest account seems to cause
505 <li>Don't set guest only = yes in the global section</li> 503problems when running <c>cupsaddsmb</c> sometimes when trying to
506 <li>
507 The guest account seems to cause problems when running cupsaddsmb sometimes
508 when trying to connect from Windows machines. See below, too, when we talk 504connect from Windows machines. See below, too, when we talk about
509 about cupsaddsmb and the problems that can arise. Use a dedicated printer 505<c>cupsaddsmb</c> and the problems that can arise. Use a dedicated
510 user, like "printeruser" or "printer" or "printme" or whatever. It doesn't 506printer user, like <c>printeruser</c> or <c>printer</c> or
511 hurt and it will certainly protect you from a lot of problems. 507<c>printme</c> or whatever. It doesn't hurt and it will certainly
512 </li> 508protect you from a lot of problems.
513</ul> 509</warn>
514 510
515<p> 511<p>
516Now create the directories required for the minimum configuration of 512Now create the directories required for the minimum configuration of
517Samba to share the installed printer throughout the network. 513Samba to share the installed printer throughout the network.
518</p> 514</p>
519 515
520<pre caption="Create the directories"> 516<pre caption="Create the directories">
521# <i>mkdir /etc/samba/printer</i> 517# <i>mkdir /etc/samba/printer</i>
522# <i>mkdir /var/spool/samba</i> 518# <i>mkdir /var/spool/samba</i>
523# <i>mkdir /home/samba/public</i> 519# <i>mkdir /home/samba/public</i>
524</pre> 520</pre>
525 521
526<p> 522<p>
527At least one Samba user is required in order to install the printer 523At least one Samba user is required in order to install the printer
528drivers and to allow users to connect to the printer. Users must 524drivers and to allow users to connect to the printer. Users must
532<pre caption="Creating the users"> 528<pre caption="Creating the users">
533# <i>smbpasswd -a root</i> 529# <i>smbpasswd -a root</i>
534 530
535<comment>(If another user is to be a printer admin)</comment> 531<comment>(If another user is to be a printer admin)</comment>
536# <i>smbpasswd -a username</i> 532# <i>smbpasswd -a username</i>
537</pre> 533</pre>
538 534
539<p> 535<p>
540The Samba passwords need not be the same as the system passwords 536The Samba passwords need not be the same as the system passwords
541in <path>/etc/passwd</path>. 537in <path>/etc/passwd</path>.
542</p> 538</p>
543 539
544</body> 540</body>
545</section> 541</section>
546<section> 542<section>
547<title>Configuring clam-av</title> 543<title>Configuring Clam AV</title>
548<body> 544<body>
549 545
550<p> 546<p>
551The configuration file specified to be used in <path>smb.conf</path> is 547The configuration file specified to be used in <path>smb.conf</path> is
552<path>/etc/samba/vscan-clamav.conf</path>. While these options are set 548<path>/etc/samba/vscan-clamav.conf</path>. While these options are set
553to the defaults, the infected file action may need to be changed. 549to the defaults, the infected file action may need to be changed.
554</p> 550</p>
555 551
556<pre caption="/etc/samba/vscan-clamav.conf"> 552<pre caption="/etc/samba/vscan-clamav.conf">
557[samba-vscan] 553[samba-vscan]
558<comment>; run-time configuration for vscan-samba using 554<comment>; run-time configuration for vscan-samba using
559; clamd 555; clamd
560; all options are set to default values</comment> 556; all options are set to default values</comment>
561 557
562<comment>; do not scan files larger than X bytes. If set to 0 (default), 558<comment>; do not scan files larger than X bytes. If set to 0 (default),
603; of period, samba-vscan use a last recently used file mechanism to avoid 599; of period, samba-vscan use a last recently used file mechanism to avoid
604; multiple scans of a file. This setting specified the maximum number of 600; multiple scans of a file. This setting specified the maximum number of
605; elements of the last recently used file list. (default: 100)</comment> 601; elements of the last recently used file list. (default: 100)</comment>
606max lru files entries = 100 602max lru files entries = 100
607 603
608<comment>; an entry is invalidad after lru file entry lifetime (in seconds). 604<comment>; an entry is invalidad after lru file entry lifetime (in seconds).
609; (Default: 5)</comment> 605; (Default: 5)</comment>
610lru file entry lifetime = 5 606lru file entry lifetime = 5
611 607
612<comment>; socket name of clamd (default: /var/run/clamd)</comment> 608<comment>; socket name of clamd (default: /var/run/clamd)</comment>
613clamd socket name = /var/run/clamd 609clamd socket name = /var/run/clamd
614</pre> 610</pre>
615 611
616<p> 612<p>
617It is generally a good idea to start the virus scanner immediately. Add 613It is generally a good idea to start the virus scanner immediately. Add
618it to the default runlevel and then start the clamd service immediately. 614it to the <e>default</e> runlevel and then start the <c>clamd</c> service immediately.
619</p> 615</p>
620 616
621<pre caption="Add clamd to bootup and start it"> 617<pre caption="Add clamd to bootup and start it">
622# <i>rc-update add clamd default</i> 618# <i>rc-update add clamd default</i>
623# <i>/etc/init.d/clamd start</i> 619# <i>/etc/init.d/clamd start</i>
624</pre> 620</pre>
625 621
626</body> 622</body>
627</section> 623</section>
628<section> 624<section>
629<title>Configuring CUPS</title> 625<title>Configuring CUPS</title>
630<body> 626<body>
631 627
632<p> 628<p>
633This is a little more complicated). CUPS' main config file is 629This is a little more complicated. CUPS' main config file is
634<path>/etc/cups/cupsd.conf</path>. It's structure is similar to Apache's 630<path>/etc/cups/cupsd.conf</path>. It's structure is similar to Apache's
635<path>httpd.conf</path> file, so many you may find it familiar. Outlined 631<path>httpd.conf</path> file, so many you may find it familiar. Outlined
636in the example are the directives that need to be changed: 632in the example are the directives that need to be changed:
637</p> 633</p>
638 634
639<pre caption="/etc/cups/cupsd.conf"> 635<pre caption="/etc/cups/cupsd.conf">
640ServerName <i>PrintServer</i> <comment># your printserver name</comment> 636ServerName <i>PrintServer</i> <comment># your printserver name</comment>
641ServerAdmin <i>root@PrintServer</i> <comment># the person for printer-related hate-mail, eg you</comment> 637ServerAdmin <i>root@PrintServer</i> <comment># the person for printer-related hate-mail, eg you</comment>
642 638
643AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment> 639AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment>
644ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment> 640ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment>
645 641
646LogLevel debug <comment># only while isntalling and testing, should later be 642LogLevel debug <comment># only while isntalling and testing, should later be
647 # changed to 'info'</comment> 643 # changed to 'info'</comment>
648 644
662&lt;/Location&gt; 658&lt;/Location&gt;
663 659
664&lt;Location /admin&gt; 660&lt;Location /admin&gt;
665AuthType Basic 661AuthType Basic
666AuthClass System 662AuthClass System
667Allow From <i>192.168.1.*</i> <comment># same as above, allow any host on the 663Allow From <i>192.168.1.*</i> <comment># same as above, allow any host on the
668 # 192.168.1.0 network to connect and do 664 # 192.168.1.0 network to connect and do
669 # administrative tasks after authenticating</comment> 665 # administrative tasks after authenticating</comment>
670Order Deny,Allow 666Order Deny,Allow
671Deny From All 667Deny From All
672&lt;/Location&gt; 668&lt;/Location&gt;
673</pre> 669</pre>
674 670
675<p> 671<p>
676Edit <path>/etc/cups/mime.convs</path> to uncomment some lines. 672Edit <path>/etc/cups/mime.convs</path> to uncomment some lines.
677The changes to mime.convs and mime.types are needed to make CUPSprint Microsoft Office document files. 673The changes to <path>mime.convs</path> and <path>mime.types</path> are
674needed to make CUPS print Microsoft Office document files.
678</p> 675</p>
679 676
680<pre caption="/etc/cups/mime.convs"> 677<pre caption="/etc/cups/mime.convs">
681<comment>(The following line is found near the end of the file. Uncomment it)</comment> 678<comment>(The following line is found near the end of the file. Uncomment it)</comment>
682application/octet-stream application/vnd.cups-raw 0 679application/octet-stream application/vnd.cups-raw 0
683</pre> 680</pre>
684 681
685<p> 682<p>
686Edit <path>/etc/cups/mime.convs</path> to uncomment some lines. 683Edit <path>/etc/cups/mime.convs</path> to uncomment some lines.
687</p> 684</p>
688 685
689<pre caption="/etc/cups/mime.types"> 686<pre caption="/etc/cups/mime.types">
690<comment>(The following line is found near the end of the file. Uncomment it)</comment> 687<comment>(The following line is found near the end of the file. Uncomment it)</comment>
691application/octet-stream 688application/octet-stream
692</pre> 689</pre>
714First, go to <uri link="http://linuxprinting.org">LinuxPrinting.Org</uri> 711First, go to <uri link="http://linuxprinting.org">LinuxPrinting.Org</uri>
715to find and download the correct PPD file for your printer and CUPS. To 712to find and download the correct PPD file for your printer and CUPS. To
716do so, click the link Printer Listings to the left. Select your 713do so, click the link Printer Listings to the left. Select your
717printers manufacturer and the model in the pulldown menu, eg HP and 714printers manufacturer and the model in the pulldown menu, eg HP and
718DeskJet 930C. Click "Show". On the page coming up click the "recommended 715DeskJet 930C. Click "Show". On the page coming up click the "recommended
719driver" link after reading the various notes and information. Then fetch 716driver" link after reading the various notes and information. Then fetch
720the PPD file from the next page, again after reading the notes and 717the PPD file from the next page, again after reading the notes and
721introductions there. You may have to select your printers manufacturer 718introductions there. You may have to select your printers manufacturer
722and model again. Reading the <uri link="http://www.linuxprinting.org/cups-doc.html">CUPS 719and model again. Reading the <uri link="http://www.linuxprinting.org/cups-doc.html">CUPS
723quickstart guide</uri> is also very helpful when working with CUPS. 720quickstart guide</uri> is also very helpful when working with CUPS.
724</p> 721</p>
725 722
726<p> 723<p>
727Now you have a PPD file for your printer to work with CUPS. Place it in 724Now you have a PPD file for your printer to work with CUPS. Place it in
728<path>/usr/share/cups/model</path>. The PPD for the HP DeskJet 930C was 725<path>/usr/share/cups/model</path>. The PPD for the HP DeskJet 930C was
729named HP-DeskJet_930C-hpijs.ppd. You should now install the printer. 726named <path>HP-DeskJet_930C-hpijs.ppd</path>. You should now install the printer.
730This can be done via the CUPS web interface or via command line. The web 727This can be done via the CUPS web interface or via command line. The web
731interface is found at http://PrintServer:631 once CUPS is running. 728interface is found at <path>http://PrintServer:631</path> once CUPS is running.
732</p> 729</p>
733 730
734<pre caption="Install the printer via command line"> 731<pre caption="Install the printer via command line">
735# <i>lpadmin -p HPDeskJet930C -E -v usb:/dev/ultp0 -m HP-DeskJet_930C-hpijs.ppd</i> 732# <i>lpadmin -p HPDeskJet930C -E -v usb:/dev/ultp0 -m HP-DeskJet_930C-hpijs.ppd</i>
736</pre> 733</pre>
737 734
738<p> 735<p>
739Remember to adjust to what you have. Be sure to have the name (-p) right (the 736Remember to adjust to what you have. Be sure to have the name
740name you set above during the Samba configuration!) and to put in the 737(<c>-p</c> argument) right (the name you set above during the Samba
741correct usb:/dev/usb/blah, parallel:/dev/blah or whatever device you 738configuration!) and to put in the correct <c>usb:/dev/usb/blah</c>,
742are using for your printer. 739<c>parallel:/dev/blah</c> or whatever device you are using for your
743</p> 740printer.
744
745<p> 741</p>
742
743<p>
746You should now be able to access the printer from the web interface. You 744You should now be able to access the printer from the web interface
747should now be able to print a test page. 745and be able to print a test page.
748</p> 746</p>
749 747
750</body> 748</body>
751</section> 749</section>
752<section> 750<section>
753<title>Installing the Windows printer drivers</title> 751<title>Installing the Windows printer drivers</title>
754<body> 752<body>
755 753
756<p> 754<p>
757Now that the printer should be working it is time to install the drivers 755Now that the printer should be working it is time to install the drivers
758for the Windows clients to work. Samba 2.2 introduced this functionality. 756for the Windows clients to work. Samba 2.2 introduced this functionality.
759Browsing to the print server in the Network Neighbourhood, right-clicking 757Browsing to the print server in the Network Neighbourhood, right-clicking
760on the printershare and selecting "connect" downloads the appropriate 758on the printershare and selecting "connect" downloads the appropriate
761drivers automagically to the connecting client, avoiding the hassle of 759drivers automagically to the connecting client, avoiding the hassle of
762manually installing printer drivers locally. 760manually installing printer drivers locally.
778 776
779<p> 777<p>
780This HOWTO uses the CUPS drivers for Windows. The downloaded file is 778This HOWTO uses the CUPS drivers for Windows. The downloaded file is
781called <path>cups-samba-5.0rc2.tar.gz</path>. Extract the files 779called <path>cups-samba-5.0rc2.tar.gz</path>. Extract the files
782contained into a directory. 780contained into a directory.
783</p> 781</p>
784 782
785<pre caption="Extract the drivers and run the install"> 783<pre caption="Extract the drivers and run the install">
786# <i>tar -xzf cups-samba-5.0rc2.tar.gz</i> 784# <i>tar -xzf cups-samba-5.0rc2.tar.gz</i>
787# <i>cd cups-samba-5.0rc2</i> 785# <i>cd cups-samba-5.0rc2</i>
788<comment>(Only use this script if CUPS resides in /usr/share/cups)</comment> 786<comment>(Only use this script if CUPS resides in /usr/share/cups)</comment>
789# <i>./cups-samba.install</i> 787# <i>./cups-samba.install</i>
790</pre> 788</pre>
791 789
792<p> 790<p>
793cups-samba.ss is a TAR archive containing three files: 791<path>cups-samba.ss</path> is a TAR archive containing three files:
794cups5.hlp, cupsdrvr5.dll and cupsui5.dll. These are the actual driver 792<path>cups5.hlp</path>, <path>cupsdrvr5.dll</path> and
795files. 793<path>cupsui5.dll</path>. These are the actual driver files.
796</p> 794</p>
797 795
798<warn> 796<warn>
799The script cups-samba.install may not work for all *nixes (ie FreeBSD) 797The script <c>cups-samba.install</c> may not work for all *nixes (ie FreeBSD)
800because almost everything which is not part of the base system is 798because almost everything which is not part of the base system is
801installed somewhere under the prefix <path>/usr/local/</path>. This 799installed somewhere under the prefix <path>/usr/local/</path>. This
802seems not to be the case for most things you install under GNU/Linux. 800seems not to be the case for most things you install under GNU/Linux.
803However, if your CUPS installation is somewhere other than 801However, if your CUPS installation is somewhere other than
804<path>/usr/share/cups/</path> See the example below. 802<path>/usr/share/cups/</path> see the example below.
805</warn> 803</warn>
806 804
807<p> 805<p>
808Suppose your CUPS installation resides under 806Suppose your CUPS installation resides under
809<path>/usr/local/share/cups/</path>, and you want to install the drivers there. 807<path>/usr/local/share/cups/</path>, and you want to install the drivers there.
810Do the following: 808Do the following:
811</p> 809</p>
812 810
813<pre caption="Manually installing the drivers"> 811<pre caption="Manually installing the drivers">
814# <i>cd /path/you/extracted/the/CUPS-driver/tarball/into</i> 812# <i>cd /path/you/extracted/the/CUPS-driver/tarball/into</i>
815# <i>tar -xf cups-samba.ss</i> 813# <i>tar -xf cups-samba.ss</i>
816<comment>(This extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY)</comment> 814<comment>(This extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY)</comment>
817# <i>cd usr/share/cups/drivers</i> 815# <i>cd usr/share/cups/drivers</i>
818<comment>(no leading / !)</comment> 816<comment>(no leading / !)</comment>
819# <i>cp cups* /usr/local/share/cups/drivers</i> 817# <i>cp cups* /usr/local/share/cups/drivers</i>
832</pre> 830</pre>
833 831
834<warn> 832<warn>
835The execution of this command often causes the most trouble. 833The execution of this command often causes the most trouble.
836Reading through the <uri 834Reading through the <uri
837link="http://forums.gentoo.com/viewtopic.php?t=110931">posts in this 835link="http://forums.gentoo.com/viewtopic.php?t=110931">posts in this
838thread</uri>. 836thread</uri>.
839</warn> 837</warn>
840 838
841<p> 839<p>
842Here are common errors that may happen: 840Here are common errors that may happen:
843</p> 841</p>
844 842
845<ul> 843<ul>
846 <li> 844 <li>
847 The hostname given as a parameter for -h and -H (PrintServer) often does 845 The hostname given as a parameter for <c>-h</c> and <c>-H</c>
848 not resolve correctly and doesn't identify the print server for CUPS/Samba 846 (<c>PrintServer</c>) often does not resolve correctly and doesn't
849 interaction. 847 identify the print server for CUPS/Samba interaction. If an error
850 If an error like: <b>Warning: No PPD file for printer "CUPS_PRINTER_NAME" - 848 like: <b>Warning: No PPD file for printer "CUPS_PRINTER_NAME" -
851 skipping!</b> occurs, the first thing you should do is substitute 849 skipping!</b> occurs, the first thing you should do is substitute
852 PrintServer with localhost and try it again. 850 <c>PrintServer</c> with <c>localhost</c> and try it again.
853 </li> 851 </li>
854 <li> 852 <li>
855 The command fails with an <b>NT_STATUS_UNSUCCESSFUL</b>. This error message 853 The command fails with an <b>NT_STATUS_UNSUCCESSFUL</b>. This error message
856 is quite common, but can be triggered by many problems. It's unfortunately 854 is quite common, but can be triggered by many problems. It's unfortunately
857 not very helpful. One thing to try is to temporarily set <b>security = 855 not very helpful. One thing to try is to temporarily set <c>security =
858 user</b> in your <path>smb.conf</path>. After/if the installation completes 856 user</c> in your <path>smb.conf</path>. After/if the installation completes
859 successfully, you should set it back to share, or whatever it was set to 857 successfully, you should set it back to share, or whatever it was set to
860 before. 858 before.
861 </li> 859 </li>
862</ul> 860</ul>
863 861
864<p> 862<p>
865This should install the correct driver directory structure under 863This should install the correct driver directory structure under
866<path>/etc/samba/printer</path>. That would be 864<path>/etc/samba/printer</path>. That would be
867<path>/etc/samba/printer/W32X86/2/</path>. The files contained should 865<path>/etc/samba/printer/W32X86/2/</path>. The files contained should
868be the 3 driver files and the PPD file, renamed to YourPrinterName.ppd 866be the 3 driver files and the PPD file, renamed to YourPrinterName.ppd
869(the name which you gave the printer when installing it (see above). 867(the name which you gave the printer when installing it (see above).
870</p> 868</p>
871 869
872<p> 870<p>
873Pending no errors or other complications, your drivers are now 871Pending no errors or other complications, your drivers are now
961<body> 959<body>
962 960
963<p> 961<p>
964Despite the variation or distribution, the only thing needed is CUPS. 962Despite the variation or distribution, the only thing needed is CUPS.
965Do the equivalent on any other UNIX/Linux/BSD client. 963Do the equivalent on any other UNIX/Linux/BSD client.
966</p> 964</p>
967 965
968<pre caption="Configuring a Gentoo system."> 966<pre caption="Configuring a Gentoo system.">
969# <i>emerge cups</i> 967# <i>emerge cups</i>
970# <i>/etc/init.d/cupsd start</i> 968# <i>/etc/init.d/cupsd start</i>
971# <i>rc-update add cupsd default</i> 969# <i>rc-update add cupsd default</i>
972</pre> 970</pre>
973 971
974<p> 972<p>
975That should be it. Nothing else will be needed. Just point your web 973That should be it. Nothing else will be needed. Just point your web
976browser to http://localhost:631 (on the CLIENT) and you'll see that 974browser to <c>http://localhost:631</c> on the client and you'll see that
977PrintServer broadcasts all available printers to all CUPS clients. 975PrintServer broadcasts all available printers to all CUPS clients.
978</p> 976</p>
979 977
980<p> 978<p>
981To print, use for example 979To print, use for example
982</p> 980</p>
983 981
984<pre caption="Printing in *nix"> 982<pre caption="Printing in *nix">
985# <i>lpr -pHPDeskJet930C anything.txt</i> 983# <i>lpr -pHPDeskJet930C anything.txt</i>
986# <i>lpr -PHPDeskJet930C foobar.whatever.ps</i> 984# <i>lpr -PHPDeskJet930C foobar.whatever.ps</i>
987</pre> 985</pre>
988 986
989<p> 987<p>
990In order to setup a default printer, you have to edit 988In order to setup a default printer, you have to edit
991<path>/etc/cups/client.conf</path> and set the directive ServerName to 989<path>/etc/cups/client.conf</path> and set the directive
992your printserver. In the case of this guide that would be the 990<c>ServerName</c> to your printserver. In the case of this guide that
993following example. 991would be the following example.
994</p> 992</p>
995 993
996<pre caption="/etc/cups/client.conf"> 994<pre caption="/etc/cups/client.conf">
997ServerName PrintServer 995ServerName PrintServer
998</pre> 996</pre>
999 997
1000<p> 998<p>
1001The following will print foorbar.whatever.ps directly to the print 999The following will print <path>foorbar.whatever.ps</path> directly to the print
1002server. 1000server.
1003</p> 1001</p>
1004 1002
1005<pre caption="Printing to the default printer"> 1003<pre caption="Printing to the default printer">
1006$ <i>lpr foobar.whatever.ps</i> 1004$ <i>lpr foobar.whatever.ps</i>
1007</pre> 1005</pre>
1008 1006
1009<p> 1007<p>
1010Some common observations when setting a default printer in this manner 1008Some common observations when setting a default printer in this manner
1011include the following: 1009include the following:
1012</p> 1010</p>
1013 1011
1014<ul> 1012<ul>
1015 <li> 1013 <li>
1016 Setting the ServerName in client.conf seems to work well for only one 1014 Setting the <c>ServerName</c> in <path>client.conf</path> seems to
1017 printer, there may be yet another way to set a client's default remote 1015 work well for only one printer, there may be yet another way to
1018 printer. 1016 set a client's default remote printer.
1019 </li> 1017 </li>
1020 <li> 1018 <li>
1021 Also, when accessing http://localhost:631 on the client now, no printers 1019 Also, when accessing <c>http://localhost:631</c> on the client
1022 seem to be "found" by the client-CUPS. This is to be expected when setting 1020 now, no printers seem to be "found" by the client-CUPS. This is to
1021 be expected when setting <c>ServerName</c> in
1023 ServerName in <path>client.conf</path>. 1022 <path>client.conf</path>.
1024 </li> 1023 </li>
1025</ul> 1024</ul>
1026 1025
1027</body> 1026</body>
1028</section> 1027</section>
1029<section> 1028<section>
1030<title>Mounting a Windows or Samba share in GNU/Linux</title> 1029<title>Mounting a Windows or Samba share in GNU/Linux</title>
1031<body> 1030<body>
1032 1031
1033<p> 1032<p>
1034Now is time to configure our kernel to support it the smbfs. Since I'm 1033Now is time to configure our kernel to support smbfs. Since I'm
1035assumming we've all compiled at least one kernel, we'll need to make 1034assumming we've all compiled at least one kernel, we'll need to make
1036sure we have all the right options selected in our kernel. 1035sure we have all the right options selected in our kernel.
1037For simplicity sake, make it as a module for ease of use. It is the 1036For simplicity sake, make it a module for ease of use. It is the
1038authors opinion that kernel modules are a good thing and should be used 1037authors opinion that kernel modules are a good thing and should be used
1039whenever possible. 1038whenever possible.
1040</p> 1039</p>
1041 1040
1042<pre caption="Relevant kernel options" > 1041<pre caption="Relevant kernel options" >
1043CONFIG_SMB_FS=m 1042CONFIG_SMB_FS=m
1044CONFIG_SMB_UNIX=y 1043CONFIG_SMB_UNIX=y
1045</pre> 1044</pre>
1046 1045
1047<p> 1046<p>
1048Then make the module/install it; insert them with: 1047Then make the module/install it; insert them with:
1049</p> 1048</p>
1050 1049
1051<pre caption="Loading the kernel module"> 1050<pre caption="Loading the kernel module">
1052# <i>modprobe smbfs</i> 1051# <i>modprobe smbfs</i>
1068# <i>mount -t smbfs -o username=USERNAME,password=PASSWORD //PrintServer/public /mnt/public</i> 1067# <i>mount -t smbfs -o username=USERNAME,password=PASSWORD //PrintServer/public /mnt/public</i>
1069</pre> 1068</pre>
1070 1069
1071<p> 1070<p>
1072After you mount the share, you would access it as if it were a local 1071After you mount the share, you would access it as if it were a local
1073drive. 1072drive.
1074</p> 1073</p>
1075 1074
1076</body> 1075</body>
1077</section> 1076</section>
1078<section> 1077<section>
1079<title>Printer Configuration for Windows NT/2000/XP clients</title> 1078<title>Printer Configuration for Windows NT/2000/XP clients</title>
1080<body> 1079<body>
1081 1080
1082<p> 1081<p>
1083That's just a bit of point-and-click. Browse to \\PrintServer and right 1082That's just a bit of point-and-click. Browse to
1084click on the printer (HPDeskJet930C) and click connect. This will 1083<path>\\PrintServer</path> and right click on the printer
1085download the drivers to the Windows client and now every application 1084(HPDeskJet930C) and click connect. This will download the drivers to
1086(such as Word or Acrobat) will offer HPDeskJet930C as an available 1085the Windows client and now every application (such as Word or Acrobat)
1087printer to print to. :-) 1086will offer HPDeskJet930C as an available printer to print to. :-)
1088</p> 1087</p>
1089 1088
1090</body> 1089</body>
1091</section> 1090</section>
1092</chapter> 1091</chapter>
1093<chapter> 1092<chapter>
1094<title>Final Notes</title> 1093<title>Final Notes</title>
1095<section> 1094<section>
1096<title>A Fond Farewell</title> 1095<title>A Fond Farewell</title>
1097<body> 1096<body>
1098 1097
1099<p> 1098<p>
1100Well that should be it. You should now have a successful printing enviroment 1099Well that should be it. You should now have a successful printing enviroment
1101that is friendly to both Windows and *nix as well as a fully virus-free working 1100that is friendly to both Windows and *nix as well as a fully virus-free working
1102share! 1101share!

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20