Go to main content

Creating Package Repositories in Oracle® Solaris 11.4

Exit Print View

Updated: November 2018
 
 

How to Serve Multiple Repositories From Separate Locations

In this example, the solarisstudio repository exists in addition to the solaris repository. The solaris repository is accessible from http://localhost/ using port 81, as specified in the solaris instance of the pkg/server service. See Enabling Users to Retrieve Packages Using an HTTP Interface.

  1. Create a new repository server instance.

    Use the add subcommand of the svccfg command to add a new instance of the pkg/server service.

    $ svccfg -s pkg/server add studio
  2. Set the path to the repository.

    Set the path where this instance of the service can find the repository data.

    $ svccfg -s pkg/server:studio setprop pkg/inst_root=/var/share/pkgrepos/solarisstudio
  3. (Optional) Set the port number for the new instance.
    $ svccfg -s pkg/server:studio setprop pkg/port=82
  4. (Optional) Set the Apache proxy base.

    See Configuring a Simple Prefixed Proxy for an example of setting the pkg/proxy_base.

  5. Set the repository name and description.

    Make sure the repository name and description are set as shown in Modifying Repository Property Values.

  6. Start the repository service.

    Restart the package depot server service.

    $ svcadm refresh pkg/server:studio
    $ svcadm enable pkg/server:studio
  7. Check that the new instance is online.
    $ svcs pkg/server
    STATE  STIME    FMRI
    online 14:54:16 svc:/application/pkg/server:default
    online 14:54:20 svc:/application/pkg/server:studio

    If the pkg/server:studio instance is not online, use the svcs -xvL pkg/server:studio command to get more information to diagnose and fix the problem.

  8. Test that the repository server is working.

    Open a browser window on the http://localhost:82/ location.

    If you did not set the port number, the default is 80. View your repository at http://localhost:80/ or http://localhost/.

    If the port number is also being used by another pkg/server instance, append the publisher name to the location to see the new packages. For example, view your repository at http://localhost:81/solarisstudio/.

  9. Set the publisher origin.

    Set the publisher origin to one of the following values:

    • The pkg/inst_root location.

      $ pkg set-publisher -g /var/share/pkgrepos/solarisstudio/ solarisstudio
    • The pkg/port location.

      $ pkg set-publisher -g http://localhost:82/ solarisstudio

See Also

See Multiple Repositories Under One Domain for information about running multiple repositories under one domain name with different prefixes such as http://pkg.example.com/solaris and http://pkg.example.com/studio.