window xp dos下通过设置http_proxy 使用代理上网或者下载文件

window xp dos下通过设置http_proxy 使用代理上网或者下载文件

由于公司内部本机不能上网,都是通过代理上网的,在配置perl 的ppm文件升级的时候经常报错误,
比如升级perl install dmake 下载dmake的ppm包的时候报
Downloading ActiveState Package Repository packlist...failed 500 Can't connect to ppm4.activestate.com:80 (Bad hostname)
ppm install failed: Can't find any package that provides dmake

这时可以通过设置环境变量http_proxy 来解决。
dos下查看是否有设置变量set http_proxy

The http_proxy Environment Variable 几种http_proxy的设置区别
如果我代理的IP是10.2.4.5 端口是808

Set the http_proxy variable with the hostname or IP address of the proxy server:

  http_proxy=http://proxy.example.org
  http_proxy=10.2.4.5:808
If the proxy server requires a user name and password, include them in the following form:

  http_proxy=http://username:password@proxy.example.org

If the proxy server uses a port other than 80, include the port number:

  http_proxy=http://username:password@proxy.example.org:8080

各平台操作系统设置http_proxy的方法 Setting http_proxy
Windows XP设置代理
    1、Open the Control Panel and click the System icon.登陆到控制面板并点击系统
    2、The System Properties dialog is displayed.系统属性对话框
    3、On the Advanced tab, click on Environment Variables.点击高级 tab 页面的环境变量
    4、The Environment Variables dialog is displayed.
    5、Click New in the System variables panel. 新建环境变量
    6、The New Sytem Variable dialog is displayed.
    7、Add http_proxy with the appropriate proxy information (see examples above).设置环境变量

Windows 200x设置代理
    1、Right click on My Computer.
    2、Click on Properties and select the Advanced tab.
    3、Click "Environment Variables".
    4、The "System Variables" dialog appears.
    5、Click New and add http_proxy, with the appropriate proxy information (see examples above).

Windows NT设置代理
    Right click on My Computer.
    Click on Properties, select the Environment tab.
    Add http_proxy with the appropriate proxy information (see examples above).

Windows 95/98/ME设置代理
    Open the C:\autoexec.bat file for editing (e.g. in Notepad).
    Add a "SET" line like the following (see examples above):
          SET http_proxy=http://username:password@hostname:port
    Restart your computer for the change to take effect.

Mac OS X设置代理
The http_proxy should be set in two places on OS X:
    Shell: Add a line like the following in .bash_profile (/Users/<name>/.bash_profile):
          http_proxy=http://username:password@hostname:port;  export http_proxy
    This setting applies to PPM when it is launched from or used at the command line.
    Desktop: Add an entry like the following in your environment.plist file (/Users/<name>/.MacOSX/environment.plist):
          <key>http_proxy</key>
          <string>http://username:password@hostname:port</string>
    This setting applies to PPM when it is launched by clicking the PPM icon.

Linux, Solaris or HP-UX设置代理
Set the http_proxy environment variable using the command specific to your shell (e.g. set or export). To make this change persistent, add the command to the appropriate profile file for the shell. For example, in bash, add a line like the following to your .bash_profile or .bashrc file:
    http_proxy=http://username:password@hostname:port;  export http_proxy

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

«    2025年4月    »
123456
78910111213
14151617181920
21222324252627
282930
搜索
标签列表
网站分类
最新留言
    文章归档
    友情链接

    Powered By Z-BlogPHP 1.7.3

    Copyright Your WebSite.Some Rights Reserved.闽ICP备11018667号-2