bandersnatch建立本地pip源
bandersnatch现在github上需要python3以上,不过2.7要改几行代码
httpd.conf
Listen 9600
NameVirtualHost 172.1.1.3
<VirtualHost 172.1.1.3>
DocumentRoot /pip3/pypi/web
ServerName pip3.a.com
<Directory /pip3/pypi/web>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow From All
</Directory>
</VirtualHost>
nginx.conf
server {
listen 80;
server_name pip3.a.com;
location / {
proxy_pass http://172.1.1.3:9600/;
}
}
server {
listen 443;
ssl on;
server_name pip3.a.com;
error_log /opt/log/apipl.error;
ssl_certificate /etc/pki/tls/server.pem;
ssl_certificate_key /etc/pki/tls/server.key;
ssl_session_cache shared:SSL:1m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
proxy_pass http://172.1.1.3:9600/;
}
}
其他机器引用
touch ~/.pip/pip.conf
[global]
index-url = http://pip3.a.com/simple
[install]
trusted-host = pip3.a.com
下载的包目录结构
[root@localhost pypi]# ls
generation todo web
[root@localhost pypi]# cd web
[root@localhost web]# ls
local-stats packages simple
pip install Mako
pip install --upgrade Mako
python2.7和Python3的包区别太大了
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341