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.

Can you have 2 public folders?

Discussion in 'General Discussion' started by clarocque, Dec 7, 2005.

  1. clarocque

    clarocque Member

    Joined:
    Mar 1, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    OK if this is answered I am truly sorry.... I have searched but wouldn't be the first time I searched wrong.


    I have a custom PHP application that I need to share all the files across many sites.

    For several reasons I feel going with sperate accounts for my clients is better than subs in one account.

    So now I am trying to figure out how to do it. What I have done is created a master account with all the files and dynamic code to handle it.

    But I still need to call some files specific to the client like xml and css.

    So I have found a symlink called public_html will call the data from the master account but I have to rename the public_html folder to do this and then I cant access it. Is there anyway to make it so public_html2 can be accessed via http so I can use the sym link method?

    Sorry if it is confusing but any idea would be appreciated.

    Chris
     
  2. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    to combat the problem of the public_html directory being renamed then not accessible from apache, edit the httpd.conf for the virtual host of the second domain (/usr/local/apache/conf)
    change the document root under the virtual host to match the folder you renamed it to
     
  3. clarocque

    clarocque Member

    Joined:
    Mar 1, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Thanks for the reply...

    I will give this a try, but will this allow me to list 2 folders in the document root?

    I use a sym link named public_html to load the data from the master directory. If I simply change the name in the conf will it still call the symlink public_html by defaukt?

    I need it to look for public_html symlink and still allow me to access another folder.


    Chris
     
  4. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    The short answer is NO. You may have only one web accessible folder per domain. That said it would be possible to have a sub-domain point to a second public_html folder, but both folders cannot be in the same root directory. In other words you cannot have:
    /home/user1/public_html
    /home/user1/public_html [sym link]

    You could have:
    domain.tld /home/user1/folder/public_html
    www.domain.tld /home/user1/folder1/public_html

    Or

    domain.tld /home/user1/folder/public_html
    www.domain.tld /home/user1/folder/public_html1
     
  5. adept2003

    adept2003 Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    283
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ~ "/(extra|special)/data"
    Do you want all sites to appear identical?

    You could try creating a new account with a dedicated IP (doesn't matter which domain). Then Modify the DNS records so that the A record for each domain points to the dedicated IP.

    If you want the sites to appear different, but use the same php script, you may be able to use the above method, but instead create a subdomain for each site and change the A record for the subdomain to point to the dedicated IP.

    You may need to edit the PHP script to use the IP address rather than a specific URL.
     
  6. clarocque

    clarocque Member

    Joined:
    Mar 1, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Thank you all for the replies...

    At this point I have split the difference and for the front end files I am sharing code and for the backend I am sending them directly to that source account.

    Thsi wil work for me now... 2 dyas is too much time on this - thansk again.

    Chris
     
Loading...

Share This Page