Tuesday, September 16, 2008

Remote Access to CUPS Web Interface

If you have a server(without gnome or kde running) and need to install a printer, the easiest way is to use the CUPS web interface. You can see it on your own ubuntu computer by going to http://localhost:631/admin. But to get to this page remotely for a server, you need to first make some edits to the cups conf file. So do the following:
1. Edit the cups configuration file by first running the following command on your server:
sudo nano /etc/cups/cupsd.conf
2. Your first edit to the file is to make the section that looks like:
# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
look like this:
# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock
3. You then want to change the sections that looks like this:
< Location / >
# Restrict access to the server...
Order allow,deny
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
< /Location >
so they look like this:
< Location / >
# Restrict access to the server...
Order allow,deny
Allow all
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow all
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow all
< /Location >
4. Finally, restart cups with the following:
sudo /etc/init.d/cupsys restart
5. You should now be able to log into cups on your server with:
http://yourserverip:631
Note that when you change something, it may tell you that you need to add a certificate to firefox. Do so by clicking the add/get certificate button at the bottom of the firefox error message page. It will also tell you that to change stuff, you need to use the "https" version of the page instead of "http" so just go to:
https://yourserverip:631
You might also have to open/port forward port 631.

Sources:
Ubuntu forums post
Ubuntu Community Docs on Network Printing

5 comments:

Anonymous said...

Thanks!
It was very helpful and now my cups server is working from remote pc.

Anonymous said...

Thanks! This was helpful.

An addition would be that instead of doing "Allow from all", you can use "Allow from @LOCAL" and it restricts access to your local network.

Anonymous said...

thanks worked like a charm. I now access my printer from work so when my wife has a problem printing from her xp laptop I can just restart printer or whatever without having to explain it to her.

Anonymous said...

Thk!!!

Anonymous said...

You make my day. Thanks.