Saturday, 19 September 2015

Setup Printer for UNIX

There are 2 different methods to install printer driver for UNIX:
  1. Using the Installation Shell Script

  2. Adding the device manually

Note:
  • Before starting, make sure that the IP address has been configured correctly.
  • For this example, 192.168.15.16 has been used as the IP address.

Using the Installation Shell Script
  1. Log on to the workstation as root.
    If you do not log on as root, the installation shell script will not run.

  2. Get the installation shell script from the printer.

  3. Move to the directory you want to copy the installation shell script to.

  4. Use FTP to connect to the printer with the IP address which you've already configured.
    # ftp 192.168.15.16
    Connected to 192.168.15.16
    220 printer FTP server ready.
    name (192.168.15.16:root:)

  5. When a user name is requested, leave the user name field blank and press the [RETURN] ( [ENTER] ) key.
    331 Password required for root.
    Password:

  6. When a password is requested, leave the password field blank and press the [RETURN] ( [ENTER] ) key.
    230 User root logged in.
    ftp>

  7. Enter the following to get the installation shell script:
    ftp> get install

  8. Close the ftp session.
    ftp> bye
    221 Goodbye.
    #

  9. Run the installation shell script. (Insert a period and slash before the current directory.)
    # sh ./install

  10. Enter a number to select the workstation operating system that you are using.
    Network printer install shell
     Select your workstation OS type
      1.SunOS 4.x.x
      2.Solaris 2.x, Solaris 7-9 (SunOS5.x)
      3.HP-UX
      4.UnixWare
      5.Linux
      6.OpenServer
      7.Quit
     Enter <1-7>:
    2

  11. Enter the printer's IP address.
    Enter Printer host IP address <xxx.xxx.xxx.xxx> [return=skip]:
    192.168.15.16
    If the host name of the printer has already been configured, press the [RETURN] ( [ENTER] ) key. Nothing will be added to the /etc/hosts file.

  12. Enter the printer's host name.
    Enter Printer host name : nphost

  13. Configure the printer name.
    Enter logical printer name [default nphost_prn]
    If you want to use the default name, press the [RETURN] ( [ENTER] ) key. Enter a new name if you want to use a different one. The host name entered in the previous step followed by "_prn" appears in "default".

  14. Set the print option.
    Enter remote printer name [default lp]:
    • Press the [RETURN] ( [ENTER] ) key, and printing with PCL or PostScript is enabled.
    • If you want to set the device option, enter the option parameter.
      Enter remote printer name [default lp]:tray=tray1
    • If you enter "text", text printing is enabled. If you enter "text", printing with PCL and PostScript is disabled.
      Enter remote printer name [default lp]:text

    • After setup with the installation shell script is complete, and if you entered the IP address, the following message appears:
      hosts file is modified

  15. Perform a test print to make sure that the settings are correct.
    # lpr -Pnp file_name
    # lp -d np file_name
Adding the device manually
In Linux:
  1. The following line must be added to the /etc/hosts file.
    192.168.15.16 nphost # Network Printer
    192.168.15.16 is the IP address, nphost is the host name, from # to the end of the line is the comment.

  2. The following entry must be added to the /etc/printcap file
    ##PRINTTOOL3## REMOTE
    np|Network Printer:|np|Network Printer:|np|Network Printer:| np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:| np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:|np|Network Printer:\
      :rm=nphost:\
      :rp=option:\
      :sd=/var/spool/lpd/npd:\
      :lf=/var/log/npd-errs:\
      :sh:\
      :mx#0:

  3. Create a spool directory under /var/spool/lpd. The name of the spool directory should be the name of the printer followed by a "d".
    # cd /var/spool/lpd
    # mkdir npd
    # chown root npd
    # chgrp lp npd

  4. Error messages are logged to a file created in the /var/log directory. The log file name is the printer name followed by "d-errs".
    # cd /var/log
    # touch npd-errs
    # chown root npd-errs
    # chgrp lp npd-errs

In Solaris:
  1. Add the IP address and host name to the /etc/hosts file
    192.168.15.16 nphost # Network Printer
    192.168.15.16 is the IP address, nphost is the host name, from # to the end of the line is the comment.

  2. Register the printer
    1. If your workstation is Solaris 2.5.1, register the print server and print client to the print service.
      # lpsystem -t bsd -R 0 -y Network Printer nphost
    2. Register the printer as a remote printer.
      # lpadmin -p np -s nphost!option -T dump -I any
    3. If your workstation is Solaris 2.5.1, set the print job to active so it can be accepted by the print queue.
      /usr/lib/accept np
    4. If your workstation is Solaris 2.5.1, set the print job to active to print.
      /usr/lib/enable np

In HP-UX:
  1. Add the IP address and host name to the /etc/hosts file
    192.168.15.16 nphost # Network Printer
    192.168.15.16 is the IP address, nphost is the host name, from # to the end of the line is the comment.

  2. Register the printer
    1. Stop the scheduler.
      /usr/lib/lpshut
    2. Register the printer.
      /usr/lib/lpadmin -Pnp -v/dev/null -mrmodel -ormnphost -orpoption -ob3
    3. Set the printer so the print job is listed in the print queue.
      /usr/lib/accept np
    4. Set the printer to perform the print job.
      /usr/lib/enable np
    5. Restart the scheduler.
      /usr/lib/lpsched
Share This

No comments:

Post a Comment

Register Now

Contact Form

Name

Email *

Message *