0

I am looking for a good short-term solution to storage space concerns on my website. Currently, I have all uploaded files (flash video, images, etc.) inside the 'files' directory in my web root (/home/account/public_html/files).

That directory is located on my high-speed main hard drive (two mirrored 74 GB 15k SCSI drive).

I have another drive with much more capacity (300 GB), but spinning at 10k rpm (so still fast, but not as good for random reads/writes as the main drive). The entire drive is mounted at /backup

Right now I'm just using it as a backup volume. I would like to create a symlink from my /home/account/public_html/files folder to /backup/files, and have all files reside on the second drive.

However, if someone accesses a file at http://www.example.com/files/filename.jpg, would it still work if I symlinked to the second drive? (Basically, would Apache/PHP automatically know to follow the symlink for that directory?).

I'm beginning to run out of space on the main drive, and I can't get the budget to upgrade. I'm running CentOS 5.3, Apache 2.2.x, PHP 5.2.13.

geerlingguy
  • 1,357
  • 2
  • 17
  • 28

2 Answers2

2

If you have Options FollowSymLinks set globally, or for that virtual host, or for the parent directory, then yes, Apache will know to follow the symlink.

Prof. Moriarty
  • 870
  • 8
  • 12
  • Do you know if that's enabled by default? I will check httpd.conf, just to be sure... – geerlingguy Apr 26 '10 at 19:01
  • This is probably distro specific, and I don't have access to a CentOS box right now, but on Red Hat Enterprise 5.5 (on which CentOS is based) it is enabled by default. – Prof. Moriarty Apr 26 '10 at 19:05
0

Another possibility is using alias in Apache. For example:

alias /files /backups/files
David
  • 3,519
  • 21
  • 17