This is an old revision of the document!
PYPI
pip custom repo
~/.pip/pip.conf
[global] #trusted-host = projects.csgalileo.org extra-index-url = https://projects.csgalileo.org/pypi/simple https://user:pass@pypi.csgalileo.org/wega/simple https://xxx:xxx@projects.csgalileo.org/giano/simple
setuptools with custom repo
~/.pypirc
[distutils] index-servers = pypi galileo [pypi] repository: http://pypi.python.org/pypi username: password: [galileo] repository: https://pypi.csgalileo.org username:user password:password
PYPI repo with apache
https
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \ -keyout /etc/apache2/ssl/pypi.csgalileo.org.key \ -out /etc/apache2/ssl/pypi.csgalileo.o.pem
sudo a2enmod ssl
apache virtualhost
/etc/apache2/sites-enabled/pypi.conf
<VirtualHost *:80> ServerName pypi.csgalileo.org RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost *:443> ServerName pypi.csgalileo.org DocumentRoot /var/www/pypi.csgalileo.org SSLEngine On SSLCertificateFile /etc/apache2/ssl/pypi.csgalileo.org.pem SSLCertificateKeyFile /etc/apache2/ssl/pypi.csgalileo.org.key <Directory /var/www/pypi.csgalileo.org/> AllowOverride None Options +Indexes IndexOptions SuppressColumnSorting IndexIgnore .. Order deny,allow Allow from all AuthType Basic AuthName "Galileo" AuthBasicProvider file AuthUserFile /etc/apache2/passwords_pypi Require valid-user </Directory> LogLevel warn ErrorLog /var/log/apache2/pypi-error.log CustomLog /var/log/apache2/pypi-access.log combined </VirtualHost>
Users
create
sudo htpasswd -c /etc/apache2/passwords_pypi <user>
add user or change password
sudo htpasswd /etc/apache2/passwords_pypi <user>
generate password
openssl passwd -apr1