Это старая версия документа.


Сервер печати CUPS

Первичный (основной) механизм для печати и сервисов печати в Ubuntu - это Общая система печати UNIX (Common UNIX Printing System - CUPS). Данная система печати - это свободный, доступный и переносимый слой, который стал новым стандартом печати для большинства дистрибутивов Linux.

CUPS управляет заданиями печати и обеспечивает сетевую печать с использованием стандарта IPP (интернет протокол печати), поддерживая огромный список принтеров от матричных до лазерных и любых других. CUPS также поддерживает PostScript описание принтеров (PPD) и автоопределение сетевых принтеров, а также простую настройку и администрирование через web интерфейс.

Установка

Для установки CUPS на ваш Ubuntu компьютер просто используйте sudo для выполнения команды apt-get, передав ей названия пакетов в качестве параметра. Полная установка CUPS содержит много зависимостей, но они все могут быть определены в одной команде. Введите следующее в терминале для установки CUPS:

sudo apt-get install cups

После аутентификации вас по паролю, пакеты должны загрузиться и установиться без ошибок. В заключении установки сервер CUPS будет запущен автоматически.

При необходимости решения проблем, вы можете получить доступ к ошибкам сервера CUPS через файл журнала /var/log/cups/error_log. Если журнал ошибок не дает достаточно информации для решения какой-либо проблемы, уровень журналирования CUPS можно повысить изменением директивы LogLevel в файле настроек (описывается ниже) до debug или даже debug2 со стандартного info, что будет сохранять в журнал абсолютно все. Если вы решите провести такое изменение, не забудьте вернуть все обратно после решения проблемы, чтобы избежать излишнего разрастания файла журнала.

Настройка

The Common UNIX Printing System server's behavior is configured through the directives contained in the file /etc/cups/cupsd.conf. The CUPS configuration file follows the same syntax as the primary configuration file for the Apache HTTP server, so users familiar with editing Apache's configuration file should feel at ease when editing the CUPS configuration file. Some examples of settings you may wish to change initially will be presented here.

Prior to editing the configuration file, you should make a copy of the original file and protect it from writing, so you will have the original settings as a reference, and to reuse as necessary.

Copy the /etc/cups/cupsd.conf file and protect it from writing with the following commands, issued at a terminal prompt:

sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original

  ServerAdmin: To configure the email address of the designated administrator of the CUPS server, simply edit the /etc/cups/cupsd.conf configuration file with your preferred text editor, and add or modify the ServerAdmin line accordingly. For example, if you are the Administrator for the CUPS server, and your e-mail address is 'bjoy@somebigco.com', then you would modify the ServerAdmin line to appear as such:
  ServerAdmin bjoy@somebigco.com
  Listen: By default on Ubuntu, the CUPS server installation listens only on the loopback interface at IP address 127.0.0.1. In order to instruct the CUPS server to listen on an actual network adapter's IP address, you must specify either a hostname, the IP address, or optionally, an IP address/port pairing via the addition of a Listen directive. For example, if your CUPS server resides on a local network at the IP address 192.168.10.250 and you'd like to make it accessible to the other systems on this subnetwork, you would edit the /etc/cups/cupsd.conf and add a Listen directive, as such:
  Listen 127.0.0.1:631           # existing loopback Listen
  Listen /var/run/cups/cups.sock # existing socket Listen
  Listen 192.168.10.250:631      # Listen on the LAN interface, Port 631 (IPP)
  In the example above, you may comment out or remove the reference to the Loopback address (127.0.0.1) if you do not wish cupsd to listen on that interface, but would rather have it only listen on the Ethernet interfaces of the Local Area Network (LAN). To enable listening for all network interfaces for which a certain hostname is bound, including the Loopback, you could create a Listen entry for the hostname socrates as such:
  Listen socrates:631  # Listen on all interfaces for the hostname 'socrates'
  or by omitting the Listen directive and using Port instead, as in:
  Port 631  # Listen on port 631 on all interfaces

For more examples of configuration directives in the CUPS server configuration file, view the associated system manual page by entering the following command at a terminal prompt:

man cupsd.conf

Whenever you make changes to the /etc/cups/cupsd.conf configuration file, you'll need to restart the CUPS server by typing the following command at a terminal prompt:

sudo /etc/init.d/cups restart

Web интерфейс

CUPS can be configured and monitored using a web interface, which by default is available at http://localhost:631/admin. The web interface can be used to perform all printer management tasks.

In order to perform administrative tasks via the web interface, you must either have the root account enabled on your server, or authenticate as a user in the lpadmin group. For security reasons, CUPS won't authenticate a user that doesn't have a password.

To add a user to the lpadmin group, run at the terminal prompt:

sudo usermod -aG lpadmin username

Further documentation is available in the Documentation/Help tab of the web interface.

Ссылки

CUPS Website

Debian Open-iSCSI page