Recently in Apache Category

Movable Type is a large application with a lot of files. In a CGI context that application is loaded into memory every single time, and there is no ability to leverage a cache across a session or multiple requests.

When using FastCGI, the application is loaded into memory so that it doesn't have to be reparsed and interpreted every single request. This dramatically increases performance.

Unfortuantly some scripts of Movable Type are not compatible with FastCGI. A few of those scripts are i.e. mt-check.cgi or mt-xmlrpc.cgi (which is needed for XmlRPC transactions with your blog).

How to get the FastCGI-incompatible files up and running

In the end the solution is quite easy. You just need to tell Apache to not run some of Movable Type's scripts through FastCGI, but through classic CGI.

In your Apache configuration you need to activate add the following lines to the directives handling the Movable Type direcory:

That's all you need to do - Movable Type will run flawlessly.

What if you don't have direct access to your Apache configuration?

To ease up things you can also just create a template for a .htaccess file. It may also be much easier to use and maintainable this way. Just make sure you don't rebuild it each time you rebuild your site.

phpUnderControl is a customization of CruiseControl.

For those wanting to run CruiseControl behind an Apache webserver without configuring mod_jk or the like, this short how-to is just right.

Installing phpUnderControl / CruiseControl

This article is not about installing phpUnderControl or CruiseControl. For refernces see http://www.phpundercontrol.org/ or http://cruisecontrol.sourceforge.net/.

Configuring Apache as a proxy

So we are considering you have your phpUnderControl / CruiseControl instance up and running at http://localhost:8080/. We are also considering you have an instance of the Apache webserver up and running.

First we'll need to enable the proxy module of Apache. Consult the apache manual on how to enable the module in your instance of the Apache webserver. Now edit your Apache vHost or httpd.conf configuration.

You need to make sure that mod_proxy.so and mod_proxy_http.so do point to the right location on your harddisk.

Fixing URLs

Proxying already works with this configuration, but unfortunately clicking any link in your installation of phpUnderControl / CruiseControl would point to the direct installation of the instance. This is where mod_jk would come into play. But as we're just wanting a quick and easy resolution for runnning phpUnderControl / CruiseControl behind the Apache webserver, we'll be solving this issue quite easily:

Make sure to enable the ext_filter module. Now edit your Apache vHost or httpd.conf configuration again:

Conclusion

Just restart your Apache webserver and your instance of phpUnderControl / CruiseControl should be running perfectly well behind your Apache webserver.

Moveable Type is great when it comes to being lightweight on your webserver, because it creates most of your blog's functions as static content. It also creates a really nice URL structure, which comes in very nice when you are an URL fetishist like me. But you certainly have been bugged by the fact that MovableType's installation URL kicks in when you need to use MovableType's search function. Today I'd like to show you, how to configure your Moveable Type installation and your Apache Webserver to display smart URLs everywhere (expect the administration interface).

My blog makes use of what follows. Although I don't offer Movable Type's internal search function, but Google webpage search, my blog does have a tags page, with all tags being linked to related posts. This feature typically uses MovableType's search engine.

Editing your templates

First you should edit three related widget templates: Search, Syndication and Tag Cloud. You will find those templates by visiting the web administration interface of your Moveable Type installation. Click Design > Templates, then in the right sidebar on Widgets.

Using the Tag Cloud template, I will show you exemplary, how to edit all three templates:

The important part to look for is <a href="<$MTBlogURL$>tag/<$MTTagName$>"><$mt:TagName$></a>. What I'm doing is to point the tags to an URL like: http://www.example.com/tag/SampleTag.

Telling Apache to understand the changes

Now we need our webserver to understand, what those new links mean. In your Apache configuration you need to activate mod_rewrite. Next we need to provide a rewrite rule, so the Apache knows where to redirect a call to the URL to.

In our particular case it would look like this:

Remember to replace both $$$ with your current IDs (just click a tag and see, which IDs are being used).

Where to repeat those changes

To also apply those changes to Search and Syndication, you need to modify the templates Search and Syndication accordingly.

In Apache you should add those two lines:

Again, remember to replace both $$$ with your current IDs (should be the same ones you have had to use for the tags rewrite rule).

What if you don't have direct access to your Apache configuration?

To ease up things you can also just create a template for a .htaccess file. It may also be much easier to use and maintainable this way. Just make sure you don't rebuild it each time you rebuild your site.

Apache: August 2008: Monthly Archives

Recent Activity

Tuesday

  • I tweeted, "Just published a new blog post:Problems when upgrading to Ubuntu 8.10 - Kernel panic - Unable to mount root fs http://tinyurl.com/5fbb6j"
  • I tweeted, "Dear american voters - don't be silly to vote for McCain ... thanks!"
  • I tweeted, "@janl Just ping me, I've Hot leads ..."

More ...

Conferences

Conferences I presented at:

Programming Blogs - BlogCatalog Blog Directory
Creative Commons License
This weblog is licensed under a Creative Commons License. blogoscoop

About this Archive

This page is a archive of recent entries in the Apache category.

Conferences is the next category.

Find recent content on the main index or look in the archives to find all content.