<?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>LinuxByte &#187; 系统网络安全</title>
	<atom:link href="http://www.linuxbyte.org/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxbyte.org</link>
	<description>一个Linux Blog</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:13:08 +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>apache,php安全小技巧</title>
		<link>http://www.linuxbyte.org/tips-for-apache-php-security.html</link>
		<comments>http://www.linuxbyte.org/tips-for-apache-php-security.html#comments</comments>
		<pubDate>Thu, 28 Feb 2008 07:11:23 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[系统网络安全]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/tips-for-apache-php-security</guid>
		<description><![CDATA[最简单的安全技巧，隐藏apache，php 的版本信息 Apache: 打开 httpd.conf，加入以下两行: ServerTokens ProductOnly ServerSignature Off PHP: 打开 php.ini，加入: expose_php = Off 完成以上两个设定后，重新启动 Apache ... ]]></description>
			<content:encoded><![CDATA[<p>最简单的安全技巧，隐藏apache，php 的版本信息</p>
<p><strong>Apache:</strong><br />
打开 httpd.conf，加入以下两行:</p>
<p>ServerTokens ProductOnly<br />
ServerSignature Off</p>
<p><strong>PHP:</strong><br />
打开 php.ini，加入:<span id="more-47"></span></p>
<p>expose_php = Off</p>
<p>完成以上两个设定后，重新启动 Apache 即可。</p>
<p>这个是最水货的安全措施了，另外apache 还可以改改源码把版本信息改为IIS<br />
编辑apache 源码目录下 /include/ap_release.h 文件<br />
参照下面代码修改</p>
<p>#define AP_SERVER_BASEVENDOR “这里填写开发组织名，例如：Microsoft Corp.”<br />
#define AP_SERVER_BASEPRODUCT “这里填写服务器软件名，例如:Microsoft-IIS”<br />
#define AP_SERVER_MAJORVERSION “主版本，例如：5&#8243;<br />
#define AP_SERVER_MINORVERSION “次版本，例如：0&#8243;<br />
#define AP_SERVER_PATCHLEVEL “修正版本，例如：1&#8243;</p>
<p>打开/include/os.h 文件,修改下面例句中的代码</p>
<p>#define PLATFORM “这里填写操作系统的名称，例如：Winnt”</p>
<p>打开文件 /os/PLATFORM/os.h ，修改</p>
<p>#define PLATFORM “这里填写操作系统的名称，例如：Winnt”</p>
<p>打开文件 /modules/generators/mod_info.c  修改</p>
<p>Search “Apache Server Information” replace with “这里填写在查看server-info现实的页面标题，例如:Microsoft-IIS Information”</p>
<p>打开文件 /modules/generators/mod_status.c 修改</p>
<p>Search “Apache Server Status” replace with “这里填写在查看server-status现实的页面标题，例如:Microsoft-IIS Status”</p>
<p>然后重新编译安装apache。</p>
<p>其实上面都是忽悠菜鸟用的，apache 中有一个modsecurity 对提升apache 的安全很有用，经过多年的发展功能已经非常强大，我个人最喜欢它对SQL注入的防护。另外 SE_linux 也是非常不错安全工具，不过这个东西配置起来比较麻烦，中文的文档也不多。</p>
<p><strong>最基本的php的安全设置</strong></p>
<p>disable_functions = phpinfo, get_cfg_var<br />
display_errors = Off<br />
allow_url_fopen = Off<br />
safe_mode = On</p>
<p>open_basedir = /usr/local/httpd/htdocs/dir1:/usr/local/httpd/htdocs/dir2<br />
#目录权限控制，dir1中的php程序就无法访问dir2中的内容。反过来也不行</p>
<h2  class="related_post_title">与本文关系暧昧的文字</h2><ul class="related_post"><li><a href="http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html" title="Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装 ">Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装 </a></li><li><a href="http://www.linuxbyte.org/centos-yum-an-zhuang-nginx-php-fpm-eaccelerator-mysql.html" title="Centos yum 安装nginx+PHP-FPM+eAccelerator+mysql">Centos yum 安装nginx+PHP-FPM+eAccelerator+mysql</a></li><li><a href="http://www.linuxbyte.org/php-5-3-4-fa-bu.html" title="PHP 5.3.4 发布 ">PHP 5.3.4 发布 </a></li><li><a href="http://www.linuxbyte.org/tui-jian-ge-php-bian-ji-qi-gphpedit.html" title="推荐个PHP 编辑器 Gphpedit">推荐个PHP 编辑器 Gphpedit</a></li><li><a href="http://www.linuxbyte.org/apache-license-version-2.html" title="Apache License Version 2.0">Apache License Version 2.0</a></li><li><a href="http://www.linuxbyte.org/config-apache-mod_limitipconn.html" title="apache 下限制单个IP 的并发连接数">apache 下限制单个IP 的并发连接数</a></li><li><a href="http://www.linuxbyte.org/apache-url-rewrite.html" title="Apache Url Rewrite(mod_rewrite)">Apache Url Rewrite(mod_rewrite)</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/tips-for-apache-php-security.html">apache,php安全小技巧</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/apache" rel="tag">apache</a>, <a href="http://www.linuxbyte.org/tag/php" rel="tag">php</a>, <a href="http://www.linuxbyte.org/tag/security" rel="tag">系统网络安全</a><br/>
</small></p>
	<p style="margin:3px 0 0 0;">标签：<a href="http://www.linuxbyte.org/tag/apache" title="apache" rel="tag">apache</a>, <a href="http://www.linuxbyte.org/tag/php" title="php" rel="tag">php</a>, <a href="http://www.linuxbyte.org/tag/security" title="系统网络安全" rel="tag">系统网络安全</a></p>

<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/tips-for-apache-php-security.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

