Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default DNS / User Accounts

    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. #2
    Member serversphere's Avatar
    Join Date
    Jan 2004
    Posts
    658

    Default

    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.
    Last edited by serversphere; 04-25-2007 at 10:47 AM. Reason: added specific example
    Darren Benfer | SS-Darren | AIM: serversphere
    www.serversphere.com
    Dedicated Server Solutions Have Come Full Circle

  3. #3
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default

    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. #4
    Member serversphere's Avatar
    Join Date
    Jan 2004
    Posts
    658

    Default

    Quote Originally Posted by garethrees View Post
    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?
    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

    Quote Originally Posted by garethrees View Post
    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 ?
    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!
    Darren Benfer | SS-Darren | AIM: serversphere
    www.serversphere.com
    Dedicated Server Solutions Have Come Full Circle

  5. #5
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    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

    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. #6
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default

    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. #7
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    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
    addon domain is correct.

    then setup redirection if needed.

  8. #8
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default

    Brilliant, So why would i need a redirect?

  9. #9
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    Brilliant, So why would i need a redirect?
    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. #10
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default

    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. #11
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    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?
    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. #12
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    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?
    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. #13
    Member
    Join Date
    Apr 2007
    Posts
    6

    Default

    Ah, didn't know you could add an entry on your machine.

    How would i do that?

    Im running mac os x firefox

  14. #14
    Member
    Join Date
    Feb 2005
    Posts
    312

    Default

    Quote Originally Posted by garethrees View Post
    Ah, didn't know you could add an entry on your machine.

    How would i do that?

    Im running mac os x firefox
    look here: http://docs.info.apple.com/article.html?artnum=88158
    or here: http://www.macwrite.com/criticalmass...-regrouped.php

Similar Threads & Tags
Similar threads

  1. User Accounts
    By mavcom in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-10-2008, 02:57 PM
  2. Need Help. User accounts.
    By chibiuk_ in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-04-2006, 03:12 PM
  3. User accounts
    By Lestat in forum New User Questions
    Replies: 14
    Last Post: 08-24-2004, 04:24 PM
  4. New User Accounts
    By redcable in forum New User Questions
    Replies: 6
    Last Post: 06-09-2004, 01:56 AM
  5. user email accounts...cannot create accounts either
    By phantom2 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-20-2004, 02:54 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube