I will forget about the security implications of doing this and will go down to business:
If you have done
ls -l /var/www and
ls -l /root you would have noticed that both has different permissions:
$ ls -l /root/cr.txt
-rw-r----- 1 root root 0 Jul 9 01:28 cr.txt
$ ls -l /var/www
-rw-r--r-- 1 www-data www-data 0 Jul 9 01:28 somefile
/root is only readable for
/var/www is readable by
www-data user. Now, if you check apache process you will notice that it's running using the
$ ps aux | grep apache
www-data 5133 0.0 0.2 6512 1208 ? R+ 10:04 0:00 apache
Now, you are trying to make apache running with the
www-data user read the file. You can take three courses of action:
Move the file to
/var/www and change it's permissions so
www-data users can read it.
mv /root/cr.txt /var/www/
chown www-data:www-data /var/www/cr.txt
This is the preferable method.
Create a symlink to the file in the
ln -s /root/cr.txt /var/www/
This won't ensure that your file is being read, in some cases.
This is dangerous and should not be done! Add the
www-data user to the
root group, or change the file ownership so it could be read by
chown :www-data /root/cr.txt
sudo adduser www-data root
This shouldn't be done if you don't understand the risks!