I am using Centos 6.3 final and Apache 2.2.15. I recently installed a new HDD and created a symlink within my website's root directory so that my script can write big files to it and uses can access them through web. However, it looks like I misconfigured something or missed something and it's not working now.

This is what I did so far:

Old HDD: /var/www/vhosts/mysite.com/httpdocs/bigfile2 (symlink to link to folder below in new HDD)

New HDD: /newdisk/bigfile2

Now, my website php script writes files to new HDD properly but users can't access them from website. It gives 403, forbidden error when I try to visit mysite.com/bigfile2/file1.mov. I read a similar post here somewhere where someone mentioned about adding something like this within httpd.conf file maybe?

<Directory "/newdisk/bigfile2"> 
Options Indexes FollowSymLinks 
AllowOverride None 
Order Allow,Deny 
Allow from all 

And restart apache but still no luck! Do I need to add this to .htaccess ?

Any idea what am i missing? Note that i cannot use LVM.



You forgot to use semanage to change the SELinux file context given to files created in the new location. chcon will allow you to change them so that your site will work. See the httpd_selinux(8), semanage(8), and chcon(1) man pages for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.