Modified: karaf/site/production/manual/latest/urls.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest/urls.html?rev=1816059&r1=1816058&r2=1816059&view=diff ============================================================================== --- karaf/site/production/manual/latest/urls.html (original) +++ karaf/site/production/manual/latest/urls.html Wed Nov 22 14:52:25 2017 @@ -517,7 +517,7 @@ table.CodeRay td.code>pre{padding:0} </div> <div class="listingblock"> <div class="content"> -<pre><bundle>http://repo1.maven.org/maven2/org/apache/servicemix/nmr/org.apache.servicemix.nmr.api/1.0.0-m2/org.apache.servicemix.nmr.api-1.0.0-m2.jar</bundle></pre> +<pre class="CodeRay highlight nowrap"><code><bundle>http://repo1.maven.org/maven2/org/apache/servicemix/nmr/org.apache.servicemix.nmr.api/1.0.0-m2/org.apache.servicemix.nmr.api-1.0.0-m2.jar</bundle></code></pre> </div> </div> <div class="paragraph"> @@ -555,35 +555,426 @@ located in a directory which is not avai <p>In addition to being less verbose, the Maven url handlers can also resolve snapshots and can use a local copy of the jar if one is available in your Maven local repository.</p> </div> <div class="paragraph"> -<p>The <code>org.ops4j.pax.url.mvn</code> bundle resolves <code>mvn</code> URLs. It can be configured using the file <code>etc/org.ops4j.pax.url.cfg</code></p> +<p>The <code>org.ops4j.pax.url.mvn</code> bundle resolves <code>mvn</code> URLs. It can be configured using the file <code>etc/org.ops4j.pax.url.cfg</code>. +Full reference of <code>org.ops4j.pax.url.mvn</code> PID configuration can be found <a href="https://ops4j1.jira.com/wiki/display/paxurl/Aether+Configuration">on pax-web Wiki page</a>.</p> </div> <div class="paragraph"> -<p>The most important property is :</p> +<p>The most important property is:</p> </div> <div class="ulist"> <ul> <li> -<p><code>org.ops4j.pax.url.mvn.repositories</code> : Comma separated list of repository remote repository URLs that are checked in order of occurence when resolving maven artifacts</p> +<p><code>org.ops4j.pax.url.mvn.repositories</code> : Comma separated list of remote repository URLs that are checked in order of occurence when resolving maven artifacts</p> </li> </ul> </div> <div class="paragraph"> -<p>By default, snapshots are disabled. To enable an URL for snapshots append @snapshots to a repository entry. For example</p> +<p>Two other significant properties are:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p><code>org.ops4j.pax.url.mvn.defaulRepositories</code> : Comma separated list of locations that are checked before querying remote repositories. These can be treated as read-only repositories, as nothing is written there during artifact resolution.</p> +</li> +<li> +<p><code>org.ops4j.pax.url.mvn.localRepository</code> : by default (implicitly) it’s standard <code>~/.m2/repository</code> location. This +local repository is used to store artifacts downloaded from one of remote repositories, so at next resolution attempt +no remote request is issued.</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>By default, snapshots are disabled. To enable an URL for snapshots append <code>@snapshots</code> to a repository URI. For example</p> </div> <div class="listingblock"> <div class="content"> -<pre>http://www.example.org/repo@snapshots</pre> +<pre>org.ops4j.pax.url.mvn.repositories = http://www.example.org/repo@snapshots</pre> </div> </div> <div class="paragraph"> <p>Repositories on the local machine are supported through <code>file:/</code> URLs.</p> </div> </div> +<div class="sect3"> +<h4 id="_maven_configuration_commands">Maven configuration commands</h4> +<div class="paragraph"> +<p>Full configuration of <code>org.ops4j.pax.url.mvn</code> bundle can be done using <code>org.ops4j.pax.url.mvn</code> PID (see <code>etc/org.ops4j.pax.url.mvn.cfg</code> file). This however may be cumbersome in some scenarios.</p> +</div> +<div class="paragraph"> +<p>In order to make user’s life easier and provide more <em>domain</em> oriented approach, Karaf provides several shell commands that makes Maven configuration easier.</p> +</div> +<div class="sect4"> +<h5 id="_maven_summary">maven:summary</h5> +<div class="paragraph"> +<p>This command shows quick summary about current <code>org.ops4j.pax.url.mvn</code> PID configuration. For example:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:summary -s + +Option â Value â Source +âââââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ� �ââââââââââââââââââââââ +Local repository â /home/ggrzybek/.m2/repository â Implicit ${user.home}/.m2/repository +Settings file â /home/ggrzybek/.m2/settings.xml â Implicit ${user.home}/.m2/settings.xml +Security settings file â /home/ggrzybek/.m2/settings-security.xml â Implicit ${user.home}/.m2/settings-security.xml +Global update policy â â Implicit "never", but doesn't override repository-specific value +Global checksum policy â warn â Default "warn" +Update releases â false â Default "false" +Require Config Admin â true â BundleContext property (org.ops4j.pax.url.mvn.requireConfigAdminConfig) +Use fallback repository â false â Explicit org.ops4j.pax.url.mvn PID configuration (org.ops4j.pax.url.mvn.useFallbackRepositories) +Offline mode â false â Default "false" +SSL/TLS certificate check â true â Explicit org.ops4j.pax.url.mvn PID configuration (org.ops4j.pax.url.mvn.certificateCheck) +Remote repositories â http://repo1.maven.org/maven2/ â PID configuration + â http://repository.apache.org/content/groups/snapshots-group/ â PID configuration + â https://oss.sonatype.org/content/repositories/snapshots/ â PID configuration + â https://oss.sonatype.org/content/repositories/ops4j-snapshots/ â PID configuration +Default repositories â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/system/ â PID configuration + â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/kar/ â PID configuration +HTTP proxies â proxy.everfree.forest:3128 â Maven XML settings</code></pre> +</div> +</div> +<div class="ulist"> +<ul> +<li> +<p><code>-s</code> option show where the value of the option come from. It may be implicit, explicit or default. We can also see +whether the value was configured in PID or in <code>settings.xml</code> file.</p> +</li> +<li> +<p><code>-p</code> option uses original option names from <code>org.ops4j.pax.url.mvn</code> PID instead of descriptive option names</p> +</li> +<li> +<p><code>-d</code> option shows additional description, explaining what given option should be used for</p> +</li> +<li> +<p><code>-x</code> option turns on password display - if there’s master password configured, it’ll be displayed in clear text. +This option may be used only by user with <code>admin</code> role.</p> +</li> +</ul> +</div> +</div> +<div class="sect4"> +<h5 id="_maven_repository_list">maven:repository-list</h5> +<div class="paragraph"> +<p>This command displays all configured Maven repositories - in much more readable way than plain <code>config:proplist --pid org.ops4j.pax.url.mvn</code> command does.</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:repository-list -v + +== Remote repositories +ID â URL â Releases â Snapshots â Defined in +âââââââââââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼ââââââââââââââ¼ââââââââââââââ¼âââââââââââ +central â http://repo1.maven.org/maven2/ â yes (daily) â no â PID +apache â http://repository.apache.org/content/groups/snapshots-group/ â no â yes (daily) â PID +sonatype.snapshots.deploy â https://oss.sonatype.org/content/repositories/snapshots/ â no â yes (daily) â PID +ops4j.sonatype.snapshots.deploy â https://oss.sonatype.org/content/repositories/ops4j-snapshots/ â no â yes (daily) â PID +special â https://repository.everfree.forest/ â yes (daily) â no â SETTINGS + +== Default repositories +ID â URL â Releases â Snapshots +âââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼ââââââââââââââ¼ââââââââââââ +system.repository â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/system/ â yes (daily) â yes (daily) +kar.repository â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/kar/ â yes (daily) â yes (daily) +child.system.repository â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/system/ â yes (daily) â yes (daily)</code></pre> +</div> +</div> +<div class="ulist"> +<ul> +<li> +<p><code>-v</code> option shows additional information about policies related to given repository</p> +</li> +<li> +<p><code>-x</code> shows credentials for given repository (if defined)</p> +</li> +</ul> +</div> +</div> +<div class="sect4"> +<h5 id="_maven_password">maven:password</h5> +<div class="paragraph"> +<p><code>org.ops4j.pax.url.mvn</code> bundle uses Aether library to handle Maven resolution. It uses <code>settings.xml</code> file if +credentials have to be used when accessing remote Maven repositories. This isn’t done by <code>org.ops4j.pax.url.mvn</code>, +but by Aether itself (or rather maven-settings library). When dealing with <code>settings.xml</code> file, passwords that +are stored there may need to be decrypted. +Outside of Karaf, we can use <code>mvn -emp</code> and <code>mvn -ep</code> passwords and manually configure <code>~/.m2/settings-security.xml</code> +file.</p> +</div> +<div class="paragraph"> +<p>Karaf makes the task of managing credentials easier.</p> +</div> +<div class="paragraph"> +<p>In order to use encrypted repository (or http proxy) passwords inside <code>settings.xml</code> file, Maven must know the <em>master +password</em> stored inside <code>settings-security.xml</code> file. This file isn’t usually present inside <code>~/.m2</code> directory and if +there’s a need to use it, one has to be created manually.</p> +</div> +<div class="paragraph"> +<p>Here’s the way to encrypt Maven <em>master password</em> (which is used to encrypt ordinary passwords for repository or http proxies):</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:password -emp +Master password to encrypt: ***** +Encrypted master password: {y+p9TiYuwVEHMHV14ej0Ni34zBnXXQrIOqjww/3Ro6U=}</code></pre> +</div> +</div> +<div class="paragraph"> +<p>The above usage simply prints encrypted <em>master password</em>. We can however make this password persistent. This will +result in new <code>settings-security.xml</code> file to be created and change in <code>org.ops4j.pax.url.mvn.security</code> property.</p> +</div> +<div class="admonitionblock note"> +<table> +<tr> +<td class="icon"> +<div class="title">Note</div> +</td> +<td class="content"> +Karaf maven commands will never overwrite your current <code>~/.m2/settings.xml</code> or <code>~/.m2/settings-security.xml</code> files. +If there’s a need to change these files, maven commands will make a copy of existing file and set relevant <code>org.ops4j.pax.url.mvn</code> PID options +to point to new locations. +</td> +</tr> +</table> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:password -emp --persist +Maven security settings will be stored in new file. This file will be used in org.ops4j.pax.url.mvn.security property. Continue? (y/N) y +Master password to encrypt: ***** +Encrypted master password: {lPPIFSUcPrMHnhwdauttAJYZcOe1D9sYGj4rwoaTwnY=} +New security settings stored in "/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-security-settings-1498120766139.xml" +karaf@root()> maven:summary -x + +Option â Value +âââââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ +... +Security settings file â /data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-security-settings-1498120766139.xml +Master password â admin +...</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Now, when Maven <em>master password</em> is set, we can encrypt ordinary passwords that may be then used when defining/changing +remote repositories or http proxies:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:password -ep +Password to encrypt: ***** +Encrypted password: {fHl8U3pINkEH7RR1CufRT+utj5gJHfqsRgd6wTo92Eo=} +You can use this encrypted password when defining repositories and proxies</code></pre> +</div> +</div> +</div> +<div class="sect4"> +<h5 id="_configuring_repositories_default_and_remote">Configuring repositories (default and remote)</h5> +<div class="paragraph"> +<p>As mentioned before, there are two kinds of repositories that are used/queried by <code>org.ops4j.pax.url.mvn</code> bundle when resolving +<code>mvn:</code> based URIs:</p> +</div> +<div class="dlist"> +<dl> +<dt class="hdlist1">default repositories</dt> +<dd> +<p>These are read-only local repositories that are simply queried before performing any remote access. +The best example of such repository is <code>$KARAF_HOME/system</code> directory.</p> +</dd> +<dt class="hdlist1">remote repositories</dt> +<dd> +<p>These are well-known Maven remote repositories - usually accessible over http(s) protocol. Popular +repositories are Sonatype Nexus or JFrog Artifactory.</p> +</dd> +</dl> +</div> +<div class="paragraph"> +<p>Both kinds of repositories may be created using <code>maven:repository-add</code> command.</p> +</div> +<div class="paragraph"> +<p>Here’s how default repository may be created:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:repository-add --default -id my.default.repository --snapshots '${karaf.home}/special-repository' + +... +== Default repositories +ID â URL â Releases â Snapshots +âââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼ââââââââââââââ¼ââââââââââââ +... +my.default.repository â file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/special-repository/ â yes (daily) â yes (daily)</code></pre> +</div> +</div> +<div class="paragraph"> +<p>For remote repository, we can specify more options (like credentials or update policies):</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:repository-add -idx 0 -id my.remote.repository --snapshots -up never --username admin --password '{fHl8U3pINkEH7RR1CufRT+utj5gJHfqsRgd6wTo92Eo=}' http://localhost/cloud-repository +Maven settings will be updated and org.ops4j.pax.url.mvn.settings property will change. Continue? (y/N) y +New settings stored in "/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-settings-1498121385253.xml" + +karaf@root()> maven:repository-list -x + +== Remote repositories +ID â URL â Username â Password +âââââââââââââââââââââââââââââââââ¼âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¼âââââââââââ¼âââââââââ +my.remote.repository â http://localhost/cloud-repository/ â admin â admin +...</code></pre> +</div> +</div> +<div class="paragraph"> +<p>In the above example, new <code>settings.xml</code> file was created. The reason is that although new repository itself was added +to <code>org.ops4j.pax.url.mvn.repositories</code> property, the credentials had to be stored in <code>settings.xml</code> file:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code><servers> + <server> + <username>admin</username> + <password>{fHl8U3pINkEH7RR1CufRT+utj5gJHfqsRgd6wTo92Eo=}</password> + <id>my.remote.repository</id> + </server> +</servers></code></pre> +</div> +</div> +<div class="paragraph"> +<p>Here’s summary of all options for <code>maven:repository-add</code> command:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p><code>-id</code> mandatory identifier of repository</p> +</li> +<li> +<p><code>-d</code> option may be used to configure default repositories instead of remote ones</p> +</li> +<li> +<p><code>-nr</code> option disables non-SNAPSHOT artifacts resolution in this repository</p> +</li> +<li> +<p><code>-s</code> option enables SNAPSHOT artifacts resolution in this repository</p> +</li> +<li> +<p><code>-up</code> sets <em>update policy</em> for given repository (<code>daily</code>, <code>always</code>, <code>never</code>, <code>interval:MINUTES</code>)</p> +</li> +<li> +<p><code>-cp</code> sets <em>checksum policy</em> for given repository (<code>fail</code>, <code>warn</code>, <code>ignore</code>)</p> +</li> +<li> +<p><code>-f</code> disables confirmation prompts for commands</p> +</li> +<li> +<p><code>-idx</code> allows to insert a repository at given position (instead of simply appending new repository at the end of current list of repositories)</p> +</li> +<li> +<p><code>-u</code> sets username for remote repository access</p> +</li> +<li> +<p><code>-p</code> sets password for remote repository access (may be encrypted using <code>maven:password -ep</code>)</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>After creating a repository, it may be deleted (using <code>maven:repository-remove</code> command) or changed (<code>maven:repository-change</code> command). +All the options are the same as in <code>maven:repository-add</code> command. When removing a repository, only <code>-id</code> (and possibly <code>-d</code>) options are needed.</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> repository-remove -d -id my.default.repository +Are you sure to remove repository with ID "my.default.repository" for URL file:/data/servers/apache-karaf-4.2.0-SNAPSHOT/special-repository/? (y/N) y + +karaf@root()> repository-change -id special --username discord --password d1sc0rd +Maven settings will be updated and org.ops4j.pax.url.mvn.settings property will change. Continue? (y/N) y +New settings stored in "/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-settings-1498122026388.xml"</code></pre> +</div> +</div> +</div> +<div class="sect4"> +<h5 id="_configuring_http_proxies">Configuring HTTP proxies</h5> +<div class="paragraph"> +<p>When accessing remote repositories using <code>org.ops4j.pax.url.mvn</code> (Aether library) there may be a need to let Maven/Aether +know about HTTP proxies to use. HTTP proxies <strong>can’t be configured</strong> inside <code>etc/org.ops4j.pax.url.mvn.cfg</code> file. It has to +be done in <code>settings.xml</code> and its location has to be set in <code>org.ops4j.pax.url.mvn.settings</code> PID property.</p> +</div> +<div class="paragraph"> +<p><code>maven:http-proxy</code> command can be used to add/change/remove HTTP proxy definition. It automatically does a copy +of existing <code>settings.xml</code> file and changes <code>org.ops4j.pax.url.mvn.settings</code> PID property.</p> +</div> +<div class="paragraph"> +<p>For example:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code>karaf@root()> maven:http-proxy-list -x + +ID â Host â Port â Non-proxy hosts â Username â Password +ââââââââââ¼ââââââââââââââââââââââââ¼âââââââ¼ââââââââââââââââââ¼âââââââââââ¼âââââââââââââ +my.proxy â proxy.everfree.forest â 3128 â 192.168.2.* â admin â super-secret + +karaf@root()> maven:http-proxy --remove -id my.proxy +New settings stored in "/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-settings-1498122255098.xml" + +No HTTP proxies configured in /data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-settings-1498122255098.xml + +karaf@root()> maven:http-proxy --add -id my.proxy --username discord --password '{fHl8U3pINkEH7RR1CufRT+utj5gJHfqsRgd6wTo92Eo=}' --non-proxy-hosts '127.*|192.168.*|localhost' proxy.everfree.forest:3128 +New settings stored in "/data/servers/apache-karaf-4.2.0-SNAPSHOT/data/cache/bundle53/data/maven-settings-1498122328731.xml" + +karaf@root()> maven:http-proxy-list -x + +ID â Host â Port â Non-proxy hosts â Username â Password +ââââââââââ¼ââââââââââââââââââââââââ¼âââââââ¼ââââââââââââââââââââââââââââ¼âââââââââââ¼âââââââââ +my.proxy â proxy.everfree.forest â 3128 â 127.*|192.168.*|localhost â discord â admin</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Here’s summary of options for <code>maven:http-proxy</code> command:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p><code>-id</code> identifier of HTTP proxy</p> +</li> +<li> +<p><code>-add</code> / <code>--change</code> / <code>--remove</code> is an operation to perform on proxy</p> +</li> +<li> +<p><code>-f</code> disables confirmation prompts for commands</p> +</li> +<li> +<p><code>-u</code> sets username for remote HTTP proxy</p> +</li> +<li> +<p><code>-p</code> sets password for remote HTTP proxy (may be encrypted using <code>maven:password -ep</code>)</p> +</li> +<li> +<p><code>-n</code> sets <em>non proxy hosts</em> option, which is <code>|</code>-separated list of glob patterns for IP addresses/host names that should be +accessed bypassing HTTP proxy</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p><code>maven:http-proxy</code> configures for example this section in <code>settings.xml</code>:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight nowrap"><code><proxies> + <proxy> + <username>discord</username> + <password>{fHl8U3pINkEH7RR1CufRT+utj5gJHfqsRgd6wTo92Eo=}</password> + <port>3128</port> + <host>proxy.everfree.forest</host> + <nonProxyHosts>127.*|192.168.*|localhost</nonProxyHosts> + <id>my.proxy</id> + </proxy> +</proxies></code></pre> +</div> +</div> +</div> +</div> </div> </div> <div id="footer"> <div id="footer-text"> -Last updated 2016-04-27 13:59:28 CEST +Last updated 2017-11-22 15:12:31 +01:00 </div> </div> </body>
Modified: karaf/site/production/manual/latest/webconsole.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest/webconsole.html?rev=1816059&r1=1816058&r2=1816059&view=diff ============================================================================== --- karaf/site/production/manual/latest/webconsole.html (original) +++ karaf/site/production/manual/latest/webconsole.html Wed Nov 22 14:52:25 2017 @@ -599,7 +599,7 @@ Right now, the WebConsole doesn’t </div> <div id="footer"> <div id="footer-text"> -Last updated 2016-04-27 13:59:28 CEST +Last updated 2017-07-26 16:36:29 +02:00 </div> </div> </body> Modified: karaf/site/production/manual/latest/webcontainer.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest/webcontainer.html?rev=1816059&r1=1816058&r2=1816059&view=diff ============================================================================== --- karaf/site/production/manual/latest/webcontainer.html (original) +++ karaf/site/production/manual/latest/webcontainer.html Wed Nov 22 14:52:25 2017 @@ -569,10 +569,56 @@ table.CodeRay td.code>pre{padding:0} <div class="sect4"> <h5 id="_configuration">Configuration</h5> <div class="paragraph"> -<p>The default port used by the WebContainer is 8181.</p> +<p>The default port used by the WebContainer is 8181. Note: the connector is actually bound only when at least a servlet or webapplication is using it. +It means that just installing the <code>http</code> or <code>war</code> feature doesn’t bind the connector.</p> </div> <div class="paragraph"> -<p>The WebContainer configuration is in the <code>etc/jetty.xml</code> configuration file.</p> +<p>By default, Karaf creates an internal Jetty connector that you can configure via <code>etc/org.ops4j.pax.web.cfg</code>:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight"><code>org.osgi.service.http.port=8181</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Note: if you want to use port numbers < 1024, remember you have to run with root privileges.</p> +</div> +<div class="paragraph"> +<p>It’s possible to enable HTTPs "internal" connector. The first step is to create a keystore containing a server certificate. +For instance the following command creates a keystore with a self-signed certificate:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight"><code>keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore -storepass karaf1234 -validity 360 -keysize 2048</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Now, we can enable and configure the HTTPs connector with this keystore in <code>etc/org.ops4j.pax.web.cfg</code>:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight"><code>org.osgi.service.http.port.secure=8443 +org.osgi.service.http.secure.enabled=true +org.ops4j.pax.web.ssl.keystore=/path/to/keystore +org.ops4j.pax.web.ssl.password=foo +org.ops4j.pax.web.ssl.keypassword=karaf1234</code></pre> +</div> +</div> +<div class="paragraph"> +<p>It’s possible to use only HTTPs and to disable the HTTP using:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight"><code>org.osgi.service.http.enabled=false</code></pre> +</div> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="CodeRay highlight"><code>org.osgi.service.https.enabled=true</code></pre> +</div> +</div> +<div class="paragraph"> +<p>As an alternative to the default connectors, it is possible to configure additional connectors in the <code>etc/jetty.xml</code> configuration file.</p> </div> <div class="paragraph"> <p>The <code>etc/jetty.xml</code> is a standard Eclipse Jetty configuration file.</p> @@ -940,7 +986,7 @@ corresponding to the bundle ID (as displ </div> <div id="footer"> <div id="footer-text"> -Last updated 2016-04-27 13:59:28 CEST +Last updated 2017-08-09 13:23:59 +02:00 </div> </div> </body> Modified: karaf/site/production/manual/latest/writing-tests.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest/writing-tests.html?rev=1816059&r1=1816058&r2=1816059&view=diff ============================================================================== --- karaf/site/production/manual/latest/writing-tests.html (original) +++ karaf/site/production/manual/latest/writing-tests.html Wed Nov 22 14:52:25 2017 @@ -947,7 +947,7 @@ The advantage though is that you can als </div> <div id="footer"> <div id="footer-text"> -Last updated 2016-04-27 13:59:28 CEST +Last updated 2017-07-26 16:36:29 +02:00 </div> </div> </body>
