personium / setup-vagrant

Vagrantfile and ansible for setting up of personium.io
Apache License 2.0
4 stars 9 forks source link

Try Personium on your machine

These procedures set up a Personium Unit on 1VM using vagrant + ansible.

You can easily set up on your machine and try to explore the Personium APIs.

Confirmed environment

The setup procedures described here are tested in the following environment.

Environment Windows VirtualBox Vagrant Installation time
1 8.1 x64 RAM 8GB 5.2.8 2.1.0 7 hrs
2 10 x64 RAM 16GB 5.2.14 2.1.2 2 hrs

Setup procedures

Ok, let's start to set up Personium!

  1. Download and install VirtualBox. (Download page)

  2. Download and install Vagrant. (Download page)

  3. Clone this repository. (https://github.com/personium/setup-vagrant.git)
    * Please clone or download the zip file from the release branch.
    * Since the master branch may contain new features which are under testing and development, errorneous behavior may be expected.
    * If Japanese is included in the path of the git clone directory, vagrant up commnd will fail. Please do not include Japanese in the path.

    $ git clone https://github.com/personium/setup-vagrant.git
  4. Change to setup-vagrant directory under the local repository you cloned, and run vagrant up.
    * Depending on your network bandwidth and CPU power, this procedure may take at least 2 hours to complete.
    * Sometimes tomcat will failed to start because it takes more than 60 seconds. But tomcat is usually running, so please ignore the failure and go to the next step.
    * If your network is behind a proxy server, please configure the proxy settings for vagrant and Ansible before running vagrant up.
    How to Setting in proxy environment
    Make sure that port 443/tcp is not used on the PC and execute it.

    $ cd ./setup-vagrant
    $ vagrant up
  5. Add following to end of hosts file on your machine.(E.G: C:\Windows\System32\drivers\etc\hosts)

    127.0.0.1  personium.example.com

Confirm Personium

  1. Log in to the virtual server and check the information of personium administration account.

    $ vagrant ssh
    $ sudo su -
    # cat /root/ansible/unitadmin_account
    unitadmin {password}
    # exit
    $ exit
  2. Verify that your Personium Unit-Manager is up and running.

    1. Access the following URL from the browser.
         https://personium.example.com/app-uc-unit-manager/__/html/login.html
      * Please refer to the link for Unit-Manager.

    2. Enter the following on the login page and click the "sign in" button.

  3. Verify that your Personium is up and running.

    1. Execute the following command

      $ curl -X POST "https://personium.example.com/__ctl/Cell" \  
      -d "{\"Name\":\"sample\"}" -H "Authorization:Bearer example_master_token" \  
      -H "Accept:application/json" -i -sS -k

      * To execute the API on the virtual server, execute the command as follows.

      $ curl -X POST "https://personium.example.com/__ctl/Cell" \  
      -d "{\"Name\":\"sample\"}" -H "Authorization:Bearer example_master_token" \  
      -H "Accept:application/json" -i -sS -k
    2. If Personium works fine, 201 response is returned as below. a cell is successfully created!

      HTTP/1.1 201 Created
      Date: Mon, 26 Jan 2015 12:32:13 GMT
      Content-Type: application/json
      Transfer-Encoding: chunked
      Connection: keep-alive
      Access-Control-Allow-Origin: *
      DataServiceVersion: 2.0
      ETag: W/"1-1422275532964"
      Location: http://personium.example.com/__ctl/Cell('sample')
      X-Dc-Version: 1.3.20
      Server: PCS
      
      {"d":{"results":{"__metadata":{"uri":"http:\/\/personium.example.com\/__ctl\/Cell('sample')","etag":"W\/\"1-1422275532964\"","type":"UnitCtl.Cell"},"Name":"sample","__published":"\/Date(1422275532964)\/","__updated":"\/Date(1422275532964)\/"}}}

Information about the Personium Unit

If you follow the above procedures, your Personium Unit is constructed with the following specifications.

Personium Unit
OS and Middleware on VM