Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
thank you very much! –  yuval Mar 10 '10 at 4:30
add comment

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?

share|improve this answer
    
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 9 '10 at 0:47
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.