Moving /var/www with SELinux enforcing

Mikkel L. Ellertson mikkel at infinity-ltd.com
Mon Dec 15 20:18:14 UTC 2008


Tim Largy wrote:
> Because I have limited space in /var and a program that wants to put
> gigabytes of data in /var/www, I want to move that directory
> (/var/www) elsewhere and simlink to it. What's the proper way to do
> this with SELinux enforcing?
> 
> Tim
> 
If I have this correct, you would want to add a rule for the new
location.

From SELinux administration:

File Specification - <path to new location>(/.*)?
File Type - all files
SELinux Type - httpd_sys_content_t
MLS - s0

You may also have to the modify Apache config to allow symlinks.

One other possibility would be to mount the new directory tree on a
mount point in /var/www using "mount --bind olddir newdir". But I
have not played with this - you may also have to add
"context=system_u:object_r:httpd_sys_content_t:s0" to the mount
command. If it works you can add it to /etc/fstab.

mount --bind olddir newdir -o
context=system_u:object_r:httpd_sys_content_t:s0

Let me know how it works out.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20081215/550bf8bc/attachment-0001.bin 


More information about the users mailing list