Leveraging Windows Printers

Setting up a Windows printer has been made easier over the years . In our examples, we'll physically attach a printer to our Windows server. In addition, you might have other options, such as printer that is "networkable" via, say, an HP Jetdirect or similar print server device . We can't possibly go over all the potential options out therethere are just too darn many printer manufacturers with their own ways of doing things. However, we'll try to show you how to best prepare for those cases as you consult the manuals for the printers and their accompanying networking devices.

To get started, we'll physically attach our printer to our Windows server's parallel port. Our printer is a Canon BJC-7000.

Setting Up a Windows Printer

First things first: Let's tell our server about our new printer. We'll do this in four steps.

  1. We'll load the appropriate Windows drivers onto our server machine.

  2. Then, we'll share the printer so Windows computers and Linux computers running Samba can find it.

  3. We'll enable Windows' Internet Printing , otherwise known as IPP (Internet Printing Protocol), which will allow for both Windows and Linux clients to simply point to a web address to find the printer.

  4. We'll enable "old-school" Unix printing support via the LPD (Line Printer Daemon) protocol.

Loading Windows Printer Drivers

We'll tell Windows to maintain the spooler (which holds jobs in queue as they go to the printer) here on our server, windc1.ad.corp.com . But be forewarned, the vocabulary the wizard uses can be a bit misleading. We'll explain this as we go.

To set up a new Windows printer:

  1. Select Start image from book Control Panel image from book Printers and Faxes image from book Add Printer to initiate the "Add Printer Wizard." Once the wizard starts, click "Next."

  2. At the "Local or Network Printer" dialog select "Local printer attached to this computer." This is because in our examples we have physically attached the printer to the server via parallel port. However, note that you would use this same option to connect to HP Jetdirect or other networkable printer devices because even though those devices are over the network, the spooler (or software that holds the queue for printing) resides on this box. This can be confusing because the other option, "A network printer, or a printer attached to another computer" seems very temptingbut don't use it. You'd use that option to print to a printer that was already set up on another server.

  3. In the "Local or Network Printer" dialog, you also have the option to "Automatically detect and install my Plug and Play printer." I suggest you leave this check box disabled. In the upcoming dialogs you'll be able to specify which drivers are best suited to use.

  4. At the "Select a Printer Port" dialog, select the "Use the following port," select the "LPT1" setting, and click "Next."

  5. At the "Install Printer Software" dialog, select the manufacturer and printer model. In our example, we chose "Canon Bubble-Jet BJC-7000." Windows has built-in drivers for this printer. Then click "Next."

  6. At the "Name your Printer" screen, you can enter a name for the printer. Clear out the suggested name and enter WinPrinter1 and click "Next."

  7. At the "Printer Sharing" screen, you can give it a share name for others to see. By default, Windows truncates the name so all clients can handle itincluding Windows 9 x and all ancient computers. However, we're assuming you have no ancient machines in our pretend world, so go ahead and change the name back to WinPrinter1 and click "Next."

  8. At the "Location and Comment" screen enter something that might be appropriate, like 1st floor by the coffee machine ; you might also enter a comment such as who tends to the supplies and other care and feeding. When ready, click "Next."

  9. At the "Print Test Page" we always select "Yes." That way, we know Windows actually sees the printer.

Enabling Windows Internet Printing (IPP)

Windows and Linux share a modern, neat way of offering printing services to clients. It's an Internet standard called IPP, or Internet Printing Protocol, and it's documented in the Internet Printing Protocol (IPP) in RFC 2910. The idea is that if you know a web page address (e.g., http://< something > ), you'll be able to print to the printer. RFC 2910 says that printer traffic will come over port 631 (as opposed to the normal port 80 traffic for http).

Everything in Windows that involves anything http means that Windows IIS needs to be configured. At installation time, we recommended that you install IIS on your Windows server, so you should be ready to go here. If you haven't loaded IIS, you'll have to do that now. Again, IPP is optional but very neat, and we'll be setting it up so our Windows and Linux clients will know the web address of our printers and be able to be off and running.

Here's the trick, though. Windows doesn't call it IPP, they have their own name: Windows Internet Printing. In addition, Microsoft's Windows Internet Printing doesn't use the standard port 631it uses regular ol' port 80. According to Microsoft, this is because the original RFC didn't specify a port, and that's what Microsoft wrote to. Now the RFC specifies port 631, but Microsoft was already committed to port 80. This really isn't a problem, though it might be nice if Microsoft had an easy-breezy way to make Windows Internet Printing completely support the RFC standard. But they don't. So, as we go along in this journey, we'll tell our Linux clients how to use Windows Internet Printing over port 80 so the Windows server can pick up the traffic, run with it, and start printing.

Let's configure it now.

Installing IIS and Internet Printing (If Not Previously Performed)

The first step in using IPP is to ensure that Windows IIS and the Internet Printing extension is installed. To install IIS (or to check if it's installed):

  1. Select Start image from book Control Panel image from book Add or Remove Programs.

  2. Select "Add / Remove Windows Components ."

  3. In the list of components, double-click "Web Application Server" and select the "Internet Information Services (IIS)" check box.

  4. Double-click the "Internet Information Services (IIS)" entry to see the optional components underneath. Ensure "Internet Printing" is selected, as shown in Figure 5.2.

  5. Click "OK" to close the "Internet Information Services (IIS)" screen. Click "OK" to close the "Application Server" screen.

  6. Click "Next" to continue at the Windows Components screen.

  7. Click "Finish," then close Add/Remove Programs

image from book
Figure 5.2: Use Add/Remove Programs to install "Internet Printing."
Verifying Windows Internet Printing is Installed

You just verified that IIS with the "Internet Printing" option is installed. So, theoretically, Windows Internet Printing is ready to go. However, it's always best to confirm that it's enabled. To confirm Windows Internet Printing is enabled:

  1. Select Start image from book Programs image from book Administrative Tools image from book Internet Information Services Manager (IIS).

  2. Drill down to Windc1 image from book Web Services Extensions. Ensure "Internet Printing" is present and has a status of "Allowed."

Setting Up IIS to Allow Windows Internet Printing from Linux Clients

By default the only clients who can print via IPP are (who woulda guessed?) Windows clients. If we want Linux clients to be able to print using Windows Internet Printing, we need to open up additional access to "anonymous access."

Enabling anonymous printing allows a Linux user to send bazillions of pages of print jobs to any printer hosted by the Windows print server. As it stands now, Windows users can already do this, but you should know what you're getting into.

Warning 

Allowing access to Anonymous opens up a potential security issue. This is because Anonymous will have read/write access to the spool files.

To do this:

  1. In the IIS manager, drill down to WinDC1 image from book Web Sites image from book Default Web Site image from book Printers. Right-click "Printers" and select "Properties."

  2. Select the "Directory Security" tab. In the "Authentication and access control" section select "Edit" to open the "Authentication Methods " dialog.

  3. In the "Authentication Methods" dialog, select "Enable anonymous access" and ensure "Integrated Windows authentication" is enabled, as shown in Figure 5.3. You can leave everything else the same.

  4. Click "OK" to return to the "Printers Properties" dialog.

  5. Click "OK" to return to the IIS Manager. Close the IIS Manager.

image from book
Figure 5.3: You can secure IIS to allow authentication in a number of ways. Here, we suggest you specify only "Integrated Windows authentication."
Tip 

You can also control access to Internet printers based on the IP address (as opposed to user credentials). To specify which computers can use the printers, in the Printers Properties screen, select "Edit" under "IP address and domain name restrictions."

Preparing for Older Clients

As time marches on, newer and better ways to do things come along. Printing is definitely one of those things that have gotten easer and better over time. However, there might be occasions when you have Windows or Linux clients that are stuck in the stone age. Consequently, you need to configure your server so your older clients can still print. Let's make some adjustments to our Windows servers so our older Windows clients can print. Additionally, we'll set up a service on our Windows server so that older Unix (and Linux) clients can print using an older protocol called LPD.

Preparing for Older Windows Clients

Modern Windows clients need little preparation to start printing with Windows servers right away. However, if you have old and crusty clients such as Windows 9 x or Windows NT 4 lying around, it might be in your best interest to enable those computers to automatically download the drivers from this Windows server.

To do that, right-click over the printer definition in the Printers applet in Control Panel and select "Properties." In the "Sharing" tab, select "Additional Drivers" (in the lower right side). Then select the category of driver you want to additionally install, such as Windows NT 4.0. Note that in Figure 5.4, no older client drivers are actually selected.

image from book
Figure 5.4: If desired, you can add automatic downloading driver support for older Windows clients.

Once you select the additional drivers, you'll be prompted for the files. This is where the pain can occur. That is, you need to dig up the drivers from either the old NT 4 CD-ROM or download them from a manufacturer's websiteor maybe they don't exist at all.

Preparing for Older Unix/Linux Clients

As you're about to see, we'll want our Linux clients to print to Windows servers via modern methods, such as the traditional Windows printing protocol (SMB, the same protocol used for Windows file sharing in Chapter 4) or the newer Windows Internet Printing.

However, the original old-school way to print from Unix to Unix was via a client-side program called Line Printer Request, or "LPR," which sent data to a Unix server running "LPD" or Line Printer Daemon. This method is falling by the wayside but is still in heavy use, especially on legacy systems. To that end, Windows can pretend to run LPD. That way, older Unix and Linux clients that don't want to (or cannot) print via one of the new-school ways can still interoperate and print.

So we'll teach Windows to run the LPD (via a service called "Print Services for Unix") so an older Unix or Linux machine needn't change in any way to print to Windows. Again, this isn't the preferred methodit's here for completeness. Additionally, the "Print Services for Unix" are not part of the Services for Unix 3.5 we loaded in earlier chapters. "Print Services for Unix" are just a regular, built-in part of Windows 2003 and Windows XP.

To enable Print Services for Unix:

  1. Select Start image from book Control Panel image from book Add or Remove Programs.

  2. Select "Add / Remove Windows Components."

  3. In the list of components, double-click "Other Network File and Print Services" and select the "Print Services for Unix," as shown in Figure 5.5.

  4. Click "OK" to return to the Windows Components screen and click "Next" to continue.

  5. Click "Finish" when finished.

image from book
Figure 5.5: "Print Services for Unix" is built into Windows 2003 and Windows XP and enables LPD printing.

Performing Printing Tests

Now that our Windows server is all set up to accept print jobs from Windows and Linux clients, let's do some testing.

Printing from Windows Clients

There are several ways you can locate printers from a Windows client:

  • Using Active Directory We'll be exploring this option later, but here's the short story. Once SMB printers are available (either from Windows or Linux Samba), they can be "published" in Active Directory. Then our Active Directoryaware clients can easily find them, connect to them, and print to them.

  • Using Network Neighborhood to browse You can, if you like, browse for SMB printers using Network Neighborhood. Just browse, browse, browse, find the printer and double-click it to load the drivers. You'll get a chance to do this later.

  • Using \\ servername \printername We'll explore this in this chapter. That is, we'll just enter the name of the server and the printer and, voil ! We'll be printing in no time.

  • Using Windows Internet Printing This method of printing allows us to take advantage of the new Windows Internet Printing we just set up. We can point our Windows clients to the printer using only a web-browser. We'll also explore this in this chapter.

Using \\servername\printername

The most common way to connect to a Windows printer is by opening the "Printers and Faxes" applet in Control Panel and selecting "Add a printer" to start the "Add Printer Wizard."

At the "Local or Network Printer" screen, you'll be able to select "A network printer, or a printer attached to another computer." You'll then have the option to "Connect to this printer (or to browse for a printer, select this option and click Next)," as shown in Figure 5.6. Either type the name of the printer ( \\windc1\WinPrinter1 ), or leave it blank and click "Next" and browse for the printer.

image from book
Figure 5.6: You can enter the SMB name of the printer in the "Add Printer Wizard."

Note that browsing for the printer is different from searching for the printer. Browsing relies on Windows' Browser service. Searching, as we'll perform at the end of the chapter, relies on records within Active Directory that we can search for.

When ready, enter the name of the server and printer as shown in Figure 5.6 and click "Next." You will be asked if you want to make this the default printer. Click "Next" to say yes, then click "Finish" to close the wizard.

Note 

At the "Local or Network Printer" screen, instead of selecting a network printer you can browse for a printer. To do this, select the option "Connect to this printer" option and click "Next"but note that browsing for the printer is different from searching for the printer. Browsing relies on Windows' Browser service. Searching, as we'll perform at the end of the chapter, relies on records within Active Directory that we can search for.

Using Windows Internet Printing

Another way to connect to the printer on WinDC1 is to use the Windows Internet Printing we set up earlier. To connect to a printer from an XP client:

  1. Fire up Internet Explorer.

  2. Enter the address in the form of http:// <server_name> /printers , such as http://windc1/printers . A list of shared printers on the server appears.

  3. Click the name of the printer. You'll see several possible "Printer Actions." Select "Connect to this printer," as shown in Figure 5.6, and you'll be prompted to add the printer as shown in Figure 5.7.

image from book
Figure 5.7: Windows Internet Printing offers an easy way to connect to printers.
Note 

You already installed the printer in the previous step, so re-installing it here won't have any effect.

You can now try to send a test print to the printer!

Printing to Windows Servers from Linux Clients

Of course, Windows to Windows printing should "just work." The fun part starts when Linux clients try to print to Windows server. There are three ways they can do this:

  • Printing via LPD Linux can talk old school to Windows (which is happy to talk old school, too).

  • Printing via SMB Linux can send native SMB printing requests to Windows machinesjust like the majority of Windows clients do.

  • Printing via Internet Printing (IPP) Since we just set up Windows Internet Printing, it might be nice to use it. Again, note that Windows uses port 80 (where the RFC specifies port 631), so we have to tell our Linux clients to use port 80 and not 631.

Linux Clients Printing to Windows LPD

As stated, the old-fashioned way to print on Unix is called LPD. It's still well supported by modern Linux distributions. When you have a modern Linux client and a modern Windows server, you're not likely to use it because you have the (better) options of using IPP and/or SMB printing. However, for completeness, let's ensure that our Windows can embrace Linux printer jobs and utilize LPD.

We'll configure our Linux client (which is a member of our Active Directory), adlincli1 , to print via LPD. Rather than Webmin, we'll use Fedora's standard printer configuration tool, which does a good job. Indeed, the Printer Queue Setup Wizard is quite friendly to work with. In general, the standard Fedora tools work well enough for client tasks , so we chose not to install Webmin on our clients.

In the Unix world, historically everything was printed in a common lingua franca known as the Postscript language, and the old-school Unix-to-Unix way of printing would be to just choose a generic Postscript driver. This clever technique sidesteps the worry about specific printer drivers on every Unix client system; we'll further explore this curiosity later.

However, in this case, we need to tell our Linux client about the proper printer driver we need because our target machine is a Windows print server. We'll select the BJC-7000 specifically (when we come to that step). To configure our Linux client machine to print a Windows LPD server:

  1. From the "Applications" menu, drill down to System Settings image from book Printing. Wait for the "Printer configuration" tool to appear.

  2. Click the "New" button to add a new print queue.

  3. Click "Forward" on the explanatory page that follows .

  4. On the "Queue name" page, enter WinPrinter1ViaLPD in the "Name" field. In the "Short description" field, enter Windows Printer One Via LPD or another descriptive name that you like. Click "Forward."

  5. On the "Queue type" page, pull down the "Select a queue type" menu and pick "Networked Unix (LPD)," as shown in Figure 5.8.

  6. The "Server" and "Queue" fields appear. Enter windc1 in the "Server" field and WinPrinter1 in the "Queue" field. Click "Forward."

  7. On the "Printer model" page, pull down the "Manufacturer" menu and pick "Canon." Then scroll through the list of models and pick "BJC 7000." Click "Forward."

  8. The "Finish, and Create the New Print Queue" page appears. Click "Finished."

  9. When asked whether you wish to print a test page, click the "Yes" button. A test page will emerge from your printer after a short delay.

image from book
Figure 5.8: Once your Windows server has LPD set up, you can choose LPD printing as an option.

For a more interesting test, we also suggest launching OpenOffice Writer from the "Office" section of the "Applications" menu. Create a simple document and pick "Print" from the "File" menu. Be sure to select "WinPrinter1ViaLPD" as the printer to use, then click "Print" in the "Print" dialog to send your test document to the Windows-hosted printer.

Linux Clients Printing via Samba to Windows SMB

Linux can also handle printing to native Windows SMB printer shares, thanks to Samba. The process is just as smooth as the just-demonstrated LPD (and quite similar), though there is one snag.

You'll choose this option when you have control over your Linux clients but can't change (or don't want to change) much on the Windows server. In cases like these, printing directly to Windows via Linux SMB printing support is ideal.

When you have the option of setting up Windows Internet Printing on the Windows server, the case for SMB isn't quite as strong. Given a choice between the two, Windows Internet Printing is probably the easiest way to go. That's because IPP is an open standard; the rules aren't likely to change.

Since SMB is not a fully open and documented standard, there's always a chance that a new version or service pack of Windows will exercise features the Samba team hasn't seen before. That makes SMB printing a moving target, which can lead to temporary but annoying problems for Samba file sharing and printing. In addition, in our tests we had difficulty printing test pages from the Fedora printer configuration tool, although printing from actual applications worked fine. True, SMB printer sharing offers the ability to install drivers automatically, but those drivers are for Windows only, so they don't help your Linux clients support new printers. Active Directory does offer a searchable database of printers, but as of this writing, Fedora's printer configuration tool doesn't support searching it. Given these facts, we think your best choice is to set up Windows Internet Printing. However, when you can't, SMB printing from Linux is a fine alternative.

Setting up adlincli1 to print via SMB isn't difficult. Once again, we'll use Fedora's standard printer configuration tool. The Printer Queue Setup Wizard works fine for SMB printing, except for a problem we observed in our tests of the "print a test page" feature.

  1. Pull down the "Applications" menu and drill down to System Settings image from book Printing. Wait for the printer configuration tool to come up.

  2. Click the "New" button to add a new print queue.

  3. Click "Forward" on the following page.

  4. On the "Queue name" page, enter WinPrinter1ViaSMB in the "Name" field. In the "Short description" field, enter Windows Printer One Via SMB or another descriptive name that you like. Click "Forward."

  5. On the "Queue type" page, pull down the "Select a queue type" menu and pick "Networked Windows (SMB)."

  6. A list of shares appears. If the server you want appears, greatclick the arrow to the left of it to display a list of shares and double-click the shared printer you want. The "Authentication" dialog should appear with the "Workgroup," "Server" and "Share" fields already filled in. If it does not, as in our tests, click the "Specify" button.

  7. If not already done, set the "Workgroup" field to AD , as shown in Figure 5.9.

  8. If not already done, set the "Server" field to WinDC1 .

  9. If not already done, set the "Share" field to WinPrinter1 .

  10. Set the "User name" field to administrator .

  11. Set the "Password" field to p@ssword .

    Note 

    For the record, Windows applications that provide SMB print services are kerberized . That means, theoretically, you shouldn't have to enter your username and password when printing from Windows clients to Windows servers. However, the Linux client GUI isn't quite there yet with kerberization. So, when printing from Linux to Windows clients, you will likely still need to enter your credentials. See Chapter 4 for more information about kerberization.

  12. Click "OK" to dismiss the "Authentication" dialog.

  13. Note that WinDC1 is added to the list of servers if it was not previously detected . Make sure "WinPrinter1 (Specified)" is selected beneath it.

  14. Click "Forward."

  15. On the "Printer model" page, pull down the "Manufacturer" menu and pick "Canon." Then scroll through the list of models and pick "BJC 7000." Click "Forward."

  16. The "Finish, and Create the New Print Queue" page appears. Click "Finished."

  17. When asked whether you wish to print a test page, you may click the "Yes" button. However, in our tests, this did not produce a successful test pagebut actual printing from applications worked just fine.

image from book
Figure 5.9: Select your Windows queue and then enter your Active Directory credentials.

For a more meaningful test, especially if the test page feature does not work for you, we suggest launching OpenOffice Writer from the "Office" section of the "Applications" menu. As in the previous example, create a simple document and pick "Print" from the "File" menu. Be sure to select "WinPrinter1ViaSMB" as the printer to use, then click "Print" in the "Print" dialog to send your test document to the Windows-hosted printer.

Linux Clients Printing via IPP to Windows Internet Printing

Leveraging Windows Internet Printing is the best bet for supporting Linux clients printing to Windows servers because Windows Internet Printing is compatible with the Internet Printing Protocol (IPP), an open standard. Again, however, it should be noted that the genuine RFC 2910 standard clearly states that the printing traffic is required (in big ALL CAP letters ) to utilize port 631, whereas Windows Internet Printing only supports port 80 by default. To be fair, it is possible to add an additional virtual "website" listening on port 631 to your IIS configuration, but this ought to happen right out of the box when IPP is installed. We'll continue configuring adlincli1 and have it print to our Windows servers via IPP/Windows Internet Printing.

Windows Internet Printing printers don't advertise their existence in a way that makes it easy for Fedora clients to browse them. By contrast, you'll see later that when we set up printers on Fedora that Fedora goes the extra mile and broadcasts their existence. This allows for users on Fedora to more easily find Fedora printers. Windows clients can browse or search for Windows Internet Printing printers if they are published in Active Directory, but this doesn't currently help Fedora clients.

So Fedora clients won't be able to just "find" Windows printers via Windows Internet Printing. We need to manually type the path and server where the printer is located the first time we use such a printer. And, since Windows Internet Printing normally responds on port 80 while Fedora's expectation is to deliver on port 631, we'll need to properly instruct the client about the required port change.

Let's jump right to the end of this little story by taking a look at the dialog box we'll enter our printer information into, as shown in Figure 5.10. (Don't worry, we'll describe all the step-by-steps in a second.)

image from book
Figure 5.10: Printing to a Windows server with Windows Internet Printing requires you to specifically enter the port number (80) and the printer path.

To talk to a Windows Internet Printing server, we need to know three pieces of information:

  • Server The "Server" field will always look like this

     servername:80 
  • In our example, the server name is WinDC1, so the correct setting is:

     WinDC1:80 
  • Path The "Path" field will always look like this:

     /printers/printername/.printer 
  • In our example, the printer name is WinPrinter1, so the correct setting is:

     /printers/WinPrinter1/.printer 

The /printers/ prefix is necessary because Windows Internet Printing is delivered by the web server, which may have other uses. So printers don't belong in the top folder. The /.printer suffix is a common convention and mandatory when using Windows Internet Printing.

Now we know enough to set up our Fedora system as a client of Windows Internet Printing. To have our Linux client print to Windows via IPP:

  1. Pull down the "Applications" menu and drill down to System Settings image from book Printing. Wait for the "Printer configuration" tool to appear.

  2. Click the "New" button to add a new print queue.

  3. Click "Forward" on the explanatory page that follows.

  4. On the "Queue name" page, enter WinPrinter1ViaIPP in the "Name" field. In the "Short description" field, enter Windows Printer One Via IPP or another descriptive name that you like. Click "Forward."

  5. On the "Queue type" page, pull down the "Select a queue type" menu and pick "Networked Unix (CUPS)."

  6. The "Server" and "Queue" fields appear. Enter WinDC1:80 in the "Server" field (note that we specify port 80). Enter /printers/WinPrinter1/.printer in the "Path" field (see Figure 5.10). Click "Forward."

  7. On the "Printer model" page, pull down the "Manufacturer" menu and pick "Canon." Then scroll through the list of models and pick "BJC 7000." Click "Forward."

  8. The "Finish, and Create the New Print Queue" page appears. Click "Finished."

  9. When asked whether you wish to print a test page, click the "Yes" button. A test page will emerge after a short delay.

As in the previous scenarios, we also suggest using OpenOffice Writer to carry out a more interesting test. Be sure to select "WinPrinter1ViaIPP" as the printer to use.



Windows and Linux Integration. Hands-on Solutions for a Mixed Environment
Windows And Linux Integration Hands-on Solutions for a Mixed Environment - 2005 publication.
ISBN: B003JFRFG0
EAN: N/A
Year: 2005
Pages: 71

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net