EduSoho网络教学软件 加入小组

537个成员 301个话题 创建时间:2013-09-17

EduSoho: IIS7.0 + FastCGI + PHP 下的配置安装

发表于 2013-10-18 9870 次查看

     本文不涉及IIS 7.0 + FastCGI + PHP的安装, 而是谈如何完整配置EduSoho站点。  

1、下载 EduSoho后,解压缩,先看看我的站点目录结构

   

2、IIS路径配置 

 

3、files目录权限设置,去除脚本权限

 

 4、Php.ini三个参数别忘了改

post_max_size = 300m

upload_max_filesize = 300m

memory_limit = 300m

5、提高IIS本身的上传大小限制 

    找到 C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml

    停止IIS,将权限分配给管理员,按照如下提示修改

   <element name="requestLimits">
         <attribute name="maxAllowedContentLength" type="uint"         defaultValue="30000000" />//这里多加个0,支持300M
  ......
</element>

6、选中站点根目录,选中URL重写(url rewrite)

    文本配置,可以通过url重写“导入功能”

# Defend your computer from some worm attacks

RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]

# we skip all files with .something except .html
RewriteCond URL .*\..+$
RewriteCond URL (?!.*\.html$).*
RewriteRule (.*) $1 [L]


# we keep the .php files unchanged
RewriteRule (.*\.php)(.*) $1$2 [L]

RewriteRule (.*) /app.php [L]

   另一种形式,web.config,直接编辑网站web根目录下的web.config,加入如下

<rule name="已导入的规则 1">
    <match url=".*(?:global.asa|default\.ida|root\.exe|\.\.).*" />
     <action type="CustomResponse" url="." statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="已导入的规则 2" stopProcessing="true">
    <match url="(.*)" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
       <add input="{REQUEST_URI}" pattern=".*\..+$" ignoreCase="false" />
        <add input="{REQUEST_URI}" pattern="(?!.*\.html$).*" ignoreCase="false" />
    </conditions>
    <action type="Rewrite" url="{R:1}" />
</rule>
<rule name="已导入的规则 3" stopProcessing="true">
     <match url="(.*\.php)(.*)" ignoreCase="false" />
     <action type="Rewrite" url="{R:1}{R:2}" />
</rule>
<rule name="已导入的规则 4" stopProcessing="true">
    <match url="(.*)" ignoreCase="false" />
    <action type="Rewrite" url="/app.php" />
</rule>

7,大于30M文件无法上传的问题: 

  1. 打开IIS管理器,找到Default Web Site。先进行停止。
  2. 在IIS中双击“请求筛选”打开。
  3. 点击右边的“编辑功能设置”,打开“编辑请求筛选设置”对话框。
  4. 其中的允许的最大容量长度,默认是”30000000“,30M,将其修改为你所需要的大小即可。
  5. 启动IIS.
9回复
发表回复
功能维护升级中,维护完成完后将再次开放,非常抱歉给您学习造成的不便。
话题作者
kent
头衔: