LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-26-2004, 07:17 PM   #1
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Rep: Reputation: 15
CUPS: Cannot print to remote printer


Hi,

I am using RedHat 9 and I have 3 computers depending on the same printer (it's a HP LaserJet 4). I am using CUPS and can print everything perfectly in the computer which is functioning as the printer server (to which the printer is directly attached). So printing to a local printer is ok. What I am having troubles with is printing from the clients. I cannot print from the other 2 computers on which I try to add the printer as a remote printer. Here is what I am doing:

I add the remote printer on the client computers using:

/usr/sbin/lpadmin -p lp -E -v ipp://computername.domain.edu/printers/lp

Then I go to the server and create a file /etc/xinetd.d/printer containing the following:
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/lib/cups/daemon/cups-lpd
}

I also modify the cups.conf file on /etc/cups (on the server) by uncommenting the following lines

Listen:631
Browsing On
BrowseProtocols cups
BrowseAddress @LOCAL
BrowseShortNames Yes
BrowseAllow ALL
BrowseInterval 30
BrowsePort 631

<Location /printers/lp>
AuthType None
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From nameof2ndcomputer.domain.edu
Allow From nameof3rdcomputer.domain.edu
</Location>

Ok, this is it for the server. Now, on each of the other 2 computers (clients) I modify the cups.conf file by uncommenting the following lines

Browsing On
BrowseProtocols cups
BrowseAddress @LOCAL
BrowseShortNames Yes
BrowseAllow ALL
BrowseInterval 30
BrowseOrder allow,deny
BrowsePoll nameofprintersever.domain.edu:631

But when I type lpq on the 2 clients I get an error message from one of them saying:

Printer 'lp@localhost' - cannot open connection - No such file or directory
Make sure the remote host supports the LPD protocol

I get no error from the second client, but it sends the jobs to print to the lp printer as if it were a local printer, not a remote one. Of course, nothing prints, for there is no local printer on that machine! It was suppose to send it to the remote printer!

Ok, I am confused. I am doing the same thing in both clients yet both of them are trying to do different things.

How can I fix this mess?
I need to get those client computers to print!
Can someone help me?
 
Old 09-26-2004, 07:50 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

The twin to this post can be found here Please post any replies to it. -- J.W.
 
Old 09-27-2004, 12:48 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
hi
make sure you are actually running cups on the client machines and not lpd or LPrng or whatever comes on redhat
do
ldd `which ld`
first line returned should be
libcups.so.2 => /usr/lib/libcups.so.2 (0x43f2c000) (something similar)
if not
you may have to remove them so they don't conflict also i have heard of a red hat command
redhat-switch-printer ???? but thats total hearsay
also
make sure you set the name of the remote server as
ServerName
on each of the two clients in cups/client.conf
 
Old 09-27-2004, 01:01 AM   #4
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Hello,

Ok, I checked that cups was actually the daemon running by using the redhat-switch-printer command. That got rid of the error message on the first client. But now it is doing the same thing as the second client. None of them recognize the printer as a remote printer. They think it is a local printer. This is what I get on lpq:

lp is ready
no entries

If I send a job to print, say the file hosts.allow, on lpq I see

lp is ready and printing
Rank Owner Job File(s) Total Size
active root 7 hosts.allow 1024 bytes

But I see no job at all listed on the lpq of the server, and of course, nothing prints.

Same thing on both the server and the clients.

I also set the name of the remote server as ServerName on the cups.conf file on the clients as you said. (I guess the clients still think the printer is local??)

What else do I need to do?

Z.

Last edited by nazarioz; 09-27-2004 at 01:49 AM.
 
Old 09-27-2004, 01:47 AM   #5
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Ok, just one more note, in case it helps to find an answer to my problem: if I go to the web interface (localhost:631) from the clients I see the printer lp added as Remote Printer. I do not understand why I see

Device URI: http://servername.domain.edu:631/printers/lp

i.e. the URI as an http instead of ipp which is how I added the printers on the clients.

Anyway, the clients do not print.

Help please!

Last edited by nazarioz; 09-27-2004 at 01:51 AM.
 
Old 09-27-2004, 04:42 PM   #6
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
I checked the error_log file generated in /var/log/cups after I send a job to print from the servers. There is an error message showing up there. Since I imagine it might be annoying for people to see all the file posted due to its length, I am just posting here the error message. Let me know if more info is needed.

D [27/Sep/2004:13:40:16 -0700] [Job 8] Getting supported attributes...
E [27/Sep/2004:13:40:22 -0700] cups-polld: get-printers failed: server-error-service-unavailable

Any suggestions on how to resolve this?
 
Old 10-11-2004, 12:12 AM   #7
mdb
LQ Newbie
 
Registered: Aug 2004
Location: Flagstaff, AZ
Posts: 19

Rep: Reputation: 0
Did you try editting the client.conf file in the /etc/cups/ directory? I believe by default each machine with cups sets the client to the localhost. Edit the client.conf file with this line:
ServerName [server name]

The server is the machine with the printer locally connected.

Hope this helps
 
Old 10-12-2004, 05:31 PM   #8
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks for your help mdb. I did as you said and modified the client.conf file in the /etc/cups/ directory to have the correct Server Name. Now I try to send a job to print and the client machine gives me this error:

lpr: unable to print file: server-error-service-unavailable

I still cannot print!!
 
Old 10-17-2004, 06:35 PM   #9
cevjr
Member
 
Registered: Jul 2003
Location: USA
Distribution: Slack 12.2 and Ubuntu 9.04
Posts: 61

Rep: Reputation: 15
First you don't need to add the printer using any commands whatsoever. If your using commands your doing something way too complicated. Remove any printers on the clients.

Make sure your local printer is working on the Cups Server.

Network Printing
1)Once the Server or primary computer can print...edit the /etc/cups/cupsd.conf as shown below
2)Download and add CUPS to client machine. Add the server ip # to /etc/cups/client.conf where it asks for server name and uncomment it.
3)On client machine. Go to http://localhost:631 and printer will automatically appear. Ready to print. No need to add anything. Open up GEDIT and print.

########################################################################
# #
# This is the CUPS configuration file. #
# #
########################################################################

#### the ipaddress of the server goes here!!!! this should be the same as the ip address on the
#### /etc/cuos/client.conf for the client pc's
ServerName 192.168.0.8
LogLevel info
PreserveJobHistory Yes
PreserveJobFiles No
AutoPurgeJobs No
MaxCopies 100
MaxJobs 50
MaxJobsPerPrinter 0
MaxJobsPerUser 0
########
######## Network Options
########
Port 631
########
######## Browsing Options
########
Browsing On
BrowseProtocols cups
BrowseAddress @LOCAL
BrowseShortNames Yes
BrowseAllow from @LOCAL
BrowseInterval 30
BrowseOrder deny,allow
BrowsePort 631

###THIS IS THE IMPORTANT STUFF############
<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From @LOCAL
AuthClass Anonymous
AuthType None
</Location>

<Location /admin>
#
# You definitely will want to limit access to the administration functions.
# The default configuration requires a local connection from a user who
# is a member of the system group to do any admin tasks. You can change
# the group name using the SystemGroup directive.
#

AuthType Basic
AuthClass System

## Restrict access to local domain
Order Deny,Allow
Deny From All
Allow From 127.0.0.1


#Encryption Required
</Location>

#
# End of "$Id: cupsd.conf.in,v 1.13 2003/04/10 20:14:04 mike Exp $".
#
 
Old 10-28-2004, 06:39 PM   #10
nazarioz
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
Hello cevjr,

Thanks so much for your reply. I followed your instrtuctions and it worked perfectly!
I can print now!

Thank you

Z.
 
Old 10-29-2004, 05:33 PM   #11
cevjr
Member
 
Registered: Jul 2003
Location: USA
Distribution: Slack 12.2 and Ubuntu 9.04
Posts: 61

Rep: Reputation: 15
no problem. Alot of the problems encountered in Linux are readily and easily solved. And http://www.linuxquestions.org is a great resource. If only we the users would ask better questions and we the GURU's make sure we test our responses! Sometimes they are off the cuff and you can't have that with newbies.

Good Luck!
-C
 
Old 11-14-2004, 03:42 PM   #12
mehlkelm
Member
 
Registered: Apr 2003
Location: Basel, Switzerland
Distribution: Ubuntu, OS X
Posts: 77

Rep: Reputation: 15
Thumbs up thanks

@ cevjr

cool this simple solution helped me, too!
thanks a lot

stefan
 
Old 12-14-2004, 03:18 AM   #13
syzuhdi
LQ Newbie
 
Registered: May 2002
Location: Sanglang,Kedah,Malaysia
Distribution: Mandrake
Posts: 28

Rep: Reputation: 15
Hi;
How to make my printer server as a client to print to another printer server ?
 
Old 01-12-2005, 05:50 AM   #14
MacMurphy
LQ Newbie
 
Registered: Dec 2004
Location: Australia
Posts: 11

Rep: Reputation: 0
I am trying to get clients to print in CUPS and have the server printing fine. The CUPS docs state that the servername is used to report TO clients:
http://www.cups.org/sam.html#ServerName

If this is specified in the clients cupsd.conf as the location of THE print server how would clients be able to access printers on various print servers ?

Thanks

Murphy
 
Old 01-12-2005, 10:26 AM   #15
cevjr
Member
 
Registered: Jul 2003
Location: USA
Distribution: Slack 12.2 and Ubuntu 9.04
Posts: 61

Rep: Reputation: 15
you are right - if you specify ServerName=x then the clients will only print to x

if you have various Print Servers, you may need to investigate using BrowsePoll. Although I cannot say for certain as I do not have multiple Print Servers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't print to remote printer using CUPS pfunk Linux - General 1 10-22-2004 01:51 PM
remote client can't print using cups wilcsnyder Linux - Networking 0 10-01-2004 03:41 AM
CUPS: Cannot print to remote printer nazarioz Linux - Hardware 1 09-26-2004 08:23 PM
CUPS: Cannot print to remote printer nazarioz Linux - Newbie 1 09-26-2004 07:49 PM
remote cups printing to a smb/cups print server? justanothergeek Linux - Networking 2 09-15-2004 09:31 AM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration