<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>小桥的记事本 &#187; SELinux</title>
	<atom:link href="http://www.hmqq.net/tag/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hmqq.net</link>
	<description>Xiaoqiao's Blog</description>
	<lastBuildDate>Sat, 13 Aug 2011 16:56:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CentOS 5.2 SELinux</title>
		<link>http://www.hmqq.net/2008/10/centos-52-selinux/</link>
		<comments>http://www.hmqq.net/2008/10/centos-52-selinux/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 14:49:36 +0000</pubDate>
		<dc:creator>小桥</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://www.hmqq.net/?p=157</guid>
		<description><![CDATA[CentOS 5.2，在启用SELinux的情况下配置vsftpd使用pam_mysql做用户认证和安装Zend Optimizer v3.3.3还是有点麻烦的，需要改SELinux的规则才能使用。 首先， #cd /usr/local/Zend #find lib -type d -exec chcon -t lib_t {} \; #find lib -name "*.so" -exec chcon -t textrel_shlib_t {} \; 接着编辑/etc/selinux/targeted/modules/local.te文件如下： 然后运行以下命令： checkmodule -M -m -o local.mod local.te semodule_package -o local.pp -m local.mod [...]]]></description>
			<content:encoded><![CDATA[<p>CentOS 5.2，在启用SELinux的情况下配置vsftpd使用pam_mysql做用户认证和安装Zend Optimizer v3.3.3还是有点麻烦的，需要改SELinux的规则才能使用。<br />
首先，<br />
<code>#cd /usr/local/Zend<br />
#find lib -type d -exec chcon -t lib_t {} \;<br />
#find lib -name "*.so" -exec chcon -t textrel_shlib_t {} \;</code><br />
接着编辑/etc/selinux/targeted/modules/local.te文件如下：<span id="more-157"></span></p>
<pre class="brush: cpp; title: ; notranslate">module local 1.0;
require {
type httpd_t;
type ftpd_t;
type mysqld_db_t;
type mysqld_var_run_t;
type mysqld_t;
class process { execstack execmem execheap };
class dir search;
class sock_file write;
class unix_stream_socket connectto;
class capability { dac_read_search dac_override };
}
#============= httpd_t ==============
allow httpd_t self:process { execstack execmem execheap };
#============= ftpd_t ==============
allow ftpd_t mysqld_db_t:dir search;
allow ftpd_t mysqld_t:unix_stream_socket connectto;
allow ftpd_t mysqld_var_run_t:sock_file write;
allow ftpd_t self:capability { dac_read_search dac_override };</pre>
<p>然后运行以下命令：<br />
<code>checkmodule -M -m -o local.mod local.te<br />
semodule_package -o local.pp -m local.mod<br />
semodule -i ./local.pp </code><br />
还要运行一下这个命令，vsftpd才能让本地/虚拟用户正常登陆<br />
<code>setsebool -P ftp_home_dir 1</code></p>
<p>如果还有什么不正常，参考audit2allow -a /var/log/audit/audit.log</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hmqq.net/2008/10/centos-52-selinux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

