I have hacked a script that I found at http://www.koders.com/ruby into a
generalized webrick startup script. The script is attached to this post
and the help text is reproduced below. "script/server" runs webrick
on
port 3000 bound to 0.0.0.0. If that is too general then you can pass a
specific port using -p= or --port=. "script/server -s" runs webrick
in
ssl mode and generates a self-signed certificate. The other options are,
I hope, fairly self-explanatory.
script/server
Usage: ruby server [options]
With all defaults runs Webrick in standard http mode
listening on port 3000 for all configured addresses. If
-s | --sslmode then the server will start in https mode
on port 3000 and auto-generate a self-signed certificate.
If --sslauto=off then you must provide a server key
and certificate within the RAILS_ROOT.
-b, --binding=ip Binds Rails to the specified ip.
Default: 0.0.0.0 - listen on all
addresses
-c, --charset=charset Set default charset for output.
Default: UTF-8
-d, --daemon Make Rails run as a Daemon (only
works
if fork is available -- meaning on *nix).
-e, --environment=name Specifies the environment to run
this
server under (test/development/production).
Default: development
-h, --help Print this help text.
-m, --mime-types=filename Specifies an Apache style
mime.types
configuration file to be used for mime types
Default: none
-p, --port=port Runs Rails on the specified port.
Default: 3000
--sslcert=/path/to/certificate
For SSL (https) operation pass the
server
certificate file location relative to RAILS_ROOT.
default: /config/ssl/server.key
--sslkey=/path/to/key For SSL (https) operation pass the
server
key file location relative to RAILS_ROOT.
default: /config/ssl/server.key
-s, --sslmode Run server in SSL (https) mode.
--sslroot=/path/to/root_cert For SSL (https) operation pass the
Certificate Authority root file location relative to
RAILS_ROOT.
default:
/config/ssl/rails_root_ca.crt
--sslself=on|off Generate self-signed SSL
certificate.
Default: on
Attachments:
http://www.ruby-forum.com/attachment/286/server
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---