Create a Linux printing server in Windows

Source: Internet
Author: User

I. Preface

The printer used in the office is HP Color Inkjet Printer, which has been used for a long time. However, as the printing volume increases, it is found that the purchase of ink cartridges is a small expense (the purchase is all original ). Then I got an HP 3050 black and white laser printer. The previous color frame was equipped with a network printing module, so the whole office can be used after installation, but now this laser does not carry this module, in addition, the Office does not have Windows servers available all day long. In order to complete the task of publishing the printer to the network, I finally finished the printing server after one or two days under a Linux server. The installation process is recorded as follows.

II. Environment Description

Operating System: Centos 5 (compare to RHEL 5) text mode, install the default compilation tool. You have installed Apache, PHP, PureFTP, and Mldonkey software on your own (the software installation and configuration will be available later ). The CPU is P4 2.8 GB, memory is 512 MB, and the two hard disks are 80 GB in total. The HP LaserJet 3050 multi-functional integrated printer uses a USB port. Among them, the official website of HP does not provide Linux drivers, which is also the most difficult place. (Http://h50176.www5.hp.com/support/Q6504A/drivers? Lang = zh-hans & cc = cn & submit = % C3 % A5 % C2 % BC % C2 % 80% C3 % A5 % C2 % A7 % C2 % 8B % C3 % A6 % c2 % 90% C2 % 9C % C3 % A7 % C2 % B4 % C2 % A2 % 20% C3 % 82% C2 % BB)

Iii. configuration process
Install basic components

In the specific configuration, it is best to configure the YUM source of the system for easier operations in subsequent installation. For how to configure the YUM source, see enable yum upgrade RedHat Linux Enterprise (http://waringid.blog.51cto.com/65148/51947 ). The main YUM sources are shown below:123456<strong>vi/etc/yum.repo.d/utteramblings. Repo this file is mainly used to update PHP, others use the default Sourcename=Jason's Utter Ramblings Repobaseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/enabled=1gpgcheck=1gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</strong>


You must first install the CUPS and Samba components, which can be executed using the following commands.1<strong>yum –y installcups cups-windows cups-libs hal-cups-util samba samba-client samba-common</strong>


After the installation is complete, as shown in:

Check whether the printer is successfully installed.
Before configuring the printer, bring the printer online and run the following command to determine whether the system is properly identified. The actual environment here uses a USB port, if it is a serial or parallel data line, follow the actual situation. By default, the device name of the USB printer is/dev/usb/lp0. The system uses the plug-and-play (PnP) feature to automatically detect the device. We can use the following command to perform the test.


Configure the Print Service

After confirming that the printer is connected properly, you can configure the printer server. The configuration information of CUPS is in the/etc/cups folder by default. The important files are:/etc/cups/printers. conf printer settings, all printer settings are in this file
The main settings of/etc/cups/cupsd. conf CUPS, including the settings as servers, are all in this file.
Driver for/etc/cups/ppd/*. ppd printer
Usb:/dev/usb/lp0 USB Interface
Parallel:/dev/lp0 parallel port
Ipp: // ip/printer model Network Printer
Smb: // user: password @ host/modify cupsd. conf for the neighbor printer on the printer network. The Setting principle is to allow computers in the 192.168.0.0/24 network segment to access the CUPS management interface. The main changes are as follows:12345678910111213141516171819Port 631 CUPS service default enabled Port<Location />Allow 192.168.0.0/24Order allow,denyAllow @LOCAL</Location><Location /admin>Encryption RequiredAllow 192.168.0.0/24Order allow,denyAllow @LOCAL</Location><Location /admin/conf>AuthType DefaultRequire user @SYSTEMAllow 192.168.0.0/24Order allow,denyAllow @LOCAL</Location>


To ensure normal printing in Windows, you need to modify the configuration file of the following files:123456vi/etc/cups/mime.convs # Locate this line in the last few lines and remove the comments!application/octet-streamapplication/vnd.cups-raw 0 -vi/etc/cups/mime.types# Locate this line in the last few lines and remove the comments!application/octet-stream


Remember to download and install the HP3050 driver after completing the settings (http://www.openprinting.org/show_printer.cgi? Recnum = HP-LaserJet_3050), there are a lot of files on this page, the real need to download and install is:Wget http://www.openprinting.org/download/printdriver/RPMS/i486/gutenprint-5.0.1-1lsb3.1.i486.rpm
Yum install gutenprint-5.0.1-1lsb3.1.i486.rpm
Service cups restartAfter successful access, you can access and set the settings on the webpage, as shown in:

Publish a printer in Samba

The printers installed in Linux can be used. However, to support Windows systems, you must release the printers through corresponding programs, in the printer language, the Postscript printing language can ensure normal printing in various systems. You only need to provide the Postscript driver to the Samba server to support Automatic Installation of Windows drivers.

Before installing Postscript, you must install and set the Samba server as follows:

1234567891011121314151617181920212223242526272829useraddptadmin # Add the user first. Otherwise, the user cannot add the user later.smbpasswd –a ptadmin # Joining Samba shared management usersvi/etc/samba/smb.conf[global]workgroup = WORKGROUPserver string = printservernetbios name = PrintServerprintcapname = cupsload printers = yesprinting = cups[printers]comment = All Printerspath = /var/spool/sambabrowseable = yesguest ok = yeswritable = yesprintable = yespublic = yesvalid users= @usersptadminprinter admin = ptadmin[print$]comment = Printer Driverspath = /etc/samba/driversbrowsable = yesreadonly = yeswrite list = ptadminmkdir/etc/samba/driverschownptadmin /etc/samba/driversservice smb restart


Add the postscribd driver

First go to the website (http://ftp.easysw.com/pub/cups/windows/) to download the corresponding program installation, first install the license. You can also set "C: copy the files starting with PS in the \ WINDOWS \ system32 \ spool \ drivers \ w32x86 \ 3 directory to/usr/share/cups/drivers/directory (if the directory does not exist, create one by yourself ). Note that the file cannot start with an uppercase letter after being copied to/usr/share/cups/drivers; otherwise, the subsequent copy fails.After the CUPS-Samba package is installed, it is shown as follows:Test SMB settings, view smb driver sharing and printer settings, and add the printer to smb sharing. The command line is as follows:1234<strong><strong><strong>testparmservice smb restartsmbbclient -L //127.0.0.1 -U ptamdincupsaddsmb -H localhost -U ptadmin -a –v</strong></strong></strong>


After the settings are completed, the body image is shown as follows:You can also set it through the WEB interface:Print test in Windows


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.