The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

shared folder between differant sites

Discussion in 'General Discussion' started by ZeusChicago, Nov 22, 2007.

  1. ZeusChicago

    ZeusChicago Active Member

    Joined:
    Oct 9, 2005
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    I have several sites:

    www.dealer1.com
    www.dealer2.com
    www.dealer3.com

    that live for example the following

    /home/dealer1/public_html
    /home/dealer2/public_html
    /home/dealer3/public_html

    I would like to write a bunch of common php classes and place them "somewhere" on my server that all three sites could access. For example, an inventory.class.php file that all three sites could access. What I am trying to avoid is having the same inventory.class.php files in each /home/dealerx/public_html folder so when I make a change to the class file I dont have to upload it to 3 seperate places (which in time will be dozens and dozens of differant sites).

    What I have looked into so far was using sybmolic links, but I am getting stuck on the permissions I think.

    Has any one done this? Seen any thread about it, or could you point me in the right direction?

    Thanks so much in adavance.

    Z

    p.s. note, these differant sites cant be "subdomains" but will be differant domains.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Symbolic links are a frequent solution to this issue.

    What I do in this situation with my own custom code is have the PHP code give a return value that can be used by other PHP scripts. On servers that are well locked down, I have the PHP code generate a return value in plain text format - and store that into a buffer, and store that buffer into a variable for use. You can find documentation on doing this at http://www.php.net/include (See example 16.10).
     
  3. ZeusChicago

    ZeusChicago Active Member

    Joined:
    Oct 9, 2005
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Was researching and found some folks using the Alias directive in the httpd.conf to map a common folder.

    Was wondering what everyones comments/concerns of that would be.

    Please keep in mind that this server (and all the domains on it) will always be in my control. I am simply using it to host a magnitude of sites for a particular sector and i want to have a common code base, so when I fix a bug on one site (it fixes it on all)

    Thanks in adavance!

    Zeus

    p.s. Thanks for the reply David , I read through that page and the example and it should work for me, but I am hoping the above might be a bit more simplistic for what I need (i.e. its really for ease of maintence for me, then for multiple clients to use directly)
     
  4. gtgeorge

    gtgeorge Well-Known Member

    Joined:
    Feb 28, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Would it be possible to set them all up as addon domains on one cpanel account which should allow access to files since they are all in the same user account? Also might make it better organized to set the root domain into a subfolder too so the domains would all have seperate folders and the root could contain all shared items.

    Just a thought.
     
Loading...

Share This Page