Creating link with mount –bind

In linux users home folders are in /home. Many times we need it in /var/www/html but we do not want to change default setting. Then there is a simple workaround for this.

Step 1. : Just create directory home under /var/www/html
Step 2. : mount –bind /home /var/www/html/home
Step 3. : Put above command in init script. For eg. If you are using CentOS then put it in /etc/rc.local

And your link is ready. 🙂

Neelesh Gurjar has written 122 articles

Leave a Reply