为什么我在 ubuntu 9.10 cups 服务器中收到 400 Bad Request?

aar*_*ron 3 cups ubuntu-9.10

我的家庭网络上有一个在 ubuntu 9.10 上运行的 cups 服务器。现在我可以在 处访问它192.168.1.101:631,但是当我尝试在 处访问它时myservername.local:631,我得到了一个400 Bad Request. 这是我当前的相关部分cupsd.conf

ServerName 192.168.1.101

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

# any of the below 'Listen' directives all yield the same result
Listen 192.168.1.101:631
#Listen *:631
#Listen myservername.local:631

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
BrowseAddress 192.168.1.255

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

# Restrict access to the server...
<Location />
  Order deny,allow
  Deny from All
  Allow from 127.0.0.1
  Allow from 192.168.1.*
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order deny,allow
  Deny from All
  #Allow from 127.0.0.1
  #Allow from 192.168.1.*
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order deny,allow
  Deny from All
  #Allow from 127.0.0.1
  #Allow from 192.168.1.*
</Location>
Run Code Online (Sandbox Code Playgroud)

我得到以下内容/var/log/cups/error_log

E [03/Jan/2010:18:33:41 -0600] 来自“192.168.1.100”的请求使用无效的主机:字段“myservername.local:631”

我需要做什么才能在 和 处访问 cups192.168.1.101:631服务器myservername.local:631

Ada*_*ers 5

从 Cups 1.3.10 开始,服务器在启动时不会尝试查找自己的主机名。可以通过添加来恢复旧的行为

HostNameLookups on
Run Code Online (Sandbox Code Playgroud)

到您的 cupsd.conf 文件。更多信息可参见此Gentoo Bug 报告以及CUPS 1.3.10 发行说明

您可能还想查看ServerNameServerAliasconfig 指令。请参阅联机帮助页(或在此处man cupsd.conf在线获取)以获取更多信息。