*New 11.3 series Release:
2019-10-05: XigmaNAS 11.3.0.4.6928 - released, 11.2 series are soon unsupported!

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[HOWTO] Use NAS4Free as a CUPS server for Hewlett-Packard and Samsung Printer

XigmaNAS Packages
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
ozdesoner
NewUser
NewUser
Posts: 8
Joined: 10 Nov 2015 16:59
Location: Ordu/TURKEY
Status: Offline

[HOWTO] Use NAS4Free as a CUPS server for Hewlett-Packard and Samsung Printer

#1

Post by ozdesoner » 16 Mar 2016 22:26

Today's topic is installing CUPS for the print service in NAS4Free as the printer server.
Set up a Static IP (for ex: 192.168.1.250) for your NAS4Free box since the OS can constantly change the IP address after a reboot or a power on, as well as the DNS server(s).

Step 1: Installation of required packages
Login to your NAS4Free box via your web browser of your choice: http{s*}://(Server IP):{port**} (For Ex me: http://192.168.1.250)
* If you set up your NAS4Free box to use HTTPS, type in https, otherwise, use HTTP.
** Custom port number must be entered if you used a custom port number other than 80 (HTTP) or 443 (HTTPS)
Go to Access > Users and Groups
Click On Groups and click on the Add (+) Button.
Type in your group name, group ID (leave as-is), and type in a description, click on Add and apply
Create a new user by clicking the Add (+) Button
Type in the login name of user (ex: soner)
Type in the full name (ex: Soner Ozdemir)
Type and Re-enter your desired password (ex: soner1234)
Specify a User ID, or leave as-is
Specify a shell login (bash is recommended)
Select your primary group (ex: sonerfirma)
Select the additional groups wheel and sshd (recommended for logging in via ssh and for running su - root)
Setup a home directory for read-write access for your user (ex: /home/soner)
*Optional, but recommended* tick the box to allow the user to access the user portal
Click on Add and apply
Go to Services > SSH
Click on Enable, and click on Save and Restart
Sign in to your NAS4Free box on your computer that is either running Windows, Linux, Mac OS X or UNIX via ssh
Windows: download and run PuTTY, and type in the IP Address (my’s: 192.168.1.250) of your NAS4Free box, and select SSH, and click on open.
Type in your username and password
Linux, Unix, and Mac OS X: Run a terminal and type in the following:

Code: Select all

ssh -l username ip-address
Where username is your newly created username and ip-address is your NAS4Free IP Address and type in your password to login.
Login as root by typing in:

Code: Select all

su - root
Type in root's password (nas4free)
Enter the following command to install the packages:

Code: Select all

pkg install foomatic-filters cups gutenprint-cups hplip splix
cups = For Main Core Of Server
hplip = For Hewlet-Packard Printers
splix = For Samsung Printers
gutenprint-cups = For Lexmark, Epson, Canon, Sony, Olympus, and PCL printers
After the packages have installed, reboot your NAS4Free system for the package installations to take effect, same as the path for the commands, like hp-setup.

Step 2: Configuring CUPS and System Files
Login as root by typing in:

Code: Select all

su - root
Type in root's password (nas4free)
move the cupsd.conf file and make a new one:

Code: Select all

mv /usr/local/etc/cups/cupsd.conf /usr/local/etc/cups/cupsd.bak
nano /usr/local/etc/cups/cupsd.conf
Copy and paste the contents for the new cupsd.conf file:

Code: Select all

#
# "$Id: cupsd.conf.in 11025 2013-06-07 01:00:33Z msweet $"
#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#
# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn
DefaultEncryption Never
# Only listen for connections from the local machine.
Listen *:631
Listen /var/run/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols dnssd
# Default authentication type, when authentication is required...
DefaultAuthType Basic
# Web interface setting...
WebInterface Yes
# Restrict access to the server...
<Location />
  Order allow,deny
  Allow ALL
</Location>
# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow ALL
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow ALL
</Location>
Press Ctrl + O to save, and Ctrl + X to exit
Type in:

Code: Select all

dmesg | grep ugen
and you will get the following line:

Code: Select all

ugen0.2: <Hewlett-Packard> at usbus0
ugen3.2: <Samsung Printer> at usbus3
X and Y are the usb connections For ugenX.Y
ugen0.2 for Hewlett-Packard 'usb/0.2.*'
ugen3.2 for Samsung Printer 'usb/3.2.*'
Edit 'usb/X.Y.*' Copy and paste the following:

Code: Select all

[system=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'usb*' mode 0770 group cups
add path 'ugen*' mode 0660 group cups
add path 'usb/X.Y.*' mode 0660 group cups
make a new file called devfs.rules

Code: Select all

touch /etc/devfs.rules
nano /etc/devfs.rules
Save the file and exit nano
Editing foomatic filter configuration

Code: Select all

nano /usr/local/etc/foomatic/filter.conf
And uncomment the line that reads:

Code: Select all

#cupsfilterpath: /usr/local/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter
into:

Code: Select all

cupsfilterpath: /usr/local/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter
Login to NAS4Free via web interface, go to access > users and groups
Syntax for cups:
Username: cups
Name: cups
user ID 1001
shell: nologin
primary group: cups
additional group: wheel
Add and apply
Restart both CUPS and devfs:

Code: Select all

/etc/rc.d/devfs restart
/usr/local/etc/rc.d/cupsd restart
Go to System > Advanced and click on rc.conf
Add the following variables and values:
Variable---------------------Value
cupsd_enable----------------YES
devfs_enable----------------YES
devfs_system_ruleset------system
Reboot to apply settings.
Now Ready CUPS Server.

Step 3: Adding and testing printers
Download File For Hewlett Packard 'http://foo2zjs.rkkda.com/foo2zjs.tar.gz' and unzip file.
Download File For Samsung 'http://heanet.dl.sourceforge.net/projec ... .0.tar.bz2' and unzip file.
To access the CUPS print server, type in http://ipaddress:631 (Ex me: 192.168.1.250:631)
Go to Administration and click on Add Printers. If prompted for a username and password, enter root and the password for root (default nas4free)
After the packages are installed, and the printers are connected via USB, LPT, or some other means, it's time for adding the printer.
Normally, people would select the USB Printer #n (no restart) for their USB printers, which limits functionality, such as network scanning. With the proper packages installed, the printer would show up in this style format:
Select 'USB Printer #1' first from Local Printers and Click Continue.
Printer Name : 'HP_Printer' for HP and 'Samsung_Printer' for Samsung.
Description : 'HP Printer' for HP and 'Samsung Printer' for Samsung.
Location : WORKGROUP
Click ' Share This Printer' and Click Continue.
Click Open File from Provide a PPD File: and find
Your HP Printer Model in foo2zjs/PPD or
Your Samsung Printer Model in splix-2.0.0/PPD And select PPD file of Printer Model. Finally Click Add Printer.
Continue to go to the next page, which is defining the defaults for the printer, such as ink quality and speed ratings, double-sided printing, duplex installed, etc. and click on Add. If all goes well, you have successfully installed a printer in CUPS.
Now, click on your Queue Name (Printer), and under Maintenance, click on print test page. It'll say that the print job is being processed and is printing.

Step 4: Installing and testing printers under Windows
Go to Control panel and Select Devices and Printers. Click Add a printer.
In the Add Printer wizard, click Add a network, wireless or Bluetooth printer.
Select 'I want to print is not listed' and appear next window 'Select the shared printer name'
in the text box type:
http://(servername):631/printers/printername
For Ex HP : http://192.168.1.250:631/printers/HP_Printer
For Ex Samsung : http://192.168.1.250:631/printers/Samsung_Printer
Complete the additional steps in the wizard, and then click Finish.
Next Finally ready your printer.

Thanks to bjwil1991 for the topics.
FOXCONN 45CS/45CSX 2GB RAM 16 GB SSD 4 TB HDD x64-full on Intel Atom CPU 230 @ 1.60GHz Silverstone ML05 Mini-ITX

Post Reply

Return to “Packages”