# How to use Webrick server

**URL:** <https://www.ruby-forum.com/t/how-to-use-webrick-server/73558>\
**Category:** Rails\
**Created:** [October 25, 2006, 9:38am UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558 "2006-10-25T09:38:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 9:38am UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/1 "2006-10-25T09:38:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 10:01am UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/2 "2006-10-25T10:01:34Z")

</div>

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](http://localhost:3000), i want to access  
> [http://www.domain.com](http://www.domain.com).  
> How can i achieve this using Webrick Server ?

---

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 10:49am UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/3 "2006-10-25T10:49:46Z")

</div>

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

I need to specify it by [http://appname](http://appname) (or) [http://www.appname.com](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.

---

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 1:06pm UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/4 "2006-10-25T13:06:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 5:24pm UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/5 "2006-10-25T17:24:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![senthilkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@senthilkumar](https://www.ruby-forum.com/u/senthilkumar)\
**Post date:** [October 25, 2006, 12:43pm UTC](https://www.ruby-forum.com/t/how-to-use-webrick-server/73558/6 "2006-10-25T12:43:22Z")

</div>

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
