Skip to content

Commit

Permalink
changes to ensure backward compatibility with tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus Perez committed Jun 25, 2014
1 parent 05643b7 commit 3ee8084
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: java
jdk:
- openjdk7
- openjdk6
before_install:
- python travis.py --mirrors;

Expand Down
85 changes: 37 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# FI-WARE SDC [![Build Status](https://travis-ci.org/telefonicaid/fiware-sdc.svg)](https://travis-ci.org/telefonicaid/fiware-sdc) [![Coverage Status](https://coveralls.io/repos/jesuspg/fiware-sdc/badge.png)](https://coveralls.io/r/jesuspg/fiware-sdc)
# FI-WARE SDC [![Build Status](https://travis-ci.org/telefonicaid/fiware-sdc.svg)](https://travis-ci.org/telefonicaid/fiware-sdc) [![Coverage Status](https://coveralls.io/repos/jesuspg/fiware-sdc/badge.png)](https://coveralls.io/r/jesuspg/fiware-sdc) [![help stackoverflow](http://b.repl.ca/v1/help-stackoverflow-orange.png)](http://www.stackoverflow.com)


## Software Deployment and Configuration



###SDC Build and Installation
###SDC Installation

This guide tries to define the procedure to build and install the SDC in a machine, including its requirements and possible troubleshooting that we could find during the installation. We have to talk about two nodes, one including the core functionality of the enabler itself and the other one which allocated the chef server.
This guide tries to define the procedure to install the SDC in a machine, including its requirements and possible troubleshooting that we could find during the installation. We have to talk about two nodes, one including the core functionality of the enabler itself and the other one which allocated the chef server.

### Requirements

Expand All @@ -16,36 +17,10 @@ In order to execute the SDC, it is needed to have previously installed the follo
* Chef server [http://wiki.opscode.com/display/chef/Installing+Chef+Server]. For CentOS it is possible to follow the following instructions[http://blog.frameos.org/2011/05/19/installing-chef-server-0-10-in-rhel-6-scientificlinux-6/]

* SDC node
* open jdk 7
* Tomcat 7.X.X [http://tomcat.apache.org/download-70.cgi]
* PostgreSQL [http://www.postgresql.org/]
* Webdav


### Building instructions
It is a a maven application:

- Compile, launch test and build all modules

$ mvn clean install
- Create a zip with distribution in target/sdc-server-dist.zip

$ mvn assembly:assembly -DskipTests

- You can generate a rpm o debian packages (using profiles in pom)

for debian/ubuntu:

$ mvn install -Pdebian -DskipTests
(created target/sdc-server-XXXXX.deb)

for centOS:

$ mvn package -P rpm -DskipTests
(created target/rpm/sdc/RPMS/noarch/fiware-sdc-XXXX.noarch.rpm)


## Installation instructions
### Chef server
#### Chef server Installation
The installation of the chef-server involves to install the chef-server package, which can be obtained in [http://www.getchef.com/chef/install/]. We can just execute
Expand Down Expand Up @@ -133,6 +108,29 @@ Then we need to create the database tables for the sdc. To do that obtain the fi
psql -d sdc -a -f db-initial.sql
psql -d sdc -a -f db-changelog.sql

### Apache Tomcat configuration

#### Install Tomcat 7
Install Tomcat 7 together with standard Tomcat samples, documentation, and management web apps:

yum install tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps

Start/Stop/Restart Tomcat 7 as a service:

sudo service tomcat7 start

stop:

sudo service tomcat7 stop

restart:

sudo service tomcat7 restart

Add Tomcat 7 service to the autostart

sudo chkconfig tomcat7 on


#### Install and configure WebDav

Expand Down Expand Up @@ -186,7 +184,7 @@ After, we introduce the WebDAV section into the Virtual host:
# But we apply different settings
<Location /webdav>
Dav on
AuthType Basic
AuthType Basic
AuthName "SDC Server Webdav"
AuthUserFile /etc/apache2/passwd/passwords
Require user root
Expand All @@ -198,30 +196,21 @@ We reconfigure apache and reload it

In order to test if the webdav has been configured in a good way, with a explorer go to http://{IP}/webdav/. Finally, create the directories product and application in the webdav. This directories will be visible trough the url: http://{IP}/webdav/product and http://{IP}/webdav/application

#### Configure SDC application
Once the prerequisites are satisfied, you change the context file. To do that, change sdc.xml found in distribution file and store it in folder $SDC_HOME/webapps/.
#### Install SDC applications
Once the prerequisites are satisfied, you shall create the context file. To do that, change sdc.xml found in distribution file and store it in folder $CATALINA_HOME/conf/Catalina/localhost.

See the snipet bellow to know how it works:


<New id="sdc" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/sdc</Arg>
<Arg>

<New class="org.postgresql.ds.PGSimpleDataSource">
<Set name="User"> <database user> </Set>
<Set name="Password"> <database password> </Set>
<Set name="DatabaseName"> <database name> </Set>
<Set name="ServerName"> <IP/hostname> </Set>
<Set name="PortNumber">5432</Set>
</New>

</Arg>
</New>

<Context path="/sdc" docBase="war path" reloadable="true" debug="5">
<Resource name="jdbc/sdc" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" <!-- select the driver-->
url="jdbc:postgresql://localhost:5432/sdc" <!-- select the connection url-->
username="postgres" password="postgres" <!-- select the user/password-->
maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>

You also have to add the provided scripts found in the dist file (in folder /opt/sdc/scripts/) in the same folder (or everywhere you want if you prefer to change the default configuration).

Include the library postgresql-8.4-702.jdbc4.jar in $CATALINA_HOME

#### Configure SDC application
The configuration of SDC is in configuration_properties table. There, it is required to configure:
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- This properties will be added to sonar as manual measures -->
<product.area.name>Industrial IoT</product.area.name>
<product.name>FIWARE</product.name>
<product.release>3.2.3</product.release>
<product.release>3.4.3</product.release>

<assembly-directory>target/distribution</assembly-directory>

Expand Down Expand Up @@ -76,7 +76,7 @@
<copyright.year>2012</copyright.year>
<junit.version>4.11</junit.version>
<jmock.version>2.5.1</jmock.version>
<jvm.version>1.7</jvm.version>
<jvm.version>1.6</jvm.version>
<maven-surefire-plugin.version>2.12.2</maven-surefire-plugin.version>

<logback.version>1.1.2</logback.version>
Expand Down Expand Up @@ -138,12 +138,12 @@
<dependency>
<groupId>com.telefonica.euro_iaas</groupId>
<artifactId>commons-dao</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.telefonica.euro_iaas</groupId>
<artifactId>commons-properties</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
26 changes: 13 additions & 13 deletions rest-api/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,52 @@

<appender name="sdcAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${jetty.base}/logs/sdc.log</file>
<file>${catalina.base}/logs/sdc.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${jetty.base}/logs/sdc.%d{yyyy-MM-dd}.gz</fileNamePattern>
<fileNamePattern>${catalina.base}/logs/sdc.%d{yyyy-MM-dd}.gz</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>time=%d{yyyy-MM-ddTHH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
<pattern>time=%d{yyyy-MM-dd HH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
</pattern>
</encoder>
</appender>

<appender name="puppetAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${jetty.base}/logs/puppet.log</file>
<file>${catalina.base}/logs/puppet.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${jetty.base}/logs/puppet.%d{yyyy-MM-dd}.gz</fileNamePattern>
<fileNamePattern>${catalina.base}/logs/puppet.%d{yyyy-MM-dd}.gz</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>time=%d{yyyy-MM-ddTHH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
<pattern>time=%d{yyyy-MM-dd HH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
</pattern>
</encoder>
</appender>

<appender name="chefAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${jetty.base}/logs/chef.log</file>
<file>${catalina.base}/logs/chef.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${jetty.base}/logs/chef.%d{yyyy-MM-dd}.gz</fileNamePattern>
<fileNamePattern>${catalina.base}/logs/chef.%d{yyyy-MM-dd}.gz</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>time=%d{yyyy-MM-ddTHH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
<pattern>time=%d{yyyy-MM-dd HH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
</pattern>
</encoder>
</appender>

<appender name="authentication"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${jetty.base}/logs/authentication.log</file>
<file>${catalina.base}/logs/authentication.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${jetty.base}/logs/authentication.%d{yyyy-MM-dd}.gz</fileNamePattern>
<fileNamePattern>${catalina.base}/logs/authentication.%d{yyyy-MM-dd}.gz</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>time=%d{yyyy-MM-ddTHH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
<pattern>time=%d{yyyy-MM-dd HH:mm:ss.SSS} | lvl=%-5p | trans=%X{txId} | comp=%C{1} | msg=%m%n
</pattern>
</encoder>
</appender>
Expand Down Expand Up @@ -91,7 +91,7 @@
</logger>

<root>
<level value="WARN"/>
<level value="DEBUG"/>
<appender-ref ref="sdcAppender"/>
</root>

Expand Down

0 comments on commit 3ee8084

Please sign in to comment.