Koozali.org: home of the SME Server

Are virtual directories across iBays possible in SME?

Offline LANMonkey

  • ****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Are virtual directories across iBays possible in SME?
« on: April 26, 2014, 12:55:17 AM »
I'd like to be able to have a URL go to one iBay and a directory on the URL go to another.  For example, www.myurl.com goes to iBay /myiBay1 and www.myurl.com/mystuff goes to /myiBay2.

Is this possible in SME server?

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: Are virtual directories across iBays possible in SME?
« Reply #1 on: April 26, 2014, 08:14:16 AM »
I'd like to be able to have a URL go to one iBay and a directory on the URL go to another.  For example, www.myurl.com goes to iBay /myiBay1 and www.myurl.com/mystuff goes to /myiBay2.

if www.myurl.com is your principal domain (set in the console) then set it to go to ibay1 (see the domain panel) and then set an ibay called mystuff.

normally www.myurl.com ->ibay1 and www.myurl.com/mystuff ->ibay mystuff
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Are virtual directories across iBays possible in SME?
« Reply #2 on: April 26, 2014, 02:18:10 PM »
Here are some ways I've done this, or looked at doing it:

Option 1: Symlinks
This might work with symlinks:
Code: [Select]
db accounts myiBay1 FollowSymLinks enabled
cd /home/e-smith/files/ibays/myiBay1/html
ln -s /home/e-smith/files/ibays/myiBay2/html mystuff
signal-event remoteaccess-update

If the content you want from myiBay2 is a webapp like a wordpress or drupal site it may not work with two different URLs (http://www.myurl.com/mystuff AND http://www.myPrimaryDomain.com/myiBay1) -- some web apps allow access via any URL with no problem, some work this way only after jiggering the configuration, and some won't work this way at all (in my experience).

Option 2: Install into .../ibays/myiBay1/html/mystuff
If you *don't* need myiBay2 to work at two URLs (on its own and within myiBay1) you could install the second website into a folder within myiBay1 - and not create a second iBay at all.

Option 3: ProxyPass
If you *do* need myiBay2 to work from both URLs and the symlink method doesn't work, you could proxypass the mystuff folder using the instructions from http://wiki.contribs.org/SME_Server:Documentation:ProxyPass#ProxyPass_a_alias.2Fdirectory.2Flocation:
Code: [Select]
db accounts set mystuff ProxyPass
db accounts setprop mystuff Target http://localhost/myiBay2
db accounts setprop mystuff Description InternalServer
db accounts setprop mystuff HTTP on
db accounts setprop mystuff HTTPS on
expand-template /etc/httpd/conf/httpd.conf
sv t httpd-e-smith
(note: I think this creates the "/mystuff" url for all domains on the server -- something to be aware of...)


Offline LANMonkey

  • ****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Are virtual directories across iBays possible in SME?
« Reply #3 on: April 26, 2014, 05:29:39 PM »
Looks good.  I'll be back when I try it all out.

Thanks all and if anyone else has anything to add, feel free.