LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2003, 05:39 PM   #1
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Rep: Reputation: 16
Unhappy CUPS red hat 9.0


issue config: CUPS
distro: red hat 9.0
kernel: 2.4.22
no firewall.

server ip: 192.168.0.1
client ip: 192.168.0.2
printer name: deskjet940c

summary: linux host can print just fine where CUPS is installed and configured . Windows xp client cannot print at all. How can I fix or reconfigure CUPS?

Question 1: After I set up CUPS, I tried to print a test page from the CUPS admin page I get this error: "The connection was refused when attempting to contact 127.0.0.1:631".

Why is this when I just set it up?

However, when I print from any other application or even from mozilla on Linux itself I can print ok.

Problem -critical:
Windows XP machine can't print to my CUPS/linux print server I just set up.

Set up on Windows:
add printer wizard => network printer =>URL::: http://192.168.0.1:631/printers/deskjet940c

Error:"Windows cannot connect to the printer. Either the printer name was typed incorrectly, or the specified printer list its connection to the server."

I get the same error if I do add printer wizard => network printer =>Name::: \\192.168.0.1\deskjet940c

from my /etc/cups/cupsd.conf file

Code:
       <Location /printers/deskjet940c>
        Order Deny,Allow
        Deny From All
        Allow From 127.0.0.1
        AuthType None
        Allow from All
        </Location>
        <Location />
        Order Deny,Allow
       Deny From All
       Allow From 127.0.0.1
        Allow From 192.168.0.2
      </Location>

Last edited by randomx; 10-14-2003 at 06:13 PM.
 
Old 10-14-2003, 05:59 PM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
You're sure that cupsd is runing yeah? Sorry give such a simple reply but it would seem to make the most sense given the messages you are getting. What does ps -ef | grep cups show you?

cheers

Jamie...
 
Old 10-14-2003, 06:02 PM   #3
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Ignore my last post, I'm a muppet.

You don't appear to have an allow line for 192.215.85.173 for the printer itself. Just for testing you might want to change to this Allow from All and use Order Allow,Deny just to rule this out.

As there anything helpful in the Cups logs?

cheers

Jamie...
 
Old 10-14-2003, 06:03 PM   #4
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Original Poster
Rep: Reputation: 16
Unhappy yeah it's running

yeah, cups is running.

I checked chkconfig and services to make sure.

I also made sure that CUPS was the default printing system.

Here is the answer to your question.

Code:
[root@shell]# ps -ef | grep cups
randomx    4652     1  0 Oct08 ?        00:00:03 eggcups --sm-client-id default6
root     16418     1  0 14:53 ?        00:00:00 cupsd
root     16739  9127  0 14:59 pts/1    00:00:00 grep cups
 
Old 10-14-2003, 06:11 PM   #5
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Original Poster
Rep: Reputation: 16
Unhappy still no joy...output of log

I this on /var/log/cups/error_log

The same error gets logged right after I try to print something out. I think it's CUPS logging system to say " error connecting to printer."

Code:
E [14/Oct/2003:09:36:43 -0700] PID 7182 crashed on signal 11!
 
Old 10-14-2003, 06:17 PM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Signal 11 is SIGSEGV - segmentation violation - which suggests that something more serious is going wrong with cups. Try turning up the debugging to see if this gives you any useful output. In your first post you said you could print from Mozilla. You definatly only have your printer setup under CUPS yeah, no where else that could be working for local applications?

cheers

Jamie...
 
Old 10-15-2003, 12:06 PM   #7
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Original Poster
Rep: Reputation: 16
Smile started to see the light at the end of the tunnel

I reinstalled CUPS from scratch and re- did everything.

I managed to set up the network printer from the windows xp client. No errors no nothing while setting it up. I set it up via http://server:631/printers/deskjet940c

Now...when I try to print something from Windows the queue says there's an error and nothing prints out.

But it prints just fine from the linux host, print server itself.

Do I need extra drivers or something on the windows xp client?
 
Old 10-15-2003, 06:44 PM   #8
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
I would just expect you to have the normal DeskJet drivers installed under XP. Do your logs give you any more information now you have reinstalled?

cheers

Jamie...
 
Old 10-15-2003, 07:59 PM   #9
filsee
LQ Newbie
 
Registered: Oct 2003
Location: Washington State, USA
Distribution: Redhat 9
Posts: 13

Rep: Reputation: 0
i have a redhat 9 server, with this exact same problem. (hp 932c)
i've been trying to setup stuff using webmin, swat, and the default redhat config tools.
i can access and print a test page using the http:.... printers link above, but yet, i cannot print from xp.
on one of my computers it tells me that it cannot connect when i try to connect to the printer, but the another xp comp doesn't say that; still cannot print anything from any xp's though.

i know it may be a little different, but i can call anyone in the U.S. if that would be easier.
or i can get on almost any type of chat (including irc) for a live help session.=)

i am fairly new to linux, and redhat is all i've ever used.
my samba is working ok (basic share working, without user verification), i just can't seem to get this damn printer-cups-xp-blah stuff to work.=)

yes i've searched all over the web, and through countless forums, re-installed redhat 3 times, and even changed my printer connection from usb to parallel(sp?).


Thankyou in advance

filsee
 
Old 10-16-2003, 12:07 AM   #10
filsee
LQ Newbie
 
Registered: Oct 2003
Location: Washington State, USA
Distribution: Redhat 9
Posts: 13

Rep: Reputation: 0
ok, i fixed the problem today.=)
VERY easy fix.

i went out and bought a netgear print server.=)

got home, hooked it up, told the machine where to look, and bam! pow! holy rusted metal batman! it works!


i know it's the slightly more expensive, easy way out, but hey, i gotta have my printer!



good luck to the rest of you.=)


filsee
 
Old 10-16-2003, 12:46 AM   #11
locutus233
Member
 
Registered: Aug 2003
Location: South Surrey, BC
Distribution: Redhat, Gentoo
Posts: 47

Rep: Reputation: 15
Easy Solution:

-Modify smb.conf

ensure the following is set:

printing = cups
printcap name = cups


[printers]
comment = all printers
browseable = no
guest ok - no
writable = no
printable = yes


modfiy the following cups files:

/etc/cups/mime.conv
-uncomment the line:
application/octet-stream application/vnd.cups-raw

/etc/cups/mime.types
-uncomment the line:
application/octet-stream

-restart cups
-restart samba

-problem solved... connect to the printer using samba and all should be solved.

-Setting up windows to connect directly to a cups printer is a scary thing. It can be done, but i can almost certainly say that M$ modified IPP some where so it only works when you connect to a microsoft print server.

-If you really want to make this work well look into learning how to use cupsomatic which will put the correct ppd files into a ps driver that your windows machines just download
 
Old 10-16-2003, 06:36 PM   #12
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Original Poster
Rep: Reputation: 16
Cool got it

I gathered tons of info here and there, and finally came up with an algorithm that worked.


Thanks to everybody who contributed in the previous posts and this forum a while back. I got some stuff from their posts too. Sorry I forgot their names.

This is what I did.

CUPS linux print server (redhat 9.0, kernel 2.4.22)
scenario: local USB printer attached to a linux workstation.
objective: windows xp print to it.

Both machines are on the same LAN. But it works ok if you are at home with a simple switch-hub or crossover cable.

1). Get the package cups package. Rpm or source. www.cups.org
--if you ask me, rpms are not really my choice.

2.) Install the cups package by doing:
# ./configure; make; make install.

3.) Restart service. You should see cups start with output "Cups scheduler started". /sbin/service cups start | stop

3.) Go to Linuxprinting.org. On the left side navigation bar, select The Database-> Printer Listings. Select your make/model printer, then click on the Show button. The next page will give you the option to generate a ppd file for your printer. Click on download PPD and save the file to /usr/share/cups/model. The file should be in a model.ppd format, if not, then rename it to my_printer.ppd.

4.) Restart cups by doing
/sbin/service cups restart.

5.) http://www.linuxprinting.org/download/foomatic/ and download the latest foomatic-filters.tar.gz (version 3.0 as of this writing). Then do the following:

# tar -xzf foomatic-filters-3.0.0.tar.gz
# ./configure
# make
# cp foomatic-rip /usr/lib/cups/filter/

6) in Red Hat, I went to #printconf-gui, click on Action, then Sharing...Selected what I wanted. Allow all, or specific IP.
****OR***
Open your favorite browser and point it to http://localhost:631
Under Administrative Tasks, add your printer. Just follow the directions.

7.) modify /etc/cups/cupsd.conf

<Location /printers/deskjet940c>
#Order Allow,Deny //comment added
#Deny From All //comment added
Allow From 127.0.0.1
Allow From 192.168.0.* //added this line
#AuthType None //comment added
Allow from All
</Location>
<Location />
#Order Deny,Allow //comment added
#Deny From All //comment added
Allow From 127.0.0.1
Allow From 192.168.0.* //added this line
</Location>
Browsing On
BrowseProtocols cups
#BrowseOrder Deny,Allow //comment added
BrowseAllow from @LOCAL
#BrowseAddress 192.168.0.255 //comment added

9)Modify smb.conf

ensure the following is set:

printing = cups
printcap name = cups

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
printing = cups
public = yes
printer name = deskjet940c

10.modfiy the following cups files:

/etc/cups/mime.convs
-uncomment the line:
application/octet-stream application/vnd.cups-raw

/etc/cups/mime.types
-uncomment the line:
application/octet-stream

11. /sbin/service cups stop | start
12/ sbin/service smb stop | start

Connection from Windows XP.
Go to add printer wizard, connect to:\\<ip linux server\deskjet940c, add drivers, and enjoy. Try http://<ip>/printers/deskjet940c but that requires you have ipp on windows.
Both ways worked just fine for me.
 
Old 10-20-2003, 06:06 PM   #13
cpdsaorg
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Rep: Reputation: 0
well, getting a external print server is one way. But this is what i did with RH9...

1. connected HP photosmart 7350 to USB port

2. configured printer with these instructions...
http://www.redhat.com/docs/manuals/l...g-sharing.html

3. test print and printing from local machine worked fine. You can also point your browser to http://localhost:631 to get the Cool Cups print manager.

4. Remote machine doesn't see print server. checked the host ip address at port 631 from remote machine browser. got connection refused.

5. Lightbulb goes off in my head - (mabe it's the firewall)

6. search the web on how to open port 631 and 3 ways come up: lokkit, Menu -> System Settings -> Security Level, and iptables

the "lokkit" utility (just type lokkit on the command line) will let you specefy any port you want opened. But this somehow broke my passive ftp access. Which I was able to fix with the:

"Security Level" configuration tool. this tool is useless to help you with cups printing because you cannot specefy individual ports. However this is easy with:

"iptables" just type in:
"iptables -I INPUT -p tcp --dport 631 -j ACCEPT"
and
"service iptables save active"

and you are done.
 
Old 04-14-2004, 04:48 AM   #14
paul.nel
Member
 
Registered: Nov 2003
Location: Cape Town
Distribution: Gentoo, Redhat 9, SuSE 9.0, 9.2, Win XP
Posts: 149

Rep: Reputation: 15
I found this thread rather usefull and eventually managed to get my XP machines to print to my rh9 printer - not using quite the same config files though, so here's mine just for reference:

Code:
/etc/samba/smb.conf

[global]
	printcap name = /etc/printcap
	load printers = yes
	printing = cups

[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = no
	printable = yes

/etc/cups/cupsd.conf

Printcap /etc/printcap

<Location /printers/HP_on_Gandalf>
Order Deny,Allow
Deny From None
Allow From All 
AuthType None
</Location>

Browsing On
BrowseProtocols cups
BrowseOrder Deny,Allow
BrowseAllow from All
BrowseAddress 255.255.255.255
Listen *:631
I also had to make the changes refered to by randomx in his last post step 10. I skipped steps 3 - 5 though.

System info:
Server:
Red Hat 9
kernel: 2.4.20-30.9
printer: HP Deskjet 845c

Clients:
XP Pro

Cheers

p.n
 
Old 05-11-2004, 01:25 AM   #15
dont_know_much
LQ Newbie
 
Registered: Apr 2004
Distribution: Red Hat 9.0
Posts: 6

Rep: Reputation: 0
Ok I'm another newbie.
Same setup, file sharing has no problem. XP pro could see the linux box and the printer. BUT... it says Localhost access denied, unable to connect.

I've changed all the setup.. still doesn't work

One stupid question, should I restart my xp box for the change to work?

Desperate'
av
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat custom Kernel compilation mini-How-To for Red Hat 8-9 Thetargos Red Hat 431 04-13-2007 06:19 AM
Can't get CUPS to rock in Red Hat, works flawless in Slackware ni0wn Linux - Software 2 11-12-2004 04:35 AM
printing from win 98 client to samba printer on red hat linux with cups shashi_lq Linux - Networking 0 12-10-2003 02:04 AM
Red Hat does not plan to release another product in the red hat linux line... Whitehat General 5 11-03-2003 07:33 PM
Red Hat 7.2... & a modem with Red Hat 7.1 driver support rahduku Linux - Distributions 1 02-14-2002 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:13 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
Open Source Consulting | Domain Registration