Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-17-2006, 04:04 PM   #1
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
can i run rails and apache on one box?

lo there all,
i am running apache2 on ubuntu-dapper. I am using virtual hosting w/ about 7 sites. All of these are php and html sites. Now i am wanting to do some testing and learning with ruby rails, but i don't want to mess up my main config or anything.

so, can i run rails on the same computer ? rails, by default runs on port 3000, how could i set something like that up with my dns ? i use zoneedit for dns right now. lets say i wanted a new domain for rails like and set my ip up at zoneedit. Would i put my ip plus my port number ?
or could i just serve it from a doc root like my other sites in /var/www/somewebsite/web_root. And would i configure apache the same way and serve the rails stuff on port 80 ?

lots of questions, i know, but i just wanted some tips or links to good docs if anyone has them or any experience with trying this out.

SO, if you have read this far, bless you, and thanks for your time.
Old 08-18-2006, 07:22 AM   #2
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
I don't use Ruby on Rails myself, but can give a few pointers

Ruby on Rails is designed to run alongside Apache so no problem installing on the same machine.

DNS only handles a hostname to IP address translation. The port number is not included in DNS. So you cannot change the port number using DNS.

You could use the Apache Redirect directive

For an entire virtual host just use

or if you want a specific directory to redirect you could use:
Redirect /ruby

You could setup more complex rules using RedirectMatch directives
or mod_rewrite for the ultimate flexibility

See the following guide to mod_rewrite (although it is based on directory names, not port numbers)
Apache mod_rewrite mini tutorial
Old 08-18-2006, 08:39 AM   #3
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Original Poster
Rep: Reputation: 30
Hey thanks for this.
i got a book for rails dev yesterday and this was the first thing i looked up.
Apparently i can run a rails app from an apache virtual host directory on port 80, so i would map it just like any other virt host that i have.
your info is handy though because at work i wanted to test out a php package and didn't want to use port 80 for that just yet.

so thanks for your time and help
Old 09-01-2006, 01:55 AM   #4
LQ Newbie
Registered: Jul 2006
Distribution: Ubuntu
Posts: 22

Rep: Reputation: 15
Hi Nephish,

We actually run RoR along with apache on our hosting servers. We use the FastCGI module to load it up. It's become pretty popular with hosting clients.
Old 09-01-2006, 07:37 AM   #5
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Original Poster
Rep: Reputation: 30
cool. thanks for this.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache (vhost) + ruby on rails = problems Jasmo *BSD 0 01-05-2006 10:53 PM
HOWTO put Ruby on Rails on your Slackware box Marsanghas Slackware 2 04-16-2005 05:13 PM
How many distros do you run on your box? kodon General 8 09-24-2004 02:36 PM
When running a script I get a box asking "Run or display ?" I want it to just run aaronruss Linux - Newbie 4 05-28-2004 01:03 AM
Linux box calling a batch script on a windows box to run? Is it possible? joelhop Programming 8 05-17-2004 05:49 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration