• No results found

You can create an embedded server application with tc Server. In an embedded server application, the application is deployed and run as a JAR; the JAR file launches a main() method which in turn starts the server and deploys itself on it.

This section contains general instructions for embedding tc Server. For a worked example, see https://

github.com/vFabric/tcs-embed-example.

Prerequisites

• Maven 2.2.1

• The instructions below assume the existence of a Maven project into which you wish to embed tc Server.

Procedure

1. Create an account at repository.cloudfoundry.com

2. Configure the repository in your project's pom.xml (in the root of your project directory).

<repository>

<id>tcserver-embed-release</id>

<name>TC Server Embedded Runtime</name>

<snapshots>

<enabled>true</enabled>

<updatePolicy>always</updatePolicy>

<checksumPolicy>fail</checksumPolicy>

</snapshots>

<url>http://repository.cloudfoundry.com/data2/maven/bundles/release</

url>

</repository>

3. Configure dependencies in your project's pom.xml file.

See Example pom.xml below.

4. Configure credentials for accessing the tcruntime-release package at build-time, as a server stanza in the Maven settings file (.m2/settings.xml) .

<settings>

<servers>

...

<server>

<id>tcserver-embed-release</id>

<username>UserName</username>

<password>DecryptedPassword</password>

</server>

...

</servers>

</settings>

5. Run the following command to build the application with embedded tc Server and install it in your local Maven repository (.m2), located in your home directory.

mvn clean compile assembly:single 6. Start the application with a command like this:

java -jar target/example-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Embedded Jars

Table 11: tc Server Embedded Jars

Group Id Artifact Id Description

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.embed.coreContains all of the core jars for tc Server embedded: catalina.jar, coyote.jar,annotations-api.jar, coyote.jar,annotations-api.jar, tomcat-util.jar, servlet-api.jar

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.embed.jasperContains all of the JSP classes:

jsp-api.jar, jasper-el.jar, jasper.jar, el-api.jar

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.embed.logging.juliContains the Juli logging classes:

tomcat-juli.jar

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.embed.logging.log4jContains the log4j logging classes: log4j.jar

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.embed.clusterContains classes for clustering:

catalina-ha.jar, catalina-tribes.jar com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.dbcpContains classes for DBCP:

tomcat-dbcp.jar

com.springsource.vfabric.tcruntime.embedcom.springsource.org.apache.tomcat.jdbcContains classes for Tomcat JDBC: tomcat-jdbc.jar com.springsource.vfabric.tcruntime.embedcom.springsource.org.eclipse.jdt.compilerContains classes for Eclipse

compiler: ecj-<version>.jar com.springsource.vfabric.tcruntime.embedcom.springsource.tcserver Contains the tc Server classes:

tcServer.jar Example pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://

www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://

maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<artifactId>maven-assembly-plugin</artifactId>

<configuration>

<archive>

<manifest>

<mainClass>com.springsource.tcruntime.embeddedexample.example.App</

mainClass>

</manifest>

</archive>

<descriptorRefs>

<descriptorRef>jar-with-dependencies</descriptorRef>

</descriptorRefs>

</configuration>

<executions>

<execution>

<id>make-assembly</id> <!-- this is used for inheritance merges -->

<phase>package</phase> <!-- bind to the packaging phase -->

<goals>

<id>tcserver-embed-release</id>

<name>TC Server Embedded Runtime</name>

<snapshots>

<enabled>true</enabled>

<updatePolicy>always</updatePolicy>

<checksumPolicy>fail</checksumPolicy>

</snapshots>

<url>http://repository.cloudfoundry.com/data2/maven/bundles/release</

url>

<version>7.0.37.B.RELEASE</version>

<groupId>com.springsource.vfabric.tcruntime.embed</groupId>

<artifactId>com.springsource.org.apache.tomcat.embed.jasper</

artifactId>

<version>7.0.37.B.RELEASE</version>

</dependency>

<dependency>

<groupId>com.springsource.vfabric.tcruntime.embed</groupId>

<artifactId>com.springsource.tcserver</artifactId>

<version>2.9.1.RELEASE</version>

Pivotal is committed to providing products and solutions that allow you to assess the security of your information, secure your information infrastructure, protect your sensitive information, and manage security information and events to assure effectiveness and regulatory compliance. As part of this commitment, the following Pivotal tc Server-specific security information is provided to help you secure your environment:

External Ports

Resources That Must Be Protected

Log File Locations

User Accounts Created at Installation

Obtaining and Installing Latest Version of Product

External Interfaces, Ports, and Services

A tc Runtime instance uses TCP/IP ports to receive incoming requests and send outgoing responses.

Different protocols (such as HTTP/S, JMX, and AJP) listen on different ports. If you create a tc Runtime instance using all default values, then the default TCP/IP ports for the various protocols are as follows:

• HTTP: 8080

• HTTPS: 8443

• JMX: 6969

• AJP: 8009

You can change the TCP/IP listen ports for a particular tc Runtime instance by updating the INSTANCE-DIR/conf/catalina.properties file, where INSTANCE-DIR refers to the directory in which the tc Runtime instance is located, such as /var/opt/pivotal/pivotal-tc-server-standard/

myserver.

The following snippet of catalina.properties shows how to change the HTTP, HTTPS, and JMX ports to 8181, 8553, and 7979, respectively:

Related documents