setup question with open_basedir constraint

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DJ Majestik

    setup question with open_basedir constraint

    I accidently posted this over at php.general, but I don't generally get
    a response over there, and I get a better response here, so I am posing
    this question here as well. Hopefully someone has done something like
    this and can offer some advice. Thanks in advance.

    OK, I need some expert advice on how to do something like this. I have
    an open_basedir restriction in place by my host, and I am hosting a few
    sites (that will grow in the future).

    What I want is something like this.

    /mainsite - application files that I am creating would go here.
    /site1 - folder for site 1
    /site2 - folder for site 2

    I would like to have all my application files underneath /mainsite like
    this:

    /mainsite
    config.php
    index.php
    ...

    Then under /site1 and /site2 I would have symlinks (or php files with
    include files in them) that would point to the same file in /mainsite

    /site1
    config.php - pointing to /mainsite/config.php
    index.php - pointing to /mainsite/config.php
    ...

    Same for /site2

    Problem is I have open_basedir set, so that I can't get to
    /mainsite/config.php from /site1/config.php

    What are some of my options for setting this up? This would allow me to
    essentially have one code base, and then anytime a site (say site1)
    wanted a custom config.php file, I could replace the symlink config.php
    file with one created just for them, but the rest of the code would
    still be from the main code base.

    ANyone have any ideas? I have tried to figure out the best way to
    accomplish this, and essentially come upon roadblocks.

    Would like to hear any ideas or suggestions. Thank you,

    JJ

  • Colin McKinnon

    #2
    Re: setup question with open_basedir constraint

    DJ Majestik wrote:

    <snip>[color=blue]
    >
    > Then under /site1 and /site2 I would have symlinks (or php files with
    > include files in them) that would point to the same file in /mainsite
    >
    > /site1
    > config.php - pointing to /mainsite/config.php
    > index.php - pointing to /mainsite/config.php
    > ...
    >
    > Same for /site2
    >
    > Problem is I have open_basedir set, so that I can't get to
    > /mainsite/config.php from /site1/config.php
    >
    > What are some of my options for setting this up? This would allow me to
    > essentially have one code base, and then anytime a site (say site1)
    > wanted a custom config.php file, I could replace the symlink config.php
    > file with one created just for them, but the rest of the code would
    > still be from the main code base.[/color]

    If they're on the same filesystem, you could use hard links instead - but
    it's kinda messy. Anything other than copying the files or changing the
    open_basedir or document roots is going to be a bit of kludge.

    C.

    Comment

    • DJ Majestik

      #3
      Re: setup question with open_basedir constraint

      Thanks for getting back to me.

      What are hard links? Can you help me out in that area? Thanks,

      JJ

      PS - might be my only option.

      Comment

      Working...