LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2006, 03:04 PM   #1
nephish
Member
 
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 nephishrails.com and set my ip up at zoneedit. Would i put my ip plus my port number ? xxx.xxx.xxx.xxx:3000
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, 06:22 AM   #2
penguintutor
Member
 
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
Redirect http://mysite.com:3000

or if you want a specific directory to redirect you could use:
Redirect /ruby http://mysite.com:3000

You could setup more complex rules using RedirectMatch directives http://httpd.apache.org/docs/2.0/mod/mod_alias.html
or mod_rewrite for the ultimate flexibility http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

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, 07:39 AM   #3
nephish
Member
 
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, 12:55 AM   #4
NSWKim
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, 06:37 AM   #5
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

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


Reply



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 09:53 PM
HOWTO put Ruby on Rails on your Slackware box Marsanghas Slackware 2 04-16-2005 04:13 PM
How many distros do you run on your box? kodon General 8 09-24-2004 01: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 12:03 AM
Linux box calling a batch script on a windows box to run? Is it possible? joelhop Programming 8 05-17-2004 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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