Go to main content

Copying and Creating Package Repositories in Oracle® Solaris 11.3

Exit Print View

Updated: September 2018
 
 

How to Enable Users to Retrieve Packages Using an HTTP Interface

To enable systems to access the local repository by using HTTP or HTTPS, this procedure shows how to configure a svc:/application/pkg/depot SMF service instance. The pkg/depot instance provides a scalable package repository server.

Before You Begin

To get the svc:/application/pkg/depot SMF service and the pkg.depot-config(1M) man page, make sure the pkg:/package/pkg/depot package is installed.

  1. Create a pkg/server instance.

    See How to Configure a pkg/server Service Instance. The svc:/application/pkg/server instance for each repository provides the file system location of the repository (in the pkg/inst_root property). Each pkg/server instance serves a single local repository. A single pkg/depot instance can serve multiple repositories.

    By default, repository content is served by an instance of the pkg.depotd package depot server. If you run svcs -p on the pkg/server instance, you see a pkg.depotd process associated with this pkg/server instance:

    $ svcs -p pkg/server:solaris
    STATE          STIME    FMRI
    online         Jun_26   svc:/application/pkg/server:solaris
                   Jun_26       16129 pkg.depotd

    Running a pkg.depotd process under a pkg/server instance works well when a small number of clients need to access the repository simultaneously. For greater scalability, configure the repository to be served directly by the Apache depot server by associating a pkg/depot instance, as described in the following steps.

  2. Ensure that the value of the readonly property is true.

    The default value of the pkg/readonly property is true. If this value has been changed, reset the value to true.

  3. Set the standalone property.

    To configure the repository to be served directly by the Apache depot server, set the value of the pkg/standalone property for the appropriate pkg/server service instance to false.

    • If the pkg/standalone property of a particular pkg/server instance is set to true, then the repository is served by the pkg.depotd process.

    • If the pkg/standalone property of a particular pkg/server instance is set to false and the pkg/readonly property is set to true, then the repository is served by the pkg/depot:default instance, which runs the Apache instance.

    Each pkg/server instance either runs pkg.depotd or instructs the pkg/depot service to serve this repository and provides the file system location of the repository.

    Use the -c option with the svcprop command because you have not yet refreshed the service:

    $ svccfg -s pkg/server:solaris setprop pkg/standalone=false
    $ svcprop -c -p pkg/standalone pkg/server:solaris
    pkg/standalone boolean false

    After you restart this pkg/server service instance, you no longer see processes associated with this pkg/server instance. If you run svcs -p on the pkg/depot service, you see Apache worker processes associated with the pkg/depot service:

    $ svcs -p pkg/depot pkg/server:solaris
    STATE          STIME    FMRI
    online         12:26:38 svc:/application/pkg/server:default
    online         12:26:40 svc:/application/pkg/depot:default
                   12:26:39     6266 httpd.worker
                   12:26:39     6269 httpd.worker
                   12:26:39     6270 httpd.worker
                   12:26:39     6272 httpd.worker
                   12:26:39     6273 httpd.worker
  4. Set the host name.

    Set the value of the config/host property of the pkg/depot:default instance to the IP address or host name of the system that hosts the repository file system.

    $ svccfg -s pkg/depot:default setprop config/host=pkg.example.com

    If you need to access this repository URI from other systems, specify the host name to use as the argument to the Apache ServerName directive. See ServerName directive examples in How to Configure Secure Repositories and Adding SSL Configuration to the Apache Configuration File.

  5. (Optional) Set other properties.

    For descriptions of pkg/depot properties, see the Options section of the pkg.depot-config(1M) man page.

    The following command lists the depot configuration properties and their values:

    $ svcprop -p config pkg/depot

    To set multiple service properties, use the following command to edit all of the properties at once. Remember to remove the comment marker (#) from the beginning of any lines that you change.

    $ svccfg -s pkg/depot:default editprop
  6. Start the pkg/depot instance.
    • If the pkg/depot instance is disabled, refresh and enable the instance:
      $ svcadm refresh pkg/depot:default
      $ svcadm enable pkg/depot:default

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

    • If the pkg/depot instance is online, refresh and restart the instance:
      $ svcadm refresh pkg/depot:default
      $ svcadm restart pkg/depot:default
  7. Restart the pkg/server instance.

    The pkg/server instance should already be online.

    $ svcadm refresh pkg/server:solaris
    $ svcadm restart pkg/server:solaris

See Also