setting up a network printer using cups

6
Page 1 Setting Up a Network Printer using CUPS - LinuxQuestions.org 12/9/2010 9:23:45 PM http://www.linu xquestions.org /linux/answer s/Networking/ Setting_Up_a _Network_Pri nter_using_CUPS Google.com/Chrome Ads by Google Go Job Hunting at the LQ Job Marketplace www .HostGator . com Ads by Google Home Forums HCL Reviews Tutorials Articles Register Search  LinuxQuestions.org > Linux Answers > Networking Setting Up a Network Printer using CUPS User Name User Name Remember Me? Password Log in Notices Welcome to LinuxQuestions.org , a friend ly and active Linux Commu nity. You are curren tly viewing LQ as a guest. By joinin g our commun ity you will have the ability to post to pics, receiv e our newsle tter, use the advance d search, subscrib e to thread s and access many other specia l features. Registrat ion is quick, simple and absolutely free. Join our community today! Notethat registered memberssee fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestion s.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here . Having a problem logging in? Please visit this page to clear all LQ-related cook ies. Intro ductio n to Linux - A Hands on Guide This guide was creat ed as an overvie w of the Linux Ope rating System, geared toward new users as an explo ration tour and getting start ed guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collectio n of the base knowledge needed to proceed with system and network administration. This book contains many real life exampl es derived from the author's experience as a Linux system and network admini strator, trainer and consultant. They hope these examples will help you to get a better un derstan ding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. By busbarn at 2005-07-02 21:42 Scope and Purpose As the descr iption states, this tutorial deals with setting up a network print er with just linux computer s. There is already plenty of information in the forums if you have a windows box. I don't have a windows box, so when I hit a snag I had a tough time findin g an answer. Also, I will NOT be specifically describing how to install print drivers on the local machine--there's already plenty of documentation out there on that too, so why waste your time! I will go throu gh the extreme basics of instal ling and starting the cups server. So, if you're having troub le conne cting your linux box to your linux print server, this article is for you! While I am using Slackware 10.1 and KDE, t hese instructions shoul d be nearly universal for any linux distro (the exception is starting and stopping the cups d aemon) . Background I have a simp le home network set up with two computer s and a wirele ss router. One computer is in my office, while my wife 's is in hers. She is connect ed wireles sly . We both have printers but after a while, paying for two different types of ink cartridges gets to be a hassle. So I decided to turn my box into a print server, so that we could share a printer. NOTE: From here on out, I will call the CUPS server (the computer that has the printer physically plugged into it) server and the networked computer (t he computer in the other room) client . Step 1: Make sure your printer works local ly Before trying to get a network printe r to work , make sure it works locally. While not specific, here's the basics of it Main Menu Linux Forums Search LQ Tags Linux HCL Linux Tutorials LQ Job Marketplace Linux Wiki Distro Reviews Book Reviews Download Linux Social Groups LQ Blogs Home (Con't)  My LQ Login Register

Upload: keyur-shah

Post on 09-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 1/6

Page 1g Up a Network Printer using CUPS - LinuxQuestions.org

12/9/2010 9:23:45 PMwww.linuxquestions.org/linux/answers/Networking/Setting_Up_a_Network_Printer_using_CUPS

Google.com/Chrome Ads by Google

Go Job Hunting at the LQ Job Marketplace

www.HostGator. com Ads by Google

Home Forums HCL Reviews Tutorials Articles Register Search

 LinuxQuestions.org > Linux Answers > NetworkingSetting Up a Network Printer using CUPS

User Name User Name Remember Me?

Password Log in

otices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

ou are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive ourewsletter, use the advanced search, subscribe to threads and access many other special features. Registration is

uick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

re you new to LinuxQuestions.org? Visit the following links:

ite Howto | Site FAQ | Sitemap | Register Now

f you have any problems with the registration process or your account login, pleasecontact us. If you need to reset

our password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as

an exploration tour and getting started guide, with exercises at the end of each chapter.For more advanced trainees it can be a desktop reference, and a collection of the base knowledge

needed to proceed with system and network administration. This book contains many real life

examples derived from the author's experience as a Linux system and network administrator,

trainer and consultant. They hope these examples will help you to get a better understanding of 

the Linux system and that you feel encouraged to try out things on your own.

Click Here to receive this Complete Guide absolutely free.

y busbarn at 2005-07-02 21:42

cope and Purpose

s the description states, this tutorial deals with setting up a network

rinter with just linux computers. There is already plenty of informationn the forums if you have a windows box. I don't have a windows box,

o when I hit a snag I had a tough time finding an answer. Also, I will

OT be specifically describing how to install print drivers on the local

machine-- there's already plenty of documentation out there on that

oo, so why waste your time! I will go through the extreme basics of nstalling and starting the cups server. So, if you're having trouble

onnecting your linux box to your linux print server, this article is for

ou! While I am using Slackware 10.1 and KDE, these instructions

hould be nearly universal for any linux distro (the exception is starting

nd stopping the cups daemon).

ackground

have a simple home network set up with two computers and a

wireless router. One computer is in my office, while my wife 's is in hers. She is connected wirelessly . We both have

rinters but after a while, paying for two different types of inkcartridges gets to be a hassle. So I decided to turn myox into a print server, so that we could share a printer.

OTE: From here on out, I will call the CUPS server (the computer that has the printer physically plugged into it)

erver and the networked computer (the computer in the other room) client .

tep 1: Make sure your printer works locally

efore trying to get a network printer to work, make sure it works locally. While not specific, here's the basics of it

Main Menu

Linux ForumsSearch

LQ Tags

Linux HCLLinux Tutorials

LQ Job Marketplace

Linux Wiki

Distro Reviews

Book ReviewsDownload Linux

Social Groups

LQ Blogs

Home

(Con't)

 

My LQ

Login

Register

Page 2: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 2/6

Page 2g Up a Network Printer using CUPS - LinuxQuestions.org

12/9/2010 9:23:45 PMwww.linuxquestions.org/linux/answers/Networking/Setting_Up_a_Network_Printer_using_CUPS

efore trying to get a network printer to work, make sure it works locally. While not specific, here's the basics of itf your printer already works, skip to Step 2):

ownload and install cups and any other driver software that you need ( for example,gimp-print). If you are using

waret, it's as simple as

Code:

root# swaret --install cups

root# swaret --install gimp-print

Once installed, you need to start the cups daemon (this command will be different if you aren't using Slackware):

Code:

root#/etc/rc.d/rc.cups start

his will start the cups server. Next, you'll need to add a printer by using the web interface. To do this, open a web

rowser and type in localhost:631. If your server is started, a page should load with links to various tasks. Click the

rst link Do Administration Tasks. A dialog will pop up asking for username and password.You need to log in as root 

nd use your root password to access the administration menu.

Once logged in, click add printers and follow the prompts to set up your printer. When the printer is added, click on

he "Configure Printer" to set page size and printing quality. Finally, click "Print Test Page". If a test page prints,

ou're almost ready to go on to Step 2.

ou'll want to double check your network setup. It will be easier on everyone involved if your printer server has a

tatic ip instead of dhcp. This can be done using Slackware'snetconfig tool (be sure to restart inet1 to put yourhanges into effect-- this is done by typing: /etc/rc.d/rc.inet1 restart). You may also have to adjust your router for a

tatic ip. A quick not regarding static ip's:when you enter the gateway, enter the ip address of your router, or you

won't be able to see the wonderfully wide web of the world!

Once your printer is setup and your ip is static, go on to Step 2.

tep 2: Editing cupsd.conf 

WARNING: When editing conf files , always make a backup before making changes. That way,when it gets messed

p, you have an easy fix! This is done very simply:

Code:

root# cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup

Once your backup is created, open the cupsd.conf file using your favorite text editor (vi , nano, emacs, etc.):

Code:

root# nano /etc/cups/cupsd.conf

ou will me making only small modifications to this file. First and foremost, look for the line that looks something likehis:

Code:

#ServerName myhost.domain.com

f it isn't there, add it!

ote the #. Delete this to uncomment the line. You may either put in your hostname or the static ip address you

ssigned earlier. The line should look like this:

Code:

ServerName 192.168.1.5

Note: For simplicity sake, I personally chose ip address (if you couldn't already tell!) . That way if I modify my 

ostname or anything, the ip can stay the same.

he second adjustment you will make is to the line that looks like this( once again if it isn't there, add it):

Code:

#BrowseAddress x.y.z.255

#BrowseAddress x.y.255.255

#BrowseAddress x.255.255.255

#BrowseAddress 255.255.255.255

#BrowseAddress @LOCAL

#BrowseAddress @IF(name)

you'd like to contribute

content, let us know.

Main Menu

LQ Calendar

LQ RulesLQ Sitemap

Site FAQ

View New Posts

View Latest Posts

Zero Reply ThreadsLQ Wiki Most

Wanted

Jeremy's Blog

Report LQ Bug

Syndicate

Latest Threads

LQ News

LQ Podcast

LQ RadioTwitter : @linuxquestions

identi .ca: @linuxquestions

Facebook: @linuxquestions

Page 3: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 3/6

Page 3g Up a Network Printer using CUPS - LinuxQuestions.org

12/9/2010 9:23:45 PMwww.linuxquestions.org/linux/answers/Networking/Setting_Up_a_Network_Printer_using_CUPS

his should your broadcast for your entire network. Adjust the 255 to whatever your netmask is.

inally look for this section of the cupsd.conf file:

Code:

<Location />

Order Deny,Allow

Deny From All

Allow From 127.0.0.1

</Location>

reate a new line after Allow From 127.0.0.1 and add the ip addresses or ranges for your network. The <Location />

ection should look like this when you are done( the new line is in red):

Code:

<Location />

Order Deny,Allow

Deny From All

Allow From 127.0.0.1

Allow From 192.168.1.*

</Location>

ou should adjust this line according to your network address setup. For example, my network has static ips so I just

dded the ip address for the client, or networked computer. In networks with many more clients , this is a hassle, so

oing the above is more friendly. Save the file and restart the cups server.

Code:

root#/etc/rc.d/rc/cups restart

f the server restarts, you are ready to go on to Step 3. If you get an error, make sure that you typed in all of your ip

ddresses correctly. I ran into trouble when I updated the listen section. It only borked it up, so unless you know

what you're doing, only make the changes mentioned above.

tep 3: Setting Up the Client

our server is ready to roll, so now it's time to set up your client machine. In order for your client to communicate

with the server, the client needs to be running the cups daemon. Install cups and any other driver libraries that you

eeded on the server. In the above example, it was cups and gimp-print. Start cups:

Code:

root#/etc/rc.d.rc.cups start

ou need to have cups running to access the network printer. You don 't need to do anything with the cupsd.conf 

hough, so once the daemon is started, move on to Step 4.

tep 4: Introducing Your Client to Your Server

Many tutorials state that you can just add a printer using the KDE control center. I tried it, and I kept getting an error

hat said "You don't have access." So try to add a printer and if it works, fantastic. If it doesn't or if you don't use

de, read on.

On the client, open up your web browser and access localhost:631 . Login in using root and root's password. Click onmanage printers. If your network printer shows up, you are done and ready to go. If it doesn't, keep going!

lick on administration and add printer ( de ja vu?).

. Fill in the name of the printer.

. Under location, I type in the ip address of the server.

. You can fill in a description, but you don't have to.

. Click continue.

he next page comes up called Device with a drop down list. SelectInternet Printing Protocol (ipp) and click continue.

ow you need to tell cups the network location of your print server. To do this, you will need theserver's ip address,

nd the name of your printer as cups sees it. (For example, if you go back to the server and access the web interface,

lick on printers. The name is big and bold.)This is the format: ipp://server_ip_address /printer/printer_name

hange the ip address and printer name accordingly. Your entry should look like:

Code:

ipp://192.168.1.5/printer/EpsonPrinter

od question! Since I don't have a multi -function printer to test, I can offer a big I don't know. My apologies.

wever, I do know that the "printer" is singular and theprinter_name needs to match the cupsd.conf file on the

ver machine. I got most of my info from this CUPS System Amdministrator's Guide. That may give you some more for a muliuse printer.

sername17 on Mon, 2005-07-25 14:51

od info... but

er installing CUPS, /etc/rc.d/ rc.cups is not executable by default.

e needs to "chmod +x /etc/rc.d/rc.cups" then execute it.

ce it is changed to executable, it will start at boot.is not chmodded, you cannot run "/etc /rc.d/rc.cups start" like the tutorial says.

t a FYI.

ylie 1001 on Sun, 2005-09-04 09:05

o all,

s is good info as in most of LQ. I have a printer it is an HP photosmart 2710 with a network connection sitting on

network with an ip of xxx.x.xx.xxx . I have spent numerous hours trying to get it to work. This printer is not

nected to any computer on my network. I have cups installed nothing special there. I also removed LPRNG this

gram conflicts with cups. In cups set up your printer and set it to Device URI: socket:// xxx.xx.x.xxx the ip of thenter also set it for the default printer and mine worked like a champ. After doing hours of reading and hunting I

ld not find info for stand alone printers on a network . I also used the web browser to set up the printer on cups

ng http:/ /127.0.0.1:631 use your root account and password and configure the printer. Also start up /etc/rc.d/

ups . I wanted to share this because printers have been a real sore spot for me for the past years using Linux.

k

likone on Wed, 2005-09-07 10:53

ave been running an HP Photosmart 8450 as a stand-alone networked printer... and having no problems printing to

ith both my windows and Linux computers.

a " for example", here are the approximate steps I took to make it work...

--

to

p:/ /sourceforge.net/project/showf...group_id=16846

download / install the latest hpijs and hplip.

the command "hp-makeuri" to get a Device URI. Make sure to specify the IP address of the printer you want to

up.

to

p:/ /www .cups.org/

download / install the latest cups, if your distro does not already have it setup. Next, go to

p:/ /www .linuxprinting.org/printer_list.cgi?make=HP

download the appropriate .ppd file for your printer and copy it to /usr/ share/cups/model.

d up a web browser as root and go to

p://127.0.0.1:631/

should now see the cups web interface. Go to add a new printer... when you get to the Device URI field, enter

string given previously by the "hp-makeuri" command, which should look something like

/ net/Photosmart_8400_series?ip=192.168.0.20

t a test page and see if it works.

Page 4: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 4/6

ipp://192.168.1.5/printer/EpsonPrinter

lick continue.

hoose the correct printer, click continue, choose the correct driver, and click continue again. Be sure to configure the

rinter so that the driver knows what size paper and print quality to use. Finally, click print test page.

onclusion

or some odd reason, once I added a printer on the client, cups could then see my network printer. Now in the cups

onfiguration screen, it shows two printers: the one I added manually and the one is sees on the server. However, inde and openoffice.org, it only shows one printer. Bizarre, but it works.

Page 5: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 5/6

Page 5g Up a Network Printer using CUPS - LinuxQuestions.org

s a " for example", here are the approximate steps I took to make it work...

----

o to

ttp:// sourceforge.net/project/showf...group_id=16846

nd download / install the latest hpijs and hplip.

se the command "hp -makeuri" to get a Device URI. Make sure to specify the IP address of the printer you want to

etup.

Page 6: Setting Up a Network Printer Using CUPS

8/8/2019 Setting Up a Network Printer Using CUPS

http://slidepdf.com/reader/full/setting-up-a-network-printer-using-cups 6/6

Page 6g Up a Network Printer using CUPS - LinuxQuestions.org

y pietie on Tue, 2006-12-19 03:58

Quote:

Originally Posted by halw

This procedure does not work for me. When attempting to 'add printer' using localhost:631 am asked to enter 

User Name and Password for CUPS. Have tried Administrator(root) and password for host and user id &

 password for client.

Client system is Kubuntu 6.06.

either for me well the root + root passwd... I am running SuSE 10 .1

y busbarn on Wed, 2007-01-17 20:20