Monday, August 21, 2006

Starting Webrick on a different port

Often you may need to start webrick on a different port. Luckily, you can do so using the -p options.

[root@srv31 ror]# ruby script/server -p 9191
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:9191
=> Ctrl-C to shutdown server; call with --help for options
[2006-08-21 13:45:37] INFO WEBrick 1.3.1
[2006-08-21 13:45:37] INFO ruby 1.8.4 (2005-12-24) [i686-linux]
[2006-08-21 13:45:37] INFO WEBrick::HTTPServer#start: pid=4812 port=9191


For more help options use the --help option:

[root@srv31 ror]# ruby script/server --help
=> Booting WEBrick...
Usage: ruby server [options]

-p, --port=port Runs Rails on the specified port.
Default: 3000
-b, --binding=ip Binds Rails to the specified ip.
Default: 0.0.0.0
-e, --environment=name Specifies the environment to run this server under (test/development/production).
Default: development
-m, --mime-types=filename Specifies an Apache style mime.types configuration file to be used for mime types
Default: none
-d, --daemon Make Rails run as a Daemon (only works if fork is available -- meaning on *nix).
-c, --charset=charset Set default charset for output.
Default: UTF-8

-h, --help Show this help message.

8 Comments:

At 6:37 AM, Blogger animeworld said...

thanks!!!

this is very interesting!

 
At 6:15 PM, Blogger Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa

 
At 10:32 PM, Blogger Christeddy said...

How to run ruby server with use many port ?
For example, i want to run ruby server on port 3001-3010. Thank you.

 
At 10:29 AM, Blogger David said...

Christeddy, you'll have to use a firewall to do that. If you're on Linux, you can use an iptables NAT redirection to pull that off fairly easily.

 
At 11:27 PM, Blogger atin said...

thanx

 
At 11:27 PM, Blogger atin said...

thanx

 
At 8:53 AM, Blogger kik13 said...

what is the syntax for multiple options?

 
At 3:49 AM, Blogger benslin kard said...

Easy to set up web alternatives using
Ruby on Rails as it works well with broad range of web servers and directories that apply CGI or Fast SGI.

 

Post a Comment

<< Home

eXTReMe Tracker