1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
---|
2 | <HTML> |
---|
3 | <HEAD> |
---|
4 | <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> |
---|
5 | <TITLE> LPRng-HOWTO: Client To Server Connection Information</TITLE> |
---|
6 | <LINK HREF="LPRng-HOWTO-8.html" REL=next> |
---|
7 | <LINK HREF="LPRng-HOWTO-6.html" REL=previous> |
---|
8 | <LINK HREF="LPRng-HOWTO.html#toc7" REL=contents> |
---|
9 | </HEAD> |
---|
10 | <BODY> |
---|
11 | <A HREF="LPRng-HOWTO-8.html">Next</A> |
---|
12 | <A HREF="LPRng-HOWTO-6.html">Previous</A> |
---|
13 | <A HREF="LPRng-HOWTO.html#toc7">Contents</A> |
---|
14 | <HR> |
---|
15 | <H2><A NAME="s7">7. Client To Server Connection Information</A></H2> |
---|
16 | |
---|
17 | <P>The LPRng software is a true set of client/server applications. |
---|
18 | The LPRng clients, |
---|
19 | <CODE>lpr, lprm, lpq,</CODE> and <CODE>lpc</CODE> connect to a <CODE>lpd</CODE> server using a |
---|
20 | TCP/IP connection. |
---|
21 | This means that you must have TCP/IP networking enabled on your workstation |
---|
22 | to use LPRng. |
---|
23 | <P>However, |
---|
24 | you do not need to have an external network connection to the Internet. |
---|
25 | For most single system users, |
---|
26 | the <CODE>lpd</CODE> server is running on the same workstation as the client program, |
---|
27 | and the clients will simply talk to the <CODE>localhost</CODE>. |
---|
28 | <H2><A NAME="forcelocalhost"></A> <A NAME="defaultprinterwhenunknown"></A> <A NAME="defaultprinter"></A> <A NAME="defaulthost"></A> <A NAME="PRINTER"></A> <A NAME="printerenv"></A> <A NAME="ss7.1">7.1 Printer Name and Server IP Address</A> |
---|
29 | </H2> |
---|
30 | |
---|
31 | <P>Options used: |
---|
32 | <UL> |
---|
33 | <LI> <CODE>PRINTER</CODE><EM> Environment variable </EM></LI> |
---|
34 | <LI> <CODE>force_localhost</CODE><EM> force clients to send requests to localhost </EM></LI> |
---|
35 | <LI> <CODE>default_printer_when_unknown</CODE> <EM>used by LPD when printer name not in printcap </EM></LI> |
---|
36 | </UL> |
---|
37 | <P>When an LPRng client such as |
---|
38 | <CODE>lpr</CODE>, |
---|
39 | <CODE>lpq</CODE>, |
---|
40 | <CODE>lprm</CODE>, |
---|
41 | or |
---|
42 | <CODE>lprc</CODE> |
---|
43 | needs to communicate with a print server, |
---|
44 | the only information they normally need is: |
---|
45 | <OL> |
---|
46 | <LI>The spool queue or <I>remote printer</I> |
---|
47 | to be used in requests to the <CODE>lpd</CODE> print server. |
---|
48 | This is sometimes referred to as the <I>printer</I> or <I>print queue</I> name.</LI> |
---|
49 | <LI>The IP address or hostname of the <I>print server</I> or <I>remote server</I>. |
---|
50 | This is sometimes called the <I>remote host</I> or simply <I>server</I>.</LI> |
---|
51 | <LI>Options that control <EM>how</EM> jobs or commands are transferred to the server host. |
---|
52 | These options might include encryption and client side job filtering. |
---|
53 | We will discuss these capabilities later.</LI> |
---|
54 | </OL> |
---|
55 | <P>LPRng has several ways to specify the <I>printer queue</I> and <I>server</I> information. |
---|
56 | <H3>Command Line -Pprinter@host</H3> |
---|
57 | |
---|
58 | <P>The <CODE>-P printer@host</CODE> option specifies both the print queue and |
---|
59 | server. |
---|
60 | <BLOCKQUOTE><CODE> |
---|
61 | <PRE> |
---|
62 | lpr -Plaser@10.0.0.1 |
---|
63 | lpq -Plp@myserver |
---|
64 | </PRE> |
---|
65 | </CODE></BLOCKQUOTE> |
---|
66 | <P>When used as a command line option, |
---|
67 | the printcap database will not be consulted for other options or information. |
---|
68 | This allows LPRng clients to function without a printcap database, |
---|
69 | and without a <CODE>lpd</CODE> print server running on their local host. |
---|
70 | However, |
---|
71 | options set in the <CODE>/etc/lpd.conf/</CODE> and the compile time defaults |
---|
72 | will still be used. |
---|
73 | <H3>Command Line -Pprinter</H3> |
---|
74 | |
---|
75 | <P>This form will cause the LPRng clients to look in the |
---|
76 | <CODE>/etc/printcap</CODE> |
---|
77 | for a printcap entry with the name or alias <CODE>printer</CODE> |
---|
78 | and use the information in that printcap entry. |
---|
79 | We will discuss the format of the printcap entry in a moment. |
---|
80 | Example: |
---|
81 | <BLOCKQUOTE><CODE> |
---|
82 | <PRE> |
---|
83 | lpr -Plp |
---|
84 | </PRE> |
---|
85 | </CODE></BLOCKQUOTE> |
---|
86 | <H3>PRINTER Environment Variable</H3> |
---|
87 | |
---|
88 | <P>If no command line option is specified, |
---|
89 | the LPRng clients will check for a <CODE>PRINTER</CODE> environment variable value |
---|
90 | and will use it as though specified as a |
---|
91 | <CODE>-P$PRINTER</CODE> command line option. |
---|
92 | <P>If the $PRINTER value has the form |
---|
93 | <CODE>printer@host</CODE> the print queue will be <CODE>printer</CODE> on server <CODE>host</CODE> |
---|
94 | and not consult the printcap database. |
---|
95 | If the $PRINTER value has the form <CODE>printer</CODE> then the printcap will be searched |
---|
96 | for a <CODE>printer</CODE> printcap entry. |
---|
97 | For example: |
---|
98 | <BLOCKQUOTE><CODE> |
---|
99 | <PRE> |
---|
100 | export PRINTER=laser@10.0.0.1; lpr |
---|
101 | export PRINTER=pr; lpr |
---|
102 | </PRE> |
---|
103 | </CODE></BLOCKQUOTE> |
---|
104 | <H3>Default Printer From Printcap</H3> |
---|
105 | |
---|
106 | <P>If you do not specify a printer on the command line or in the <CODE>PRINTER</CODE> |
---|
107 | environment variable, |
---|
108 | then LPRng will search the printcap and use the first valid printcap entry |
---|
109 | as the printer. |
---|
110 | <H3>Default Printer When No Printcap</H3> |
---|
111 | |
---|
112 | <P>If you do not have a <CODE>/etc/printcap</CODE> file, |
---|
113 | then LPRng will use the |
---|
114 | <CODE>default_printer</CODE> |
---|
115 | and |
---|
116 | <CODE>default_remote_host</CODE> |
---|
117 | <I>fallback</I> |
---|
118 | values set in the <CODE>/etc/lpd.conf</CODE> file or by the compile time defaults. |
---|
119 | <P>Using the fallback values is usually not a desirable event and may indicate |
---|
120 | that you have a misconfigured host, so the fallback values are usually set |
---|
121 | by administrators to <CODE>missingprinter@localhost</CODE> to provoke an annoying message for users. |
---|
122 | <H3>LPD Default Printer</H3> |
---|
123 | |
---|
124 | <P>For completeness, |
---|
125 | there is even a <CODE>default_printer_when_unknown</CODE> configuration |
---|
126 | entry for use by LPD when it is given a printer name not in its printcap |
---|
127 | database. |
---|
128 | By default, |
---|
129 | it will look up this name in the database and treat the job as though it was |
---|
130 | sent to this printer. |
---|
131 | <H2><A NAME="ss7.2">7.2 LPD Server Runnning on Localhost</A> |
---|
132 | </H2> |
---|
133 | |
---|
134 | <P>Workstations for personal use or in extremely simple configurations |
---|
135 | will always run an <CODE>lpd</CODE> server on the <I>localhost</I>. |
---|
136 | This is the most common situation for the majority of new |
---|
137 | users, |
---|
138 | and the |
---|
139 | default LPRng installation sets the default value of the |
---|
140 | <CODE>force_localhost</CODE> configuration parameter to <B>TRUE</B> or to 1. |
---|
141 | The |
---|
142 | <CODE>lpr</CODE> |
---|
143 | <CODE>lpq</CODE> |
---|
144 | <CODE>lprm</CODE> |
---|
145 | and |
---|
146 | <CODE>lpc</CODE> will connect to <CODE>localhost</CODE> (usually IP address 127.0.0.1) |
---|
147 | unless explicitly overridden by the command line <CODE>-Pprinter@host</CODE> argument. |
---|
148 | <P>Larger sites or organizations which want to use a central print server |
---|
149 | to handle multiple printers or printer sharing |
---|
150 | may want the clients to connect directly to the server. |
---|
151 | In this case the system administrator should set |
---|
152 | <CODE>force_localhost@</CODE> in the |
---|
153 | <CODE>/etc/lpd.conf</CODE> or modify the compile time default. |
---|
154 | See |
---|
155 | <A HREF="LPRng-HOWTO-8.html#lp">Simple Client Printcap Entry</A> |
---|
156 | for ways to change this. |
---|
157 | <HR> |
---|
158 | <A HREF="LPRng-HOWTO-8.html">Next</A> |
---|
159 | <A HREF="LPRng-HOWTO-6.html">Previous</A> |
---|
160 | <A HREF="LPRng-HOWTO.html#toc7">Contents</A> |
---|
161 | </BODY> |
---|
162 | </HTML> |
---|