On 04/04/2012 08:37 PM, zxq9 wrote:
On 04/04/2012 12:27 PM, Mike Chan wrote:
*From:* Tam Nguyen

Mike,

I forgot one method that may or may not be available to you depending on how the system is set up.

In your mount command you can include explicit SELinux context options.

So, given that:
/var/www/virtual is the document root to your vHost
/var/www/virtual/foo is a symlink to /mnt/web-data
/mnt/web-data is a mountpoint for an NFS share on nfs.server:/shared/bar

You could do:
mount -t nfs -o context=system_u:object_r:httpd_sys_content_t server:/shared/foo /mnt/web-data

(
Prettied up in case line-breaks killed it:
mount \
        -t nfs \
        -o context=system_u:object_r:httpd_sys_content_t \
        server:/shared/foo /mnt/web-data
)

Some people have had mixed results with this approach, but it is the best way to be explicit and the best solution in the case that you have more than a single NFS mount that only serves data to Apache.

-z

Reply via email to