0

Just for clarity, I already posted this on StackOverflow and got advice that this better fits in ServerFault.com so here goes:

I know you can redirect subdomains to a different server, but can you do the same with folders?

Say I have example.com. I can redirect mysubdomain.example.com to a different server, but can I redirect example.com/mysubdomain to a different server? I'd like to host a rails app in that folder on a site that runs php while still maintaining good search engines ratings (by not creating a sub domain which in my experience in recognized as a different site).

Any help?

Thanks!

yuval
  • 157
  • 1
  • 2
  • 5

4 Answers4

1

Take a look at Passenger: it's a module for Apache that allows you to run RoR apps within Apache. A bit further down in the Apache sub-section of [this][1] Ubuntu/RoR docs, it mentions creating a simlink to your RoR directory from your sub-directory in Apache, etc.

[1]: https://help.ubuntu.com/community/RubyOnRails#Configure the server

Edit: actually, straight from the horse's mouth: http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri

gravyface
  • 13,957
  • 19
  • 68
  • 100
0

Couldn't you keep those files on something like an NFS share and just export that share to be mounted the server that you want to read it?

MDMarra
  • 100,734
  • 32
  • 197
  • 329
  • i'd like to host an application using rubyonrails in example.com/myapp while example.com is using php as it's main langugae – yuval Mar 09 '10 at 00:47
0

Effectively what you want to do is have the subdirectory address act as a proxy.

This is most commonly seen if you're setting up an anonymizer or redirector script, so looking for existing scripts designed for that use may give you a good open source basis to start from. You may run into some issues with doing this (SSL security issues with man-in-the-middle, etc.) but working from the existing setups will probably get you most of the way to where you want to go.

You may also be able to use this same setup (or look at existing scripts providing) authenticated access to internal servers - connecting to https://example.com/secure/whicheverapp encrypts everything to your gateway proxy server which then passes traffic off inside your hopefully-secure internal network.

fencepost
  • 972
  • 6
  • 10
0

Should be no problem, you can either make an NFS share out of your folder or place a redirect/frame script in it, although that last option would off course not be a very search engine friendly one. Creating an NFS/SMB share (depending on which OS'es are used) should do the trick just fine.

Oldskool
  • 2,025
  • 1
  • 16
  • 27