bandersnatch建立本地pip源
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
下载的包目录结构
[[email protected] pypi]# ls
generation todo web
[[email protected] pypi]# cd web
[[email protected] web]# ls
local-stats packages simple
pip install Mako
pip install --upgrade Mako
python2.7和Python3的包区别太大了
本文出自 “要有梦想,万一实现了呢” 博客,请务必保留此出处http://szgb17.blog.51cto.com/340201/1975522
以上是关于bandersnatch建立本地pip源的主要内容,如果未能解决你的问题,请参考以下文章