LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-02-2016, 02:01 AM   #1
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
CUPS localhost:631 no longer works


Hello. I'm not having any problem. But I did recently upgrade my system to the newest LTS release (so, 16.04) and I noticed today that I can't access the CUPS server via my browser with localhost:631. Is this a recent change? Is this everyone's experience? Or is this a screw up on my computer? I have CUPS installed (2.1.3-4).
 
Old 10-02-2016, 02:55 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Is cupsd running?
Code:
ps -A|grep cupsd
If that checks out ok, the next thing to investigate is /etc/cups/cupsd.conf

Is the following entry is present?
Code:
Listen localhost:631
 
Old 10-02-2016, 03:08 AM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Also, you may need to make sure the web interface is explicitly enabled
Code:
WebInterface Yes
The default is no. Refer to the CUPS documentation...

https://www.cups.org/doc/man-cupsd.conf.html
 
Old 10-03-2016, 07:22 PM   #4
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Thanks for the answer ferrari. I checked what you suggested.

Code:
mark@mark-N150-N210-N220:~$ ps -A|grep cupsd
mark@mark-N150-N210-N220:~$ 

mark@mark-N150-N210-N220:~$ cat /etc/cups/cupsd.conf | grep "WebInterface Yes"
WebInterface Yes

mark@mark-N150-N210-N220:~$ cat /etc/cups/cupsd.conf | grep "Listen localhost:631"
Listen localhost:631
I assume the process "cupsd" isn't running. The other two entries you specified are present though.

I plugged in my printer to the computer (via usb), and then checked localhost:631 again. This time it gives me the cover page:

Quote:
CUPS 2.1.3

CUPS is the standards-based, open source printing system developed by Apple Inc. for OS X® and other UNIX®-like operating systems.
But none of the links work. IE, http://localhost:631/help/overview.html gives the following,

Quote:
Unable to connect

Firefox can’t establish a connection to the server at localhost:631.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
The "Unable to connect" note is delivered on all the links within the home page of localhost:631. I'm not sure what is causing this.

Last edited by mark_alfred; 10-03-2016 at 07:28 PM.
 
Old 10-03-2016, 07:38 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
What is the output of the following?
Code:
grep "Listen" /etc/cups/cupsd.conf
 
Old 10-03-2016, 07:47 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Another thought I had - Your CUPS configuration might be employing idle timeout. Refer to
Code:
man cupsd.conf
Quote:
IdleExitTimeout seconds
Specifies the length of time to wait before shutting down due to
inactivity. The default is "60" seconds. Note: Only applicable
when cupsd(8) is run on-demand (e.g., with -l).
Check your cupsd.conf configuration accordingly.
 
Old 10-03-2016, 07:58 PM   #7
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Code:
mark@mark-N150-N210-N220:~$ grep "Listen" /etc/cups/cupsd.conf
Listen localhost:631
Listen /var/run/cups/cups.sock
mark@mark-N150-N210-N220:~$
 
Old 10-03-2016, 07:58 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
This long-running bug report describes similar behaviour...
https://bugs.launchpad.net/ubuntu/+s...e/+bug/1020048
Refer comments #61,#62
 
Old 10-03-2016, 08:00 PM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
The 'Listen' directives are as expected. Check for timeout parameters (if they exist).
 
Old 10-03-2016, 08:05 PM   #10
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Hmm. I have no clue. Here's the entire file:

Quote:
#
#
# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
# complete description of this file.
#

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

# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

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

# Show shared printers on the local network.
Browsing Off
BrowseLocalProtocols dnssd

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

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
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/subscription privacy...
JobPrivateAccess default
JobPrivateValues default
SubscriptionPrivateAccess default
SubscriptionPrivateValues default

# Job-related operations must be done by the owner or an administrator...
<Limit Create-Job Print-Job Print-URI Validate-Job>
Order deny,allow
</Limit>

<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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
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 CUPS-Get-Devices>
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 Cancel-Jobs 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>

# Set the authenticated printer/job policies...
<Policy authenticated>
# Job/subscription privacy...
JobPrivateAccess default
JobPrivateValues default
SubscriptionPrivateAccess default
SubscriptionPrivateValues default

# Job-related operations must be done by the owner or an administrator...
<Limit Create-Job Print-Job Print-URI Validate-Job>
AuthType Default
Order deny,allow
</Limit>

<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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Default
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 Cancel-Jobs 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>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>

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

#
#
 
Old 10-03-2016, 08:27 PM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Is Ubuntu 16.04 LTS using systemd? If, so check
Code:
sudo systemctl status cups
If necessary, do
Code:
sudo systemctl restart cups
then try to navigate to the CUPS pages eg
Code:
localhost:631/admin
It would be interesting to see if cupsd is terminating after a time.
 
1 members found this post helpful.
Old 10-03-2016, 08:27 PM   #12
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
I tried Chromium instead of Firefox (since it doesn't have NoScript, which my Firefox does have) and it won't even allow the cover page. It states that localhost:631:

Quote:
This site can’t be reached

localhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
There's no firewall. I checked Chromium's settings under Network (looking for a proxy server) and it said, "Chromium is using your computer's system proxy settings to connect to the network." So I pressed "Change proxy settings" under Chromium, which said,

Quote:
When running Chromium under a supported desktop environment, the system proxy settings will be used. However, either your system is not supported or there was a problem launching your system configuration.

But you can still configure via the command line. Please see man chromium-browser for more information on flags and environment variables.
So, "man chromium-browser" gives the following (excerpt)

Quote:
--no-proxy-server
Disables the proxy server. Overrides any environment variables or settings picked via the options dialog.
So,

Code:
mark@mark-N150-N210-N220:~$ chromium-browser --no-proxy-server
Using PPAPI flash.
[22502:22502:1003/212523:ERROR:browser_main_loop.cc(283)] <unknown>: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-8tVAaEHcVO: Connection refused
Now, Chromium did come up, yet I was still unable to connect to "localhost:631". Not sure what's up.
 
Old 10-03-2016, 08:35 PM   #13
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,841

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
This looks like cupsd is not running to me... we need to check if it is still active
Code:
netstat -tupln|grep 631
 
Old 10-03-2016, 08:38 PM   #14
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Quote:
Originally Posted by ferrari View Post
Is Ubuntu 16.04 LTS using systemd? If, so check
Code:
sudo systemctl status cups
If necessary, do
Code:
sudo systemctl restart cups
then try to navigate to the CUPS pages eg
Code:
localhost:631/admin
It would be interesting to see if cupsd is terminating after a time.
Code:
mark@mark-N150-N210-N220:~$ sudo systemctl status cups
[sudo] password for mark: 
● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2016-10-03 19:06:29 EDT; 2h 24min ago
     Docs: man:cupsd(8)
  Process: 16777 ExecStart=/usr/sbin/cupsd -l (code=exited, status=0/SUCCESS)
 Main PID: 16777 (code=exited, status=0/SUCCESS)

Oct 03 19:00:26 mark-N150-N210-N220 systemd[1]: Started CUPS Scheduler.
mark@mark-N150-N210-N220:~$
Hmm.

Code:
mark@mark-N150-N210-N220:~$ sudo systemctl restart cups
And this one is just hanging. So, I tried "localhost:631/admin" and it worked! It worked in both Firefox and Chromium. And now the command seems to have completed. It seems that restarting cups has allowed the web administration to work. At least for now.
 
Old 10-03-2016, 08:44 PM   #15
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Tried it in my midori browser, and it's working there too. Seems to be working for now. I'll try restarting my computer to see if it still will be working.

First:

Code:
mark@mark-N150-N210-N220:~$ netstat -tupln|grep 631
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
udp        0      0 0.0.0.0:631             0.0.0.0:*                           -               
mark@mark-N150-N210-N220:~$
Okay, for now it's working. I'll try to restart my computer, to see if it continues to work. Perhaps it's fixed.
 
  


Reply

Tags
cups, ubuntu, web interface



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
Can't Access CUPS localhost:631??? libertinux Linux - Networking 8 05-21-2009 10:08 AM
cups no longer starts on port 631 BCarey Slackware 2 11-04-2007 11:17 AM
newbie: cups: no connection with localhost:631 aprovis Linux - Newbie 1 12-14-2005 11:04 AM
cups +localhost:631 trscookie Linux - Software 5 12-05-2005 07:15 AM
CUPS http://localhost:631/ LUB997 Linux - Software 1 09-26-2005 07:52 PM

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

All times are GMT -5. The time now is 05:11 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