source: trunk/third/lprng/doc/LPRng-HOWTO-7.html @ 14517

Revision 14517, 6.3 KB checked in by mwhitson, 25 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14516, which included commits to RCS files with non-trunk default branches.
Line 
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.
18The LPRng clients,
19<CODE>lpr, lprm, lpq,</CODE> and <CODE>lpc</CODE> connect to a <CODE>lpd</CODE> server using a
20TCP/IP connection.
21This means that you must have TCP/IP networking enabled on your workstation
22to use LPRng.
23<P>However,
24you do not need to have an external network connection to the Internet.
25For most single system users,
26the <CODE>lpd</CODE> server is running on the same workstation as the client program,
27and 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>&nbsp;&nbsp;Environment variable </EM></LI>
34<LI> <CODE>force_localhost</CODE><EM>&nbsp;&nbsp;force clients to send requests to localhost </EM></LI>
35<LI> <CODE>default_printer_when_unknown</CODE>&nbsp;&nbsp; <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>,
41or
42<CODE>lprc</CODE>
43needs to communicate with a print server,
44the only information they normally need is:
45<OL>
46<LI>The spool queue or <I>remote printer</I>
47to be used in requests to the <CODE>lpd</CODE> print server.
48This 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>.
50This 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.
52These options might include encryption and client side job filtering.
53We 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
59server.
60<BLOCKQUOTE><CODE>
61<PRE>
62lpr -Plaser@10.0.0.1
63lpq -Plp@myserver
64</PRE>
65</CODE></BLOCKQUOTE>
66<P>When used as a command line option,
67the printcap database will not be consulted for other options or information.
68This allows LPRng clients to function without a printcap database,
69and without a <CODE>lpd</CODE> print server running on their local host.
70However,
71options set in the <CODE>/etc/lpd.conf/</CODE> and the compile time defaults
72will 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>
77for a printcap entry with the name or alias <CODE>printer</CODE>
78and use the information in that printcap entry.
79We will discuss the format of the printcap entry in a moment.
80Example:
81<BLOCKQUOTE><CODE>
82<PRE>
83lpr -Plp
84</PRE>
85</CODE></BLOCKQUOTE>
86<H3>PRINTER Environment Variable</H3>
87
88<P>If no command line option is specified,
89the LPRng clients will check for a <CODE>PRINTER</CODE> environment variable value
90and 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>
94and not consult the printcap database.
95If the $PRINTER value has the form <CODE>printer</CODE> then the printcap will be searched
96for a <CODE>printer</CODE> printcap entry.
97For example:
98<BLOCKQUOTE><CODE>
99<PRE>
100export PRINTER=laser@10.0.0.1; lpr
101export 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>
107environment variable,
108then LPRng will search the printcap and use the first valid printcap entry
109as the printer.
110<H3>Default Printer When No Printcap</H3>
111
112<P>If you do not have a <CODE>/etc/printcap</CODE> file,
113then LPRng will use the
114<CODE>default_printer</CODE>
115and
116<CODE>default_remote_host</CODE>
117<I>fallback</I>
118values 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
120that you have a misconfigured host, so the fallback values are usually set
121by administrators to <CODE>missingprinter@localhost</CODE> to provoke an annoying message for users.
122<H3>LPD Default Printer</H3>
123
124<P>For completeness,
125there is even a <CODE>default_printer_when_unknown</CODE> configuration
126entry for use by LPD when it is given a printer name not in its printcap
127database.
128By default,
129it will look up this name in the database and treat the job as though it was
130sent 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
135will always run an <CODE>lpd</CODE> server on the <I>localhost</I>.
136This is the most common situation for the majority of new
137users,
138and the
139default LPRng installation sets the default value of the
140<CODE>force_localhost</CODE> configuration parameter to <B>TRUE</B> or to 1.
141The
142<CODE>lpr</CODE>
143<CODE>lpq</CODE>
144<CODE>lprm</CODE>
145and
146<CODE>lpc</CODE> will connect to <CODE>localhost</CODE> (usually IP address 127.0.0.1)
147unless 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
149to handle multiple printers or printer sharing
150may want the clients to connect directly to the server.
151In 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.
154See
155<A HREF="LPRng-HOWTO-8.html#lp">Simple Client Printcap Entry</A>
156for 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>
Note: See TracBrowser for help on using the repository browser.