Introduction
Once you have created your project, you can start adapting it to your own needs and requirements.
Deployment directory
Currently, Syncope needs two base directories to be defined:
- bundles - where ConnId bundles are stored (check what a connector bundle is);
- log - where all system logs are written.
For example, you can create directories as follows:
$ mkdir /opt/syncope $ mkdir /opt/syncope/bundles $ mkdir /opt/syncope/log
Internal storage
Internal storage is a database where all information and configurations are stored.
You may want to setup some default content to be loaded on internal storage upon schema creation: for this you need to edit
core/src/main/resources/content.xml
.
Please note that Syncope core will populate internal storage with provided content only if the corresponding database is empty, i.e. does not contain any table or view.
Depending on your DBMS, you will need to change your project setup accordingly; modify the content of
core/src/main/resources/persistence.properties
as indicated in the following.
PostgreSQL
jpa.driverClassName=org.postgresql.Driver jpa.url=jdbc:postgresql://localhost:5432/syncope jpa.username=syncope jpa.password=syncope jpa.dialect=org.hibernate.dialect.PostgreSQLDialect dbUnitDataTypeFactory=org.dbunit.ext.postgresql.PostgresqlDataTypeFactory quartz.jobstore=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate quartz.sql=tables_postgres.sql
This assumes that you have a PostgreSQL instance running on localhost, listening on its default port 5432 with a database
syncope
fully accessible by user
syncope
with password
syncope
.
MySQL
jpa.driverClassName=com.mysql.jdbc.Driver jpa.url=jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8 jpa.username=syncope jpa.password=syncope jpa.dialect=org.hibernate.dialect.MySQL5InnoDBDialect dbUnitDataTypeFactory=org.dbunit.ext.mysql.MySqlDataTypeFactory quartz.jobstore=org.quartz.impl.jdbcjobstore.StdJDBCDelegate quartz.sql=tables_mysql_innodb.sql
This assumes that you have a MySQL instance running on localhost, listening on its default port 3306 with a database
syncope
fully accessible by user
syncope
with password
syncope
.
Oracle
jpa.driverClassName=oracle.jdbc.driver.OracleDriver jpa.url=jdbc:oracle:thin:@localhost:1521:orcl jpa.username=syncope jpa.password=syncope jpa.dialect=org.hibernate.dialect.Oracle10gDialect dbUnitDataTypeFactory=org.dbunit.ext.oracle.Oracle10DataTypeFactory quartz.jobstore=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate quartz.sql=tables_oracle.sql database.schema=SYNCOPE
This assumes that you have an Oracle instance running on localhost, listening on its default port 1521 with a database
syncope
under tablespace
SYNCOPE
fully accessible by user
syncope
with password
syncope
.
You will also need to
- create directory
core/src/main/resources/META-INF
- download Oracle mapping file, rename it to
and copy it under the directory created above
orm.xml
JEE container
Apache Tomcat 7
This assumes that you have got Apache Tomcat 7 installed in directory
$CATALINA_HOME
.
setenv.sh
Create
$CATALINA_HOME/bin/setenv.sh
with content (keep everything on a single line).
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server \ -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m \ -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
context.xml
Uncomment
<Manager pathname="" />
in
$CATALINA_HOME/conf/context.xml
.
Optionally, define a datasource for internal storage (following example is for MySQL): please check that the connection parameters are same configure above.
Syncope, when not finding a datasource called
jdbc/syncopeDataSource
, will connect to internal storage by instantiating a new connection upon request: this is of course strongly discouraged for any production environment.
<Resource name="jdbc/syncopeDataSource" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true" testOnBorrow="true" testOnReturn="true" validationQuery="SELECT 1" validationInterval="30000" maxActive="50" minIdle="2" maxWait="10000" initialSize="2" removeAbandonedTimeout="10" removeAbandoned="true" logAbandoned="true" suspectTimeout="10" timeBetweenEvictionRunsMillis="5000" minEvictableIdleTimeMillis="5000" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" username="syncope" password="syncope" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8"/>
Be sure to put the JDBC driver JAR file under
$CATALINA_HOME/lib
for the Datasource you have defined above.
Other setup tasks
Uncomment element
<resource-ref ... />
in
core/src/main/webapp/WEB-INF/web.xml
, if you have defined a datasource.
Modify
console/src/main/resources/configuration.properties
so that
baseURL
reflects the hostname and port number where your JEE container is running and the URL context where Syncope core will be deployed.
For example, when running Apache Tomcat 7 and having
1.0-SNAPSHOT
as project version (as created by Maven archetype), you should set
baseURL
to http://localhost:9080/syncope-1.0-SNAPSHOT/rest/.
Build and deploy
Assuming that you have created the two deployment directories defined above, just run
mvn clean package -Dbundles.directory=/opt/syncope/bundles -Dlog.directory=/opt/syncope/log
At this point you can deploy
core/target/syncope-$PROJECT-VERSION.war
and
console/target/syncope-console-$PROJECT-VERSION.war
(where $PROJECT-VERSION is project version as created by Maven archetype) to your JEE container.
Test your deploy
- Point your favorite browser to administration console at
http://localhost:8080/syncope-console-$PROJECT-VERSION/
- Login as 'admin' / 'password'