Posts Tagged ‘IIS’

  • 转载:IIS FastCGI PHP 环境下搭建 WordPress

    Date: 2010.01.12 | Category: Learn from Others, Web Back-end, WordPress | Response: 0

    看到 Jerry Tao 在其博客上发表了一篇如何配置IIS7+FastCGI的文章,特转载过来学习。

    Win­dows Server 2008 (SP2) + IIS 7
    添加 Web 服务器角色,需要安装 CGI 扩展支持。

    image

    Read the rest of this entry »

    • Share/Bookmark
  • 配置ASP.NET中使用SQL Server模式的Session State

    Date: 2009.09.18 | Category: Web Back-end | Response: 0

    作者通过亲自试验,完成了在Plesk平台下的SQLServer模式会话状态的配置。具体步骤如下:

    1. 为回话状态建立或是选择相应的数据库Database(Create New Database)
    2. 执行会话状态模板SQL语句
      首先进入文件夹C:\Windows\Microsoft.NET\Framework\version_ID\,对于ASP.NET 2.0来说,一般version_ID是v2.0.50727。然后找到InstallSqlStateTemplate.sql,并将文中所有Data­ba­se­Na­me­Pla­ce­Ho­lder替换为你自己的数据库名称,最后将此SQL拖到数据库上执行
    3. 此时也许你会发现,测试SQL语句没问题,但是执行的时候出现了一些问题如下:
      ————————————————-
      Sta­r­ting exe­cu­tion of InstallSqlStateTemplate.SQL
      ————————————————-

      ————————————————–
      Note:                                            
      This file is inclu­ded for backward compa­ti­bi­lity 
      only.  You should use aspnet_regsql.exe to install
      and unin­stall SQL session state.                 

      Run ‘aspnet_regsql.exe -?’ for details.        
      ————————————————–
      If the job does not exist, an error from msdb.dbo.sp_delete_job is expe­cted.
      Msg 229, Level 14, State 5, Pro­ce­dure sp_delete_job, Line 1
      The EXECUTE per­mi­ssion was denied on the object ‘sp_delete_job’, data­base ‘msdb’, schema ‘dbo’.
      If the cate­gory already exi­sts, an error from msdb.dbo.sp_add_category is expe­cted.
      Msg 229, Level 14, State 5, Pro­ce­dure sp_add_category, Line 1
      The EXECUTE per­mi­ssion was denied on the object ‘sp_add_category’, data­base ‘msdb’, schema ‘dbo’.
      Msg 229, Level 14, State 5, Pro­ce­dure sp_add_job, Line 1
      The EXECUTE per­mi­ssion was denied on the object ‘sp_add_job’, data­base ‘msdb’, schema ‘dbo’.

      ————————————————–
      Comple­ted exe­cu­tion of InstallSqlStateTemplate.SQL
      ————————————————–
    4. 不必担心,这个主要是由于用户权限不够而不能将某些规划任务加入到数据库计划中。我们无法将过期的一些session数据删除,不过可以手动操作,或是请求你的主机运营商帮忙

    5. 更新web.config文件:
      <session­State mode=“SQLServer” allowCustomSqlDatabase=“true” sqlConnectionString=“data source=localhost;initial catalog=数据库名;user id=用用户名;password=密码” cookieless=“false” timeout=“20” />

     

    Refe­rence:

    • Share/Bookmark
  • 使用WP-Super-Cache 帮你加速构建在IIS7上的WordPress博客

    Date: 2009.04.26 | Category: WordPress | Response: 0

    自从我将自己的博客搬家到海外的一个IIS7的服务器上,我发现速度比原来构建在Linux上的系统要严重慢很多。我也一直在尝试着寻找为什么WPIIS上跑竟然如此之慢,也想改变这种状况。

    将所有的日志和页面转换成静态html格式不失为一种加速博客很好的办法,通常我们都为我们的WordPress博客加装“WP-Super-Cache”插件。但很不幸,我在自己的主机上一直没用配置这个插件成功,总是遇到一些问题。不过今天我解决了问题,也在此和朋友们分享解决的经验。

    如果你是一个blogger,并且你的博客系统是基于WordPress加上IIS7,那么我的这篇文章一定会对你有所帮助的。在解决了那些非常麻烦的问题后,我终于成功的在我的博客上加装了WP-Super-Cache插件。让我们用这个插件来加速我们的博客吧!

    具体怎么做呢?来看看我的步骤。

    安装和配置部分

    通过10步就可以完成配置:

    1. 下载这个插件(这里就不多废话了,后台有插件搜索的地方,直接下载即可)

    2. 将插件解压到 /wp-content/plugins/wp-super-cache/ 目录下

    3. 将 /wp-content/plugins/wp-super-cache/wp-cache-phase1.php 文件复制到
    /wp-content/advanced-cache.php

    4. 打开 /wp-content/plugins/wp-super-cache/wp-cache.php 文件,找到如下内容:
    [sou­r­ce­code language=“php”]function wp_cache_check_link() { glo­bal $wp_cache_link, $wp_cache_file;[/sourcecode]
    将它们替换成 [sou­r­ce­code language=“php”]function wp_cache_check_link() { glo­bal $wp_cache_link, $wp_cache_file; if ( file_exists($wp_cache_link) ) return true; else { echo “advanced-cache.php does not exist”; echo “Create it by copying $wp_cache_file to $wp_cache_link on your server”; return false; } [/sourcecode] Read the rest of this entry »

    • Share/Bookmark
  • Speed up your WordPress Blog on IIS 7 by using WP-Super-Cache

    Date: 2009.04.26 | Category: WordPress | Response: 1

      Since I moved my Blog to an IIS 7 server outside main­land China, I found it became ter­ri­bly slow than before on a LAMP (Linux+Apache+MySQL+PHP) Server. I tried to find out why my site was so slow run­ning on IIS and wan­ted to change this situation.

    Tur­ning all posts and pages into sta­tic html files is a good way to ext­re­mely speed up my blog. It is common to install a plu­gin named “WP-Super-Cahce” for the action. But unfo­r­tu­na­tely, there was always some­thing wrong in my WP and that plu­gin doesn’t work at all times. I fixed the pro­blem today and want to share my expe­rience with you all. Let’s start!

    If you are a blo­g­ger and your blog is based on an IIS 7 envi­ron­ment, I think this arti­cle maybe helpful for you. I succe­ssfu­lly insta­lled WP-Super-Cache plu­gin on my IIS 7 website after solving some ugly pro­blems. Let’s make our blog faster and faster runing on Win­dows Server!

    Install and Con­fi­gure WP-Super-Cache

    There are 10 easy steps to get cached con­tent on your IIS or Apa­che server under Windows:

    1. Down­load plugin.

    2. Ext­ract it so you have a /wp-content/plugins/wp-super-cache/ dire­ctory with all the files (like wp-cache.php) in there.

    3. Copy /wp-content/plugins/wp-super-cache/wp-cache-phase1.php to
        /wp-content/advanced-cache.php

    4. Open up /wp-content/plugins/wp-super-cache/wp-cache.php and locate this:
        [sou­r­ce­code language=“php”]function wp_cache_check_link() { glo­bal $wp_cache_link, $wp_cache_file;[/sourcecode]
        Replace that with [sou­r­ce­code language=“php”]function wp_cache_check_link() { glo­bal $wp_cache_link, $wp_cache_file; if ( file_exists($wp_cache_link) ) return true; else { echo “advanced-cache.php does not exist”; echo “Create it by copying $wp_cache_file to $wp_cache_link on your server”; return false; } [/sourcecode]

    6. Add the follo­wing rew­rite rule to the web.config file loca­ted at the root folder of Wor­dP­ress site. Make sure that the “WP Super Cache” rule is before the Wor­dP­ress rule for pre­tty per­ma­links. Typi­ca­lly the <rew­rite> section will look as below:

    <rew­rite>
    <rules>
      <rule name=“WP Super Cache” stopProcessing=“true”>
        <match url=”^(\d{4})/(\d{2})/(.+?)/?$” ignoreCase=“false” />
        <con­di­tions>
          <add input=”{REQUEST_METHOD}” negate=“true” pattern=“POST” ignoreCase=“false” />
          <add input=”{QUERY_STRING}” negate=“true” pattern=”.*=.*” ignoreCase=“false” />
          <add input=”{QUERY_STRING}” negate=“true”
                    pattern=”.*attachment_id=.*” ignoreCase=“false” />
          <add input=”{HTTP_COOKIE}” negate=“true”
                   pattern=”^.*(comment_author_|wordpress|wp-postpass_).*$” ignoreCase=“false” />
          <add
            input=”{DOCUMENT_ROOT}\wp-content\cache\supercache\{HTTP_HOST}\{R:1}\{R:2}\{R:3}\index.html”
            matchType=“IsFile” />
        </conditions>
        <action type=“Rewrite”
             url=“wp-content/cache/supercache/{HTTP_HOST}/{R:1}/{R:2}/{R:3}/index.html” />
      </rule>

      <rule name=“Wordpress Pre­tty Per­ma­links” patternSyntax=“Wildcard”>
        <match url=”*” />
        <con­di­tions>
          <add input=”{REQUEST_FILENAME}” matchType=“IsFile” negate=“true” />
          <add input=”{REQUEST_FILENAME}” matchType=“IsDirectory” negate=“true” />
        </conditions>
        <action type=“Rewrite” url=“index.php” />
      </rule>
    </rules>
    </rewrite>

    Note: this rule exa­mple is con­fi­gu­red to work with Wor­dP­ress per­ma­links that use “Month and name” for­mat, e.g. http://wordpress/index.php/2008/12/sample-post/. If you use any other per­ma­link for­mat then the rule will need to be adju­sted for that.

    If you are using per­ma­link style like “/%post_id%.html”, please use the follo­wing configuration:

    <rule name=“WP Super Cache” stopProcessing=“true”>
        <match url=”^([0–9]+).html$” ignoreCase=“false” />
        <con­di­tions>
            <add input=”{REQUEST_METHOD}” negate=“true” pattern=“POST” ignoreCase=“false” />
            <add input=”{QUERY_STRING}” negate=“true” pattern=”.*=.*” ignoreCase=“false” />
            <add input=”{QUERY_STRING}” negate=“true”
                      pattern=”.*attachment_id=.*” ignoreCase=“false” />
            <add input=”{HTTP_COOKIE}” negate=“true”
                     pattern=”^.*(comment_author_|wordpress|wp-postpass_).*$” ignoreCase=“false” />
            <add
              input=”{DOCUMENT_ROOT}\wp-content\cache\supercache\{HTTP_HOST}\{R:1}.html\index.html”
              matchType=“IsFile” />
        </conditions>
        <action type=“Rewrite” url=“wp-content/cache/supercache/{HTTP_HOST}/{R:1}.html/index.html” />
    </rule>

    In addi­tion, if you want to cache your front page like index.php, please add an rule in the front of “WP Super Cache” rule, just like this:

    <rule name=“WP Super Cache Index Page” stopProcessing=“true”>
        <match url=“index.php” ignoreCase=“false” />
        <con­di­tions>
            <add input=”{REQUEST_METHOD}” negate=“true” pattern=“POST” ignoreCase=“false” />
            <add input=”{QUERY_STRING}” negate=“true” pattern=”.*=.*” ignoreCase=“false” />
            <add input=”{QUERY_STRING}” negate=“true”
                      pattern=”.*attachment_id=.*” ignoreCase=“false” />
            <add input=”{HTTP_COOKIE}” negate=“true”
                     pattern=”^.*(comment_author_|wordpress|wp-postpass_).*$” ignoreCase=“false” />
            <add
              input=”{DOCUMENT_ROOT}\wp-content\cache\supercache\{HTTP_HOST}\index.html”
              matchType=“IsFile” />
        </conditions>
        <action type=“Rewrite” url=“wp-content/cache/supercache/{HTTP_HOST}/index.html” />
    </rule>

    7. Add the follo­wing line into the wp-config.php file above the “require_once(ABSPATH.’wp-settings.php’);” line:

    define( ‘WP_CACHE’, true );

    8. Log into your dashboard and ena­ble WP Super Cache in the Plu­gins page.

    9. Go to the WP Super Cache options page and ena­ble caching.

    10. If you have mod_gzip, mod_deflate, or IIS dyna­mic con­tent caching ena­bled, make sure you don’t ena­ble Super Cache gzip because it’s already being done on the server level (which is better, anyway! :) )

    After that 10 steps, you may find your blog become faster than before. Please open a post and see the sou­rce file code. If that plu­gin is suce­ssfu­lly run, you may find the follo­wing con­tents at the bottom of the sou­rce code:

    <!– Dyna­mic Page Served (once) in x.xxx seconds –>

    If you see that message, Congratulations!

    Make it rea­lly works for you if you meet extra problems

    But in some cir­cu­mstance, you will get fai­led. Because some of your plu­gin prevent WP-Super-Cache from working.

    You may see that message instead:

    <!– Page not cached by WP Super Cache. No clo­sing HTML tag. Check your theme. –>

    Don’t worry about your theme, it may not your theme’s fault. If you’ve seen “</html>” in that sou­rce code page, it should be some pro­blems cau­sed by one or more of your other plu­gins. They may have some conflicts!

    For my site, I found my ano­ther plu­gin named Sta­tP­re­ssCN is con­fli­cted with WP-Super-Cache. You may try to dea­ctive all your plu­gins and active them one by one while seeing the html sou­rce code to check which plu­gin is not fit for your WP-Super-Cache. After fin­ding out the con­fli­cts, you can decide which plu­gin you need more and give up another.

    Try to do that and enjoy your faster blog site and your blo­g­ger life!

    –Paul

     

    Some refer­rence for my article:

    • Share/Bookmark

Paul’s Online Services

Dynamic Tag Cloud

Recent Posts

Recent Comments

Tags

2008.11.Trip-of-GuangXi ASP.net C++ China Chrome css dotNet FCGuoAn Firefox Football gmail IBM IE IIS IT Association Joke Microsoft music mysql NLP Nokia ntfs NumPy OpenSolaris open source Open Team php pidgin PKUSS Python Python Challenge qq Samba SciPy Learning shell solaris SQL SUN Thunderbird Travel web host Win 7 WordPress X11 zfs