After my first Ubunutu Server install (Hardy Heron LTS 8.04), I couldn’t get the local printer setup. Here’s how I fixed it.
I’m a linux newbie and was feeling a bit lost without GUI. Several articles I read said gnome on a server was an unnecessary security risk, so I installed Webmin. But I couldn’t add the printer via Webmin Hardware -> Printers Administration. I kept getting the following error:
Failed to save printer: lpadmin failed :
lpadmin: No such file or directory
I have a brother MFC printer, so I first made sure the printer drivers where installed. I found info on the Ubuntu Brother MFC drivers and installed the package via Webmin System -> Software Packages. But trying to add the printer via Webmin still gave the same error.
I decided to try to install the printer another way, and found out that CUPS was likely the way to do it. I checked the package manager to make sure CUPS was installed. It was.
I then tried the CUPS web interface to see if I could install from there. But I couldn’t get to it. I found some CUPS documentation and realized that by default the CUPS server only listens to requests from localhost. So, I edited the etc/cups/cupsd.conf file:
- comment out:
#Listen localhost:631
- add : (my server host name is “alexander”)
Listen alexander:631
- turn on browsing:
Browsing On
I restarted the CUPS server
sudo /etc/init.d/cupsys restart
and and tried to connect to https://alexander.mydomain.com:631/, but I got a 403 Forbidden error.
After some searching, I discovered that I had change the blocks to add access from the local network. I add “Allow @LOCAL” lines to etc/cups/cupsd.conf file. Changed parts of the file noh now looked like this:
# Only listen for connections from the local machine. # Listen localhost:631 Listen alexander:631 #added by Carl (alexander is the server's host name) Listen /var/run/cups/cups.sock # Show shared printers on the local network. Browsing On #turned on by Carl BrowseOrder allow,deny BrowseAllow all BrowseAddress @LOCAL # Default authentication type, when authentication is required... DefaultAuthType Basic # Restrict access to the server... <Location /> Order allow,deny Allow localhost #added by Carl Allow @LOCAL #added by Carl </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny Allow localhost #added by Carl Allow @LOCAL #added by Carl </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny Allow @LOCAL #added by Carl </Location>
Another CUPS server restart and… I was in! What a beautiful sight: the CUPS GUI.
Now life was good. I clicked “Add Printer,” walked through the GUI steps, and in about 60 seconds the printer was installed.
cha-ching!
Update for Ubuntu 10.04:
- needed to add to cupsd.conf file: ServerAlias *
- For my Brother MFC 7420, I had to install: sudo apt-get install brother-cups-wrapper-laser
Update for Canon Printers (thanks Jay!)
Per Jay’s comment below, if you have a Canon printer, don’t use the default cups drivers. Download them from Cannon instead and you should be all set.
Thank a lot for this article.
I’ve got this kind of problem on Ubuntu server with webmin + cups.
Now it’s ok. It works.
Thank you SOO much!!!
Thanks for the article. I was having the exact same problem with webmin and this worked beautifully!
A simpler way to connect to the CUPS interface is to use SSH redirection.
Make sure SSH is installed (it should be !)
then simply ssh to your server as follows:
ssh -L8000:localhost:631 username@ip_address
In other words, port 8000 (can be anything unused on your local machine) points to the localhost:631 of your remote server.
Open a browser and connect to http://localhost:8000
Thank you very much. This saved me the trouble of going through the CUPS manual and having to figure this out while in a hurry.
Much appreciated.
The same scenario on my server, and I was pretty pissed. Googled to here and followed the steps and solved the problem. Thanks , your lifesaver
Hi,
Thanks for this. I now have the CUPS GUI working. I am using a Canon LBP3100 local printer. I can add it but it won’t print. Have tried switching off and on, disconnecting the USB cable and restarting.
I also print to a network printer and that works fine.
Any ideas?
Thanks!
Thanks for the info. I did exactly as you specified and was able to get into the web interface.
Carl! Thanks, your article really helped me! I worked out that CUPS was rejecting advances from other machines on my network, but didn’t know what to put in cupsd.conf. Your article set me (and my computer) straight!
Big help, big help. And spureltaive news of course.
Nice job, if you’re still following this post, it was still valid on version 11.04 of ubuntu server. NICE, wasn’t really expecting it to work. Thanks for the post!
I have a Printer connected directly to network. What will be the Port number for the printer? I simply connected the printer to the network and the network page doesnot have the port information that i need to put in the webmin add printer page
Sanjit, sorry to hear you are having trouble. Please provide some specs for you system and hopefully we can help.
Great note. Worked for me excepted I had to add a user ‘cupsys’ to gain access. Also if anyone has a canon, do not attempt to use the default drivers in the cups interface. The drivers from canon worked for me. I hope this save someone a few hours.
Thanks Jay! I updated the post with your info.
Thanks for the article. Had all this set up before my old server died. Couldn’t remember how it was done, but got it up now.
This worked beautifully. Thanks!
Thanks for this…..got in a minute….just forgot howto
Comments on this entry are closed.