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.
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.
The default value of the pkg/readonly property is true. If this value has been changed, reset the value to true.
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
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.
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
$ 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.
$ svcadm refresh pkg/depot:default $ svcadm restart pkg/depot:default
The pkg/server instance should already be online.
$ svcadm refresh pkg/server:solaris $ svcadm restart pkg/server:solaris
The pkg.depot-config(1M) man page provides more information about web server configuration for pkg package repositories.
Serving Multiple Repositories Using Web Server Access describes how to serve multiple repositories from multiple locations or from a single location.
Multiple Repositories Under One Domain describes how to run multiple repositories under one domain name with different prefixes.
Running the Package Depot Server Behind a Web Server describes how to configure your web server for caching, load balancing, and serving multiple repositories.
Configuring HTTPS Repository Access describes how to configure secure repository access.