| 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.19 2005/10/02 21:26:32 rane Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/quick-samba-howto.xml,v 1.28 2007/06/06 22:42:25 nightmorph 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="/doc/en/quick-samba-howto.xml"> |
| 5 | <title>Gentoo Samba3/CUPS/ClamAV 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"> |
| … | |
… | |
| 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.12</version> |
23 | <version>1.17</version> |
| 24 | <date>2005-03-26</date> |
24 | <date>2007-06-06</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> |
| … | |
… | |
| 144 | <ul> |
144 | <ul> |
| 145 | <li>net-fs/samba</li> |
145 | <li>net-fs/samba</li> |
| 146 | <li>app-antivirus/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/hplip (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 (2.6)</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> |
| 152 | <li> |
152 | <li> |
| 153 | A working network (home/office/etc) consisting of more than one machine) |
153 | A working network (home/office/etc) consisting of more than one machine) |
| 154 | </li> |
154 | </li> |
| 155 | </ul> |
155 | </ul> |
| … | |
… | |
| 172 | <section> |
172 | <section> |
| 173 | <title>The USE Flags</title> |
173 | <title>The USE Flags</title> |
| 174 | <body> |
174 | <body> |
| 175 | |
175 | |
| 176 | <p> |
176 | <p> |
| 177 | Before emerging anything, take a look at the various USE flags |
177 | Before emerging anything, take a look at some of the various USE flags available |
| 178 | available to Samba. |
178 | to Samba. |
| 179 | </p> |
179 | </p> |
| 180 | |
180 | |
| 181 | <pre caption="Samba uses the following USE Variables:"> |
181 | <pre caption="Samba uses the following USE Variables:"> |
| 182 | kerberos mysql xml acl cups ldap pam readline python oav libclamav |
182 | kerberos acl cups ldap pam readline python oav |
| 183 | </pre> |
183 | </pre> |
| 184 | |
184 | |
| 185 | <p> |
185 | <p> |
| 186 | Depending on the network topology and the specific requirements of |
186 | Depending on the network topology and the specific requirements of |
| 187 | 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 |
| … | |
… | |
| 197 | <th><b>kerberos</b></th> |
197 | <th><b>kerberos</b></th> |
| 198 | <ti> |
198 | <ti> |
| 199 | Include support for Kerberos. The server will need this if it is |
199 | Include support for Kerberos. The server will need this if it is |
| 200 | intended to join an existing domain or Active Directory. See the note |
200 | intended to join an existing domain or Active Directory. See the note |
| 201 | below for more information. |
201 | below for more information. |
| 202 | </ti> |
|
|
| 203 | </tr> |
|
|
| 204 | <tr> |
|
|
| 205 | <th><b>mysql</b></th> |
|
|
| 206 | <ti> |
|
|
| 207 | This will allow Samba to use MySQL in order to do password authentication. |
|
|
| 208 | It will store ACLs, usernames, passwords, etc in a database versus a |
|
|
| 209 | flat file. If Samba is needed to do password authentication, such as |
|
|
| 210 | acting as a password validation server or a Primary Domain Controller |
|
|
| 211 | (PDC). |
|
|
| 212 | </ti> |
|
|
| 213 | </tr> |
|
|
| 214 | <tr> |
|
|
| 215 | <th><b>xml</b></th> |
|
|
| 216 | <ti> |
|
|
| 217 | The xml USE option for Samba provides a password database backend allowing |
|
|
| 218 | Samba to store account details in XML files, for the same reasons listed in |
|
|
| 219 | the mysql USE flag description. |
|
|
| 220 | </ti> |
202 | </ti> |
| 221 | </tr> |
203 | </tr> |
| 222 | <tr> |
204 | <tr> |
| 223 | <th><b>acl</b></th> |
205 | <th><b>acl</b></th> |
| 224 | <ti> |
206 | <ti> |
| … | |
… | |
| 275 | Provides on-access scanning of Samba shares with FRISK F-Prot |
257 | Provides on-access scanning of Samba shares with FRISK F-Prot |
| 276 | Daemon, Kaspersky AntiVirus, OpenAntiVirus.org ScannerDaemon, Sophos Sweep |
258 | Daemon, Kaspersky AntiVirus, OpenAntiVirus.org ScannerDaemon, Sophos Sweep |
| 277 | (SAVI), Symantec CarrierScan, and Trend Micro (VSAPI). |
259 | (SAVI), Symantec CarrierScan, and Trend Micro (VSAPI). |
| 278 | </ti> |
260 | </ti> |
| 279 | </tr> |
261 | </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> |
|
|
| 286 | </table> |
262 | </table> |
| 287 | |
263 | |
| 288 | <p> |
264 | <p> |
| 289 | A couple of things worth mentioning about the USE flags and different |
265 | A couple of things worth mentioning about the USE flags and different |
| 290 | Samba functions include: |
266 | Samba functions include: |
| … | |
… | |
| 299 | <li> |
275 | <li> |
| 300 | While Active Directory, ACL, and PDC functions are out of the intended |
276 | While Active Directory, ACL, and PDC functions are out of the intended |
| 301 | scope of this HOWTO, you may find these links as helpful to your cause: |
277 | scope of this HOWTO, you may find these links as helpful to your cause: |
| 302 | <ul> |
278 | <ul> |
| 303 | <li><uri>http://www.bluelightning.org/linux/samba_acl_howto/</uri></li> |
279 | <li><uri>http://www.bluelightning.org/linux/samba_acl_howto/</uri></li> |
| 304 | <li><uri>http://open-projects.linuxcare.com/research-papers/winbind-08162000.html</uri></li> |
|
|
| 305 | <li><uri>http://www.wlug.org.nz/HowtoSamba3AndActiveDirectory</uri></li> |
280 | <li><uri>http://www.wlug.org.nz/HowtoSamba3AndActiveDirectory</uri></li> |
| 306 | </ul> |
281 | </ul> |
| 307 | </li> |
282 | </li> |
| 308 | </ul> |
283 | </ul> |
| 309 | |
284 | |
| … | |
… | |
| 384 | </pre> |
359 | </pre> |
| 385 | |
360 | |
| 386 | </body> |
361 | </body> |
| 387 | </section> |
362 | </section> |
| 388 | <section> |
363 | <section> |
| 389 | <title>Emerging net-print/hpijs</title> |
364 | <title>Emerging net-print/hplip</title> |
| 390 | <body> |
365 | <body> |
| 391 | |
366 | |
| 392 | <p> |
367 | <p> |
| 393 | You only need to emerge this if you use an HP printer. |
368 | You only need to emerge this if you use an HP printer. |
| 394 | </p> |
369 | </p> |
| 395 | |
370 | |
| 396 | <pre caption="Emerge hpijs"> |
371 | <pre caption="Emerge hplip"> |
| 397 | # <i>emerge net-print/hpijs</i> |
372 | # <i>emerge net-print/hplip</i> |
| 398 | </pre> |
373 | </pre> |
| 399 | |
374 | |
| 400 | </body> |
375 | </body> |
| 401 | </section> |
376 | </section> |
| 402 | </chapter> |
377 | </chapter> |
| … | |
… | |
| 679 | in the example are the directives that need to be changed: |
654 | in the example are the directives that need to be changed: |
| 680 | </p> |
655 | </p> |
| 681 | |
656 | |
| 682 | <pre caption="/etc/cups/cupsd.conf"> |
657 | <pre caption="/etc/cups/cupsd.conf"> |
| 683 | ServerName <i>PrintServer</i> <comment># your printserver name</comment> |
658 | ServerName <i>PrintServer</i> <comment># your printserver name</comment> |
| 684 | ServerAdmin <i>root@PrintServer</i> <comment># the person for printer-related hate-mail, eg you</comment> |
659 | ServerAdmin <i>root@PrintServer</i> <comment># the person for printer-related hate-mail, e.g. you</comment> |
| 685 | |
660 | |
| 686 | AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment> |
661 | AccessLog /var/log/cups/access_log <comment># probably doesn't need changing</comment> |
| 687 | ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment> |
662 | ErrorLog /var/log/cups/error_log <comment># doesn't really need changing either</comment> |
| 688 | |
663 | |
| 689 | LogLevel debug <comment># only while isntalling and testing, should later be |
664 | LogLevel debug <comment># only while isntalling and testing, should later be |
| 690 | # changed to 'info'</comment> |
665 | # changed to 'info'</comment> |
| 691 | |
666 | |
| 692 | MaxClients 100 <comment># I've had to set this to 1000000000 or so because some time back, |
667 | MaxClients 100 <comment># I've had to set this to 1000000000 or so because some time back, |
| 693 | # there seemed to be a bug in CUPS' controlling of the web interface, |
668 | # there seemed to be a bug in CUPS' controlling of the web interface, |
| 694 | # making CUPS think a denial of service attack was in progress when |
669 | # making CUPS think a denial of service attack was in progress when |
| 695 | # I tried to configure a printer with the web interface. weird.</comment> |
670 | # I tried to configure a printer with the web interface. weird.</comment> |
| … | |
… | |
| 698 | |
673 | |
| 699 | <Location /> |
674 | <Location /> |
| 700 | Order Deny,Allow |
675 | Order Deny,Allow |
| 701 | Deny From All |
676 | Deny From All |
| 702 | Allow From <i>192.168.1.*</i> <comment># the addresses of your internel network |
677 | Allow From <i>192.168.1.*</i> <comment># the addresses of your internel network |
| 703 | # eg 192.168.1.* will allow connections from any host on |
678 | # e.g. 192.168.1.* will allow connections from any host on |
| 704 | # the 192.168.1.0 network. change to whatever suits you</comment> |
679 | # the 192.168.1.0 network. change to whatever suits you</comment> |
| 705 | </Location> |
680 | </Location> |
| 706 | |
681 | |
| 707 | <Location /admin> |
682 | <Location /admin> |
| 708 | AuthType Basic |
683 | AuthType Basic |
| … | |
… | |
| 754 | |
729 | |
| 755 | <p> |
730 | <p> |
| 756 | First, go to <uri link="http://linuxprinting.org">LinuxPrinting.Org</uri> to |
731 | First, go to <uri link="http://linuxprinting.org">LinuxPrinting.Org</uri> to |
| 757 | find and download the correct PPD file for your printer and CUPS. To do so, |
732 | find and download the correct PPD file for your printer and CUPS. To do so, |
| 758 | click the link Printer Listings to the left. Select your printers manufacturer |
733 | click the link Printer Listings to the left. Select your printers manufacturer |
| 759 | and the model in the pulldown menu, eg HP and DeskJet 930C. Click "Show". On |
734 | and the model in the pulldown menu, e.g. HP and DeskJet 930C. Click "Show". On |
| 760 | the page coming up click the "recommended driver" link after reading the |
735 | the page coming up click the "recommended driver" link after reading the |
| 761 | various notes and information. Then fetch the PPD file from the next page, |
736 | various notes and information. Then fetch the PPD file from the next page, |
| 762 | again after reading the notes and introductions there. You may have to select |
737 | again after reading the notes and introductions there. You may have to select |
| 763 | your printers manufacturer and model again. Reading the <uri |
738 | your printers manufacturer and model again. Reading the <uri |
| 764 | link="http://www.linuxprinting.org/cups-doc.html">CUPS quickstart guide</uri> |
739 | link="http://www.linuxprinting.org/cups-doc.html">CUPS quickstart guide</uri> |
| … | |
… | |
| 773 | interface is found at <path>http://PrintServer:631</path> once CUPS is running. |
748 | interface is found at <path>http://PrintServer:631</path> once CUPS is running. |
| 774 | </p> |
749 | </p> |
| 775 | |
750 | |
| 776 | <pre caption="Install the printer via command line"> |
751 | <pre caption="Install the printer via command line"> |
| 777 | # <i>lpadmin -p HPDeskJet930C -E -v usb:/dev/ultp0 -m HP-DeskJet_930C-hpijs.ppd</i> |
752 | # <i>lpadmin -p HPDeskJet930C -E -v usb:/dev/ultp0 -m HP-DeskJet_930C-hpijs.ppd</i> |
|
|
753 | # <i>/etc/init.d/cupsd restart</i> |
| 778 | </pre> |
754 | </pre> |
| 779 | |
755 | |
| 780 | <p> |
756 | <p> |
| 781 | Remember to adjust to what you have. Be sure to have the name |
757 | Remember to adjust to what you have. Be sure to have the name |
| 782 | (<c>-p</c> argument) right (the name you set above during the Samba |
758 | (<c>-p</c> argument) right (the name you set above during the Samba |
| … | |
… | |
| 804 | drivers automagically to the connecting client, avoiding the hassle of |
780 | drivers automagically to the connecting client, avoiding the hassle of |
| 805 | manually installing printer drivers locally. |
781 | manually installing printer drivers locally. |
| 806 | </p> |
782 | </p> |
| 807 | |
783 | |
| 808 | <p> |
784 | <p> |
| 809 | There are two sets of printer drivers for this. First, the Adobe PS |
785 | There are two sets of printer drivers for this. First, the Adobe PS drivers |
| 810 | drivers which can be obtained from <uri |
786 | which can be obtained from <uri |
| 811 | link="http://www.adobe.com/support/downloads/main.html">Adobe</uri> |
787 | link="http://www.adobe.com/support/downloads/main.html">Adobe</uri> (PostScript |
| 812 | (PostScript printer drivers). Second, there are the CUPS PS drivers, |
788 | printer drivers). Second, there are the CUPS PS drivers, to be obtained <uri |
| 813 | to be obtained from <uri link="http://www.cups.org/software.php">the |
789 | link="http://dev.gentoo.org/~nightmorph/misc/cups-samba-5.0rc2.tar.gz">here</uri>. |
| 814 | CUPS homepage</uri> and selecting "CUPS Driver for Windows" from the |
790 | There doesn't seem to be a difference between the functionality of the two, but |
| 815 | pull down menu. There doesn't seem to be a difference between the |
791 | the Adobe PS drivers need to be extracted on a Windows System since it's a |
| 816 | functionality of the two, but the Adobe PS drivers need to be extracted |
792 | Windows binary. Also the whole procedure of finding and copying the correct |
| 817 | on a Windows System since it's a Windows binary. Also the whole procedure |
793 | files is a bit more hassle. The CUPS drivers seem to support some options the |
| 818 | of finding and copying the correct files is a bit more hassle. The CUPS |
794 | Adobe drivers don't. |
| 819 | drivers seem to support some options the Adobe drivers don't. |
|
|
| 820 | </p> |
795 | </p> |
|
|
796 | <!-- |
|
|
797 | used to be available at www.cups.org/articles.php?L142+p4, but only 6.0 is |
|
|
798 | available. at some point, we should update this for 6.0. |
|
|
799 | --> |
| 821 | |
800 | |
| 822 | <p> |
801 | <p> |
| 823 | This HOWTO uses the CUPS drivers for Windows. The downloaded file is |
802 | This HOWTO uses the CUPS drivers for Windows. The downloaded file is |
| 824 | called <path>cups-samba-5.0rc2.tar.gz</path>. Extract the files |
803 | called <path>cups-samba-5.0rc2.tar.gz</path>. Extract the files |
| 825 | contained into a directory. |
804 | contained into a directory. |
| … | |
… | |
| 837 | <path>cups5.hlp</path>, <path>cupsdrvr5.dll</path> and |
816 | <path>cups5.hlp</path>, <path>cupsdrvr5.dll</path> and |
| 838 | <path>cupsui5.dll</path>. These are the actual driver files. |
817 | <path>cupsui5.dll</path>. These are the actual driver files. |
| 839 | </p> |
818 | </p> |
| 840 | |
819 | |
| 841 | <warn> |
820 | <warn> |
| 842 | The script <c>cups-samba.install</c> may not work for all *nixes (ie FreeBSD) |
821 | The script <c>cups-samba.install</c> may not work for all *nixes (i.e. FreeBSD) |
| 843 | because almost everything which is not part of the base system is |
822 | because almost everything which is not part of the base system is |
| 844 | installed somewhere under the prefix <path>/usr/local/</path>. This |
823 | installed somewhere under the prefix <path>/usr/local/</path>. This |
| 845 | seems not to be the case for most things you install under GNU/Linux. |
824 | seems not to be the case for most things you install under GNU/Linux. |
| 846 | However, if your CUPS installation is somewhere other than |
825 | However, if your CUPS installation is somewhere other than |
| 847 | <path>/usr/share/cups/</path> see the example below. |
826 | <path>/usr/share/cups/</path> see the example below. |
| … | |
… | |
| 858 | # <i>tar -xf cups-samba.ss</i> |
837 | # <i>tar -xf cups-samba.ss</i> |
| 859 | <comment>(This extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY)</comment> |
838 | <comment>(This extracts the files to usr/share/cups/drivers under the CURRENT WORKING DIRECTORY)</comment> |
| 860 | # <i>cd usr/share/cups/drivers</i> |
839 | # <i>cd usr/share/cups/drivers</i> |
| 861 | <comment>(no leading / !)</comment> |
840 | <comment>(no leading / !)</comment> |
| 862 | # <i>cp cups* /usr/local/share/cups/drivers</i> |
841 | # <i>cp cups* /usr/local/share/cups/drivers</i> |
|
|
842 | # <i>/etc/init.d/cupsd restart</i> |
| 863 | </pre> |
843 | </pre> |
| 864 | |
844 | |
| 865 | <p> |
845 | <p> |
| 866 | Now we'll use the script <c>cupsaddsmb</c> provided by the CUPS |
846 | Now we'll use the script <c>cupsaddsmb</c> provided by the CUPS distribution. |
| 867 | distribution. It's man page is an interesting read. |
847 | Its man page is an interesting read. |
| 868 | </p> |
848 | </p> |
| 869 | |
849 | |
| 870 | <pre caption="Run cupsaddsmb"> |
850 | <pre caption="Run cupsaddsmb"> |
| 871 | # <i>cupsaddsmb -H PrintServer -U root -h PrintServer -v HPDeskJet930C</i> |
851 | # <i>cupsaddsmb -H PrintServer -U root -h PrintServer -v HPDeskJet930C</i> |
| 872 | <comment>(Instead of HPDeskJet930C you could also specify "-a", which will |
852 | <comment>(Instead of HPDeskJet930C you could also specify "-a", which will |
| 873 | "export all known printers".)</comment> |
853 | "export all known printers".)</comment> |
| 874 | # <i>cupsaddsmb -H PrintServer -U root -h PrintServer -a</i> |
854 | # <i>cupsaddsmb -H PrintServer -U root -h PrintServer -a</i> |
| 875 | </pre> |
855 | </pre> |
| 876 | |
856 | |
| 877 | <warn> |
857 | <warn> |
| 878 | The execution of this command often causes the most trouble. |
858 | The execution of this command often causes the most trouble. Read through the |
| 879 | Reading through the <uri |
|
|
| 880 | link="http://forums.gentoo.org/viewtopic.php?t=110931">posts in this |
859 | <uri link="http://forums.gentoo.org/viewtopic.php?t=110931">posts in this |
| 881 | thread</uri>. |
860 | thread</uri> for some troubleshooting tips. |
| 882 | </warn> |
861 | </warn> |
| 883 | |
862 | |
| 884 | <p> |
863 | <p> |
| 885 | Here are common errors that may happen: |
864 | Here are common errors that may happen: |
| 886 | </p> |
865 | </p> |
| … | |
… | |
| 1144 | troubleshooting your installation: |
1123 | troubleshooting your installation: |
| 1145 | </p> |
1124 | </p> |
| 1146 | |
1125 | |
| 1147 | <ul> |
1126 | <ul> |
| 1148 | <li><uri link="http://www.cups.org/">CUPS Homepage</uri></li> |
1127 | <li><uri link="http://www.cups.org/">CUPS Homepage</uri></li> |
|
|
1128 | <li> |
| 1149 | <li><uri link="http://www.samba.org/">Samba Homepage</uri></li> |
1129 | <uri link="http://www.samba.org/">Samba Homepage</uri>, especially the <uri |
|
|
1130 | link="http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html">chapter |
|
|
1131 | on Samba/CUPS configuration</uri> |
|
|
1132 | </li> |
| 1150 | <li><uri link="http://linuxprinting.org/">LinuxPrinting dot Org</uri></li> |
1133 | <li><uri link="http://linuxprinting.org/">LinuxPrinting dot Org</uri></li> |
| 1151 | <li> |
1134 | <li> |
| 1152 | <uri link="http://www.linuxprinting.org/kpfeifle/SambaPrintHOWTO/">Kurt |
1135 | <uri link="http://www.linuxprinting.org/kpfeifle/SambaPrintHOWTO/">Kurt |
| 1153 | Pfeifle's Samba Print HOWTO</uri> ( |
1136 | Pfeifle's Samba Print HOWTO</uri> ( |
| 1154 | This HOWTO really covers <e>ANYTHING</e> and <e>EVERYTHING</e> |
1137 | This HOWTO really covers <e>ANYTHING</e> and <e>EVERYTHING</e> |