在公司的環境下搭建了一套pip私服。需要跨域訪問。走了彎路,希望後來者記住centos下的防火牆可能做怪。
自己想盡各種招數,就是如下:
本機:
遠端:curl http://localhost:3141
welcome to pypiserver!title>
head>
welcome to pypiserver!h1>
this is a pypi compatible package index serving 0 packages.p>
to use this server with pip, run the the following command:
pip install --extra-index-url package [package2...]
pre>
blockquote>
p>
to use this server with easy_install, run the the following command:
easy_install -i ******/ package
pre>
blockquote>
p>
the complete list of all packages can be found href="/packages/">herea>
or via the href="/******/">******a> index.p>
this instance is running version 1.2.0 of the
href="">pypiservera> software.p>
body>
html>
嘗試了一整天,google查到一種方法,伺服器上做乙個server來**到3141埠。與其這樣,還不如直接用nginx做**:curl ''
curl: (7) failed to connect to x.x.x.x port
3141: connection refused
結果也不work。server
}
好了,問題轉換為如何配置防火牆,開啟3141埠了:curl ''
welcome to pypiserver!title>
head>
welcome to pypiserver!h1>
this is a pypi compatible package index serving 0 packages.p>
to use this server with pip, run the the following command:
pip install --extra-index-url package [package2...]
pre>
blockquote>
p>
to use this server with easy_install, run the the following command:
easy_install -i ******/ package
pre>
blockquote>
p>
the complete list of all packages can be found href="/packages/">herea>
or via the href="/******/">******a> index.p>
this instance is running version 1.2.0 of the
href="">pypiservera> software.p>
body>
html>
重啟後永久生效:
chkconfig iptables on/off
service iptables start/stop
修改 /etc/sysconfig/iptables 檔案,新增以下內容:
-a input -m state --state new -m tcp -p tcp --dport 3141 -j accept #允許80埠通過防火牆
備註:如果把這兩條規則新增到防火牆配置的最後一行,導致防火牆啟動失敗,正確的應該是新增到預設的22埠這條規則的下面
Google Code SVN密碼的解決之道
使用google有很久的習慣。不過現在用google總覺得很不痛快,你是不是有這樣的感覺。經常在使用google的時候,出現不能訪問,或者很慢的問題。估計這不僅僅是網路問題了。為什麼同時我訪問別的 就可以呢。哎 呀,什麼原因,司馬昭之心了。雖不痛快,但是還是沒有讓我有放棄的地方,畢竟google就是...
ORA 28547的解決之道
1.修改oracle的網路配置檔案,具體做法是 在oracle安裝目錄下搜尋sqlnet.ora檔案,一般在 network admin目錄下,用記事本開啟把檔案中的一行 sqlnet authentication services nts 修改為 sqlnet authentication ser...
泛型方法的侷限及解決之道
泛型的優點在於提高了函式的適應性,有利於 復用。但是,乙個支援泛型的方法裡面,代表該引數型別未可知,如果要直接使用它的屬性,是不行的。因此,這點是泛型的侷限,使得這個泛型引數,乃至整個方法,便利性都打了折扣。由此可知,在支援泛型的方法裡面,泛型物件作為引數,主要作用在不同的方法間傳來傳去,像踢皮球似...