localzuk Posted June 6, 2008 Posted June 6, 2008 I have a site hosted internally which needs to connect to another, externally hosted, site and as such it must go via our proxy server. I've not had to do this before, so don't know where I would set the proxy address to allow this. It isn't possible within the site itself, so it needs to be done for apache itself. Any ideas?
Geoff Posted June 6, 2008 Posted June 6, 2008 Apache makes no connections externally itself (other than DNS lookups). What sort of site is it? Is it PHP/Perl/etc?
ajtaylor Posted June 7, 2008 Posted June 7, 2008 As Geoff says, Apache itself wouldn't be making connections for you. What exactly are you trying to achieve, and in what language? If it's php, what function are you using to grab data from this other site, and what version of php?
localzuk Posted June 7, 2008 Author Posted June 7, 2008 It's os-commerce. The currencies part of the system connects remotely to an exchange rate site to update the currency values of products. So it is a php site. I didn't write the code, so I have no idea how it does it itself.
ajtaylor Posted June 7, 2008 Posted June 7, 2008 I believe some functions of php5 understand http_proxy - you could try setting http_proxy in either the environment for apache, or in httpd.conf ?
kesomir Posted June 7, 2008 Posted June 7, 2008 (edited) If it uses fopen, I don't think php uses http_proxy for that. I had a similar issue with a local rss cache I wrote for a flex application I'm building for our digital signage. You may find this useful: This feature has been added to PHP 5.0.0 Example Usage: $context = stream_context_create( array('http'=> array('proxy'=>'tcp://proxy.example.com:5100') )); $contents = file_get_contents('http://www.somesite.com/pat/to/file', false, $context); Source EDIT: Instead of poking around in oscommerce - you could write a php proxy script using the above and redirect oscommerce to check the proxy url? Edited June 7, 2008 by kesomir
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now