There are two separate groups of data available for you to mirror:
pkg(1)client with a static web server such as Apache, lighttpd, nginx, etc., without having to worry about
pkg.depotd(1M). It also means you don't have to run the mirror on OpenIndiana, if you already have a mirror server set up with another operating system.
We try to keep the requirements low for becoming a mirror in order to make it easier for people to contribute to the project. The requirements are:
The last three points can for instance be fulfilled by an Apache HTTPD with the following settings configured:
And the following is comparable for Nginx:
This page covers how to set up an OpenIndiana b147 machine for mirroring the data currently available on pkg.oi.o/dev and dlc.oi.o, it should however work fine on other versions of OpenSolaris (post b134) and OpenIndiana. It should also work without problems within a zone.
The guide will not cover how to install OpenIndiana, have a look at the 2. Installing or Upgrading guide instead. You should also install
rsync before starting on the guide, it can be installed by executing
pkg install rsync.
wget will be used to download files within the guide. It is not installed per default in a new zone but can be installed by installing the wget package, do however feel free to use another download utility such as
curl if you prefer to do so.
All commands in the guide are expected to be run with root permissions, either by using
sudo or simply a shell with root permissions.
Around 2GB is needed for /dev, around 7GB for /legacy, and currently around 6GB for dlc.oi.o.
There are two parts to getting the files needed for mirroring; the repository data and download content. We will start off with the repository data.
You should start off with the newest available tarball available on the DLC, next we are going to use
rsync for getting the repository data updated. Here I am the putting the data for the repository into
/export/pkg/dev/ with ZFS compression disabled (the depot files are already gzipped):
That leaves us with a complete updated pkg root inside
/export/pkg/dev/, so we move onto the DLC data.
The DLC data is pretty static, so we are going to fetch it using
rsync, and place the data inside
We'd recommend only mirroring the isos directory if you're short on disk space.
And that's it, those are the files needed to serve clients. Next we are going to set up a couple of services for letting other people get the files.
We have a DNS convention as follows:
So for example if you're in France, instead of gb it would be fr.
Please contact Alasdair Lumsden (alasdairrr at gmail) to request an allocated DNS entry. Please provide information regarding your mirror (Your name, contact details, who is sponsoring the mirror, where the mirror is geographically located and the bandwidth available to the mirror) and your DNS entry will be created and the mirror details added to the mirror list.
You need to serve the files with pkg.depotd from oi_147 or later. If you're not running oi_147 you can compile and install the latest pkg5.
We are going to start with setting up the PKG repository, since that's quite easy. We only need to configure the a SMF service instance of
svc:/application/pkg/server to match the directory to serve files from and the port number to run as:
That should leave you with a pkg repository running on port 10002 on the machine, try to browse it with a web browser to make sure it works before we move on.
In order to make the web interface for the repository look the part, you should use the OpenIndiana theme available. This is easily installed through
After that you simply have to restart the web server with
pkg restart pkg/server:dev and the new theme is online.
We are going to serve all the data through Apache, it will make it easy to serve multiple repositories on the same IP address, but with different hostnames or paths. Start by installing Apache on the system:
Here is an example Apache VirtualHost for serving the pkg repos taken from the pkg-origin server:
For serving dlc, a standard configuration should be sufficient.
Write how to modify pkg/proxy_base