How to use Webrick server

I am using Webrick to start my rails application.
Instead of using http://localhost:3000, i want to access
http://www.domain.com.
How can i achieve this using Webrick Server ?

You can specify the port number using the --port switch:
$ sudo ruby script/server --port=80
See --help for more options.

Senthilkumar Rajendran wrote:

I am using Webrick to start my rails application.
Instead of using http://localhost:3000, i want to access
http://www.domain.com.
How can i achieve this using Webrick Server ?

I didn’t want to change the port.
I am specifying the address http://localhost:portno (or)
http://0.0.0.0:portno (or) http://hostname:portno to start my
application using the browser.

I need to specify it by http://appname (or) http://www.appname.com
How is it possible ?

Gijs N. wrote:

You can specify the port number using the --port switch:
$ sudo ruby script/server --port=80
See --help for more options.

This for Apache server (httpd.conf)

ServerName www.example.com ServerAlias example.com DocumentRoot "/usr/example/" ServerName www.example2.com ServerAlias example2.com DocumentRoot "/usr/example2/"

I need the simillar for Webrick.

Frederick C. wrote:

You don’t need to change any thing at all on your computer. You need to
register that domain name from your preferred registrar and point that
domain name at the ip address that your server is using

Fred

Senthilkumar Rajendran wrote:

I didn’t want to change the port.

Regardless of how you set up WEBrick with a virtual host (no idea how
this is done, not a WEBrick user), you will need to change your port. I
don’t think you can ask a web browser to listen to anything other than
port 80 unless you specify it in your url, or use a proxy.

-Bryan

You don’t need to change any thing at all on your computer. You need to
register that domain name from your preferred registrar and point that
domain name at the ip address that your server is using

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs