Servidor de Impressão Cups com Cubieboard2

Neste artigo, vou demonstrar como instalar e  configurar  na Cubieboard 2  o Servidor de Impressão CUPS.

A distribuição utilizada será o Cubian, que está instalado em uma Cubieboard 2.

Link da Imagem para SD Card

http://cubie.nobrainz.de/downloads/CTDebian_1.9_hdmi.zip

 

É necessário para nossos testes uma impressora USB, PARALELA ou de REDE.
No exemplo a seguir tenho uma HP LaserJet Professional P1102w, HP Laser com rede sem fio, nela está configurado o IP 11.11.11.122.

Instalação:

aptitude update
apt-get install cups samba printer-driver-hpijs printer-driver-hpcups

vim /etc/cups/cupsd.conf

LogLevel warning
SystemGroup lpadmin

# Allow remote access
Port 631
Listen /var/run/cups/cups.sock

# Share local printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAddress @LOCAL
DefaultAuthType Basic
<Location />
Allow From All

# Allow shared printing and remote administration…
Order allow,deny
Allow @LOCAL
</Location>
<Location /admin>
Allow From All

# Allow remote administration…
Order allow,deny
Allow @LOCAL
</Location>
<Location /printers>
Order allow,deny
Allow all
</Location>
<Location /admin/conf>
AuthType Default
Require user @SYSTEM

# Allow remote access to the configuration files…
Order allow,deny
Allow @LOCAL
</Location>
<Policy default>
<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 CUPS-Move-Job>
Require user @OWNER @SYSTEM
Order allow,deny
</Limit>
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
AuthType Default
Require user @SYSTEM
Order allow,deny
</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 CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM
Order allow,deny
</Limit>
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order allow,deny
</Limit>
<Limit All>
Order allow,deny
</Limit>
</Policy>

Agora reinicie o serviço:

$ sudo /etc/init.d/cups restart

Faça um teste para ver se esta tudo correndo bem.

No exemplo abaixo eu coloco o IP da minha rede, altere conforme a sua.

  • http://11.11.11.122:631

Configuração do samba:

Aqui fica a parte muito importante, geralmente muitas pessoas recebem um erro de “Acesso Negado: Não foi possível estabelecer uma conexão”. Elas conseguem instalar a impressora, mas não é possível imprimir por acesso negado. Vamos resolver esse probleminha.

vim /etc/samba/smb.conf

#======================= Global Settings =======================

[global]

workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you’ll need this
load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
printing = cups
printcap name = cups

#======================= Share Definitions =======================

[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S

[printers]
comment = All Printers
browseable = yes
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

Instalação manual de impressoras:

Uma outra forma de detectar e configurar impressoras com o Cups  é necessáio utilizar o utilitário do pacote hplip

hp-setup -i

Adicionando Impressoras no Windows:

No executar do Windows diigite \\IPdaCubieboard

Clique com o botão direito do mouse sobre o compartilhamento de impressora e selecione abrir

Em seguida clique em OK

Nesse passo selecione o driver da sua Impressora e clique em OK



Para baixar a versão em PDF, clique no link abaixo:

http://www.lojamundi.com.br/download/servidor-de-impressao-cups-com-cubieboard2/servidor-de-impressao-cups-com-cubieboard2.pdf

Posted in: Cubieboard Tags: servidorimpressaocupscubieboard2

ENTRE EM CONTATO COM A LOJAMUNDI.

Assine nossa Newsletter! É gratuito!

Cadastre seu nome e email para receber novidades e materiais gratuitos da Lojamundi.