LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-25-2008, 03:31 PM   #16
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872

Try add this directory block at the end of cupsd.conf (on PC1) :
Code:
<Location /printers/HPDeskjet3550>
Allow From 127.0.0.1
Allow From 192.168.1.42
AuthType None
Order allow,deny
</Location>
Note that you have to use the cups web interface from the server ip (PC1) to do printer admin task, manage job etc
 
Old 08-25-2008, 04:25 PM   #17
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by __spc__ View Post
PC2 has CUPS running...
I'm pretty sure you don't need cups running on this machine unless, it has it's own printer, connected directly to it.
 
Old 08-25-2008, 06:25 PM   #18
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
PC2 needs cups. In this case cups is the gateway between the application from which you print and the network
 
Old 08-26-2008, 01:51 PM   #19
__spc__
Member
 
Registered: Feb 2006
Location: Bridgend, Wales
Distribution: Kubuntu 10.04.25 (Feb 2011)
Posts: 172

Rep: Reputation: 30
On PC2...
Code:
root@darkstar:~# lpstat -t
scheduler is running
system default destination: HPDeskjet3550
device for HPDeskjet3550: ipp://192.168.1.40:631/printers/HPDeskjet3550
HPDeskjet3550 accepting requests since Tue 26 Aug 2008 07:47:28 PM GMT
printer HPDeskjet3550 is idle.  enabled since Tue 26 Aug 2008 07:47:28 PM GMT
root@darkstar:~#
This is REALLY starting to annoy me...
 
Old 08-26-2008, 02:00 PM   #20
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Did you try to add what I suggested in cupsd.conf ?
I think with lpstat -t, you display only information from local cups
try lpstat -h 192.168.1.40:631 -t to display information from PC1

[edit]
If it does not work, try change the
# Restrict access to the server... block, to:
Code:
# Restrict access to the server...
<Location />
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow From 192.168.1.42
</Location>
Exemple taken from the cups site
Don't forget to run '/etc/rc.d/rc.cups restart' after each configuration change

Last edited by keefaz; 08-26-2008 at 02:11 PM.
 
Old 08-26-2008, 02:09 PM   #21
__spc__
Member
 
Registered: Feb 2006
Location: Bridgend, Wales
Distribution: Kubuntu 10.04.25 (Feb 2011)
Posts: 172

Rep: Reputation: 30
Quote:
Originally Posted by keefaz View Post
In PC1, do you have firewall/iptables rules set that could block incoming connection to TCP/UDP port 631 ?
In PC1, what do /var/log/cups/access_log and /var/log/cups/error_log say ? Do they show connection attempts from PC2 ?

[edit]
I see in /etc/cupsd.conf that the server only accepts connection from localhost!
Try change the 18th line in /etc/cupsd.conf (in PC1):
Code:
# Only listen for connections from the local machine.
Listen localhost:631
to:

Code:
# Allow incoming connections
Port 631
then restart cupsd, /etc/rc.d/rc.cups restart
Regarding firewalls etc, I get 'connection refused' everytime I telnet/ftp from one machine to the other.

Is this symptomatic of firewalls blocking the printer?
 
Old 08-26-2008, 02:18 PM   #22
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Did you enable ftp and telnet in /etc/inetd.conf ?
If not, the 'connection refused' is triggered by non running servers
I suggest to use SSH, better than telnet
(enabled with chmod +x /etc/rc.d/rc.sshd)

Sorry for asking again, but did you try the change in PC1 cupsd.conf I suggested ?
(and you restarted cups after the change?)

Last edited by keefaz; 08-26-2008 at 02:19 PM.
 
Old 08-26-2008, 02:22 PM   #23
__spc__
Member
 
Registered: Feb 2006
Location: Bridgend, Wales
Distribution: Kubuntu 10.04.25 (Feb 2011)
Posts: 172

Rep: Reputation: 30
Quote:
Originally Posted by keefaz View Post
Did you try to add what I suggested in cupsd.conf ?
I think with lpstat -t, you display only information from local cups
try lpstat -h 192.168.1.40:631 -t to display information from PC1

[edit]
If it does not work, try change the
# Restrict access to the server... block, to:
Code:
# Restrict access to the server...
<Location />
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow From 192.168.1.42
</Location>
Exemple taken from the cups site
Don't forget to run '/etc/rc.d/rc.cups restart' after each configuration change
Before I change anything else, here is PC1's cupsd.conf:
Code:
ServerName Desktop.castletonroad.org
Classification none
DefaultCharset UTF-8
DefaultLanguage en
Printcap /etc/printcap
PrintcapFormat BSD
RemoteRoot remroot
SystemGroup sys root
ServerCertificate /etc/cups/ssl/server.crt
ServerKey /etc/cups/ssl/server.key
<Location /printers>
  Encryption Never
  Satisfy All
  Order allow,deny
</Location>
HostnameLookups Off
KeepAlive On
KeepAliveTimeout 60
MaxClients 100
MaxRequestSize 0m
Timeout 300

# Allow remote access
Port 631
AccessLog /var/log/cups/access_log
ErrorLog /var/log/cups/error_log
PageLog /var/log/cups/page_log
MaxLogSize 1m
LogLevel info
PreserveJobHistory On
PreserveJobFiles Off
AutoPurgeJobs No
MaxJobs 0
MaxJobsPerPrinter 0
MaxJobsPerUser 0
User lp
Group sys
RIPCache 8m
FilterLimit 0
DataDir /usr/share/cups
DocumentRoot /usr/share/doc/cups
RequestRoot /var/spool/cups
ServerBin /usr/lib/cups
ServerRoot /etc/cups
TempDir /var/spool/cups/tmp

# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL
BrowseProtocols CUPS
BrowsePort 631
BrowseInterval 30
BrowseTimeout 300
ImplicitClasses On
ImplicitAnyClasses Off
HideImplicitMembers Yes
BrowseShortNames Yes

# Allow shared printing and remote administration...
<Location />
  Order allow,deny
  Allow @LOCAL
</Location>

# Allow remote administration...
<Location /admin>
  Order allow,deny
  Allow @LOCAL
</Location>

# Allow remote access to the configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow @LOCAL
</Location>

<Location /printers/HPDeskjet3550>
Allow From 127.0.0.1
Allow From 192.168.1.42
AuthType None
Order allow,deny
</Location>
 
Old 08-26-2008, 02:38 PM   #24
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
It is not the cupsd.conf installed with cups package for slackware 12.1, is it ?
So what happen when you try to print on PC2 ? (in PC1 cups access and error logs)
(don't forget /etc/rc.d/rc.cups restart after the change in config)
 
Old 08-26-2008, 03:05 PM   #25
__spc__
Member
 
Registered: Feb 2006
Location: Bridgend, Wales
Distribution: Kubuntu 10.04.25 (Feb 2011)
Posts: 172

Rep: Reputation: 30
Quote:
Originally Posted by keefaz View Post
It is not the cupsd.conf installed with cups package for slackware 12.1, is it ?
So what happen when you try to print on PC2 ? (in PC1 cups access and error logs)
(don't forget /etc/rc.d/rc.cups restart after the change in config)
After days of fiddling, the conf file no longer resembles the default file!

Here's PC1's access log after trying to print from PC2:
Code:
192.168.1.42 - - [26/Aug/2008:21:01:09 +0100] "GET /ppd/HPDeskjet3550.ppd HTTP/1.1" 200 19348 - -
192.168.1.42 - - [26/Aug/2008:21:01:18 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 307 Get-Printer-Attributes successful-ok
192.168.1.42 - - [26/Aug/2008:21:01:18 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 831974 Print-Job client-error-not-authorized
192.168.1.42 - - [26/Aug/2008:21:01:18 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 237 Get-Printer-Attributes successful-ok
192.168.1.42 - - [26/Aug/2008:21:01:52 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 307 Get-Printer-Attributes successful-ok
192.168.1.42 - - [26/Aug/2008:21:01:52 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 834206 Print-Job client-error-not-authorized
192.168.1.42 - - [26/Aug/2008:21:01:52 +0100] "POST /printers/HPDeskjet3550 HTTP/1.1" 200 237 Get-Printer-Attributes successful-ok
Ditto error log:
Code:
I [26/Aug/2008:21:01:18 +0100] Denying user "remroot" access to printer "HPDeskjet3550"...
I [26/Aug/2008:21:01:52 +0100] Denying user "remroot" access to printer "HPDeskjet3550"...
 
Old 08-26-2008, 03:49 PM   #26
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Could you try this cupsd.conf file ? (on PC1)
(it 's just the slack stock cupsd.conf with 2 mods, Port 631 and mod in <Location /> block)
Code:
#
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.
#

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel info

# Administrator user group...
SystemGroup sys root


# Accept connection on port 631
Port 631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1
  Allow From 192.168.1.42
</Location>


# Restrict access to the admin pages...
<Location /admin>
  Encryption Required
  Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job-related operations must be done by the owner or an administrator...
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

#
# End of "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $".
#

Last edited by keefaz; 08-26-2008 at 03:50 PM.
 
Old 08-27-2008, 02:07 PM   #27
__spc__
Member
 
Registered: Feb 2006
Location: Bridgend, Wales
Distribution: Kubuntu 10.04.25 (Feb 2011)
Posts: 172

Rep: Reputation: 30
Keefaz - cracked it!

I found the cupsd.conf.default files on each PC and reset these, and restarted the two CUPS. (This the hint from your post above - just start over agaon!)

I then deleted the printer on PC1, remade/reinstalled HPLIP-2.7.8 on PC1 and set up the printer again. It printed...

I then went to PC2, added a new printer, the one located on PC1. Interestingly, it added a new printer (with the PC2 description I gave it) AND the network printer already on PC1. The added printer did not work, so I deleted it. The printer that was added 'automatically' does work.

Job done!

Thank you IMMENSELY for all your efforts on this. I have certainly learnt a lot about CUPS and printing - I'm now off to set up SAMBA printing etc, as we use both PCs mostly under Linux but occasionally under XP.

I would not have this printing were it not for your support - thanks!
 
Old 08-27-2008, 04:15 PM   #28
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I am glad you found your way It is even better when you find the fix yourself, because in general you learn more
 
  


Reply



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
CUPS http://localhost:631/ LUB997 Linux - Software 1 09-26-2005 07:52 PM
Can't find http://localhost:631 encore Slackware 5 03-07-2005 06:26 PM
can't load http://localhost:631 in browser cragwolf Slackware 2 09-06-2004 06:43 PM
http://localhost:631 zaicheke Linux - Software 5 08-01-2004 01:13 PM
What the heck is http://localhost:631 glenn69 Linux - Newbie 5 10-04-2003 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:37 AM.

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