0

我想安装带有 Phusion 乘客支持的 Nginx

我有:

Ubuntu 12.04 LTS  
ruby-1.9.3-p194  
Rails 3.2.7  
I am behind the proxy(http://10.10.16.8:3128) 

test@U205-UBUNTU:~$ printenv | grep htt  
http_proxy=http://10.10.16.8:3128  
https_proxy=https://10.10.16.8:3128  

当我运行rvmsudopassenger-install-nginx-module时,出现超时错误:

  PCRE (required by Nginx) not installed, downloading it...  
    # wget -O /tmp/root-passenger-5079/pcre.tar.gz http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.tar.gz  
    --2012-07-30 13:12:27--  http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.tar.gz  
    Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59  
    Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... failed:
    Connection timed out.  
    Retrying.  

看起来没有通过代理访问。

但是当我尝试wget -O /tmp/root-passenger-5079/pcre.tar.gz http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.tar.gz单独运行时,一切正常。

任何人都可以帮助我吗?

4

2 回答 2

1

我找到了解决方案。
问题是 sudo 削减了环境变量。
要持久化环境变量,例如 http_proxy、ftp_proxy,您必须在 /etc/sudoers 文件中添加这一行:

Defaults env_keep="no_proxy http_proxy https_proxy ftp_proxy XAUTHORIZATION \
XAUTHORITY TZ PS2 PS1 PATH MAIL LS_COLORS KRB5CCNAME HOSTNAME HOME DISPLAY COLORS"
于 2012-07-30T10:41:08.643 回答
1

这对我有用:

sudo vim /etc/wgetrc

并编辑这些行:

https_proxy = http://<proxyaddress>:<port>/
http_proxy = http://<proxyaddress>:<port>/
ftp_proxy = http://<proxyaddress>:<port>/

(替换<proxyaddress><port>与您一起设置)

于 2013-06-28T10:02:35.220 回答