Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
conary repo setup

conary repo setup



Hook to apache

  • write /etc/httpd/conf.d/python-conary.conf (named python-conary.conf so that it's started after mod_python's python.conf) (suppose we want to put the mirror under /srv/conary)

      # cat /etc/httpd/conf.d/python-conary.conf
      Alias /conary/ "/srv/conary/config/repository.cnr/"
      <Directory /srv/conary/config/>
          AddHandler python-program .cnr
          PythonHandler conary.server.apachehooks
      # You may also find it useful to redirect /conary to /conary/, but if you
      # do, make sure you have trailing slashes in your repository Map entries.
      RedirectMatch /conary$ /conary/

Setup repository

  • mkdir -p /srv/conary/{config,contents,db,tmp}

  • write /srv/conary/config/repository.cnr

      # cat /srv/conary/config/repository.cnr
      repositoryDB sqlite /srv/conary/db/sqldb
      contentsDir /srv/conary/contents
      tmpDir /srv/conary/tmp
      readOnlyRepository true
      # this is the hostname part of the label, not the hostname of the machine
      # so on both and on, this
      # is "serverName".  This can also be a list if your repository
      # serves more than one label.
  • create users

      /usr/lib64/python2.7/site-packages/conary/server/ --add-user admin --admin --config-file  /srv/conary/config/repository.cnr
      /usr/lib64/python2.7/site-packages/conary/server/ --add-user anonymous --config-file  /srv/conary/config/repository.cnr
  • ensure the db and the dirs are writable by apache

      chown :apache /srv/conary/db/sqldb /srv/conary/tmp/ /srv/conary/contents/ /srv/conary
      chmod g+w /srv/conary/db/sqldb /srv/conary/tmp/ /srv/conary/contents/ /srv/conary/
  • install conary-web-common (

  • touch /usr/share/conary/web-common/css/custom.css # to get rid of a 404 warning

Do mirror

After the repository is set up, you could mirror another repository into this one.

Suppose the hostname of the your server is, and you want to mirror Your repository should have been configured to serve (serverName in the above repository.cnr).

  • write a mirror.conf

      # cat do-mirror/mirror.conf 
      user jesse XXXXX
      user admin XXXXX
  • populate it

      /usr/share/conary/mirror -v --config-file mirror.conf

Possible problems

  • Make sure the database file and the directory are writable (and the directory is executable/searchable) by apache. Or else there might be:

      DatabaseError: unable to open database file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.