Archive for January, 2006

On Blog Pinging (again)

Monday, January 30th, 2006

Dear Internet,

When a major ping service has problems, I will remind you that Blog Pings are stupid. Some companies rely upon blog pings for their crawling system. What happens when a ping service is down? Your posts don’t get indexed. Oh Snap.

People have noticed that if you want to get higher rankings in some search engines, you should find everyone who has linked to you, and send Pings for them. Ping-spoofing. It really feels like email-spoofing to me. Maybe SPF could be extended to prevent this……

Anyways, At $work we do not currently accept pings from anyone. Instead we crawl every site in our system, every 30 minutes. Its not that hard, honestly, thanks to memcached and conditional http requests. (Oh, and lots of bandwidth).

Blog Pings have fundamental problems. Until they are both reliable and secure, I hope they will die. (By secure I mean knowing that the person who sent the ping is the person who owns the feed….). FeedTree tries to go down this path. It has many problems, the foremost is using Java. If you want everyone in the world to support your protocol, you need support for everyone still using c, perl, python, php, and ruby. The other problem with FeedTree, is that it makes crypto signing of pings optional. Rule number one of making a spec: Nothing is optional, because anything that is, won’t be implemented by half the software out there.

Have a happy Monday.

-Paul

Distractions.

Sunday, January 15th, 2006

Using mod_fcgid for Ruby on Rails Applications

Sunday, January 1st, 2006

Many people know about the old school mod_fastcgi, but very few know about mod_fcgid. To put it extremely briefly, if you are using Apache 2, and you should be, you should be using mod_fcgid, and not mod_fastcgi.

Here quick guide on how to configure mod_fcgid for use with Apache HTTPD 2.2.0 and Typo, a RoR blog engine:

  1. Download and Prepare mod_fcgid:
    wget http://fastcgi.coremail.cn/mod_fcgid.1.07.tar.gz

    tar -xvzf mod_fcgid.1.07.tar.gz

    cd mod_fcgid.1.07

  2. Edit the Makefile. Change the top_dir variable to the prefix of your Apache 2 install.
  3. Apply this patch for mod_fcgid:
    wget http://constant.northnitch.com/~chip/mod_fcgid.1.07-apache2.2.0.patch
    patch -p0 < mod_fcgid.1.07-apache2.2.0.patch
    

    This patch has been submitted upstream, and should be part of the next release.

  4. Run ‘make’.
  5. Copy .libs/mod_fcgid.so to your Apache modules directory
  6. Add the following to your httpd.conf, to load the module:
    LoadModule fcgid_module modules/mod_fcgid.so
    IPCCommTimeout 40
    IPCConnectTimeout 10
    
  7. Configure mod_fcgid for your Rails Application:
    <VirtualHost *:80>
    ...
    # Insert the rest of your vhost config here.
    ServerName foo.example.com
    
    <Location /journal>
        RewriteEngine On
        # Let apache handle purely static files like images by itself.
        RewriteCond %{REQUEST_FILENAME} !-f
        # Send Everything else to Typo
        RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    </Location>
    
    <Directory /sites/foo.example.com/public_html/journal>
        # ExecCGI is required for mod_fcgid to work.
        Options Indexes FollowSymLinks ExecCGI
        # Disable .htaccess files.
        AllowOverride None
        Order allow,deny
        Allow from all
        # This tells mod_fcgid to run the dispatch.fcgi script as a FastCGI
        AddHandler fcgid-script .fcgi
    </Directory>
    ....
    </VirtualHost>
    
  8. Thats it.

This whole process can be easier, since mod_fcgid is also in many packaging systems, including FreeBSD’s Ports, and Gentoo Portage.