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的包区别太大了
相关文章