+ Post New Thread
Results 1 to 6 of 6
*nix Thread, Apache2, Ubuntu and proxying in Technical; I have a site hosted internally which needs to connect to another, externally hosted, site and as such it must ...
  1. #1

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,637
    Thank Post
    514
    Thanked 2,443 Times in 1,891 Posts
    Blog Entries
    24
    Rep Power
    831

    Apache2, Ubuntu and proxying

    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?

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Apache makes no connections externally itself (other than DNS lookups). What sort of site is it? Is it PHP/Perl/etc?

  3. #3

    Join Date
    Mar 2008
    Posts
    24
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    13
    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?

  4. #4

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,637
    Thank Post
    514
    Thanked 2,443 Times in 1,891 Posts
    Blog Entries
    24
    Rep Power
    831
    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.

  5. #5

    Join Date
    Mar 2008
    Posts
    24
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    13
    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 ?

  6. #6
    kesomir's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    288
    Thank Post
    15
    Thanked 28 Times in 23 Posts
    Rep Power
    17
    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:

    PHP Code:
    This feature has been added to PHP 5.0.0

    Example Usage:

    <?php
      $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?
    Last edited by kesomir; 7th June 2008 at 10:14 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Squid transparent proxying
    By MK-2 in forum *nix
    Replies: 46
    Last Post: 4th June 2008, 11:26 AM
  2. Apache2 SSL
    By Jackd in forum *nix
    Replies: 12
    Last Post: 5th December 2007, 01:15 PM
  3. Apache2 & LDAP
    By jasonyates in forum How do you do....it?
    Replies: 4
    Last Post: 6th November 2007, 10:03 AM
  4. Reverse proxying SSH...
    By Joedetic in forum Wireless Networks
    Replies: 7
    Last Post: 6th August 2007, 11:56 AM
  5. Reverse Proxying with Apache.
    By maniac in forum Web Development
    Replies: 7
    Last Post: 5th April 2007, 11:04 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •