SCIENTIFIC-LINUX-USERS Archives

April 2012

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Wed, 4 Apr 2012 21:25:16 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
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

ATOM RSS1 RSS2