Monday, January 13, 2014

reprepro and nginx


Experimenting with reprepro and nginx as a private package server (blog I followed):

apt-get install reprepro
mkdir -p /srv/reprepro/debian/{conf,dists,incoming,indices,logs,pool,project,tmp}
sudo chown -R `whoami` .

then create distributions file in conf:


Origin: Your Name
Label: Your repository
nameCodename: thunder
Architectures: armhf source
Components: main
Description: Description of repository you are creating

to add a package:

reprepro -S admin -P extra -b /srv/reprepro/debian includedeb thunder myapp_1.0_i386.deb

To make it accessible you have to setup a server.  Using nginx (apt-get install if necessary), in my case it was already being used by a server so I created a new server  (/etc/nginx/sites-available/reprepro.conf) containing the following:


server {
  listen 8080;
  server_name ipaddress;

  access_log /var/log/nginx/reprepro-access.log;
  error_log /var/log/nginx/reprepro-error.log;

  location / {
    root /srv/reprepro;
    index index.html;
  }

  location ~ /(.*)/conf {
    deny all;
  }

  location ~ /(.*)/db {
    deny all;
  }
}

I then place a virtual link in /etc/nginx/sites-enabled (sudo ln -s ../sites-available/reprepro.conf .) and then restart nginx (sudo service nginx reload).

Then to access the server I add the following to /etc/apt/sources.list:

deb http://ipaddress:port/debian thunder main

then apt-get update

now you should be able to install your package.

apt-get install myapp


No comments:

Post a Comment