LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-05-2014, 02:43 PM   #1
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 620

Rep: Reputation: 170Reputation: 170
Install HP Photosmart C4240 on Ubuntu Server 12.04 to print with Samba and CUPS


Hi,
I'm trying to set up a HP Photosmart C4240 All-in-one printer on my server. My goal is to be able to print from all of our Windows computers (XP, Vista, 7, 8.1). I already have Samba working, and I have the CUPS part partially working (I think...). On my Windows 7 laptop, I could install the printer, but it said that the server had an incorrect driver, and prompted me to select my printer from a list. My printer was listed, so I selected it, and it now works from my Windows 7 laptop. However, my dad's Vista work laptop doesn't list the printer, and I have yet to try it on my family's XP desktop (though I have a feeling that it won't work either). From what I've found out so far, I think I need a PPD file and I need to configure it to work with the CUPS server.

I have a little experience with Samba, but I just installed CUPS this morning and know almost nothing about it. Any help would be appreciated. I've posted my configuration files below.

/etc/samba/smb.conf:
Code:
#======================= Global Settings =======================
[global]
   workgroup = WORKGROUP
   server string = Anthony's server
   dns proxy = no
#### Debugging/Accounting ####
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
####### Authentication #######
   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
############ Misc ############
   usershare allow guests = yes
   printcap name = cups
   printing = cups

#======================= Share Definitions =======================
[printers]
   comment = All Printers
   browseable = yes
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0755
   use client driver = yes

# 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

[Server Folder]
   comment = All the files
   path = /srv
   browsable = yes
   read only = no
   writeable = yes
   guest ok = no
/etc/cups/cupsd.conf
Code:
LogLevel warn
MaxLogSize 1m
SystemGroup lpadmin
Listen localhost:631
Listen /var/run/cups/cups.sock
Listen 10.0.0.26:631
# Share local printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseRemoteProtocols
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
WebInterface Yes
<Location />
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  Order allow,deny
  Allow all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order allow,deny
  </Limit>
  <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order allow,deny
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order allow,deny
  </Limit>
  <Limit All>
    Order allow,deny
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>
  <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </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 deny,allow
  </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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
PreserveJobHistory No
/etc/cups/cups-files.conf:
Code:
#
#
# Sample file/directory/user/group configuration file for the CUPS scheduler.
# See "man cups-files.conf" for a complete description of this file.
#

# List of events that are considered fatal errors for the scheduler...
#FatalErrors config

# Default user and group for filters/backends/helper programs; this cannot be
# any user or group that resolves to ID 0 for security reasons...
#User lp
#Group lp

# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
SystemGroup lpadmin


# User that is substituted for unauthenticated (remote) root accesses...
#RemoteRoot remroot

# Do we allow file: device URIs other than to /dev/null?
#FileDevice No

# Permissions for configuration and log files...
#ConfigFilePerm 640
#LogFilePerm 0640

# Location of the file logging all access to the scheduler; may be the name
# "syslog". If not an absolute path, the value of ServerRoot is used as the
# root directory.  Also see the "AccessLogLevel" directive in cupsd.conf.
AccessLog /var/log/cups/access_log

# Location of cache files used by the scheduler...
#CacheDir /var/cache/cups

# Location of data files used by the scheduler...
#DataDir /usr/share/cups

# Location of the static web content served by the scheduler...
#DocumentRoot /usr/share/cups/doc-root

# Location of the file logging all messages produced by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory.  Also see the "LogLevel"
# directive in cupsd.conf.
ErrorLog /var/log/cups/error_log

# Location of fonts used by older print filters...
#FontPath /usr/share/cups/fonts

# Location of LPD configuration
#LPDConfigFile 

# Location of the file logging all pages printed by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory.  Also see the "PageLogFormat"
# directive in cupsd.conf.
PageLog /var/log/cups/page_log

# Location of the file listing all of the local printers...
#Printcap /var/run/cups/printcap

# Format of the Printcap file...
#PrintcapFormat bsd
#PrintcapFormat plist
#PrintcapFormat solaris

# Location of all spool files...
#RequestRoot /var/spool/cups

# Location of helper programs...
#ServerBin /usr/lib/cups

# SSL/TLS certificate for the scheduler...
#ServerCertificate ssl/server.crt

# SSL/TLS private key for the scheduler...
#ServerKey ssl/server.key

# Location of other configuration files...
#ServerRoot /etc/cups

# Location of Samba configuration file...
#SMBConfigFile 

# Location of scheduler state files...
#StateDir /var/run/cups

# Location of scheduler/helper temporary files. This directory is emptied on
# scheduler startup and cannot be one of the standard (public) temporary
# directory locations for security reasons...
#TempDir /var/spool/cups/tmp

#
#
/etc/cups/printers.conf:
Code:
# Printer configuration file for CUPS v1.5.3
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer HP_Photosmart_C4200_series>
UUID urn:uuid:b6b7ba2d-edee-3953-7da6-e0f0ea414d9d
Info HP Photosmart C4200 series
Location Upsta
MakeModel HP Photosmart c4200 Series hpijs, 3.12.2
DeviceURI usb://HP/Photosmart%20C4200%20series?serial=MY726CP1DB04VP&interface=1
State Idle
StateTime 1391610936
Type 8425500
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
 
Old 02-05-2014, 04:23 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,886

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Are you are able to print from the server itself? Can you print from the W7 PC? If so then cups and samba are working.

The [print$] in smb.conf is to be able to automatically install the print drivers from the server which you have not configured yet. It is easier to comment out the section and load the driver locally as you have already done for the W7 computer. You will have to restart samba for any changes to become effective.

Go to HPs website and down load the driver for Vista and XP. Go ahead and install them. Then add a network printer, browse to the server/printer and now the driver should be available in the list.

I am not as fluent with installing stuff on W8 as the others but you also down load its printer driver.

http://h10025.www1.hp.com/ewfrf/wc/s...s&dlc=en&lc=en
 
1 members found this post helpful.
Old 02-06-2014, 05:37 PM   #3
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 620

Original Poster
Rep: Reputation: 170Reputation: 170
Thanks for the reply!

Yes, I can print from the server. I printed the test page from the CUPS web interface. I can also print from the Win7 laptop as well. One thing I noticed was that it took about 30 seconds from when I clicked "Print" to when the printer actually started working. Any thoughts on this? The printer was previously connected to a WinXP desktop, and it never took that long to start printing.

Thanks for the driver link, I'll get into that when I get a chance.

I'll post back here when I get a chance to try this...since I'm in high school, I don't have a ton of free time, so it might be a few days.

Thanks again for your help!

A little side topic that you may or may not know much about...what would be the best thing to do about the XP computer for when Microsoft cuts support in April? I tried talking my parents into getting Lubuntu on it, but they said no (for now at least...it sounded like there was a slim chance that it might happen later). My mom uses it to check her email and save pictures, and my dad uses it for pictures and taxes. I plan on getting a Clonezilla image before April 8. I convinced them to ditch IE in favor of Firefox a few months ago, and we have Norton 360 anti-virus on it. Are there any other precautions that I should be taking?
 
Old 02-06-2014, 06:45 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,886

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
I don't know why you print jobs are delayed.

I assume that XP computer is unable to run W7? Make sure you have installed all the updates.
 
Old 02-06-2014, 08:14 PM   #5
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 620

Original Poster
Rep: Reputation: 170Reputation: 170
No, it most likely can't run 7...we would need a license anyway. It's an old computer, and if we end up getting 7 we'll most likely just get a whole new system. As for the updates, we update it every time they are released.

Thanks anyway!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba/Cups print sharing problems (/var/spool/samba files) Gates1026 Linux - General 9 06-23-2013 01:33 AM
CUPS/Samba print and file server vs. Android and Mac OS X kikinovak Slackware 1 11-13-2012 06:59 AM
cups/samba print server & manufacturers print drivers bourne Linux - Server 0 03-15-2011 04:44 PM
LXer: How To Set Up A Webgui Based Print Server On Ubuntu Server Using SWAT, CUPS, And SAMBA LXer Syndicated Linux News 0 08-20-2010 01:40 PM
[SOLVED] Cups and Samba to print one print job to 2 printers - tutorial added bourne Linux - General 7 09-18-2009 10:10 AM


All times are GMT -5. The time now is 01:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration