<div dir="ltr"><div><div>Thanks.<br></div>It works!<br><br></div>I have to remember the risk I&#39;ve taken, but that was what I wanted to do.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-01 23:34 GMT+09:00 Shintaro Fujiwara <span dir="ltr">&lt;<a href="mailto:shintaro.fujiwara@gmail.com" target="_blank">shintaro.fujiwara@gmail.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi.<br><br></div>I&#39;m working with my web server and minor trouble I&#39;m in.<br>
<br></div>I write a php script which writes to /var/www/html/javascripts directory.<br>
</div>So, I added by semanage command<br></div># semanage fcontext -a -t httpd_sys_rw_content_t &quot;/var/www/html/javascripts(/.*)?<br></div>I checked by<br></div>#semanage fcontext -l | grep /var/www/html<br></div>Found what I set.<br>

</div>So, I typed<br></div># restorecon -r -v /var/www/html<br></div>I checked by semanage fcontext -l command again and found that the directory has httpd_sys_rw_content_t.<br></div>So, I fired up php script to write a file in /var/www/html/javascripts<br>

</div>Alas, audit error, and this time, semanage fcontext -l says /var/www/html/javascripts has an context httpd_sys_content_t.<br><br></div>I have to restorecon every time I write file to /var/www/html/javascripts by php script.<br>

<br></div>Why restorecon works fine at first and next time doesn&#39;t work at all?<span class="HOEnZb"><font color="#888888"><br><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br>
<div dir="ltr"><div>$BF|K\$K%X%t%#%a%?%k!&%O!<%I%m%C%/$r:,IU$+$;$k%Z!<%8(B<br>
<a href="http://www.heavymetalhardrock.tk/" target="_blank">http://www.heavymetalhardrock.tk/</a><br><br>$B@$3&Cf$G%;%-%e%"#O#S$N(BSELinux$B$r;H$$$d$9$/$9$k%U%j!<%=%U%H(B<br><a href="http://sourceforge.net/projects/segatex/" target="_blank">http://sourceforge.net/projects/segatex/</a><br>

</div><div><br>CMS$B!J(BPHP$B$H(BPostgreSQL$B$r;H$C$?%U%j!<%=%U%H!K(B<br></div><a href="http://sourceforge.net/projects/webon/" target="_blank">http://sourceforge.net/projects/webon/</a><br></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>$BF|K\$K%X%t%#%a%?%k!&%O!<%I%m%C%/$r:,IU$+$;$k%Z!<%8(B<br><a href="http://www.heavymetalhardrock.tk/" target="_blank">http://www.heavymetalhardrock.tk/</a><br><br>$B@$3&Cf$G%;%-%e%"#O#S$N(BSELinux$B$r;H$$$d$9$/$9$k%U%j!<%=%U%H(B<br>
<a href="http://sourceforge.net/projects/segatex/" target="_blank">http://sourceforge.net/projects/segatex/</a><br></div><div><br>CMS$B!J(BPHP$B$H(BPostgreSQL$B$r;H$C$?%U%j!<%=%U%H!K(B<br></div><a href="http://sourceforge.net/projects/webon/" target="_blank">http://sourceforge.net/projects/webon/</a><br>
</div>
</div>