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.

DNS / User Accounts

Discussion in 'Bind / DNS / Nameserver Issues' started by garethrees, Apr 25, 2007.

  1. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi All, I have a bit of a question i hope someone could help me solve.

    I have a couple of accounts hosted on my server. And i would like them all to share the same user space.

    For example i want example1.com and example2.com to share the same Photos directory as example.com without having 3 copies of the images.

    I have 2 websites with seperate designs and offer slightly different services however they all have the same product images.

    For example:
    Account example1 (/home/example1/public_html/) http://www.example1.com/images/1.jpg
    Account example2 (/home/example2/public_html/) http://www.example2.com/images/1.jpg

    I would like 1.jpg to actually be found from /home/example/public_html/images/1.jpg

    So the requested http://www.example2.com/images/34.jpg would actually be stored at /home/example/public_html/34.jpg

    Although this sounds slightly confusing, If anyone could understand what i'm trying to say.

    I would be much apreciated.

    Many thanks

    Gareth Rees
     
  2. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Use a symlink:

    ln -s existingfile newfile

    or in your case from the example you cited:
    ln -s /home/example/public_html/34.jpg /home/example2/public_html/images/34.jpg

    This creates a link from one file to the other. You might run into permission problems within Apache if you run phpsuexec or similar, so you might need to tweak permissions/ownership so that the link can be read by Apache. Otherwise, easiest solution for what you want to do.
     
    #2 mctDarren, Apr 25, 2007
    Last edited: Apr 25, 2007
  3. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi serversphere!

    Thanks for your reply!

    System links sound good i guess however can i get a system link on all files in the particular folder? without specifying all images?

    so in the images/products/* where star is could be any file?

    It sounds easier than i thought it be!

    Also if there is account with out a proper domain like main.com and the address would be example.com/~main can i use DNS to link to that specific account?

    like main.example.com ?

    Many thanks

    Gareth
     
  4. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    You can symlink a directory, actually:

    ln -s /home/user1/public_html/images /home/user2/public_html/images

    Which will essentially create a mirror of the images directory from user1 for user2

    I might not understand what you're trying to do, but it sounds to me alot like an add-on domain. Log into the main domains account and choose "Add on domain". There you can add a subdomain/directory onto an existing domain, complete with it's own password. You can also then set up redirection for a separate domain as well. Hope that helps!
     
  5. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18

    I *think* I understand your issues.. there are 2 of them.

    First: the 'shared images' folder...
    there are a couple options.. one is to softlink the directory as has been suggested.
    the other is to handle it form within the apache config. this way you wont have to make links into peoples web roots.
    look for the format of the "Alias" commands in the httpd.conf
    in either case, you're users 'sharing' the images directory wouldn't be able to add or modify the images, so it's usefulness is dependant on the function.
    the apache "autoindex" module makes use of this to show the icons fore the items in the directory display.


    Second: can DNS point to a user folder?
    since example.com/~main refers to a folder, you can, as has been suggested, make a subdomain via your cpanel user mode panel, and "link" that subdomain to the folder.

    if you can't figure out exactly how to do it, put in a support ticket at cpanel.net--they're very helpful with this sort of thing.
     
  6. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I think i'm all sorted on the Links to the images the symbolic link worked great!

    So thanks for all your efforts.

    One small question.

    If one website is on someone else's server, but just wanted to point sub.domain.com to a particular user and directory, would this be an Addon Domain?

    for instance:

    the webmaster points sub.domain.com to my server, i want sub.domain.com to link to /home/user/www/sub/ how would i do this?

    Thanks
     
  7. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    addon domain is correct.

    then setup redirection if needed.
     
  8. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Brilliant, So why would i need a redirect?
     
  9. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    you might not. it depends on what you're trying to do. if just setting up the addon domain does what you want, then you're in business.
     
  10. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Another service provider has control of domain.com

    But wants to redirect sub1 and sub2 .domain.com to my server.

    At my end i have created the user domain with the domain "domain.com"

    Then on that account do i add 2 Addon Domains for sub1 and sub2?

    As i don't have total control for domain.com just the 2 sub domains forwarded to me?
     
  11. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    that sounds like the right thing to do.

    sometimes it takes less time to try something and see if it works than to ask :P
     
  12. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    that sounds like the right thing to do.

    sometimes it takes less time to try something and see if it works than to ask :P

    if DNS hasn't propogated yet, you can always test these things by putting an entry in your hosts file on your local machine and browsing to the domain, if you get what you expect, then you're done, otherwise, something may be wrong
     
  13. garethrees

    garethrees Member

    Joined:
    Apr 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Ah, didn't know you could add an entry on your machine.

    How would i do that?

    Im running mac os x firefox
     
  14. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
Loading...

Share This Page