| 1 | <?xml version = '1.0' encoding = 'UTF-8'?> |
1 | <?xml version='1.0' encoding='UTF-8'?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/quick-samba-howto.xml,v 1.5 2004/05/30 13:24:49 neysx Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/quick-samba-howto.xml,v 1.20 2006/01/01 11:51:43 neysx Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | <guide link="quick-samba-howto.xml"> |
4 | <guide link="quick-samba-howto.xml"> |
| 5 | <title>Gentoo Samba3/CUPS/Clam AV HOWTO</title> |
5 | <title>Gentoo Samba3/CUPS/ClamAV HOWTO</title> |
| 6 | <author title="Author"> |
6 | <author title="Author"> |
| 7 | <mail link="daff at dword dot org">Andreas "daff" Ntaflos</mail> |
7 | <mail link="daff at dword dot org">Andreas "daff" Ntaflos</mail> |
| 8 | </author> |
8 | </author> |
| 9 | <author title="Author"> |
9 | <author title="Author"> |
| 10 | <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail> |
10 | <mail link="joshua@sungentoo.homeunix.com">Joshua Preston</mail> |
| … | |
… | |
| 18 | |
18 | |
| 19 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
19 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 20 | <!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
20 | <!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
| 21 | <license/> |
21 | <license/> |
| 22 | |
22 | |
| 23 | <version>1.3</version> |
23 | <version>1.12</version> |
| 24 | <date>May 18, 2004</date> |
24 | <date>2005-03-26</date> |
| 25 | |
25 | |
| 26 | <chapter> |
26 | <chapter> |
| 27 | <title>Introduction to this HOWTO</title> |
27 | <title>Introduction to this HOWTO</title> |
| 28 | <section> |
28 | <section> |
| 29 | <title>Purpose</title> |
29 | <title>Purpose</title> |
| … | |
… | |
| 107 | </p> |
107 | </p> |
| 108 | |
108 | |
| 109 | <ul> |
109 | <ul> |
| 110 | <li>On the Samba server: |
110 | <li>On the Samba server: |
| 111 | <ul> |
111 | <ul> |
| 112 | <li>Install and configure CLAM-AV</li> |
112 | <li>Install and configure ClamAV</li> |
| 113 | <li>Install and configure Samba</li> |
113 | <li>Install and configure Samba</li> |
| 114 | <li>Install and configure CUPS</li> |
114 | <li>Install and configure CUPS</li> |
| 115 | <li>Adding the printer to CUPS</li> |
115 | <li>Adding the printer to CUPS</li> |
| 116 | <li>Adding the PS drivers for the Windows clients</li> |
116 | <li>Adding the PS drivers for the Windows clients</li> |
| 117 | </ul> |
117 | </ul> |
| … | |
… | |
| 141 | We will need the following: |
141 | We will need the following: |
| 142 | </p> |
142 | </p> |
| 143 | |
143 | |
| 144 | <ul> |
144 | <ul> |
| 145 | <li>net-fs/samba</li> |
145 | <li>net-fs/samba</li> |
| 146 | <li>net-mail/clamav</li> |
146 | <li>app-antivirus/clamav</li> |
| 147 | <li>net-print/cups</li> |
147 | <li>net-print/cups</li> |
| 148 | <li>net-print/foomatic</li> |
148 | <li>net-print/foomatic</li> |
| 149 | <li>net-print/hpijs (if you have an HP printer)</li> |
149 | <li>net-print/hpijs (if you have an HP printer)</li> |
| 150 | <li>A kernel of sorts (preferably 2.4.24+ or 2.6.x)</li> |
150 | <li>A kernel of sorts (preferably 2.4.24+ or 2.6.x)</li> |
| 151 | <li>A printer (PS or non-PS, maybe not TOO new or fancy)</li> |
151 | <li>A printer (PS or non-PS, maybe not TOO new or fancy)</li> |
| … | |
… | |
| 156 | |
156 | |
| 157 | <p> |
157 | <p> |
| 158 | The main package we use here is net-fs/samba, however, you will need |
158 | The main package we use here is net-fs/samba, however, you will need |
| 159 | a kernel with smbfs support enabled in order to mount a samba or windows |
159 | a kernel with smbfs support enabled in order to mount a samba or windows |
| 160 | share from another computer. CUPS will be emerged if it is not already. |
160 | share from another computer. CUPS will be emerged if it is not already. |
| 161 | net-mail/clamav will be used also, but others should be easily adapted |
161 | app-antivirus/clamav will be used also, but others should be easily adapted |
| 162 | to work with Samba. |
162 | to work with Samba. Gentoo's samba ebuild supports all kinds of virus scanning |
|
|
163 | technologies, such as Sophos, FProt, Fsav, Trend, Icap, Nai, ... |
| 163 | </p> |
164 | </p> |
| 164 | |
165 | |
| 165 | </body> |
166 | </body> |
| 166 | </section> |
167 | </section> |
| 167 | </chapter> |
168 | </chapter> |
| … | |
… | |
| 176 | Before emerging anything, take a look at the various USE flags |
177 | Before emerging anything, take a look at the various USE flags |
| 177 | available to Samba. |
178 | available to Samba. |
| 178 | </p> |
179 | </p> |
| 179 | |
180 | |
| 180 | <pre caption="Samba uses the following USE Variables:"> |
181 | <pre caption="Samba uses the following USE Variables:"> |
| 181 | kerberos mysql xml acl cups ldap pam readline python oav |
182 | kerberos mysql xml acl cups ldap pam readline python oav libclamav |
| 182 | </pre> |
183 | </pre> |
| 183 | |
184 | |
| 184 | <p> |
185 | <p> |
| 185 | Depending on the network topology and the specific requirements of |
186 | Depending on the network topology and the specific requirements of |
| 186 | the server, the USE flags outlined below will define what to include or |
187 | the server, the USE flags outlined below will define what to include or |
| … | |
… | |
| 255 | </ti> |
256 | </ti> |
| 256 | </tr> |
257 | </tr> |
| 257 | <tr> |
258 | <tr> |
| 258 | <th><b>readline</b></th> |
259 | <th><b>readline</b></th> |
| 259 | <ti> |
260 | <ti> |
| 260 | Link Samba again libreadline. This is highly recommended and should |
261 | Link Samba against libreadline. This is highly recommended and should |
| 261 | probably not be disabled |
262 | probably not be disabled |
| 262 | </ti> |
263 | </ti> |
| 263 | </tr> |
264 | </tr> |
| 264 | <tr> |
265 | <tr> |
| 265 | <th><b>python</b></th> |
266 | <th><b>python</b></th> |
| … | |
… | |
| 274 | Provides on-access scanning of Samba shares with FRISK F-Prot |
275 | Provides on-access scanning of Samba shares with FRISK F-Prot |
| 275 | Daemon, Kaspersky AntiVirus, OpenAntiVirus.org ScannerDaemon, Sophos Sweep |
276 | Daemon, Kaspersky AntiVirus, OpenAntiVirus.org ScannerDaemon, Sophos Sweep |
| 276 | (SAVI), Symantec CarrierScan, and Trend Micro (VSAPI). |
277 | (SAVI), Symantec CarrierScan, and Trend Micro (VSAPI). |
| 277 | </ti> |
278 | </ti> |
| 278 | </tr> |
279 | </tr> |
|
|
280 | <tr> |
|
|
281 | <th><b>libclamav</b></th> |
|
|
282 | <ti> |
|
|
283 | Use the ClamAV library instead of the clamd daemon |
|
|
284 | </ti> |
|
|
285 | </tr> |
| 279 | </table> |
286 | </table> |
| 280 | |
287 | |
| 281 | <p> |
288 | <p> |
| 282 | A couple of things worth mentioning about the USE flags and different |
289 | A couple of things worth mentioning about the USE flags and different |
| 283 | Samba functions include: |
290 | Samba functions include: |
| … | |
… | |
| 335 | To optimize performance, size and the time of the build, the |
342 | To optimize performance, size and the time of the build, the |
| 336 | USE flags are specifically included or excluded. |
343 | USE flags are specifically included or excluded. |
| 337 | </p> |
344 | </p> |
| 338 | |
345 | |
| 339 | <pre caption="Emerge Samba"> |
346 | <pre caption="Emerge Samba"> |
| 340 | <comment>(Note the USE flags!)</comment> |
347 | # <i>echo "net-fs/samba oav readline cups pam" >> /etc/portage/package.use</i> |
| 341 | # <i>USE="oav readline cups pam -python -ldap -kerberos -xml -acl -mysql" emerge net-fs/samba</i> |
348 | # <i>emerge net-fs/samba</i> |
| 342 | </pre> |
349 | </pre> |
| 343 | |
350 | |
| 344 | <note> |
351 | <note> |
| 345 | The following archs will need to add <e>~</e> to their <e>KEYWORDS</e>: x86, |
352 | The following archs will need to add <e>~</e> to their <e>KEYWORDS</e>: x86, |
| 346 | ppc, sparc, hppa, ia64 and alpha |
353 | ppc, sparc, hppa, ia64 and alpha |
| … | |
… | |
| 351 | </p> |
358 | </p> |
| 352 | |
359 | |
| 353 | </body> |
360 | </body> |
| 354 | </section> |
361 | </section> |
| 355 | <section> |
362 | <section> |
| 356 | <title>Emerging Clam AV</title> |
363 | <title>Emerging ClamAV</title> |
| 357 | <body> |
364 | <body> |
| 358 | |
365 | |
| 359 | <p> |
366 | <p> |
| 360 | Because the <e>oav</e> USE flag only provides an interface to allow on access |
367 | Because the <e>oav</e> USE flag only provides an interface to allow on access |
| 361 | virus scanning, the actual virus scanner must be emerged. The scanner |
368 | virus scanning, the actual virus scanner must be emerged. The scanner |
| 362 | used in this HOWTO is Clam AV. |
369 | used in this HOWTO is ClamAV. |
| 363 | </p> |
370 | </p> |
| 364 | |
371 | |
| 365 | <pre caption="Emerge clam-av"> |
372 | <pre caption="Emerge Clamav"> |
| 366 | # <i>emerge net-mail/clamav</i> |
373 | # <i>emerge app-antivirus/clamav</i> |
| 367 | </pre> |
374 | </pre> |
| 368 | |
375 | |
| 369 | </body> |
376 | </body> |
| 370 | </section> |
377 | </section> |
| 371 | <section> |
378 | <section> |
| … | |
… | |
| 413 | <pre caption="A Sample /etc/samba/smb.conf"> |
420 | <pre caption="A Sample /etc/samba/smb.conf"> |
| 414 | [global] |
421 | [global] |
| 415 | <comment># Replace MYWORKGROUPNAME with your workgroup/domain</comment> |
422 | <comment># Replace MYWORKGROUPNAME with your workgroup/domain</comment> |
| 416 | workgroup = <comment>MYWORKGROUPNAME</comment> |
423 | workgroup = <comment>MYWORKGROUPNAME</comment> |
| 417 | <comment># Of course this has no REAL purpose other than letting |
424 | <comment># Of course this has no REAL purpose other than letting |
| 418 | # everyone know its not Windows! |
425 | # everyone knows it's not Windows! |
| 419 | # %v prints the version of Samba we are using.</comment> |
426 | # %v prints the version of Samba we are using.</comment> |
| 420 | server string = Samba Server %v |
427 | server string = Samba Server %v |
| 421 | <comment># We are going to use cups, so we are going to put it in here ;-)</comment> |
428 | <comment># We are going to use cups, so we are going to put it in here ;-)</comment> |
| 422 | printcap name = cups |
429 | printcap name = cups |
| 423 | printing = cups |
430 | printing = cups |
| … | |
… | |
| 445 | guest ok = yes |
452 | guest ok = yes |
| 446 | <comment># We now will implement the on access virus scanner. |
453 | <comment># We now will implement the on access virus scanner. |
| 447 | # NOTE: By putting this in our [Global] section, we enable |
454 | # NOTE: By putting this in our [Global] section, we enable |
| 448 | # scanning of ALL shares, you could optionally move |
455 | # scanning of ALL shares, you could optionally move |
| 449 | # these to a specific share and only scan it.</comment> |
456 | # these to a specific share and only scan it.</comment> |
| 450 | vfs object = /usr/lib/samba/vfs/vscan-clamav.so |
457 | |
|
|
458 | <comment># For Samba 3.x. This enables ClamAV on access scanning.</comment> |
|
|
459 | vfs object = vscan-clamav |
| 451 | vfs options = config-file = /etc/samba/vscan-clamav.conf |
460 | vscan-clamav: config-file = /etc/samba/vscan-clamav.conf |
| 452 | |
461 | |
| 453 | <comment># Now we setup our print drivers information!</comment> |
462 | <comment># Now we setup our print drivers information!</comment> |
| 454 | [print$] |
463 | [print$] |
| 455 | comment = Printer Drivers |
464 | comment = Printer Drivers |
| 456 | path = /etc/samba/printer <comment># this path holds the driver structure</comment> |
465 | path = /etc/samba/printer <comment># this path holds the driver structure</comment> |
| 457 | guest ok = no |
466 | guest ok = yes |
| 458 | browseable = yes |
467 | browseable = yes |
| 459 | read only = yes |
468 | read only = yes |
| 460 | <comment># Modify this to "username,root" if you don't want root to |
469 | <comment># Modify this to "username,root" if you don't want root to |
| 461 | # be the only printer admin)</comment> |
470 | # be the only printer admin)</comment> |
| 462 | write list = <i>root</i> |
471 | write list = <i>root</i> |
| … | |
… | |
| 475 | |
484 | |
| 476 | <comment># Now we setup our printers share. This should be |
485 | <comment># Now we setup our printers share. This should be |
| 477 | # browseable, printable, public.</comment> |
486 | # browseable, printable, public.</comment> |
| 478 | [printers] |
487 | [printers] |
| 479 | comment = All Printers |
488 | comment = All Printers |
| 480 | browseable = yes |
489 | browseable = no |
| 481 | printable = yes |
490 | printable = yes |
|
|
491 | writable = no |
| 482 | public = yes |
492 | public = yes |
| 483 | guest ok = yes |
493 | guest ok = yes |
| 484 | path = /var/spool/samba |
494 | path = /var/spool/samba |
| 485 | <comment># Modify this to "username,root" if you don't want root to |
495 | <comment># Modify this to "username,root" if you don't want root to |
| 486 | # be the only printer admin)</comment> |
496 | # be the only printer admin)</comment> |
| … | |
… | |
| 508 | printer user, like <c>printeruser</c> or <c>printer</c> or |
518 | printer user, like <c>printeruser</c> or <c>printer</c> or |
| 509 | <c>printme</c> or whatever. It doesn't hurt and it will certainly |
519 | <c>printme</c> or whatever. It doesn't hurt and it will certainly |
| 510 | protect you from a lot of problems. |
520 | protect you from a lot of problems. |
| 511 | </warn> |
521 | </warn> |
| 512 | |
522 | |
|
|
523 | <warn> |
|
|
524 | Turning on ClamAV on access scanning in the <c>[global]</c> section will slow |
|
|
525 | down the performance of your Samba server dramatically. |
|
|
526 | </warn> |
|
|
527 | |
| 513 | <p> |
528 | <p> |
| 514 | Now create the directories required for the minimum configuration of |
529 | Now create the directories required for the minimum configuration of |
| 515 | Samba to share the installed printer throughout the network. |
530 | Samba to share the installed printer throughout the network. |
| 516 | </p> |
531 | </p> |
| 517 | |
532 | |
| … | |
… | |
| 537 | <p> |
552 | <p> |
| 538 | The Samba passwords need not be the same as the system passwords |
553 | The Samba passwords need not be the same as the system passwords |
| 539 | in <path>/etc/passwd</path>. |
554 | in <path>/etc/passwd</path>. |
| 540 | </p> |
555 | </p> |
| 541 | |
556 | |
|
|
557 | <p> |
|
|
558 | You will also need to update <path>/etc/nsswitch.conf</path> so that Windows |
|
|
559 | systems can be found easily using NetBIOS: |
|
|
560 | </p> |
|
|
561 | |
|
|
562 | <pre caption="Editing /etc/nsswitch.conf"> |
|
|
563 | # <i>nano -w /etc/nsswitch.conf</i> |
|
|
564 | <comment>(Edit the hosts: line)</comment> |
|
|
565 | hosts: files dns <i>wins</i> |
|
|
566 | </pre> |
|
|
567 | |
| 542 | </body> |
568 | </body> |
| 543 | </section> |
|
|
| 544 | <section> |
569 | </section> |
|
|
570 | <section> |
| 545 | <title>Configuring Clam AV</title> |
571 | <title>Configuring ClamAV</title> |
| 546 | <body> |
572 | <body> |
| 547 | |
573 | |
| 548 | <p> |
574 | <p> |
| 549 | The configuration file specified to be used in <path>smb.conf</path> is |
575 | The configuration file specified to be used in <path>smb.conf</path> is |
| 550 | <path>/etc/samba/vscan-clamav.conf</path>. While these options are set |
576 | <path>/etc/samba/vscan-clamav.conf</path>. While these options are set |
| … | |
… | |
| 606 | <comment>; an entry is invalidated after lru file entry lifetime (in seconds). |
632 | <comment>; an entry is invalidated after lru file entry lifetime (in seconds). |
| 607 | ; (Default: 5)</comment> |
633 | ; (Default: 5)</comment> |
| 608 | lru file entry lifetime = 5 |
634 | lru file entry lifetime = 5 |
| 609 | |
635 | |
| 610 | <comment>; socket name of clamd (default: /var/run/clamd)</comment> |
636 | <comment>; socket name of clamd (default: /var/run/clamd)</comment> |
| 611 | clamd socket name = /var/run/clamd |
637 | clamd socket name = /tmp/clamd |
|
|
638 | |
|
|
639 | <comment>; port number the ScannerDaemon listens on</comment> |
|
|
640 | oav port = 8127 |
| 612 | </pre> |
641 | </pre> |
| 613 | |
642 | |
| 614 | <p> |
643 | <p> |
| 615 | It is generally a good idea to start the virus scanner immediately. Add |
644 | It is generally a good idea to start the virus scanner immediately. Add |
| 616 | it to the <e>default</e> runlevel and then start the <c>clamd</c> service immediately. |
645 | it to the <e>default</e> runlevel and then start the <c>clamd</c> service |
|
|
646 | immediately. The service has two processes: freshclam keeps the virus definition |
|
|
647 | database up to date while clamd is the actual anti-virus daemon. First you may |
|
|
648 | want to set the paths of the logfiles so that it fits your needs. |
|
|
649 | </p> |
|
|
650 | |
|
|
651 | <pre caption="Checking the location of the logfiles"> |
|
|
652 | # <i>vim /etc/clamd.conf</i> |
|
|
653 | <comment>(Check the line "LogFile /var/log/clamd.log")</comment> |
|
|
654 | # <i>vim /etc/freshclam.conf</i> |
|
|
655 | <comment>(Check the line "UpdateLogFile /var/log/freshclam.log")</comment> |
|
|
656 | # <i>vim /etc/conf.d/clamd</i> |
|
|
657 | <comment>(Set "START_CLAMD=yes" and "START_FRESHCLAM=yes")</comment> |
|
|
658 | </pre> |
|
|
659 | |
|
|
660 | <p> |
|
|
661 | Now fire up the virus scanner. |
| 617 | </p> |
662 | </p> |
| 618 | |
663 | |
| 619 | <pre caption="Add clamd to bootup and start it"> |
664 | <pre caption="Add clamd to bootup and start it"> |
| 620 | # <i>rc-update add clamd default</i> |
665 | # <i>rc-update add clamd default</i> |
| 621 | # <i>/etc/init.d/clamd start</i> |
666 | # <i>/etc/init.d/clamd start</i> |
| … | |
… | |
| 640 | |
685 | |
| 641 | AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment> |
686 | AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment> |
| 642 | ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment> |
687 | ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment> |
| 643 | |
688 | |
| 644 | LogLevel debug <comment># only while isntalling and testing, should later be |
689 | LogLevel debug <comment># only while isntalling and testing, should later be |
| 645 | # changed to 'info'</comment> |
690 | # changed to 'info'</comment> |
| 646 | |
691 | |
| 647 | MaxClients 100 <comment># I've had to set this to 1000000000 or so because some time back, |
692 | MaxClients 100 <comment># I've had to set this to 1000000000 or so because some time back, |
| 648 | # there seemed to be a bug in CUPS' controlling of the web interface, |
693 | # there seemed to be a bug in CUPS' controlling of the web interface, |
| 649 | # making CUPS think a denial of service attack was in progress when |
694 | # making CUPS think a denial of service attack was in progress when |
| 650 | # I tried to configure a printer with the web interface. weird.</comment> |
695 | # I tried to configure a printer with the web interface. weird.</comment> |
| … | |
… | |
| 680 | <comment>(The following line is found near the end of the file. Uncomment it)</comment> |
725 | <comment>(The following line is found near the end of the file. Uncomment it)</comment> |
| 681 | application/octet-stream application/vnd.cups-raw 0 |
726 | application/octet-stream application/vnd.cups-raw 0 |
| 682 | </pre> |
727 | </pre> |
| 683 | |
728 | |
| 684 | <p> |
729 | <p> |
| 685 | Edit <path>/etc/cups/mime.convs</path> to uncomment some lines. |
730 | Edit <path>/etc/cups/mime.types</path> to uncomment some lines. |
| 686 | </p> |
731 | </p> |
| 687 | |
732 | |
| 688 | <pre caption="/etc/cups/mime.types"> |
733 | <pre caption="/etc/cups/mime.types"> |
| 689 | <comment>(The following line is found near the end of the file. Uncomment it)</comment> |
734 | <comment>(The following line is found near the end of the file. Uncomment it)</comment> |
| 690 | application/octet-stream |
735 | application/octet-stream |
| … | |
… | |
| 695 | </p> |
740 | </p> |
| 696 | |
741 | |
| 697 | <pre caption="Setting up the CUPS service" > |
742 | <pre caption="Setting up the CUPS service" > |
| 698 | <comment>(To start CUPS on boot)</comment> |
743 | <comment>(To start CUPS on boot)</comment> |
| 699 | # <i>rc-update add cupsd default</i> |
744 | # <i>rc-update add cupsd default</i> |
| 700 | <comment>(To start CUPS if it isn't started)</comment> |
745 | <comment>(To start or restart CUPS now)</comment> |
| 701 | # <i>/etc/init.d/cupsd start</i> |
|
|
| 702 | <comment>(If CUPS is already started we'll need to restart it!)</comment> |
|
|
| 703 | # <i>/etc/init.d/cupsd restart</i> |
746 | # <i>/etc/init.d/cupsd restart</i> |
| 704 | </pre> |
747 | </pre> |
| 705 | |
748 | |
| 706 | </body> |
749 | </body> |
| 707 | </section> |
750 | </section> |
| … | |
… | |
| 960 | <section> |
1003 | <section> |
| 961 | <title>Printer configuration of *nix based clients</title> |
1004 | <title>Printer configuration of *nix based clients</title> |
| 962 | <body> |
1005 | <body> |
| 963 | |
1006 | |
| 964 | <p> |
1007 | <p> |
| 965 | Despite the variation or distribution, the only thing needed is CUPS. |
1008 | Despite the variation or distribution, the only thing needed is CUPS. Do the |
| 966 | Do the equivalent on any other UNIX/Linux/BSD client. |
1009 | equivalent on any other UNIX/Linux/BSD client. |
| 967 | </p> |
1010 | </p> |
| 968 | |
1011 | |
| 969 | <pre caption="Configuring a Gentoo system"> |
1012 | <pre caption="Configuring a Gentoo system"> |
| 970 | # <i>emerge cups</i> |
1013 | # <i>emerge cups</i> |
| 971 | # <i>/etc/init.d/cupsd start</i> |
1014 | # <i>nano -w /etc/cups/client.conf</i> |
| 972 | # <i>rc-update add cupsd default</i> |
1015 | ServerName <i>PrintServer</i> <comment># your printserver name</comment> |
| 973 | </pre> |
1016 | </pre> |
| 974 | |
1017 | |
| 975 | <p> |
|
|
| 976 | That should be it. Nothing else will be needed. Just point your web |
|
|
| 977 | browser to <c>http://localhost:631</c> on the client and you'll see that |
|
|
| 978 | PrintServer broadcasts all available printers to all CUPS clients. |
|
|
| 979 | </p> |
1018 | <p> |
| 980 | |
1019 | That should be it. Nothing else will be needed. |
| 981 | <p> |
1020 | </p> |
| 982 | To print, use for example |
1021 | |
| 983 | </p> |
1022 | <p> |
|
|
1023 | If you use only one printer, it will be your default printer. If your print |
|
|
1024 | server manages several printers, your administrator will have defined a default |
|
|
1025 | printer on the server. If you want to define a different default printer for |
|
|
1026 | yourself, use the <c>lpoptions</c> command. |
|
|
1027 | </p> |
|
|
1028 | |
|
|
1029 | <pre caption="Setting your default printer"> |
|
|
1030 | <comment>(List available printers)</comment> |
|
|
1031 | # <i>lpstat -a</i> |
|
|
1032 | <comment>(Sample output, yours will differ)</comment> |
|
|
1033 | HPDeskJet930C accepting requests since Jan 01 00:00 |
|
|
1034 | laser accepting requests since Jan 01 00:00 |
|
|
1035 | <comment>(Define HPDeskJet930C as your default printer)</comment> |
|
|
1036 | # <i>lpoptions -d HPDeskJet930C</i> |
|
|
1037 | </pre> |
| 984 | |
1038 | |
| 985 | <pre caption="Printing in *nix"> |
1039 | <pre caption="Printing in *nix"> |
|
|
1040 | <comment>(Specify the printer to be used)</comment> |
| 986 | # <i>lpr -pHPDeskJet930C anything.txt</i> |
1041 | # <i>lp -d HPDeskJet930C anything.txt</i> |
| 987 | # <i>lpr -PHPDeskJet930C foobar.whatever.ps</i> |
1042 | <comment>(Use your default printer)</comment> |
| 988 | </pre> |
|
|
| 989 | |
|
|
| 990 | <p> |
|
|
| 991 | In order to setup a default printer, you have to edit |
|
|
| 992 | <path>/etc/cups/client.conf</path> and set the directive |
|
|
| 993 | <c>ServerName</c> to your printserver. In the case of this guide that |
|
|
| 994 | would be the following example. |
|
|
| 995 | </p> |
|
|
| 996 | |
|
|
| 997 | <pre caption="/etc/cups/client.conf"> |
|
|
| 998 | ServerName PrintServer |
|
|
| 999 | </pre> |
|
|
| 1000 | |
|
|
| 1001 | <p> |
|
|
| 1002 | The following will print <path>foorbar.whatever.ps</path> directly to the print |
|
|
| 1003 | server. |
|
|
| 1004 | </p> |
|
|
| 1005 | |
|
|
| 1006 | <pre caption="Printing to the default printer"> |
|
|
| 1007 | $ <i>lpr foobar.whatever.ps</i> |
1043 | # <i>lp foobar.whatever.ps</i> |
| 1008 | </pre> |
1044 | </pre> |
| 1009 | |
1045 | |
| 1010 | <p> |
|
|
| 1011 | Some common observations when setting a default printer in this manner |
|
|
| 1012 | include the following: |
|
|
| 1013 | </p> |
1046 | <p> |
| 1014 | |
1047 | Just point your web browser to <c>http://printserver:631</c> on the client if |
| 1015 | <ul> |
1048 | you want to manage your printers and their jobs with a nice web interface. |
| 1016 | <li> |
1049 | Replace <c>printserver</c> with the name of the <e>machine</e> that acts as |
| 1017 | Setting the <c>ServerName</c> in <path>client.conf</path> seems to |
1050 | your print server, not the name you gave to the cups print server if you used |
| 1018 | work well for only one printer, there may be yet another way to |
1051 | different names. |
| 1019 | set a client's default remote printer. |
1052 | </p> |
| 1020 | </li> |
|
|
| 1021 | <li> |
|
|
| 1022 | Also, when accessing <c>http://localhost:631</c> on the client |
|
|
| 1023 | now, no printers seem to be "found" by the client-CUPS. This is to |
|
|
| 1024 | be expected when setting <c>ServerName</c> in |
|
|
| 1025 | <path>client.conf</path>. |
|
|
| 1026 | </li> |
|
|
| 1027 | </ul> |
|
|
| 1028 | |
1053 | |
| 1029 | </body> |
1054 | </body> |
| 1030 | </section> |
1055 | </section> |
| 1031 | <section> |
1056 | <section> |
| 1032 | <title>Mounting a Windows or Samba share in GNU/Linux</title> |
1057 | <title>Mounting a Windows or Samba share in GNU/Linux</title> |