Author

Topic: Apache HTTPD Configuration for Bitcoin JS Remote (Read 2022 times)

newbie
Activity: 10
Merit: 1
Dear friends, ... Bitcoin JS Remote wiki has been updated to clarify several Apache configurations tips.

Please, test and feedback:
https://en.bitcoin.it/wiki/Bitcoin-js-remote
sr. member
Activity: 337
Merit: 285
ProxyPass should be enough. RPC is only JSON.
newbie
Activity: 10
Merit: 1
@tcatm, you are right

Setting up RPC.url="bitcoind/" allows to configure Apache for multiple access. For instance, following Apache configuration

   AliasMatch   ^/jbc([0-9]?)(.*)$ your_prefer_pathabs_to_JSRemote_without_trailing_slash$2
   ProxyPass    /jbc/bitcoind/ http://localhost:8332/
   ProxyPass    /jbc1/bitcoind/ http://localhost:19331/
   ProxyPass    /jbc2/bitcoind/ http://localhost:19332/

allows following concurrent accesses:

   http://mydomain/jbc   .......... Access to a bitcoind listening the default rpc port (8332)
   http://mydomain/jbc1 .......... Access to another bitcoind listening a non-default rpc port (19331)
   http://mydomain/jbc2 .......... Access to another bitcoind listening a non-default rpc port (19332)

Another tip. Taking in account bitcoind talks only json (To-Be-Confirmed), ProxyPassReverse is not required.
sr. member
Activity: 337
Merit: 285
I think that's already possible. Try setting RPC.url to "bitcoind/" and it should append that to the path.
newbie
Activity: 10
Merit: 1
@tcatm
thanks for adding my contribution.

I would like to propose you a tiny convenience improvement for BC JS Remote.

I am setting up BC JS Remote to access several instances of bitcoind running in the same box; more specifically a testnet-in-a-box configuration:
http://sourceforge.net/projects/bitcoin/files/Bitcoin/testnet-in-a-box/

Using a fixed value for RPC.url in the settings.json file is a difficulty for multiple access, because there is no way to instruct Apache to proxy to/from every bitcoind instance.

My proposal is following behaviour; if the RPC.url field is undefined, it is automatically assigned to a value derived from the directory part of the URI. For instance,

Accessing with http://mydomain/jbc1 leads to a RPC.url value of "/jbc1/bitcoind/, and
accessing with http://mydomain/jbc2 leads to a RPC.url value of "/jbc2/bitcoind/

This allows us to setup different Proxy directives for the Apache webserver. For instance:
ProxyPass /jbc1/bitcoind/ http://localhost:19331/
ProxyPass /jbc2/bitcoind/ http://localhost:19332/

Is an interesting improvement for you?, could you code such a suggestion?

Also, I could pull a patch for BC JS Remote, my experience coding JS is limited but acceptable.
sr. member
Activity: 350
Merit: 252
probiwon.com
Yes, it is useful to understand how daemon can be used
sr. member
Activity: 337
Merit: 285
Great work! I'll add a link to the wiki on the project page.
newbie
Activity: 10
Merit: 1
Dear friends,
I have just added a short wiki fragment with the proper configuration to access remotely Bitcoin daemon using a browser.

Thanks for a great piece of code: Bitcoin JS Remote.

Please, test and feedback:
https://en.bitcoin.it/wiki/Bitcoin-js-remote

Jump to: