<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[刘新修]]></title> 
<link>http://liuxinxiu.com:80/index.php</link> 
<description><![CDATA[刘新修的个人博客 (Liuxinxiu'S Blog)]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[刘新修]]></copyright>
<item>
<link>http://liuxinxiu.com:80/discuz_win2003_to_lnmp/</link>
<title><![CDATA[【原创】Win2003下discuz论坛转移至Lnmp下注意事项（Rewrite重写、上传附件目录权限）]]></title> 
<author>刘新修 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux/Unix]]></category>
<pubDate>Tue, 28 Sep 2010 14:49:44 +0000</pubDate> 
<guid>http://liuxinxiu.com:80/discuz_win2003_to_lnmp/</guid> 
<description>
<![CDATA[ 
	<p><strong>Discuz!在Nginx下的Rewrite</strong></p><p><strong><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/discuz_rewrite1.jpg"><img alt="" src="http://at.liuxinxiu.com/2010/09/image/discuz_rewrite1.jpg" /></a></strong></p><p>完整正确的Discuz!在Nginx下的Rewrite如下：</p><p>&nbsp;</p><p>&nbsp;</p><p>蓝色部分为完整的配置内容添加至，虚拟主机 server&#123;&#125; 内，不要放到 location &#123;&#125; 以内！</p><p>&nbsp;</p><p>使之单独存在于：server&#123;</p><p>location &#123;&#125;</p><p><span style="color: #0000ff">if (!-e $request_filename)</span><span style="color: #0000ff"><br />&#123;</span></p><p><span style="color: #0000ff"><br />rewrite ^/archiver/((fid&#124;tid)-[w-]+.html)$ /archiver/index.php?$1 last;<br />rewrite ^/forum-([0-9]+)-([0-9]+).html$ /forumdisplay.php?fid=$1&amp;page=$2 last;<br />rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ /viewthread.php?tid=$1&amp;extra=page%3D$3&amp;page=$2 last;<br />rewrite ^/space-(username&#124;uid)-(.+).html$ /space.php?$1=$2 last;<br />rewrite ^/tag-(.+).html$ /tag.php?name=$1 last;<br />break;</span></p><p>&#125;</p><p>=======================================================================</p><p><strong>discuz论坛由WIN移至Linux下，附件文件无法保存到服务器上的问题解决方案！</strong></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/discuz_info2.JPG"><img height="123" alt="" width="575" src="http://at.liuxinxiu.com/2010/09/image/discuz_info2.JPG" /></a></p><p><strong><span style="color: #800080"><span>提示信息：附件文件无法保存到服务器，可能是目录属性设置问题，请与管理员联系。</span></span></strong></p><p><strong>解决方法：</strong></p><p><strong>问题1：attachement目录是否设置属性777，win主机属性everyone </strong></p><p>DIDCUZ安装时提示： 设置目录属性（windows 服务器可忽略这一步）<br />以下这些目录需要可读写权限 <br />./templates <br />./attachments <br />./forumdata <br />./forumdata/cache <br />./forumdata/templates <br />./forumdata/threadcaches <br />./forumdata/logs</p><p><span style="color: #0000ff"><strong>LINUX下以上目录统一修改权限为777：</strong></span></p><p><span style="color: #0000ff">chown -R 777 templates <br />chown -R 777 attachments <br />chown -R 777 forumdata <br />chown -R 777 forumdata/cache <br />chown -R 777 forumdata/templates <br />chown -R 777 forumdata/threadcaches <br />chown -R 777 forumdata/logs </span></p><p><strong>问题2：php.ini中的设置可能存在问题</strong></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/php_ini_1.jpg"><img height="298" alt="" width="408" src="http://at.liuxinxiu.com/2010/09/image/php_ini_1.jpg" /></a></p><p>将<span style="color: #0000ff">;upload_tmp_dir =</span> 该行的注释符，即前面的分号&ldquo;<span style="color: #0000ff">；</span>&rdquo;去掉，使该行在php.ini文档中起作用。upload_tmp_dir是用来定义上传文件存放的临时路径，在这里你还可以修改并给其定义一个绝对路径，这里设置的目录必须有读写权限。付给WWW可执行权限。</p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/php_ini_2.jpg"><img height="284" alt="" width="500" src="http://at.liuxinxiu.com/2010/09/image/php_ini_2.jpg" /></a></p><p>另外：</p><p>在nginx.conf增加 client_max_body_size的相关设置, 这个值默认是1m，可以增加到<strong><span style="color: #ff0000">8m</span></strong>以增加提高文件大小限制；<br />如果运行的是php，那么还要检查php.ini，这个大小client_max_body_size要和<span style="color: #0000ff"><strong>php.ini</strong></span>中的如下值的最大值一致或者稍大，这样就不会因为提交数据大小不一致出现的错误。</p><p><span style="color: #0000ff">post_max_size = 8M<br />upload_max_filesize = 2M</span></p><p>在php.ini中upload_max_filesize 的参数设置也增加到8M和NGINX相互一直，若不需要用上传超大附件，可以在DISCUZ后台限制用户上传附件大小<strong><span style="color: #ff0000"> 8M&lt;</span></strong></p><p>以上全部更改，确保了附件目录拥有了足够了权限之后若还说不能上传。见问题3</p><p><strong>问题3：DISCUZ 后台更改附件附件 URL 地址</strong></p><p>DISCUZ 默认设置：</p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/discuz_admin_1.jpg"><img height="355" alt="" width="731" src="http://at.liuxinxiu.com/2010/09/image/discuz_admin_1.jpg" /></a></p><p>后台 基本设置 附件设置 不小心开启远程附件或者没有设置完整也会出现此问题</p><p>后台 基本设置 附件设置 设置的附件保存方式为其他方式 不是保存在同一目录下 部分服务器限制了目录属性 导致无法上传附件（虚拟空间出现的比例较多）</p><p><span style="color: #ff0000"><strong>可以尝试把附件 URL 地址: 修改为绝对路径如：</strong></span></p><p><a target="_blank" href="http://at.liuxinxiu.com/2010/09/image/discuz_admin_2.jpg"><img height="406" alt="" width="618" src="http://at.liuxinxiu.com/2010/09/image/discuz_admin_2.jpg" /></a></p><p><a href="http://bbs.liuxinxiu.com/attachments">http://bbs.liuxinxiu.com/attachments</a></p><p>liuxinxiu 换成你的域名，不再根目录下加加子目录：<a href="http://www.liuxinxiu.com/bbs/attachments">http://www.liuxinxiu.com/bbs/attachments</a></p><p>==================================================================</p><p>转载请标明出处：<a href="http://liuxinxiu.com/discuz_win2003_to_lnmp/">http://liuxinxiu.com/discuz_win2003_to_lnmp/</a></p>
]]>
</description>
</item><item>
<link>http://liuxinxiu.com:80/discuz_win2003_to_lnmp/#blogcomment</link>
<title><![CDATA[[评论] 【原创】Win2003下discuz论坛转移至Lnmp下注意事项（Rewrite重写、上传附件目录权限）]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://liuxinxiu.com:80/discuz_win2003_to_lnmp/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>