Previously I ran MovableType on my own machine (Windows + Apache). After moving to a new server, FastCGI required some changes. Following a guide, I modified .htaccess
———————————————————————–
MovableType 3.34 update (Jan 17):
- Fixed a critical XSS vulnerability.
- Improved FastCGI usability, with performance up to 15× faster.
- MT 3.34 automatically enables FastCGI depending on server environment, requiring only simple
mt-config.cgisettings.
Advantages of FastCGI for MT:
- Performance boost: caching in memory reduces page load and DB access.
- Faster comment handling: comments stored in DB for moderation, processed more efficiently.
- Reliability: fewer resources per page, less traffic and DB load.
- Better resilience against spam attacks: comments retained, but processing faster with FastCGI.
How to check FastCGI installation:
Try it and find out
Add the following code to an .htaccess file in your MT directory:
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCGIConfig -autoUpdate -idle-timeout 120 -killInterval 3600 -maxClassProcesses 6 -maxProcesses 15
Then create a [HelloWorld.fcgi] file and see if it loads properly. If it does, FastCGI is installed. Any other error and it probably isn’t.
Configuration options:
- If ISP sets
.cgifiles to run under FastCGI globally, MT works without changes. - If not, you must configure manually (e.g. DreamHost).
Two methods:
Rename scripts: Change .cgi files to .fcgi or .fpl (except mt-config.cgi). Update mt-config.fcgi accordingly:
AdminScript mt.cgi
CommentScript mt-comments.cgi
TrackbackScript mt-tb.cgi
SearchScript mt-search.cgi
ViewScript mt-view.cgi
to:
AdminScript mt.fcgi
CommentScript mt-comments.fcgi
TrackbackScript mt-tb.fcgi
SearchScript mt-search.fcgi
ViewScript mt-view.fcgi
Force .cgi under FastCGI: Edit .htaccess in the MT directory:
AddHandler fastcgi-script .cgi
Only safe if the directory contains MT scripts exclusively.
Note: Under FastCGI, program changes are not immediately visible. You must reload by forcing recompilation:
touch path/to/mt/mt.fpl
博主友情提示:
如您在评论中需要提及如QQ号、电子邮件地址或其他隐私敏感信息,欢迎使用>>博主专用加密工具v3<<处理后发布,原文只有博主可以看到。