Re: A question on links



scott wrote:
What I would like to do is create a link from one directory to another for the purposes of the apache web server. The apache directory looks like this:
/srv/www/vhosts/abc.com/srv/www/vhosts/abc.com


The above would also have a subdirectory of public_html.

For simplicity, I would like to have a directory of this:
/home/abc.com

Now abc.com would have a link to the /srv/www/vhosts/abc.com directory. So is someone reads, modifies, creates files, etc in the /home/abc.com directory it will be done to the files in the /srv/www/vhosts/abc.com directory.

Would this be a hard link or a symbolic link to do this? Also, what about permissions, ownership of the directories?


I can't advise on the security of doing this for a webserver directory but you would do it thus

ln -s /home/abc.com /srv/www/vhosts/abc.com

This would be a symbolic link. You can't make hard links of directories. The link itself will have the default permissions and ownership of whoever created it but the *effective* permissions will be whatever is on the target directory.

JohnK
.



Relevant Pages

  • RE: Symbolic link retargeting?
    ... I need a way to set the ownership and permissions on a file to ... that was imported from VMWare to directory structure which matches the rest ... I have a symbolic link that I need to retarget. ...
    (microsoft.public.windows.file_system)
  • A question on links
    ... What I would like to do is create a link from one directory to another for the purposes of the apache web server. ... Also, what about permissions, ownership of the directories? ...
    (alt.os.linux.suse)
  • Re: [PHP] Permissions issue on share
    ... I have Apache Web Server running on Mac OS X with PHP. ... only able to provide the Mac User with Permissions, ...
    (php.general)
  • Re: A question on links
    ... > another for the purposes of the apache web server. ... Set the permissions as you need them and then do `ln -s ... The best might be to make a new group like 'webcreators', ... user1 is added to e.g. abc and nbc. ...
    (alt.os.linux.suse)
  • Re: Newbie - fc6 tiscali broadband Sagem modem
    ... Yes, having read and execute permissions for user, group and world all set and only group and world write permissions is pretty common. ... If you later decide to run the Apache web server and want to put parts of the website in public_html directories under home directories the "drwxr-xr-x" pattern is needed by Apache for $HOME, public_html and all directories inside public_html. ... martin@ | Martin Gregorie ...
    (uk.comp.os.linux)