LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing CUPS on Debian Lenny server - no GUI (http://www.linuxquestions.org/questions/linux-newbie-8/installing-cups-on-debian-lenny-server-no-gui-832203/)

withanh 09-14-2010 09:33 PM

Installing CUPS on Debian Lenny server - no GUI
 
I'm posting in the noob forum because I am a noob still (at least by my standards). I'm getting better, but still have to ask a lot of questions :-)

I have installed CUPS on my Debian 5 Lenny server. I do not have a GUI installed, only SSH to command line.

I cannot get CUPS to let me browse to the html interface from another machine. I believe that CUPS is running only on localhost because when I run
Code:

netstat -tap | grep cups
I get
Code:

tcp        0      0 localhost:ipp          *:*                    LISTEN      2083/cupsd
tcp6      0      0 localhost:ipp          [::]:*                  LISTEN      2083/cupsd

When I browse (or telnet) to port 631 from another machine it refuses the connection, if I telnet from my Debian server to port 631 it connects.

My cups.conf is
Code:

#
#
#  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 warning

# Administrator user group...
SystemGroup lpadmin


# Only listen for connections from the local machine.
Listen localhost:631
#listen 192.168.2.203
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 allow,deny
#  allow localhost
#  allow 192.168.2.*
  allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
#  allow localhost
#  allow 192.168.2.*
  allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Basic
  Require user @SYSTEM
  Order allow,deny
#  allow localhost
#  allow 192.168.2.*
  allow all
</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 Basic
    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>

I'm not sure how to make it allow me to browse from another machine that does have a GUI so I can configure a printer.

Thanks!

h

brother.sand 09-14-2010 10:17 PM

You have tried it with ssl right? I mean httpS://localhost:631 Last I checked CUPS would only allow secured connections.

brother.sand 09-14-2010 10:18 PM

Sorry, I meant httpS://servername:631

D.

withanh 09-14-2010 10:19 PM

Yes, that didn't work either. Of course, I can't https://localhost:631 because localhost is a CLI server only, but if I https://<server-ip>:631 the connection is refused. It's like it's only listening on localhost and not listening on <server-ip>.

h

replied before your correction, but still same deal, https://<server-ip>:631 is no-go.

brother.sand 09-14-2010 10:24 PM

Another option, use X11 forwarding on the machine you're using to do the config with. So like this:

1. Install Firefox on the Debian server
2. Connect to the Debian server with ssh like this: ssh -X user@servername
3. From the ssh session run: firefox https://localhost:631

The X11 forwarding will cause the display of the firefox session to appear on your client machine. It runs on the Debian server, but displays on your remote machine.

If your remote machine is a Windows machine you can install something like XMing and get the same result.

Cheers,
D.

withanh 09-14-2010 10:38 PM

I found the issue, it was in this section:
Code:

# Only listen for connections from the local machine.
Listen localhost:631
#listen 192.168.2.203 #commented out because it didn't help but I wanted to leave it in for reference
Listen /var/run/cups/cups.sock

The 192.168.2.203 is my local workstation, I had tried putting that in to see if it would allow me to connect from this IP, then I thought "wait, that's what it's listening on" so I changed it to
Code:

# Only listen for connections from the local machine.
Listen localhost:631
listen 192.168.2.197:631 #server IP
Listen /var/run/cups/cups.sock

and it works, I can now connect to http://192.168.2.197:631 and get to the printer config. I have added and tested a printer and I'm golden.

Woo hoo!

h


All times are GMT -5. The time now is 01:37 PM.