ラベル proxy の投稿を表示しています。 すべての投稿を表示
ラベル proxy の投稿を表示しています。 すべての投稿を表示

2014年12月30日火曜日

プロキシ環境下でApache Subversionを使う

設定ファイル


~/.subversion/servers


グループ毎に個別指定する場合


アクセスするリポジトリが固定している場合はgroupsセクションで設定するのが望ましい
$ cat ~/.subversion/servers
(関連箇所のみ抜粋)
[groups]
targetgroup1 = somerepository.example.org

[targetgroup1]
http-proxy-host = proxy.example.com
http-proxy-port = 8080
http-proxy-username = foo.bar@example.com
http-proxy-password = hogepass


まとめて指定する場合


外部リポジトリにしかアクセスしない場合等はglobalセクションで一括設定すると楽
$ cat ~/.subversion/servers
(関連箇所のみ抜粋)
[global]
http-proxy-exceptions = *.internal.example.com, *.internal.example.net
http-proxy-host = proxy.example.com
http-proxy-port = 8080
http-proxy-username = foo.bar@example.com
http-proxy-password = hogepass

2014年6月14日土曜日

プロキシ環境下でChef Soloをインストールする

環境
  • Ubuntu Server 12.04 LTS x64

apt-get用にプロキシ設定を追加
$ sudo vi /etc/apt/apt.conf
$ cat /etc/apt/apt.conf
(関係箇所のみ抜粋)
Acquire::http::Proxy "http://proxy.example.com:8080";
Acquire::https::Proxy "http://proxy.example.com:8080";
Acquire::ftp::Proxy "http://proxy.example.com:8080";

vim、curlのインストール
$ sudo apt-get update -y
$ sudo apt-get install -y vim curl

プロキシ用の環境変数を追加
$ vim ~/.bashrc
$ cat ~/.bashrc
(関係箇所のみ抜粋)
export http_proxy="http://proxy.example.com:8080"
export https_proxy="http://proxy.example.com:8080"
export ftp_proxy="http://proxy.example.com:8080"

$ source ~/.bashrc


wget用にプロキシ設定を追加(後で実行するオムニバスインストーラスクリプト内でwgetが実行されるため)
$ sudo vim /etc/wgetrc

/etc/wgetrc(関係箇所のみ抜粋)
# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = http://proxy.example.com:8080
http_proxy = http://proxy.example.com:8080
ftp_proxy = http://proxy.example.com:8080

# If you do not want to use proxy at all, set this to off.
use_proxy = on


オムニバスインストーラを使ってChefをインストール
$ curl -L https://www.opscode.com/chef/install.sh | sudo bash

Chef Soloのバージョン確認
$ chef-solo -v


補足

wgetについて個別にプロキシ設定しない場合は、sudoコマンドにEオプションをつけることにより、ログインアカウントの環境変数を引き継いでインストールスクリプトを実行する。

$ curl -L https://www.opscode.com/chef/install.sh | sudo -E bash


[参考URL]
The little, that can make a difference...: Unable to add ppa behind proxy

2013年9月9日月曜日

Node.jsバージョン管理ツールを導入する(Windows編)

Windowsで利用可能なNode.jsバージョン管理ツールは複数あるが、ここでは個人的に最も使い勝手の良いと思われるnodistの導入方法について説明する。

プロキシ環境下にある場合は過去の内容を参考にプロキシ設定する。
$ git config --global http.proxy http://proxy.example.com:8080
$ git config --global https.proxy http://proxy.example.com:8080
$ git config --global url."https://".insteadOf git://

nodistをインストールする。
$ git clone git://github.com/marcelklehr/nodist.git

PATHを通すために、下記の通りシステム環境変数をセットする(下記は該当箇所のみ抜粋)。
変数
Path %HOMEDRIVE%%HOMEPATH%\nodist\bin

64bit環境の場合は下記の通りシステム環境変数をセットする。
変数
NODIST_X64 1

プロキシ環境下にある場合は下記の通りシステム環境変数をセットする。なお、nodist内部でHTTPS_PROXYはHTTP_PROXYに置換されるようなので、現状、HTTPS_PROXYについては設定しなくても問題ないと思われる。
変数
HTTP_PROXY http://proxy.example.com:8080
HTTPS_PROXY http://proxy.example.com:8080

nodist依存関係ファイルをインストールする。
> nodist update

動作確認する。
> nodist -v
0.3.8

Node.jsの最新安定版をインストールしてみる。
> nodist dist
> nodist stable
0.10.18

使用するNode.jsのバージョンを指定する。
> nodist 0.10.18
> node -v
v0.10.18

2013年9月7日土曜日

プロキシ環境下でgitを使う

プロキシの設定


下記の通りプロキシ設定する。
$ git config --global http.proxy http://proxy.example.com:8080
$ git config --global https.proxy http://proxy.example.com:8080

これで手動でhttpまたはhttpsスキームを指定したgit clone等ができるようになる。
$ git clone https://github.com/joyent/node.git

gitスキームのまま使いたい場合(通常はこのケースが多いだろう)は下記を追加設定する。
$ git config --global url."https://".insteadOf git://

これでgitスキームのままgit clone等ができるようになる。
$ git clone git://github.com/joyent/node.git


プロキシ設定の確認


gitコマンドによる確認
$ git config --list
(該当箇所のみ抜粋)
http.proxy=http://proxy.example.com:8080
https.proxy=http://proxy.example.com:8080
url.https://.insteadof=git://

.gitconfigファイルの確認
$ less ~/.gitconfig
(該当箇所のみ抜粋)
[http]
        proxy = http://proxy.example.com:8080
[https]
        proxy = http://proxy.example.com:8080
[url "https://"]
        insteadOf = git://


プロキシ指定についての補足

認証付きプロキシサーバの場合は認証ID、PW込みでプロキシ指定する。また、認証ID、PW、プロキシサーバURLにURIとして使用できない文字(@等)が含まれる場合はURLエンコードすること。

書式
$ git config --global http.proxy http://認証ID:認証PW@プロキシサーバのURL:ポート番号
$ git config --global https.proxy http://認証ID:認証PW@プロキシサーバのURL:ポート番号

設定例(認証IDがfoo.bar@example.com、認証PWがhogepassの場合)
$ git config --global http.proxy http://foo.bar%40example.com:hogepass@proxy.example.com:8080
$ git config --global https.proxy http://foo.bar%40example.com:hogepass@proxy.example.com:8080

2013年1月22日火曜日

プロキシ環境下でnpm installを実行する

書式
$ npm config set proxy http://プロキシサーバのURL:ポート番号

具体例
$ npm config set proxy http://proxy.example.com:8080

上記コマンドを実行するとホームディレクトリに.npmrcというファイルが作成される。
$ less ~/.npmrc

~/.npmrc
proxy = http://proxy.example.com:8080

上記の通りプロキシを設定してもエラーが出る場合には、さらに下記コマンドを実行する。
$ npm config set registry http://registry.npmjs.org/