免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2735 | 回复: 0
打印 上一主题 下一主题

在sco-unix网络中设置共享打印机 [复制链接]

论坛徽章:
1
15-16赛季CBA联赛之北控
日期:2022-03-04 22:35:50
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-10 21:58 |只看该作者 |倒序浏览

  
作者:杨跃峰   
摘自《中国计算机报》

  一、问题的提出

  随着网络的日益普及,计算机系统通过网络实现设备共享和资源共享已十分普遍。在一个公共的网络环境中,设置一台共享打印机不仅大大提高了设备的利用率和网络效率,降低了总拥有成本,还省去了操作人员长期习惯于每打印一份作业便抱一台打印机连到自己机器上的麻烦。dos、windows、netware系统下共享打印机设置比较简单,无需多言,sco-unix作为金融系统和其它大行业首选的操作系统,近年来组网非常广泛,应用也非常普及,但设置共享打印机比较麻烦。笔者经过多次试验,终获成功,介绍给大家仅供参考。

  二、工作原理

  共享打印机即按一定拓扑结构联接在网络中的打印机,通过网络协议(tcp/ip、netbeui、ipx/spx等)而被网络用户共享使用。其连接主要有以下三种方式:
  (1)打印机本身带网卡(又称网络打印机),直接连到网络中供用户共享使用(见图1)。


  (t 表示数据终端)
  图1
  (2)打印机连接到专用的打印服务器上,并通过其网络接口连到网络中供用户共享使用(见图2)。


  图2
  (3)使用一台网络上的pc或服务器兼作打印服务器,连上打印机供用户共享使用(见图3)。
  比较而言,前两种方式须购置专用设备,同时unix下还需设置bootp 或rarp服务以自动提供ip地址。而第三种方式无需购置专用设备且不影响计算机的正常使用, 经济实用,简单方便,大大节约运行成本,也是笔者下面所要介绍的。


  图3

  三、实现过程

  以网络中有a、b两台主机为例(见图4),操作系统为sco openserver 3.0 或5.0,打印机连到兼做打印服务器的b机上,供a、b主机上的用户共享使用。设a机主机名为 hosta ip地址:168.1.8.1
  b机主机名为 hostb ip地址:168.1.8.2
  打印机名为:printer
  调整unix 核心系统参数 nregion: a 机不低于800、b机不低于1000并连接核心重新引导系统。


  图4
  1.b机端设置
  以 root 用户注册:
  (1)定义主机名。修改文件 /etc/hosts 含以下行:
  168.1.8.1 hosta
  168.1.8.2 hostb
  (2)定义打印服务授权。修改文件 /etc/hosts.lpd 含以下行:
  hosta
  (3)建立本地打印机 printer (如已存在先删除),设为缺省并激活:
   #mkder lp
   选 configure→add
  其中:printer name: printer
   connection: direct
   device name: /dev/lp0
   #/usr/lib/lpadmin -d printer
   #enable printer
  (4)建立网络方式下的本地打印机,名称同上为 printer, 提示本地(local)或远程(remote)时,选择本地。
   #mkdev rlp
  提示如下(黑体字母为所选择项):
  remote printing configuration
  do you want to install or remove remote printing (i/r/q)? [q]: i
  installing remote line printing
  creating directories /usr/lpd/remote and /usr/spool/lpd and file /etc/printcap.
  saving lp, cancel and lpstat commands to /usr/lpd/remote
  installing remote lp, cancel and lpstat commands
  do you wish to change the printer description file /etc/printcap? (y/n) [n] y
  remote printing configuration
  enter information for remote printers or local printers accepting
  remote printing requests
  please enter the printer name (q to quit): printer
  is printer a remote printer or a local printer (r/l)? l
  please enter the the name of the device for printer: /dev/lp0
   printer printer uses device /dev/lp0
  is this correct? (y/n) y
   remote printing configuration
  enter information for remote printers or local printers accepting
  remote printing requests
  please enter the printer name (q to quit): q
  do you want to start remote daemon now? (y/n) y
  2?a机端设置
  以 root 用户注册:
  (1)定义主机名。修改文件 /etc/hosts 含以下行:
  168.1.8.1 hosta
  168.1.8.2 hostb
  (2)建立网络方式下的远程打印机,远程主机名为hostb,远程打印机名输入printer,提示本地(local)或远程(remote)时,选择远程。
  #mkdev rlp
  remote printing configuration
  do you want to install or remove remote printing (i/r/q)? [q]: i
  installing remote line printing
  creating directories /usr/lpd/remote and /usr/spool/lpd and file /etc/printcap.
  saving lp, cancel and lpstat commands to /usr/lpd/remote
  installing remote lp, cancel and lpstat commands
  do you wish to change the printer description file /etc/printcap? (y/n) [n] y
  remote printing configuration
  enter information for remote printers or local printers accepting
  remote printing requests
  please enter the printer name (q to quit): printer
  is printer a remote printer or a local printer (r/l)? r
  please enter the the name of the remote host that printer is attached to: hostb
   printer printer is connected to host hostb
  is this correct? (y/n) y
  would you like this to be the system default printer? (y/n) [n] y
  make sure your host name appears in hostb′s /etc/hosts.equiv
  or /etc/hosts.lpd file
  make sure that printer appears in hostb′s /etc/printcap file (bsd format)
  make sure that printer has a spool directory on hostb
  please hit to continue
   remote printing configuration
  enter information for remote printers or local printers accepting
  remote printing requests
  please enter the printer name (q to quit): q
  do you want to start remote daemon now? (y/n) y
  (3)测试。在 hosta 或 hostb 上以普通用户注册, 输入以下命令即可实现共享打印:
  ¥ lp /etc/default/lpd
  3.日常维护
  (1)管理员或普通用户通过使用命令 lpstat 或 rlpstat 查看打印机状态,并使用命令 lp 进行日常打印。
  (2)设置远程打印机时将自动安装新的lpstat、cancel、lppstat命令, 原命令存放在/usr/lpd/remote目录下
  (3) 每次增加打印机前,最好删除原有的打印机。
  我们将以上共享打印机应用于广域网中,也调试正确。windows工作站安装pc-nfs软件后,通过nfs同样可共享sco-unix打印机,一年多来,一直运行良好,各应用部门非常满意。在当前大力提倡降低总体拥有成本的今天,不失为一种好方法。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_526202.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP