Solved

ProxyPass to Cups

Posted on 2011-09-02
16
1,205 Views
Last Modified: 2012-05-12
Hello

I am looking for information and help on using Apache to proxy to a cups server.

Simple web portal that after the user logs in they can get to cups that is internal but the browser url shows the external domain.

Would think ProxyPass statements would take care of this but I have some questions.

An example:  
https://somecompany.com/finance
https://somecompany.com/humanresource

ProxyPass /finance http://127.0.0.1/classes/finance
ProxyPass /humanresource http://127.0.0.1/classes/hr

Can the cups url be changed?
Instead of the examples above you might have:
ProxyPass /finance http://127.0.0.1/finance/classes/finance
ProxyPass /humanresource http://127.0.0.1/hr/classes/hr

Can Windows printers be setup with ipp to login?

http://user:password@somecompany.com/finance/myprintque

All this is in the drawing on paper stage to wrap my head around small scale “cloud” printing.

Thanks
mld4165
0
Comment
Question by:mld4165
  • 8
  • 4
16 Comments
 
LVL 29

Expert Comment

by:pwindell
Comment Utility
Use Split-DNS so that the FQDN resolves to the correct IP# with respect to where the Client is.  That is,...internal Clients on the LAN must resolve it to the LAN IP of the resource directly,...while clients out in Internet Land must resolve the same FQDN to the Public IP# of the Firewall/Proxy and the Reverse-NAT takes over from there.

For Clients outside the LAN you can not use RFC Private IP#s.  Traffic must be Reverse-NAT'ed from a Public IP to and RFC IP of the resource.

You can never use 127.x.x.x in any situation,...ever.
0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
Sorry pwindell but the cups server runs on the Apache Server and that is why proxypass is to 127.0.0.1.

Does not seem to work anyway as cups still sees the original url and in the log files responds with can't find errors.

Thanks anyway.
mld4165
0
 
LVL 21

Expert Comment

by:Papertrip
Comment Utility
So without seeing the other pertinent config excerpts, or knowing which apache version and/or mod_proxy version etc etc, this may not work, but try the following.  This is a very simple approach to get the basics working first.

ProxyRequests Off
ProxyPass /finance/classes/finance http://localhost:631/
<Location /finance/classes/finance>
  ProxyPassReverse /
</Location>

Open in new window

0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
Papertrip

Centos 5.6
httpd-2.2.3-43
All updates applies.

Let me know what other "pertinent config excerpts" I can provide?

I have not tried the Location part that you added. Just the ProxyPass and ProxyPassReverse line. What does Location provide that ProxyPassReverse does not?

thanks
mld4165
0
 
LVL 21

Expert Comment

by:Papertrip
Comment Utility
A good example of other config excerpts to provide would be something like that you are using ProxyPassReverse, which wasn't in your original question.  Anything you have in your config that has to do with what you are trying to do is always good to post, sanitized as-needed of course.

Anyways let's just start this over, because it appears you only have 1 major problem.
ProxyPass /finance http://127.0.0.1/classes/finance

Open in new window

should look like
ProxyPass /finance http://localhost:631

Open in new window


Try that out.
0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
Papertrip

I just want to be able to use Apache to proxy requests to cups and have a url that does not show classes or printers in the url.

I also want users to be able to set up a Windows print queue using the following.

https://somecompany.com/finance/someprintque

I cannot seem to get this to work. I will try your suggestions and report back ASAP.

mld4165
0
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 
LVL 1

Author Comment

by:mld4165
Comment Utility
OK. I worked on this a lot today and it is not an Apache issue.

Setup the ProxyPass statements again and in a browser it works just fine but you cannot set up a Windows printer.

Maybe this cannot be done? See attached.

clip-of-logs.txt

thanks
mld4165
0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
I submitted the first post to quick.

Add: ProxyPass /finance http://127.0.0.1/classes

Then I am able to open a web browser up and put in the url we are passing and see the class that is setup. Setting up a Windows printer just results in an error that Windows cannot connect to printer.

Add: ProxyPass /finance http://127.0.0.1/classes/finance and the same thing occurs.

Use ProxyPass /classes http://localhost:631/classes as your config. statement and Windows printer works fine.

Cups and ipp must be the issue, or possibly the way Apache sends Cups the URL. Not sure.

thanks again!
mld4165

0
 
LVL 21

Expert Comment

by:Papertrip
Comment Utility
OK so here is the deal.  CUPS is listening on port 631.  Unless you explicitly put :631 in the URL, it will go over port 80 which is apache.  That is why your first 2 examples above do not work.

If the 3rd example does work, then it is setup correctly and you are done.
0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
Hey Papertrip,

Darn. I messed up the last two post. So sorry.

All ProxyPass statements had the port number.

Example /finance http://127.0.0.1:631/classes

So yes a web browser works perfect, so we know the url gets passed, but when you try to install a printer on a Windows desktop, Apache passes the URL https//:somecomapny.com/classes/finance to Cups, and it goes to Cups because you see it in Apache's log, and it is in the Cups access and error logs, but for whatever reason Cups reports it cannot find the class. See attachment.

Might be the difference between ipp printing and http. Right now I do not know.

What I'm learning is that what I want may not possible. If you have a working system then let me know and we can continue, if not and you want to continue maybe you could try and setup what I am attempting?

If not I really appreciate your help and prompt replies!

Thanks
mld4165
0
 
LVL 1

Author Comment

by:mld4165
Comment Utility
JustAMod

Working on this over the weekend and it appears this may not work.

Will close question if no new responses or my tests fail.

mld4165
0
 
LVL 21

Accepted Solution

by:
Papertrip earned 500 total points
Comment Utility
Hey mld4165,

Sorry I can't reproduce your exact scenario to further help with this.  If you have any new questions from your weekend of work let me know.
0
 
LVL 1

Author Closing Comment

by:mld4165
Comment Utility
Cool. I appreciate the help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now