[SOLVED] CUPS printing error (Request from localhost using invalid Host: field )
Have searched for similar posts and cannot find anything that matches exactly, so I'm posting the issue here, in a new thread.
Distro is PClinuxOS 2007 (with full dist-upgrade done as of 2009/08/10).
184.108.40.206.tex3 #1 SMP
Post the upgrade, printing from Gnome apps (eg. Evolution) didn't work anymore. Printer appears in the print dialog (eg. HP M4345), but the "print" button was greyed out! However, one printer did still work and the difference was that it had an absolute URI reference (ipp://220.127.116.11:631/printers/Local-HPlj1020). The others had all been added using the HP tool, and used refs such as "ipp://::1/printers/HP_LaserJet_M4345_MFP".
Working with the CUPS webadmin tool resulted in a Firefox error message when trying to access user permissions for a printer, warning of trying to access a non-standard port. The log files pointed to the actual problem, contained entries such as,
Request from "localhost" using invalid Host: field "::1"
A bit of searching led to a few such CUPS related errors, all posted after recent upgrades (mostly since April). The solutions varied... I did the following to get it to work:
- Open /etc/cups/cupsd.conf
- Add the line "ServerAlias *"
- Add the line "Port 631"
- Add the line "Listen /var/run/cups/cups.sock"
- Save the file and restart cups ("/etc/init.d/cups restart").
Hey presto, the HP Tool functions correctly, and so does the CUPS webadmin tool. All the printers appear in Evolution etc. with "Print" buttons enabled (and not greyed out).
Note, as an aside, that the entries made in the cupsd.conf file will mostly likely disappear with your next upgrade of CUPS, so beware.