syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Syncope > Run Syncope in real environments
Date Wed, 18 Apr 2012 09:10:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/3/_/styles/combined.css?spaceKey=SYNCOPE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments">Run
Syncope in real environments</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~coheigea@apache.org">Colm
O hEigeartaigh</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >At this point you can deploy <span
class="diff-changed-words">{code}core/target/syncope<span class="diff-added-chars"style="background-color:
#dfd;">.</span>war{code}</span> and {code}console/target/syncope-console.war{code}
to your JEE container. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Test your deploy <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
div.rbtoc1334740159969 {margin-left: 1.5em;padding: 0px;}
div.rbtoc1334740159969 ul {list-style: decimal;margin-left: 0px;}
div.rbtoc1334740159969 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1334740159969'>
<ul>
    <li><a href='#RunSyncopeinrealenvironments-Introduction'>Introduction</a></li>
    <li><a href='#RunSyncopeinrealenvironments-Deploymentdirectory'>Deployment
directory</a></li>
    <li><a href='#RunSyncopeinrealenvironments-Internalstorage'>Internal storage</a></li>
<ul>
    <li><a href='#RunSyncopeinrealenvironments-PostgreSQL'>PostgreSQL</a></li>
    <li><a href='#RunSyncopeinrealenvironments-MySQL'>MySQL</a></li>
    <li><a href='#RunSyncopeinrealenvironments-Oracle'>Oracle</a></li>
</ul>
    <li><a href='#RunSyncopeinrealenvironments-JEEcontainer'>JEE container</a></li>
<ul>
    <li><a href='#RunSyncopeinrealenvironments-ApacheTomcat7'>Apache Tomcat 7</a></li>
<ul>
    <li><a href='#RunSyncopeinrealenvironments-setenv.sh'>setenv.sh</a></li>
    <li><a href='#RunSyncopeinrealenvironments-context.xml'>context.xml</a></li>
</ul>
</ul>
    <li><a href='#RunSyncopeinrealenvironments-Othersetuptasks'>Other setup tasks</a></li>
    <li><a href='#RunSyncopeinrealenvironments-Buildanddeploy'>Build and deploy</a></li>
    <li><a href='#RunSyncopeinrealenvironments-Testyourdeploy'>Test your deploy</a></li>
</ul></div>
<h1><a name="RunSyncopeinrealenvironments-Introduction"></a>Introduction</h1>

<p>Once you have <a href="/confluence/display/SYNCOPE/Create+a+new+Syncope+project"
title="Create a new Syncope project">created your project</a>, you can start adapting
it to your own needs and requirements.</p>

<h1><a name="RunSyncopeinrealenvironments-Deploymentdirectory"></a>Deployment
directory</h1>

<p>Currently, Syncope needs two base directories to be defined:</p>
<ul>
	<li><em>bundles</em> &#45; where ConnId bundles are stored (check what
a <a href="/confluence/display/SYNCOPE/Connectors+and+resources" title="Connectors and
resources">connector bundle</a> is);</li>
	<li><em>log</em> &#45; where all system logs are written.</li>
</ul>


<p>For example, you can create directories as follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
$ mkdir /opt/syncope
$ mkdir /opt/syncope/bundles
$ mkdir /opt/syncope/log
</pre>
</div></div>

<h1><a name="RunSyncopeinrealenvironments-Internalstorage"></a>Internal
storage</h1>

<p>Internal storage is a database where all information and configurations are stored.</p>

<p>You may want to setup some default content to be loaded on internal storage upon
schema creation: for this you need to edit </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">core/src/main/resources/content.xml</pre>
</div></div>
<p>.</p>

<p><b><em>Please note</em></b> <em>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.</em></p>

<p>Depending on your DBMS, you will need to change your project setup accordingly; modify
the content of </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">core/src/main/resources/persistence.properties</pre>
</div></div>
<p> as indicated in the following.</p>

<h2><a name="RunSyncopeinrealenvironments-PostgreSQL"></a>PostgreSQL</h2>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
jpa.driverClassName=org.postgresql.Driver
jpa.url=jdbc:postgresql:<span class="code-comment">//localhost:5432/syncope
</span>jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.PostgresDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
quartz.sql=tables_postgres.sql
logback.sql=postgresql.sql
</pre>
</div></div>

<p>This assumes that you have a PostgreSQL instance running on localhost, listening
on its default port 5432 with a database </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> fully accessible by user </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> with password </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p>.</p>

<h2><a name="RunSyncopeinrealenvironments-MySQL"></a>MySQL</h2>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
jpa.driverClassName=com.mysql.jdbc.Driver
jpa.url=jdbc:mysql:<span class="code-comment">//localhost:3306/syncope?characterEncoding=UTF-8
</span>jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.MySQLDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
quartz.sql=tables_mysql_innodb.sql
logback.sql=mysql.sql
</pre>
</div></div>

<p>This assumes that you have a MySQL instance running on localhost, listening on its
default port 3306 with a database </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> fully accessible by user </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> with password </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p>.</p>

<h2><a name="RunSyncopeinrealenvironments-Oracle"></a>Oracle</h2>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
jpa.driverClassName=oracle.jdbc.OracleDriver
jpa.url=jdbc:oracle:thin:@localhost:1521:orcl
jpa.username=syncope
jpa.password=syncope
jpa.dialect=org.apache.openjpa.jdbc.sql.OracleDictionary
quartz.jobstore=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
quartz.sql=tables_oracle.sql
logback.sql=oracle.sql
</pre>
</div></div>

<p>This assumes that you have an Oracle instance running on localhost, listening on
its default port 1521 with a database </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> under tablespace </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">SYNCOPE</pre>
</div></div>
<p> fully accessible by user </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p> with password </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">syncope</pre>
</div></div>
<p>.</p>

<p>You will also need to</p>
<ol>
	<li>create directory 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">core/src/main/resources/META-INF</pre>
</div></div></li>
	<li>download <a href="https://svn.us.apache.org/repos/asf/incubator/syncope/trunk/core/src/main/resources/META-INF/orm.xml.oracle"
class="external-link" rel="nofollow">Oracle mapping file</a>, rename it to 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">orm.xml</pre>
</div></div>
<p> and copy it under the directory created above</p></li>
</ol>


<h1><a name="RunSyncopeinrealenvironments-JEEcontainer"></a>JEE container</h1>


<h2><a name="RunSyncopeinrealenvironments-ApacheTomcat7"></a>Apache Tomcat
7</h2>

<p>This assumes that you have got Apache Tomcat 7 installed in directory </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$CATALINA_HOME</pre>
</div></div>
<p>.</p>

<h3><a name="RunSyncopeinrealenvironments-setenv.sh"></a>setenv.sh</h3>

<p>Create </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$CATALINA_HOME/bin/setenv.sh</pre>
</div></div>
<p> with content (keep everything on a single line).</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">JAVA_OPTS="-Djava.awt.headless=<span class="code-keyword">true</span>
-Dfile.encoding=UTF-8 -server \
-Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m \
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"</pre>
</div></div>

<h3><a name="RunSyncopeinrealenvironments-context.xml"></a>context.xml</h3>

<p>Uncomment </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;Manager pathname="" /&gt;</pre>
</div></div>
<p> in </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$CATALINA_HOME/conf/context.xml</pre>
</div></div>
<p>.</p>

<p>Optionally, define a datasource for internal storage (following example is for MySQL):
please check that the connection parameters are same configure above.</p>

<p>Syncope, when not finding a datasource called </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">jdbc/syncopeDataSource</pre>
</div></div>
<p>, will connect to internal storage by instantiating a new connection upon request:
this is of course <b>strongly discouraged</b> for any production environment.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;Resource name=<span class="code-quote">"jdbc/syncopeDataSource"</span>
auth=<span class="code-quote">"Container"</span> type=<span class="code-quote">"javax.sql.DataSource"</span>
          factory=<span class="code-quote">"org.apache.tomcat.jdbc.pool.DataSourceFactory"</span>
testWhileIdle=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
          testOnBorrow=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
testOnReturn=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
validationQuery=<span class="code-quote">"SELECT 1"</span> validationInterval=<span
class="code-quote">"30000"</span>
          maxActive=<span class="code-quote">"50"</span> minIdle=<span class="code-quote">"2"</span>
maxWait=<span class="code-quote">"10000"</span> initialSize=<span class="code-quote">"2"</span>
removeAbandonedTimeout=<span class="code-quote">"10"</span>
          removeAbandoned=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
logAbandoned=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
suspectTimeout=<span class="code-quote">"10"</span>
          timeBetweenEvictionRunsMillis=<span class="code-quote">"5000"</span>
minEvictableIdleTimeMillis=<span class="code-quote">"5000"</span>
          jdbcInterceptors=<span class="code-quote">"org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"</span>
          username=<span class="code-quote">"syncope"</span> password=<span
class="code-quote">"syncope"</span> driverClassName=<span class="code-quote">"com.mysql.jdbc.Driver"</span>
          url=<span class="code-quote">"jdbc:mysql:<span class="code-comment">//localhost:3306/syncope?characterEncoding=UTF-8"</span>/&gt;</span>
</pre>
</div></div>

<p>Be sure to put the JDBC driver JAR file under </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$CATALINA_HOME/lib</pre>
</div></div>
<p> for the Datasource you have defined above.</p>

<h1><a name="RunSyncopeinrealenvironments-Othersetuptasks"></a>Other setup
tasks</h1>

<p>Uncomment element </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;resource-ref ... /&gt;</pre>
</div></div>
<p> in </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">core/src/main/webapp/WEB-INF/web.xml</pre>
</div></div>
<p>, if you have defined a datasource.</p>

<p>Modify </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">console/src/main/resources/configuration.properties</pre>
</div></div>
<p> so that </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">baseURL</pre>
</div></div>
<p> reflects the hostname and port number where your JEE container is running and the
URL context where Syncope core will be deployed.</p>

<p>For example, when running Apache Tomcat 7 and having </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">1.0-SNAPSHOT</pre>
</div></div>
<p> as project version (as created by Maven archetype), you should set </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">baseURL</pre>
</div></div>
<p> to <a href="http://localhost:9080/syncope-1.0-SNAPSHOT/rest/" class="external-link"
rel="nofollow">http://localhost:9080/syncope-1.0-SNAPSHOT/rest/</a>.</p>

<h1><a name="RunSyncopeinrealenvironments-Buildanddeploy"></a>Build and
deploy</h1>

<p>Assuming that you have created the two deployment directories defined above, just
run</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn clean <span class="code-keyword">package</span> -Dbundles.directory=/opt/syncope/bundles
-Dlog.directory=/opt/syncope/log
</pre>
</div></div>

<p>At this point you can deploy </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">core/target/syncope.war</pre>
</div></div>
<p> and </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">console/target/syncope-console.war</pre>
</div></div>
<p> to your JEE container.</p>

<h1><a name="RunSyncopeinrealenvironments-Testyourdeploy"></a>Test your
deploy</h1>

<ol>
	<li>Point your favorite browser to administration console at 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//localhost:8080/syncope-console/</span></pre>
</div></div></li>
	<li>Login as 'admin' / 'password'</li>
</ol>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27841547&revisedVersion=13&originalVersion=12">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message