后面的Apache代理公司 [英] Apache behind corporate proxy

查看:152
本文介绍了后面的Apache代理公司的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发PHP应用程序。我使用WAMP,我后面的企业代理。我使用 cntlm 验证 NTLM 。我需要卷曲谷歌的地理编码的API,为了做到这一点我用下面的设置,正在努力:

I'm developing a php application. I'm using wamp and I'm behind a corporate proxy. I'm using cntlm to authenticate NTLM. I need to curl google geocoding api, in order to do this I used the following settings that are working:

    curl_setopt($ch,CURLOPT_PROXY, '127.0.0.1:3128');
    curl_setopt($ch, CURLOPT_PROXYPORT, 3128);

我想找到一种方法来避免设置CURL这些选项。我相信我能与Apache设置玩,但我不知道。我需要找到这个解决方案的原因是:

I'd like to find a way to avoid setting those options for CURL. I believe I can play with Apache setting, but I'm not sure. The reasons I need to find this solution are:


  1. 在生产ENV就不会有这样的代理(目前上述方案仅用于如果环境变量设置为DEV ENV,但还是:这不是最好的解决办法)

  2. 如果我想使用第三方的SDK(如Facebook PHP SDK),这些都是内部使用卷曲,但他们不一定暴露方法来改变卷曲选项(例如Facebook的SDK不)。我不想改变SDK源$ C ​​$ C,以适合我的代理

到目前为止,我打开proxy_module的Apache和我加在httpd.conf中的以下行,但没有成功。

What I tried:

So far I turned on proxy_module on apache and I added the following line on httpd.conf, but with no success

ProxyRemote * http://127.0.0.1:3128

我仍然无法访问互联网。我用Google搜索了很多,但我无法找到一个解决办法,任何想法?

I still can't access the internet. I googled a lot, but I couldn't find a solution, any ideas?

我能找到很多人在谈论同样的问题,但我没有找到任何COM prehensive解决方案,为此我提出一个赏金。

I could find many people talking about the same issue, but I didn't find any comprehensive solution, for this reason I raise a bounty.

错误中,我发现:但我不知道这是否会工作为卷曲反正我找不到如何修改php.ini

There is this bug in which I found: But I'm not sure if this will work for curl and anyway I can't find how to modify the php.ini

[2010-12-20 14:03 UTC]
  jani@php.net
  -Summary:更改默认的HTTP的包装
  +总结:添加的php.ini选项设置为默认的包装代理
  -package:功能/变更请求
  +包装:流相关
  -PHP版本:5CVS
  + PHP版本:*

[2010-12-20 14:03 UTC] jani@php.net -Summary: changing the default http-wrapper +Summary: Add php.ini option to set default proxy for wrappers -Package: Feature/Change Request +Package: Streams related -PHP Version: 5CVS +PHP Version: *

[2011-04-05 11:29 UTC] play4fun_82在雅虎点com我有
  同样的问题。我的解决办法是通过与cntml代理服务器
  隧道的工具。您配置cntml代理转发http请求
  接受本地主机上的端口上的目的地适当
  验证。

[2011-04-05 11:29 UTC] play4fun_82 at yahoo dot com Hi, i have the same problem. My solution was to pass through proxy server with cntml tunneling tool. You configure cntml proxy to forward http request received on local host on a port to destination with proper authentication.

和梨你刚刚配置

梨配置设置HTTP_PROXY 127.0.0.1:3128

pear config-set http_proxy 127.0.0.1:3128

3128 - 是cntlm端口configuret(也可以是其他任何空闲的端口)

3128 - is port configuret in cntlm(it can be any other free port).

非常感谢

推荐答案

阅读的文章我正要在认输,但实际上有一个简单的solutiuon。我曾与Windows环境变量的发挥,在最后一个系统变量设置为https_proxy = 的https://本地主机:3128 工作!之前,它是行不通的,因为我将其设置为127.0.0.1:3128。运行命令

After reading this article I was about to throw in the towel, but there is actually an easy solutiuon. I had to play with windows environment variable, at the end setting a system variable to https_proxy=https://localhost:3128 worked! Before it was not working because I was setting it to 127.0.0.1:3128. Run the command

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"

再/复制粘贴系统变量的答案,现在它的工作!

then copy/paste the answer in the system variable and now it's working!!

这篇关于后面的Apache代理公司的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆