Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Thursday, July 20, 2017

How to hide your application name using nginx proxy_pass directive

For the showcase purpose I will be using the store application which resides inside WSO2 API Manager 2.1.0

Following are API Manager specific configs which needs to be done.

1. Set proxyPort attribute for connector configs resides in <AM_HOME>/repository/conf/tomcat/catalina-server.xml file.

        <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
                   port="9763"
                   redirectPort="9443"
                   proxyPort="80"
                   bindOnInit="false"
                   maxHttpHeaderSize="8192"

         />

        <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
                   port="9443"
                   proxyPort="443"
                   bindOnInit="false"
                   sslProtocol="TLS"
                   maxHttpHeaderSize="8192"
          />

Note that I have removed some attributes for brevity.

2. Update reverseProxy configuration resides inside <AM_HOME>/repository/deployment/server/jaggeryapps/store/site/conf/site.json

    "reverseProxy" : {
        "enabled" : true, 

        "host" : "localhost",
        "context":"",
    }

After above changes start/restart the AM node.


Now the Nginx configuration,

Make sure to generate and store SSL certificate and the key within /etc/nginx/ssl directory.

For the explanation purpose I will be having two server blocks, which can be consolidated to a one.

server{
    listen 80;
    server_name localhost;
    location / {
            proxy_pass http://localhost:9763/store/;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP      $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            include /etc/nginx/proxy_params;
            proxy_cookie_path ~*^/.* /;
    }
}
server{
    listen 443 ssl;
    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
    server_name localhost;
    location / {
            proxy_pass https://localhost:9443/store/;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP      $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            include /etc/nginx/proxy_params;
            proxy_cookie_path ~*^/.* /;
    }
}

After reloading the newly added config browse https://localhost or https://localhost,




Thursday, November 21, 2013

Deploy your own Enterprise Store [part 3]

I will discuss about few UI modifications you can do to make your own Music Store(or whatever) from what you have deployed, using WSO2 ES while following previous blog posts.You can find previous posts from [1] and [2].

At the moment we have our own mp3 asset type plus few other default asset types (gadget, site, e-book) in the ES.


First I'm going to hide all default asset types from the Store UI, there are number of ways to accomplish this task.

1. Get a fresh WSO2-ES pack and remove all default asset rxt's , asset types from store-tenant.json, publisher-tenant.json files while adding our new mp3 asset.

2. By modifying  /_system/config/store/configs/store.json in our registry. You can find this under Resources > Browse > _system > config >store > configs in our management console https://localhost:9443/admin/carbon/admin/login.jsp.

Under content menu you can update store.json with the following content by pressing Edit as text. We are going to remove all default asset types from the config.
{
  "assets": [
    "mp3"
  ],
  "assetsPageSize": 12,
  "commentsPageSize": 10,
  "userSpace": "\/_system\/governance\/users",
  "roles": {
    "Internal\/store": {
      "\/permission\/admin\/login": [
        "ui.execute"
      ]
    }
  },
  "userRoles": [
    "Internal\/store"
  ],
  "permissions": {
    "login": {
      "\/permission\/admin\/login": [
        "ui.execute"
      ]
    }
  },
  "paths": {
    "RXT_EXTENSION_PATH": "\/config\/ext\/"
  }
}
Just save it and browse our store http://localhost:9763/store/



You can update the icon-sprite.png resides under repository/deployment/server/jaggeryapps/store/extensions/assets/mp3/resources/  with a suitable one for our MP3 store.

Without writing a single line of code we can configure our simple digital asset store by using WSO2 ES :)

[1]. http://udarakr.blogspot.com/2013/11/deploy-your-own-enterprise-store-part-1.html
[2]. http://udarakr.blogspot.com/2013/11/deploy-your-own-enterprise-store-part-2.html

Wednesday, November 20, 2013

Deploy your own Enterprise Store [part 1]

Why enterprise store?

We are living in a digital-era where we create and use thousands of digital assets. There are number of tools around us to create assets, but very few resources we have to store, publish, maintain which bring immense value addition to our digital assets. This is the enterprise wide problem solved by the WSO2 Enterprise Store. Organize your assets at one place, access from everywhere !!

ES powered by two major apps, store and publisher. Lets talk about the publisher first. As the back office of the store, publisher is the platform which create, manage life-cycle and monitor statistics of assets. You can provision those published assets though the store front-end.

Lets dive in-to the ES world by running the product, first download the WSO2 ES product from here and unzip the product.You can find following directory structure inside the ES.

├── bin
├── dbscripts
├── INSTALL.txt
├── lib
├── LICENSE.txt
├── modules
├── README.txt
├── release-notes.html
├── repository
├── resources
├── tmp
└── webapp-mode
Here I'm working in a linux environment, you can follow official installation guide here if you are using/familiar with any other environment.

Navigate to the bin directory and start the server using following commands within your terminal window.
cd bin/
sh wso2server.sh 
Once the server started you can browse,

Store URL : http://localhost:9763/store
Publisher URL : http://localhost:9763/publisher
Mgt Console URL  : https://localhost:9443/admin/carbon/


Use the following default user credentials to login, or else you can create your own user.

username : admin
password : admin

By default ES 1.0.0 shipped with provision for gadgets, websites and eBooks, you can browse, search, download or bookmark, manage life-cycle, view stats of those default digital assets in this ES installation.

Few screen-shots from the ES 1.0.0.

Store home

Site-Asset home


Sample- FaceBook asset page

In the following screen-shot you can find out some interesting social features of the WSO2 ES such as commenting, rating and tagging of assets.



Store-My items page

This is where you can see all assets that you have either download or bookmark from the store.


Publisher home

Asset Statistics

This is where you one can get a insight of his/her assets.
Number of bookmarks/downloads per asset, number of bookmarks/downloads during given period of time etc.


Asset Life-cycle management

Add new asset(gadget asset type)

Lets talk about how to install your own digital asset(rather than using gadgets,sites and e-books) in coming blog post.

If you wish to contribute to the WSO2 Enterprise-Store Product, yes its on github. You can clone ES from here and play/contribute with/to the source.