Skip to main content

Configure PostgreSQL 9.3 with WSO2 Identity server 5.1.0

I'm going to show you configuration steps to use PostgresSQL with WSO2 Identity server 5.1.0.

Step 1 :- install postgresql 9.3 using below command. When you are installing this, you may have to give special permissions for /var/lib/cache directory. 



sudo apt-get update




sudo apt-get install postgresql


When you are giving permission, Do not use below command to give permission for /var/ directory. because it will override the super user and you may have to re install linux.



sudo chmod 777 -R /var/lib/sudo/


Step 2 :- start postgresql server with below command



sudo /etc/init.d/postgresql start



download Create a database and the login role from a GUI using the PGAdminIII tool.


Start PGAdminIII tool using below command. 



sudo ./postgresql-9.3.10-3-linux-x64.run



Step 3 :- 
Create a database 'gregdb' and add a new user Login Role('postgres', 'postgres')

click OK

Step 4 :- 

Download the PostgreSQL JDBC4 driver and put it in to the <PRODUCT_HOME>/repository/components/lib directory.


Step 5 :- 

Change the default data source in <PRODUCT_HOME>/repository/conf/datasources/master-datasources.xml file as below

<datasource>
      <name>WSO2_CARBON_DB</name>
      <description>The datasource used for registry and user manager</description>
      <jndiConfig>
            <name>jdbc/WSO2CarbonDB</name>
      </jndiConfig>
      <definition type="RDBMS">
            <configuration>
                <url>jdbc:postgresql://localhost:5433/gregdb</url>
                <username>regadmin</username>
                <password>regadmin</password>
                <driverClassName>org.postgresql.Driver</driverClassName>
                <maxActive>80</maxActive>
                <maxWait>60000</maxWait>
                <minIdle>5</minIdle>
                <testOnBorrow>true</testOnBorrow>
                <defaultAutoCommit>false</defaultAutoCommit>
                <validationInterval>30000</validationInterval>
           </configuration>
       </definition>
</datasource>
asource>


Step 6 :- Start the server with below command.It will create database tables automatically

For Windows: <IS_HOME>/bin/wso2server.bat -Dsetup
For Linux: <IS_HOME>/bin/wso2server.sh -Dsetup


Server will be start without any problem. If you want to use Postgresql in terminal, use below command.




sudo psql -h localhost -p 5433 -U userName dbName





Comments

Popular posts from this blog

Reverse Proxy configuration with WSO2 Identity Server 5.0.0

Reverse proxy is a type of a proxy which can hide back end servers from the client applications. According to the above figure, Original servers are not exposed to the internet. Only reverse proxy is exposed to the internet.Client knows only the reverse proxy IP address. So he thinks that he is sending a request to the reverse proxy.He doesn't know anything about the original server. You can avoid some attacks using this architecture. Today I'm going to configure Apache HTTPD server(reverse proxy) and WSO2 identity server 5.0. Please download WSO2 identity server 5.0 from here You can install apache httpd server using below commands sudo apt - get update sudo apt - get install apache2 Restart the newly install apache server sudo service apache2 restart Apache is a modular server. This implies that only the most basic functionality is included in the core server.So You have to enable few other required features. Please use below command ...

Essential Debug Logs for WSO2 Identity Server

Essential Debug loggers for WSO2 Identity Server  When you are working with WSO2 products, you have to enable debug logs to investigate issues. Its better to enable debug logs only for particular module that you need to investigate. It reduce debug writing time and unnecessary debug reading time.So you can easily understand the root cause when you are reading the console.I'm going to discuss about debug lines one by one. You have to add debug line to [WSO2_HOME]\repository\conf\log4j.properties file, all debug lines are displayed in the console and write to the wso2carbon.log file. To enable loggers for user core.This is helpful to investigate user related issues. log4j.logger.org.wso2.carbon.user.core=DEBUG      To enable debug logs for identity module. This debug log will be helpful to investigate identity related issues. log4j.logger.org.wso2.carbon.identity=DEBUG If you need to investigate saml assertion or assertion related issue, you ca...

Test SOAP Client and REST Service in WSO2 ESB

Wso2 ESB can convert anything to anything. Today I'm going to explain the below scenario. Scenario :-  1. Soap client send a request to ESB with soap header. 2. ESB remove soap header and invoke the REST service which only accept XML format. 3. REST service generate a response in xml format 4. ESB adding soap headers to response and send back to SOAP client. As an example REST service, I'm going to use  jaxrs_basic  service in WSO2 Application server. Download wso2 application server from this link Step 1 :-            Change the offset value in carbon.xml file which is located in <AS_HOME>/repository/conf directory.                 If you started WSO2 ESB in offset "0" set offset in application server as "1"   <Offset>1</Offset>                Start wso2 application server Step 2 :-        ...