<?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>浮山狼de博客 &#187; apache</title>
	<atom:link href="https://www.fushanlang.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>linux-SYN-netstat TIME_WAIT</title>
		<link>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/</link>
		<comments>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 07:44:59 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[liunx]]></category>
		<category><![CDATA[SYN flood]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2127</guid>
		<description><![CDATA[Linux Web服务器连接数控制 <p>平时检测网站服务器连接数情况，常用的如  netstat -ant &#124;awk &#8216;{print $6}&#8217;&#124;sort&#124;uniq -c &#124;sort -n  给出如下统计</p> TIME_WAIT 3699 CLOSE_WAIT 52 FIN_WAIT1 32 SYN_SENT 1 FIN_WAIT2 2 ESTABLISHED 17 SYN_RECV 45 CLOSING 6 <p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p> vi /etc/sysctl net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1000 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_max_syn_backlog = <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/">linux-SYN-netstat TIME_WAIT</a></span>]]></description>
				<content:encoded><![CDATA[<h2>Linux Web服务器连接数控制</h2>
<p>平时检测网站服务器连接数情况，常用的如  <strong>netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计</p>
<pre>
TIME_WAIT 3699
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 17
SYN_RECV 45
CLOSING 6</pre>
<p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p>
<pre>vi /etc/sysctl</pre>
<pre>net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 1000
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.ip_local_port_range = 1024 65000
net.core.netdev_max_backlog =8096</pre>
<p>先执行<strong>sysctl -p</strong> 让新设置生效，然后再次执行<strong> netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计：</p>
<pre>
TIME_WAIT 36
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 2700
SYN_RECV 4
CLOSING 6</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fastcgi mod_fcgid: HTTP request length</title>
		<link>https://www.fushanlang.com/fastcgi-mod_fcgid-http-request-length-1895/</link>
		<comments>https://www.fushanlang.com/fastcgi-mod_fcgid-http-request-length-1895/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 07:39:50 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[fastcgi]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1895</guid>
		<description><![CDATA[<p>最近在win2003 apache+php+fastcgi+mysql  开发环境下，使用wordpress上传图片时，遇到稍大的图片总是会遇到“HTTP error”，但是检查过php.ini发现文件大小限制post_max_size设置的没有问题，查看apache的logs 日志记录才显示了问题所在：</p> <p>“mod_fcgid: HTTP request length 135567 (so far) exceeds MaxRequestLen (131072)”</p> <p>原来是fastcgi模式下的设置问题，需要在配置文件.htaccess或者直接在apache的配置文件http.conf 中指明，如下：</p> <p>&#60;IfModule mod_fcgid.c&#62;   AddHandler    fcgid-script .fcgi   FcgidConnectTimeout  20   # to get around upload errors when uploading images increase the MaxRequestLen size to 15MB   MaxRequestLen  15728640 &#60;/IfModule&#62;</p> <p>里面的“MaxRequestLen”就是fastcgi模式下上传文件也就是http接受的最大文件长度。</p> ]]></description>
				<content:encoded><![CDATA[<p>最近在win2003 apache+php+fastcgi+mysql  开发环境下，使用wordpress上传图片时，遇到稍大的图片总是会遇到“<strong>HTTP error”，</strong>但是检查过php.ini发现文件大小限制post_max_size设置的没有问题，查看apache的logs 日志记录才显示了问题所在：</p>
<p>“<strong>mod_fcgid: HTTP request length 135567 (so far) exceeds MaxRequestLen (131072)”</strong></p>
<p>原来是fastcgi模式下的设置问题，需要在配置文件.htaccess或者直接在apache的配置文件http.conf 中指明，如下：</p>
<p>&lt;IfModule mod_fcgid.c&gt;<br />
  AddHandler    fcgid-script .fcgi<br />
  FcgidConnectTimeout  20<br />
  # to get around upload errors when uploading images increase the MaxRequestLen size to 15MB<br />
  MaxRequestLen  15728640<br />
&lt;/IfModule&gt;</p>
<p>里面的“<strong>MaxRequestLen”</strong>就是fastcgi模式下上传文件也就是http接受的最大文件长度。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/fastcgi-mod_fcgid-http-request-length-1895/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>win2003 apache2.2.17 php5.3配置</title>
		<link>https://www.fushanlang.com/win2003-apache2-2-17-php5-3-configuration-1847/</link>
		<comments>https://www.fushanlang.com/win2003-apache2-2-17-php5-3-configuration-1847/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 03:17:56 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2.2.17]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1847</guid>
		<description><![CDATA[Win2003 安装 apache 2.2.17 + php5.3.4 或5.3.6 +  Mysql 配置 Aapache安装 <p>apache-2.2.17 下载地址 ：http://httpd.apache.org/download.cgi   ， http://www.apache.org/dist//httpd/binaries/win32/</p> <p>版本选择httpd-2.2.17-win32-x86-no_ssl.msi (openssl多了个ssl安全认证模式，它的协议是HTTPS而不是HTTP，无特殊ssl连接需要下载no_ssl的版本即可)。</p> <p>安装：一路next 下去 填写 network domain、server domain 一般填“localhost”即可，管理员邮箱随便填一个邮箱就可以（以后服务器出现问题，会提示联系管理员邮箱，方便处理问题。）</p> <p>安装成功：一般安装结束时会请求是否开启apache服务，可以确定开启，自动打开Apache Service Monitor 同时在电脑右下角的任务栏里有一个绿色的apache服务器运行图标，显示为&#8221;&#62;&#8221; 启动状态，此时可以本地打开浏览器输入http://localhost 或者 http://127.0.0.1 或者在其他机器上输入 该服务器ip到浏览器访问 http://xx.xx.xx.xx/  可以看到简单的测试页面 &#8220;It works&#8221; 说明apache已经成功运行。</p> PHP安装 <p>php5.3.4 ，5.3.6(最新)，5.2.17(老稳定版本，不再后续支持)  下载地址：http://windows.php.net/download/</p> <p>版本选择  Thread Safe （window下一般开发环境用此版本即可，如果是以FastCGI来执行PHP时考虑到效率，需要采用None Thread Safe版本）.</p> <p>下载zip版本 此处我 解压缩到 &#8220;C:/php-5.3.6-Win32-VC9-x86&#8243;，注意如果是在win2003下运行php5.3 以上用vc9 <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/win2003-apache2-2-17-php5-3-configuration-1847/">win2003 apache2.2.17 php5.3配置</a></span>]]></description>
				<content:encoded><![CDATA[<h2>Win2003 安装 apache 2.2.17 + php5.3.4 或5.3.6 +  Mysql 配置</h2>
<h2><strong>Aapache安装</strong></h2>
<p><strong>apache-2.2.17</strong> 下载地址 ：http://httpd.apache.org/download.cgi   ， http://www.apache.org/dist//httpd/binaries/win32/</p>
<p>版本选择<strong>httpd-2.2.17-win32-x86-no_ssl.msi </strong>(openssl多了个ssl安全认证模式，它的协议是HTTPS而不是HTTP，无特殊ssl连接需要下载no_ssl的版本即可)。</p>
<p><strong>安装：</strong>一路next 下去 填写 network domain、server domain 一般填“<strong>localhost</strong>”即可，管理员邮箱随便填一个邮箱就可以（以后服务器出现问题，会提示联系管理员邮箱，方便处理问题。）</p>
<p><strong>安装成功：</strong>一般安装结束时会请求是否开启apache服务，可以确定开启，自动打开<strong>Apache Service Monitor</strong> 同时在电脑右下角的任务栏里有一个绿色的apache服务器运行图标，显示为&#8221;&gt;&#8221; 启动状态，此时可以本地打开浏览器输入http://localhost 或者 http://127.0.0.1 或者在其他机器上输入 该服务器ip到浏览器访问 http://xx.xx.xx.xx/  可以看到简单的测试页面 <strong>&#8220;It works&#8221;</strong> 说明apache已经成功运行。<span id="more-1847"></span></p>
<h2>PHP安装</h2>
<p>php5.3.4 ，5.3.6(最新)，5.2.17(老稳定版本，不再后续支持)  下载地址：http://windows.php.net/download/</p>
<p>版本选择  <strong>Thread Safe</strong> （window下一般开发环境用此版本即可，如果是以<strong>FastCGI</strong>来执行PHP时考虑到效率，需要采用None Thread Safe版本）.</p>
<p>下载<strong>zip</strong>版本 此处我 解压缩到 &#8220;C:/php-5.3.6-Win32-VC9-x86&#8243;，注意如果是在<strong>win2003</strong>下运行php5.3 以上用vc9 编译的版本的话，有可能会遇到无法运行的情况，即双击php.exe 会弹出“<strong>由于应用程序配置不正确，应用程序未能启动</strong>” 的问题，这是由于该版本的php采用vc9编译，而该<strong>win2003</strong>系统缺少运行库导致的，可以安装 <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF">Microsoft 2008 C++ Runtime (x86)</a> 来保证运行。</p>
<p><strong>问题：</strong>常见问题在配置apache里的httpd.conf 时 LoadModule php5_module 缺少 “<strong>php5apache2_2.dll</strong>” 的情况是因为下错了php版本，在Thread Safe版本下是具有php5apache2_2.dll的，而None Thread Safe版本 没有这个文件一般只用于fastcgi 所以不需要这个文件。<strong><br />
</strong></p>
<h2>MySQL安装</h2>
<p>一般安装mysql&#8211;5.1.45-win32.msi即可，安装过程中填写root密码，选择数据库编码utf8 启用innodb 选项一步一步next即可。安装成功后mysql就会以windows服务的方式启动了。</p>
<h2><strong>综合配置</strong></h2>
<p><strong>1.配置Apache：</strong></p>
<p>apache安装目录下的conf/httpd.conf 文件是比较重要的配置文件，如果害怕修改配置文件出错，则要养成修改配置文件前备份的习惯，以防出错。</p>
<p><strong>1.1 配置www网站根目录</strong>：</p>
<pre>
DocumentRoot "E:/www"
&lt;Directory "E:/www"&gt;
Options Indexes FollowSymLinks <strong>Includes ExecCGI</strong>
AllowOverride <strong>All</strong>（在打开mod_rewrite的情况下允许htaccess文件定义时需要设置为All 默认为None）
Order allow,deny
Allow from all
&lt;/Directory&gt;
</pre>
<p><strong>1.2 配置mod_rewrite:</strong></p>
<p>LoadModule rewrite_module modules/mod_rewrite.so  <br/>(现在非常流行使用rewrite功能达到美化，隐藏安全url访问的目的，打开此模块的同时也要注意目录下的AllowOverride <strong>All</strong>，才能允许htaccess有效)</p>
<p><strong>1.3A 一种方式配置mod_php：(大多数情况下采用以mod_php方式运行)</strong></p>
<pre>
（PHPIniDir为指定 php.ini的位置，可以直接放在php版本目录里面）
（以mod_php的方式运行php时需要加载 php5_module）

PHPIniDir "C:/php-5.3.6-Win32-VC9-x86"
LoadModule php5_module C:/php-5.3.6-Win32-VC9-x86/php5apache2_2.dll

（设置目录下网站首页的访问顺序如果要运行php，可以讲index.php至于前面优先访问index.php为主页）

&lt;IfModule dir_module&gt;
DirectoryIndex <strong>index.php</strong> index.html index.htm
&lt;/IfModule&gt;

（设置php5解释器，解释文件的扩展名，即访问.php或者.php3或者.phps时,
都会视为application/x-httpd-php请求，用php5解释器来解释运行）

&lt;IfModule mod_php5.c&gt;()
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
&lt;/IfModule&gt;
</pre>
<p><strong>1.3B 另一种方式配置fastcgi：(与mod_php配置有些不同，在windows下不太安全但如果要考验效率的话可以试一试)</strong></p>
<p>下载<strong>mod_fcgid-2.3.6-win32-x86</strong>，下载地址：http://httpd.apache.org/mod_fcgid/  ，下载完后 直接将 module 目录合并到 apache 安装目录下的module即可。</p>
<pre>
LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .fcgi .php
#php.ini的存放目录
FcgidInitialEnv PHPRC "C:/php-5.3.6-Win32-VC9-x86/"
# 设置PHP_FCGI_MAX_REQUESTS大于或等于FcgidMaxRequestsPerProcess，
#防止php-cgi进程在处理完所有请求前退出
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
#php-cgi每个进程的最大请求数
FcgidMaxRequestsPerProcess 1000
#php-cgi最大的进程数
FcgidMaxProcesses 3
#最大执行时间
FcgidIOTimeout 120
FcgidIdleTimeout 120
#php-cgi的路径
FcgidWrapper "C:/php-5.3.6-Win32-VC9-x86/php-cgi.exe" .php
AddType application/x-httpd-php .php
</pre>
<p><strong>#这两种方式运行php时，检查phpinfo(）可以清楚的看到两者的不同。</strong></p>
<p><strong>2. 配置PHP.ini</strong>:</p>
<pre>
date.<strong>timezone</strong> ="Asia/Shanghai"  
#(设置一下时区，一般国内可以设置为Asia/Shanghai ，不设置有些用到时间的php应用回报警告，
#ps：它又不会GPS定位你所在时区，O(∩_∩)O哈哈~)

<strong>extension_dir</strong> = "C:/php-5.3.6-Win32-VC9-x86/ext"  
#（extension_dir 指定php扩展的目录位置，必须指定绝对物理路径，
#否则加载某些扩展会找不到dll文件）
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_mysql.dll
extension=php_pdo_mysql.dll
</pre>
<p>上面打开一般的图形扩展和mysql数据库扩展，也可根据需要打开 extension=php_curl.dll 扩展之类。</p>
<p>修改完配置要重启apache服务，在Apache Service Monitor里 restart即可，然后可以测试phpinfo（） 是否okay。</p>
<p>希望对用的童鞋有用！：）</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/win2003-apache2-2-17-php5-3-configuration-1847/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>apache Could not reliably determine the server&#8217;s fully qualified domain name</title>
		<link>https://www.fushanlang.com/apache-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-1821/</link>
		<comments>https://www.fushanlang.com/apache-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-1821/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 02:03:03 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[webserver]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1821</guid>
		<description><![CDATA[“Could not reliably determine the server&#8217;s fully qualified domain name” <p>最近安装完apache，重启APACHE老出现httpd: Could not reliably determine the server&#8217;s fully qualified domain name</p> <p>出现这个错误的原因是：ServerName 没有配置或配置错误的情况下用了系统IP做网站主机IP，而DNS未能配好，本机调试不需要配置DNS的情况下，可以将ServerName 改为localhost 本地环境，就不会请求DNS了</p> <p>解决方案：</p> <p>进入apache的安装目录，用记事本打开httpd.conf</p> <p>将里面的#ServerName www.example.com:80注释去掉即可,,并改成ServerName 127.0.0.1:80。或者 ServerName localhost:80 （80是端口，只要不冲突可以改为其他端口，一般80为默认端口)</p> <p>再执行httpd</p> <p>重启APACHE后就不会出现那个提示了.</p> ]]></description>
				<content:encoded><![CDATA[<h2>“Could not reliably determine the server&#8217;s fully qualified domain name”</h2>
<div>
<p>最近安装完apache，重启APACHE老出现httpd: Could not reliably determine the server&#8217;s fully qualified domain name</p>
<p>出现这个错误的原因是：ServerName 没有配置或配置错误的情况下用了系统IP做网站主机IP，而DNS未能配好，本机调试不需要配置DNS的情况下，可以将ServerName 改为localhost 本地环境，就不会请求DNS了</p>
<p>解决方案：</p>
<p>进入apache的安装目录，用记事本打开httpd.conf</p>
<p>将里面的#ServerName www.example.com<a href="http://www.example.com/"><span style="color: #839432;">:80</span></a>注释去掉即可,,并改成ServerName 127.0.0.1:80。或者 ServerName localhost:80 （80是端口，只要不冲突可以改为其他端口，一般80为默认端口)</p>
<p>再执行httpd</p>
<p>重启APACHE后就不会出现那个提示了.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/apache-could-not-reliably-determine-the-server-s-fully-qualified-domain-name-1821/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.184 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2025-10-09 12:56:47 -->
