Lpstat: Bad Request Error in Linux

Dear Team,

Earlier my

lpstat syntax

is working on o/s, I have installed cups

"cups-1.6.1"

after that I'm not able to open the printer option in GUI and cannot do the query

"lpstat -a"

Below is the error i'm getting..Request you to advice me the best to me.

[root@r12devdb cups-1.6.1]# lpstat
lpstat: Bad Request

My O/s Version.

[root@r12devdb ~]# uname -v
#1 SMP Wed Oct 10 16:48:44 EDT 2007
[root@r12devdb ~]# uname -a
Linux r12devdb.ghobash.com 2.6.18-53.el5xen #1 SMP Wed Oct 10 16:48:44 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
[root@r12devdb ~]# uname -r
2.6.18-53.el5xen
[root@r12devdb ~]# uname -mrs
Linux 2.6.18-53.el5xen x86_64
[root@r12devdb ~]#
[root@r12devdb cups-1.6.1]# cat /etc/*release
Red Hat Enterprise Linux Server release 5.1 (Tikanga)
[root@r12devdb cups-1.6.1]# cat /proc/version
Linux version 2.6.18-53.el5xen (brewbuilder@hs20-bc1-7.build.redhat.com) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)) #1 SMP Wed Oct 10 16:48:44 EDT 2007
[root@r12devdb cups-1.6.1]#

Thank you,
Faiz.

This issue is a known regression in cups-1.6.1 apparently due to DNS rebinding attack protection code.

To work around this, try adding ServerAlias directives to your cupsd.conf file, either:

ServerAlias \*

or one per hostname, e.g.:

ServerAlias host1.example.com
ServerAlias host2.example.com
1 Like

Hi Expert,

Thank you very much for your support.I added this parameter "ServerAlias *" its given the error "lpstat: Connection refused"
Then i added below two lines its work given the lpstat output.

< Listen 192.11.10.xx:631      # Listen on the LAN interface, Port 631 (IPP)
< Listen xxxxx.xxxx.com:631  # Listen on all interfaces for the hostname 'socrates'

While i'm trying to open printer from GUI mode its giving below error,Please advise, Thanks in advance.

Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 40, in ?
    import cups
ImportError: /usr/lib64/python2.4/site-packages/cups.so: undefined symbol: _cupsAdminGetServerSettings

Thank you,
Mohammed Faiz.

Dear Expert,

Please let me know, how can i enable the GUI mode for printers...do i need to uninstall the cups? please update the action plan.

Thank you,
Faiz.