Forums

Resolved
0 votes
Hi,
I thought I should make a post here to help anyone who would like to make the print server to actually work in ClearOS 7. I do not know who maintains it, but I pretty sure that anyone who tries to install it will find it impossible to use as it is. At least that is how it has been for me, using the ClearOS 7 Community version with the "default" LDAP directory. It is possible to access the https://your-clearos-server-ip:631 web page and even get to the admin page. But there it stops. You will not be able to add/modify any printers, and if you if you manage anyway to configure any locally connected printers on your ClearOS server, nobody will be able to print to them...

After several evenings fighting my system I think I how now got it to work with all authentication turned off... Maybe someone would like to take my config file below and re-implement that, but still keep the print server in a "working mode"...

First note: If you install cups and foomatic (not the app-print-server) from the command line, you will most likely find that cups (cups is the print-server program) actually works! However, when app-print-server is installed it will overwrite the /etc/cups/cupsd.conf file and create two include-files. However whoever maintains this cannot have looked into cups release notes for some time since they contains obsolete parameters and are missing others.

No longer valid parameters in /etc/cupsd.conf
BrowseOrder
BrowseAllow
CUPS protocol

Missing declarations for following in /etc/cupsd.policy.conf
Validate-Job
Cancel-Jobs
Cancel-My-Jobs
Close-Job
CUPS-Get-Document

JobPrivateAccess
JobPrivateValues
SubscriptionPrivateAccess
SubscriptionPrivateValues

Some of the missing statements above will be set to defaults, but not all.

Also, I found that after reboot the print-server was not possible to start. I am not sure if I caused it by all my attempts to fix things, but I found out that avahi-daemon did not start automatically at reboot. So my tip to anyone who cannot start cups: Do this at the command line:
systemctl status avahi-daemon
systemctl is-enabled avahi-daemon
It should say "started" + a few more lines after the first command. It should answer "enabled" after the second command. If not do this:
systemctl enable avahi-daemon
systemctl start afahi-daemon
Now try to start cups (either from the ClearOS web-config for the print-server, or from command line)
systemctl start cups


Second: If you like me are interfacing your ClearOS server from a windows 10 client. Watch out! Windows seems to have some "memory", so if you try to print to a printer connected to your ClearOS server and it does not work and you then reconfigure the ClearOS server so it actually will work, then Windows will fool you: It will NOT print until you reboot your windows machine!

Having said all this. If you are desperate, and really would like to get printing to work. Make a backup of your /etc/cups/cupsd.conf file and then REPLACE all the content in the /etc/cups/cupsd.conf file with this (change IP address 192.168.0.10 to whatever IP your server has on your LAN):
MaxLogSize 1m
# Show general information in error_log.
LogLevel warn
# Allow remote access
Listen 192.168.0.10:631
Listen /var/run/cups/cups.sock
Browsing On
BrowseLocalProtocols dnssd
DefaultAuthType Basic
WebInterface Yes
<Location />
# Allow remote access...
Order deny,allow
Allow @LOCAL
</Location>
<Location /admin>
Order deny,allow
Allow @LOCAL
</Location>
<Location /admin/conf>
Order deny,allow
Allow @LOCAL
</Location>
<Policy default>
JobPrivateAccess default
JobPrivateValues default
SubscriptionPrivateAccess default
SubscriptionPrivateValues default
<Limit Create-Job Print-Job Print-URI Validate-Job>
Order deny,allow
Allow @LOCAL
</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>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
Order deny,allow
Allow @LOCAL
</Limit>
<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>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit Cancel-Job CUPS-Authenticate-Job>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
<Policy authenticated>
JobPrivateAccess default
JobPrivateValues default
SubscriptionPrivateAccess default
SubscriptionPrivateValues default
<Limit Create-Job Print-Job Print-URI Validate-Job>
Order deny,allow
Allow @LOCAL
</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>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
Order deny,allow
Allow @LOCAL
</Limit>
<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>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit Cancel-Job CUPS-Authenticate-Job>
Order deny,allow
Allow @LOCAL
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
BrowseWebIF Yes


Then restart cups
systemctl restart cups
You should now be able to surf to https://your-clearos-ip:631 and access the admin-pages and configure printers etc. Also, all users on the LAN should be able to print to them. (Remember to restart windows machines before changing anything more on your server...). Please note however, that all authentication is turned off by the config-file above. Look in the cupsd.location.conf and in cupsd.policy.conf (neither is in use after modifying the cupsd.conf file according to the above) for inspiration and work yourself "backwards"

/Fred
Saturday, November 07 2015, 10:12 PM
Share this post:
Responses (2)
  • Accepted Answer

    Monday, May 09 2016, 10:37 PM - #Permalink
    Resolved
    0 votes
    Just as an FYI, the above ugly workaround only worked for me if I ellided the "BrowseWebIF Yes" final line. Otherwise I was unable to restart the server after implementing that line in the cupsd.conf file. (Working with a relatively underconfigured ClearOS 7 Community install.)
    The reply is currently minimized Show
  • Accepted Answer

    Mansoor
    Mansoor
    Offline
    Thursday, September 21 2017, 09:22 AM - #Permalink
    Resolved
    0 votes
    Thank you so much Fredrik; you saved my day!

    Your config file works flawlessly with cups in clearOS 7.3. You presented this fix a year and half ago and I'm wondering why it hasn't taken its place in the new versions of clearOS?!
    The reply is currently minimized Show
Your Reply