Posts Tagged ‘IIS’
-
转载:IIS FastCGI PHP 环境下搭建 WordPress
看到 Jerry Tao 在其博客上发表了一篇如何配置IIS7+FastCGI的文章,特转载过来学习。
Windows Server 2008 (SP2) + IIS 7
添加 Web 服务器角色,需要安装 CGI 扩展支持。
-
配置ASP.NET中使用SQL Server模式的Session State
作者通过亲自试验,完成了在Plesk平台下的SQLServer模式会话状态的配置。具体步骤如下:
- 为回话状态建立或是选择相应的数据库Database(Create New Database)
- 执行会话状态模板SQL语句
首先进入文件夹C:\Windows\Microsoft.NET\Framework\version_ID\,对于ASP.NET 2.0来说,一般version_ID是v2.0.50727。然后找到InstallSqlStateTemplate.sql,并将文中所有DatabaseNamePlaceHolder替换为你自己的数据库名称,最后将此SQL拖到数据库上执行 - 此时也许你会发现,测试SQL语句没问题,但是执行的时候出现了一些问题如下:
————————————————-
Starting execution of InstallSqlStateTemplate.SQL
————————————————-
————————————————–
Note:
This file is included for backward compatibility
only. You should use aspnet_regsql.exe to install
and uninstall SQL session state.
Run ‘aspnet_regsql.exe -?’ for details.
————————————————–
If the job does not exist, an error from msdb.dbo.sp_delete_job is expected.
Msg 229, Level 14, State 5, Procedure sp_delete_job, Line 1
The EXECUTE permission was denied on the object ‘sp_delete_job’, database ‘msdb’, schema ‘dbo’.
If the category already exists, an error from msdb.dbo.sp_add_category is expected.
Msg 229, Level 14, State 5, Procedure sp_add_category, Line 1
The EXECUTE permission was denied on the object ‘sp_add_category’, database ‘msdb’, schema ‘dbo’.
Msg 229, Level 14, State 5, Procedure sp_add_job, Line 1
The EXECUTE permission was denied on the object ‘sp_add_job’, database ‘msdb’, schema ‘dbo’.
————————————————–
Completed execution of InstallSqlStateTemplate.SQL
————————————————– - 更新web.config文件:
<sessionState mode=“SQLServer” allowCustomSqlDatabase=“true” sqlConnectionString=“data source=localhost;initial catalog=数据库名;user id=用用户名;password=密码” cookieless=“false” timeout=“20” />
不必担心,这个主要是由于用户权限不够而不能将某些规划任务加入到数据库计划中。我们无法将过期的一些session数据删除,不过可以手动操作,或是请求你的主机运营商帮忙
Reference:
-
使用WP-Super-Cache 帮你加速构建在IIS7上的WordPress博客
自从我将自己的博客搬家到海外的一个IIS7的服务器上,我发现速度比原来构建在Linux上的系统要严重慢很多。我也一直在尝试着寻找为什么WP在IIS上跑竟然如此之慢,也想改变这种状况。
将所有的日志和页面转换成静态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.php4. 打开 /wp-content/plugins/wp-super-cache/wp-cache.php 文件,找到如下内容:
[sourcecode language=“php”]function wp_cache_check_link() { global $wp_cache_link, $wp_cache_file;[/sourcecode]
将它们替换成 [sourcecode language=“php”]function wp_cache_check_link() { global $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 » -
Speed up your WordPress Blog on IIS 7 by using WP-Super-Cache
- Since I moved my Blog to an IIS 7 server outside mainland China, I found it became terribly slow than before on a LAMP (Linux+Apache+MySQL+PHP) Server. I tried to find out why my site was so slow running on IIS and wanted to change this situation.
Turning all posts and pages into static html files is a good way to extremely speed up my blog. It is common to install a plugin named “WP-Super-Cahce” for the action. But unfortunately, there was always something wrong in my WP and that plugin doesn’t work at all times. I fixed the problem today and want to share my experience with you all. Let’s start!
If you are a blogger and your blog is based on an IIS 7 environment, I think this article maybe helpful for you. I successfully installed WP-Super-Cache plugin on my IIS 7 website after solving some ugly problems. Let’s make our blog faster and faster runing on Windows Server!
Install and Configure WP-Super-Cache
There are 10 easy steps to get cached content on your IIS or Apache server under Windows:
1. Download plugin.
2. Extract it so you have a /wp-content/plugins/wp-super-cache/ directory 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.php4. Open up /wp-content/plugins/wp-super-cache/wp-cache.php and locate this:
[sourcecode language=“php”]function wp_cache_check_link() { global $wp_cache_link, $wp_cache_file;[/sourcecode]
Replace that with [sourcecode language=“php”]function wp_cache_check_link() { global $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 following rewrite rule to the web.config file located at the root folder of WordPress site. Make sure that the “WP Super Cache” rule is before the WordPress rule for pretty permalinks. Typically the <rewrite> section will look as below:
<rewrite>
<rules>
<rule name=“WP Super Cache” stopProcessing=“true”>
<match url=”^(\d{4})/(\d{2})/(.+?)/?$” ignoreCase=“false” />
<conditions>
<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 Pretty Permalinks” patternSyntax=“Wildcard”>
<match url=”*” />
<conditions>
<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 example is configured to work with WordPress permalinks that use “Month and name” format, e.g. http://wordpress/index.php/2008/12/sample-post/. If you use any other permalink format then the rule will need to be adjusted for that.
If you are using permalink style like “/%post_id%.html”, please use the following configuration:
<rule name=“WP Super Cache” stopProcessing=“true”>
<match url=”^([0–9]+).html$” ignoreCase=“false” />
<conditions>
<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 addition, 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” />
<conditions>
<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 following 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 enable WP Super Cache in the Plugins page.
9. Go to the WP Super Cache options page and enable caching.
10. If you have mod_gzip, mod_deflate, or IIS dynamic content caching enabled, make sure you don’t enable 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 source file code. If that plugin is sucessfully run, you may find the following contents at the bottom of the source code:
<!– Dynamic Page Served (once) in x.xxx seconds –>
If you see that message, Congratulations!
Make it really works for you if you meet extra problems
But in some circumstance, you will get failed. Because some of your plugin prevent WP-Super-Cache from working.
You may see that message instead:
<!– Page not cached by WP Super Cache. No closing 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 source code page, it should be some problems caused by one or more of your other plugins. They may have some conflicts!
For my site, I found my another plugin named StatPressCN is conflicted with WP-Super-Cache. You may try to deactive all your plugins and active them one by one while seeing the html source code to check which plugin is not fit for your WP-Super-Cache. After finding out the conflicts, you can decide which plugin you need more and give up another.
Try to do that and enjoy your faster blog site and your blogger life!
–Paul
Some referrence for my article:
Paul’s Online Services
Dynamic Tag Cloud
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Recent Posts
- AIX Storage Learning 1
- 春节快乐! Happy Spring Festival!
- Sun is to the end of life
- 为cos-html-cache插件增加页面(Page)、标签(Tag)和分类(Category)的静态化功能
- How to configure Subversion in OpenSolaris
- 转载:IIS FastCGI PHP 环境下搭建 WordPress
- 在OpenSolaris下动态绑定域名
- Goodbye 2009, Hello 2010
- This Is It
- A Morse Code Exchanger
Recent Comments
- 新视界 (New Vision) » 在OpenSolaris下动态绑定域名 on 使用ZFS打造家庭廉价数据中心
- paul on Wordpress数据库转移网址变换的方法
- 知识 on Wordpress数据库转移网址变换的方法
- WP Super Cache V0.98 and IIS7 « Anders Heie on Speed up your WordPress Blog on IIS 7 by using WP-Super-Cache
- 博沈 on This Is It
- paul on 使用ZFS打造家庭廉价数据中心
- Anonymous on OpenSolaris 上的 Samba 服务器
- Anonymous on 使用ZFS打造家庭廉价数据中心
- Anonymous on OpenSolaris 上的 Samba 服务器
- Paul on 十年前和十年后的我们