Apr 6, 2008

Symlink can be handfull for webserver



I just finish chatting with one of my friend who is currently using ubuntu linux. I was helping him to manage his harddisk space as he is running out of space for his 'root web folder' which was define in apache2.conf. So he in the middle of making decision either wanted to clear everything and redo the config of apache root web folder to point to another hardisk or just find another way to make it possible to add more files into his webfolder.

Here is the situation:
/www/ --- space used 10.9gb /11gb
/share/ --- space used 46gb / 300gb

So my suggestion to him is to do symlink from /share/ folder to the /www/ so that he could used space from share and extend his www size by symlink the folder. So, here is the way to make a symlink :

syntax :
  • ln [option] [exact folder/files location] [link location]
And from this example, my friend's exact location is "/share/extended/" and he wanted to put it inside "/www/". So the sommand should be like this:
  • ln -s /share/extended /www/
  • explaination of -s : use for symbolic links instead of hard link. It is safer cause it will not effect the exact location if any wrong doing happened such as wrongly delete the files and etc.
  • but if you would like to make a hard link, apply the command without -s .
For more information about making a symbolic link(symlink) please refer to the man pages of 'ln' command. ln man page

How do you know your folder has being successfully link to the destination you specified? simple, just list the destination folder, and try to find a folder with '@' at the back, for example: extended@ .


Thank you for your unbelievable support on Negative Zero - Permission to read and write blog for nearly 4 years. Don't forget to like Negative Zero on Facebook.
Blogirific.com Blog Directory





Post(s) you might like to read :

2 comments: