|
Lines 1-7
Link Here
|
| 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> |
|
Lines 10-17
Link Here
|
| 10 |
</author> |
10 |
</author> |
| 11 |
|
11 |
|
| 12 |
<abstract> |
12 |
<abstract> |
| 13 |
Setup, install and configure a Samba Server under Gentoo that shares |
13 |
Setup, install and configure a Samba Server under Gentoo that shares |
| 14 |
files, printers without the need to install drivers and provides |
14 |
files, printers without the need to install drivers and provides |
| 15 |
automatic virus scanning. |
15 |
automatic virus scanning. |
| 16 |
</abstract> |
16 |
</abstract> |
| 17 |
|
17 |
|
|
Lines 32-39
Link Here
|
| 32 |
This HOWTO is designed to help you move a network from many different |
32 |
This HOWTO is designed to help you move a network from many different |
| 33 |
clients speaking different languages, to many different manchines that |
33 |
clients speaking different languages, to many different manchines that |
| 34 |
speak a common language. The ultimate goal is to help differing |
34 |
speak a common language. The ultimate goal is to help differing |
| 35 |
architechures and technologies, come together in a productive, |
35 |
architectures and technologies, come together in a productive, |
| 36 |
happily coexistant environment. |
36 |
happily coexisting environment. |
| 37 |
</p> |
37 |
</p> |
| 38 |
|
38 |
|
| 39 |
<p> |
39 |
<p> |
|
Lines 311-318
Link Here
|
| 311 |
<p> |
311 |
<p> |
| 312 |
First of all: be sure that all your hostnames resolve correctly. |
312 |
First of all: be sure that all your hostnames resolve correctly. |
| 313 |
Either have a working domain name system running on your network |
313 |
Either have a working domain name system running on your network |
| 314 |
or appropriate entries in your /etc/hosts file. cupsaddsmb often |
314 |
or appropriate entries in your <path>/etc/hosts</path> file. |
| 315 |
borks if hostnames don't point to the correct machines. |
315 |
<c>cupsaddsmb</c> often borks if hostnames don't point to the correct |
|
|
316 |
machines. |
| 316 |
</p> |
317 |
</p> |
| 317 |
|
318 |
|
| 318 |
<p> |
319 |
<p> |
|
Lines 350-362
Link Here
|
| 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> |
| 357 |
Because the oav USE flag only provides an interface to allow on access |
358 |
Because the <e>oav</e> USE flag only provides an interface to allow on access |
| 358 |
virus scanning, the actual virus scanner must be emerged. The scanner |
359 |
virus scanning, the actual virus scanner must be emerged. The scanner |
| 359 |
used in this HOWTO is <e>net-mail/clamav</e>. |
360 |
used in this HOWTO is Clam AV. |
| 360 |
</p> |
361 |
</p> |
| 361 |
|
362 |
|
| 362 |
<pre caption="Emerge clam-av"> |
363 |
<pre caption="Emerge clam-av"> |
|
Lines 401-408
Link Here
|
| 401 |
It is divided in sections indicated by [sectionname]. Comments are either |
402 |
It 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 |
| 403 |
suggestions for modifications. If more details are required, see the |
404 |
suggestions for modifications. If more details are required, see the |
| 404 |
man page for <path>smb.conf</path>, the installed smb.conf.example, the Samba |
405 |
man page for <path>smb.conf</path>, the installed |
| 405 |
Web site or any of the numerous Samba books available. |
406 |
<path>smb.conf.example</path>, the Samba Web site or any of the |
|
|
407 |
numerous 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"> |
|
Lines 493-516
Link Here
|
| 493 |
path = /home/samba/public |
495 |
path = /home/samba/public |
| 494 |
</pre> |
496 |
</pre> |
| 495 |
|
497 |
|
| 496 |
<p> |
498 |
<warn> |
| 497 |
There are several warnings that we should put here: |
|
|
| 498 |
</p> |
| 499 |
|
499 |
|
| 500 |
<ul> |
500 |
If you like to use Samba's guest account to do anything concerning |
| 501 |
<li> |
501 |
printing from Windows clients: don't set <c>guest only = yes</c> in |
| 502 |
If you like to use Samba's guest account to do anything concerning |
502 |
the <c>[global]</c> section. The guest account seems to cause |
| 503 |
printing from Windows clients: don't |
503 |
problems when running <c>cupsaddsmb</c> sometimes when trying to |
| 504 |
</li> |
504 |
connect from Windows machines. See below, too, when we talk about |
| 505 |
<li>Don't set guest only = yes in the global section</li> |
505 |
<c>cupsaddsmb</c> and the problems that can arise. Use a dedicated |
| 506 |
<li> |
506 |
printer user, like <c>printeruser</c> or <c>printer</c> or |
| 507 |
The guest account seems to cause problems when running cupsaddsmb sometimes |
507 |
<c>printme</c> or whatever. It doesn't hurt and it will certainly |
| 508 |
when trying to connect from Windows machines. See below, too, when we talk |
508 |
protect you from a lot of problems. |
| 509 |
about cupsaddsmb and the problems that can arise. Use a dedicated printer |
509 |
</warn> |
| 510 |
user, like "printeruser" or "printer" or "printme" or whatever. It doesn't |
|
|
| 511 |
hurt and it will certainly protect you from a lot of problems. |
| 512 |
</li> |
| 513 |
</ul> |
| 514 |
|
510 |
|
| 515 |
<p> |
511 |
<p> |
| 516 |
Now create the directories required for the minimum configuration of |
512 |
Now create the directories required for the minimum configuration of |
|
Lines 544-550
Link Here
|
| 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> |
|
Lines 615-621
Link Here
|
| 615 |
|
611 |
|
| 616 |
<p> |
612 |
<p> |
| 617 |
It is generally a good idea to start the virus scanner immediately. Add |
613 |
It is generally a good idea to start the virus scanner immediately. Add |
| 618 |
it to the default runlevel and then start the clamd service immediately. |
614 |
it 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"> |
|
Lines 630-636
Link Here
|
| 630 |
<body> |
626 |
<body> |
| 631 |
|
627 |
|
| 632 |
<p> |
628 |
<p> |
| 633 |
This is a little more complicated). CUPS' main config file is |
629 |
This 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 |
| 636 |
in the example are the directives that need to be changed: |
632 |
in the example are the directives that need to be changed: |
|
Lines 674-680
Link Here
|
| 674 |
|
670 |
|
| 675 |
<p> |
671 |
<p> |
| 676 |
Edit <path>/etc/cups/mime.convs</path> to uncomment some lines. |
672 |
Edit <path>/etc/cups/mime.convs</path> to uncomment some lines. |
| 677 |
The changes to mime.convs and mime.types are needed to make CUPSprint Microsoft Office document files. |
673 |
The changes to <path>mime.convs</path> and <path>mime.types</path> are |
|
|
674 |
needed 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"> |
|
Lines 726-734
Link Here
|
| 726 |
<p> |
723 |
<p> |
| 727 |
Now you have a PPD file for your printer to work with CUPS. Place it in |
724 |
Now 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 |
| 729 |
named HP-DeskJet_930C-hpijs.ppd. You should now install the printer. |
726 |
named <path>HP-DeskJet_930C-hpijs.ppd</path>. You should now install the printer. |
| 730 |
This can be done via the CUPS web interface or via command line. The web |
727 |
This can be done via the CUPS web interface or via command line. The web |
| 731 |
interface is found at http://PrintServer:631 once CUPS is running. |
728 |
interface 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"> |
|
Lines 736-750
Link Here
|
| 736 |
</pre> |
733 |
</pre> |
| 737 |
|
734 |
|
| 738 |
<p> |
735 |
<p> |
| 739 |
Remember to adjust to what you have. Be sure to have the name (-p) right (the |
736 |
Remember to adjust to what you have. Be sure to have the name |
| 740 |
name 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 |
| 741 |
correct usb:/dev/usb/blah, parallel:/dev/blah or whatever device you |
738 |
configuration!) and to put in the correct <c>usb:/dev/usb/blah</c>, |
| 742 |
are using for your printer. |
739 |
<c>parallel:/dev/blah</c> or whatever device you are using for your |
|
|
740 |
printer. |
| 743 |
</p> |
741 |
</p> |
| 744 |
|
742 |
|
| 745 |
<p> |
743 |
<p> |
| 746 |
You should now be able to access the printer from the web interface. You |
744 |
You should now be able to access the printer from the web interface |
| 747 |
should now be able to print a test page. |
745 |
and be able to print a test page. |
| 748 |
</p> |
746 |
</p> |
| 749 |
|
747 |
|
| 750 |
</body> |
748 |
</body> |
|
Lines 790-807
Link Here
|
| 790 |
</pre> |
788 |
</pre> |
| 791 |
|
789 |
|
| 792 |
<p> |
790 |
<p> |
| 793 |
cups-samba.ss is a TAR archive containing three files: |
791 |
<path>cups-samba.ss</path> is a TAR archive containing three files: |
| 794 |
cups5.hlp, cupsdrvr5.dll and cupsui5.dll. These are the actual driver |
792 |
<path>cups5.hlp</path>, <path>cupsdrvr5.dll</path> and |
| 795 |
files. |
793 |
<path>cupsui5.dll</path>. These are the actual driver files. |
| 796 |
</p> |
794 |
</p> |
| 797 |
|
795 |
|
| 798 |
<warn> |
796 |
<warn> |
| 799 |
The script cups-samba.install may not work for all *nixes (ie FreeBSD) |
797 |
The script <c>cups-samba.install</c> may not work for all *nixes (ie FreeBSD) |
| 800 |
because almost everything which is not part of the base system is |
798 |
because almost everything which is not part of the base system is |
| 801 |
installed somewhere under the prefix <path>/usr/local/</path>. This |
799 |
installed somewhere under the prefix <path>/usr/local/</path>. This |
| 802 |
seems not to be the case for most things you install under GNU/Linux. |
800 |
seems not to be the case for most things you install under GNU/Linux. |
| 803 |
However, if your CUPS installation is somewhere other than |
801 |
However, 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> |
|
Lines 844-861
Link Here
|
| 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> |
|
Lines 973-979
Link Here
|
| 973 |
|
971 |
|
| 974 |
<p> |
972 |
<p> |
| 975 |
That should be it. Nothing else will be needed. Just point your web |
973 |
That should be it. Nothing else will be needed. Just point your web |
| 976 |
browser to http://localhost:631 (on the CLIENT) and you'll see that |
974 |
browser to <c>http://localhost:631</c> on the client and you'll see that |
| 977 |
PrintServer broadcasts all available printers to all CUPS clients. |
975 |
PrintServer broadcasts all available printers to all CUPS clients. |
| 978 |
</p> |
976 |
</p> |
| 979 |
|
977 |
|
|
Lines 987-996
Link Here
|
| 987 |
</pre> |
985 |
</pre> |
| 988 |
|
986 |
|
| 989 |
<p> |
987 |
<p> |
| 990 |
In order to setup a default printer, you have to edit |
988 |
In 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 |
| 992 |
your 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 |
| 993 |
following example. |
991 |
would be the following example. |
| 994 |
</p> |
992 |
</p> |
| 995 |
|
993 |
|
| 996 |
<pre caption="/etc/cups/client.conf"> |
994 |
<pre caption="/etc/cups/client.conf"> |
|
Lines 998-1004
Link Here
|
| 998 |
</pre> |
996 |
</pre> |
| 999 |
|
997 |
|
| 1000 |
<p> |
998 |
<p> |
| 1001 |
The following will print foorbar.whatever.ps directly to the print |
999 |
The following will print <path>foorbar.whatever.ps</path> directly to the print |
| 1002 |
server. |
1000 |
server. |
| 1003 |
</p> |
1001 |
</p> |
| 1004 |
|
1002 |
|
|
Lines 1013-1026
Link Here
|
| 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 |
| 1023 |
ServerName in <path>client.conf</path>. |
1021 |
be expected when setting <c>ServerName</c> in |
|
|
1022 |
<path>client.conf</path>. |
| 1024 |
</li> |
1023 |
</li> |
| 1025 |
</ul> |
1024 |
</ul> |
| 1026 |
|
1025 |
|
|
Lines 1031-1040
Link Here
|
| 1031 |
<body> |
1030 |
<body> |
| 1032 |
|
1031 |
|
| 1033 |
<p> |
1032 |
<p> |
| 1034 |
Now is time to configure our kernel to support it the smbfs. Since I'm |
1033 |
Now is time to configure our kernel to support smbfs. Since I'm |
| 1035 |
assumming we've all compiled at least one kernel, we'll need to make |
1034 |
assumming we've all compiled at least one kernel, we'll need to make |
| 1036 |
sure we have all the right options selected in our kernel. |
1035 |
sure we have all the right options selected in our kernel. |
| 1037 |
For simplicity sake, make it as a module for ease of use. It is the |
1036 |
For simplicity sake, make it a module for ease of use. It is the |
| 1038 |
authors opinion that kernel modules are a good thing and should be used |
1037 |
authors opinion that kernel modules are a good thing and should be used |
| 1039 |
whenever possible. |
1038 |
whenever possible. |
| 1040 |
</p> |
1039 |
</p> |
|
Lines 1080-1090
Link Here
|
| 1080 |
<body> |
1079 |
<body> |
| 1081 |
|
1080 |
|
| 1082 |
<p> |
1081 |
<p> |
| 1083 |
That's just a bit of point-and-click. Browse to \\PrintServer and right |
1082 |
That's just a bit of point-and-click. Browse to |
| 1084 |
click on the printer (HPDeskJet930C) and click connect. This will |
1083 |
<path>\\PrintServer</path> and right click on the printer |
| 1085 |
download 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 |
1085 |
the Windows client and now every application (such as Word or Acrobat) |
| 1087 |
printer to print to. :-) |
1086 |
will offer HPDeskJet930C as an available printer to print to. :-) |
| 1088 |
</p> |
1087 |
</p> |
| 1089 |
|
1088 |
|
| 1090 |
</body> |
1089 |
</body> |