Environment Variables

3 views
Skip to first unread message

RNHurt

unread,
Apr 7, 2010, 8:06:22 PM4/7/10
to WebROaR - Ruby Application Server
I need to pass environment variables to WebRoar in order for it to
work on my servers. Specifically, because my Rails applications are
built as Debian APT packages I have moved some things into a more LSB
friendly location.

Under Apache2 I do something like this in the VirtualHost section:

SetEnv RAILS_LOG /var/log/</my package>
SetEnv RAILS_ETC /etc/<my package>

How would I do this using WebRoar?

Thanx!
Richard

Dharmarth Shah

unread,
Apr 15, 2010, 6:37:10 AM4/15/10
to WebROaR - Ruby Application Server
Richard,

Thanks for trying WebROaR.

WebROaR does not support environment variable setting in the current
release. We are planning to give its support in future release. We
would update you as soon as its support is added.

Thanks,
Dharmarth

Dharmarth Shah

unread,
May 6, 2010, 7:44:31 AM5/6/10
to WebROaR - Ruby Application Server
Richard,

We have added support for passing environment variables to deployed
application. The changes are committed in the repository and would be
available in next release. At your option you can try edge version
anytime to checkout the feature. To install the edge version,

git clone git://github.com/webroar/webroar.git
cd webroar
sudo rake install

To pass the environment variables, you need to directly edit the
config.h file present in the conf directory of installed gem. You can
find the sample configuration in the same file itself.

I am also reproducing it here:

# 12) Environment Variable(optional)
# It defines environment variables which can be used in
the deployed application. It take following parameter.
# I) set_env(optional)(Value is key-value pair separated
by equal sign('=') e.g. LOG_DIR=/var/log/webroar)
# Order of the above elements does not matter.
# Base-uri 'admin-panel' is reserved for 'Admin Panel'.
# Either host_names or baseuri(not both) must present to
resolve HTTP request.
# Hostnames can have multiple values, each separated by spaces.
(e.g. host_names: server.com server.co.in)
# Hostnames can be defined using wildcard(*), but wildcard can
only be at start of name or at end of name (valid hostnames are (i)
*.server.com (ii) www.server.* (iii) *.server.*).
# Prefix Hostname with tilde(~), if wildcard is used in
defining Hostname. e.g. (i) ~*.server.com (ii) ~www.server.* (iii)
~*.server.*
# Example with baseuri:
# Application Specification:
# - name: Mephisto
# baseuri: /blog
# path: /home/smartuser/work/rails_workspace/mephisto
# type: rails
# run_as_user: smartuser
# analytics: enabled
# environment: production
# min_worker: 2
# max_worker: 5
# log_level: SEVERE
# Environment Variable:
# - set_env: LOG_DIR=/var/log/webroar
# - set_env: TMP_DIR=/tmp

We plan to allow the setting of these environment variables through
Admin Panel soon, so that user doesn't need to manually edit the
config file.

Thanks,
Dharmarth

Dharmarth Shah

unread,
May 8, 2010, 11:50:57 PM5/8/10
to WebROaR - Ruby Application Server
Richard,

Sorry for the typo error in the file name. I have referred 'config.h'
file, but actually the file name is 'config.yml'.

I have also changed the key name used for reading environment
variables. So the revised configuration would look like:
# environment_variables:
# - set_env: LOG_DIR=/var/log/webroar
# - set_env: TMP_DIR=/tmp

Earlier the key name was "Environment Variable", and now it becomes
"environment_variables".

Thanks,
Dharmarth

On May 6, 4:44 pm, Dharmarth Shah <dharmarth.s...@webroar.in> wrote:
> Richard,
>
> We have added support for passing environment variables to deployed
> application. The changes are committed in the repository and would be
> available in next release. At your option you can try edge version
> anytime to checkout the feature. To install the edge version,
>
> git clone git://github.com/webroar/webroar.git
> cd webroar
> sudo rake install
>
> To pass the environment variables, you need to directly edit the
> config.h file present in the conf directory of installed gem. You can
> find the sample configuration in the same file itself.
>
> I am also reproducing it here:
>
> #         12) Environment Variable(optional)
> #             It defines environment variables which can be used in
> the deployed application. It take following parameter.
> #               I) set_env(optional)(Value is key-value pair separated
> by equal sign('=') e.g. LOG_DIR=/var/log/webroar)
> #        Order of the above elements does not matter.
> #        Base-uri 'admin-panel' is reserved for 'Admin Panel'.
> #        Either host_names or baseuri(not both) must present to
> resolve HTTP request.
> #        Hostnames can have multiple values, each separated by spaces.
> (e.g. host_names: server.com server.co.in)
> #        Hostnames can be defined using wildcard(*), but wildcard can
> only be at start of name or at end of name (valid hostnames are (i)
> *.server.com (ii)www.server.*(iii) *.server.*).

Dharmarth Shah

unread,
Aug 10, 2010, 4:06:34 AM8/10/10
to Dharmarth Shah, web...@googlegroups.com
Richard,
We have recently released WebROaR v0.4.0, which supports passing of
environment variables to the deployed application. Please checkout the
release announcement for details:

http://webroar.in/blog/2010/8/9/webroar-v0-4-0-supports-static-assets-encoding-and-static-ruby-library

Thanks,
Dharmarth

On May 9, 8:50 am, Dharmarth Shah <dharmarth.s...@webroar.in> wrote:
> Richard,
>

> Sorry for the typo error in the file name. I have referred 'config.h'
> file, but actually the file name is 'config.yml'.
>
> I have also changed the key name used for reading environment
> variables. So the revised configuration would look like:
>
> #         12) Environment Variable(optional)
> #             It defines environment variables which can be used in
> the deployed application. It take following parameter.
> #               I) set_env(optional)(Value is key-value pair separated
> by equal sign('=') e.g. LOG_DIR=/var/log/webroar)
> #        Order of the above elements does not matter.
> #        Base-uri 'admin-panel' is reserved for 'Admin Panel'.
> #        Either host_names or baseuri(not both) must present to
> resolve HTTP request.
> #        Hostnames can have multiple values, each separated by spaces.
> (e.g. host_names: server.com server.co.in)
> #        Hostnames can be defined using wildcard(*), but wildcard can
> only be at start of name or at end of name (valid hostnames are (i)

Reply all
Reply to author
Forward
0 new messages