Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    45

    Default shared folder between differant sites

    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. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by ZeusChicago View Post
    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.
    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. #3
    Member
    Join Date
    Oct 2005
    Posts
    45

    Default

    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. #4
    Member gtgeorge's Avatar
    Join Date
    Feb 2007
    Posts
    89

    Default

    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.
    regards,
    George

Similar Threads & Tags
Similar threads

  1. Differant Skel File for differant package?
    By JamieWarren09 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-24-2009, 11:13 AM
  2. SSL and Shared Sites
    By TampaTech in forum New User Questions
    Replies: 8
    Last Post: 04-30-2007, 01:42 AM
  3. Shared SSL for my Customer Sites
    By TampaTech in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-23-2006, 10:41 AM
  4. Change IP of multiple sites from 1 shared Ip to another
    By aingaranweb in forum New User Questions
    Replies: 3
    Last Post: 11-26-2005, 12:49 PM
  5. How to change the shared ip for all sites.
    By smile in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-09-2005, 05:25 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube