Hosting wordpress in a subdirectory of an existing Rails application

I have an existing rails application at mydomain.com and wanted to include a wordpress blog at mydomain.com/blog. I’m using Apache and Passenger.

My <VirutalHost> configuration has the DocumentRoot at /srv/www/mydomain.com/public (which is itself a symbolic link to /srv/www/mydomain.com/railsapp/public). For ease of maintenance, and to avoid any conflicts between rails and wordpress, I placed wordpress outside of the rails app at /srv/www/mydomain.com/wordpress.

However, I needed to tell Apache to redirect access to the wordpress resources which are not located in the DocumentRoot. The solution? Create an Apache Alias. There’s an excellent descrpition in the Linode Library about Managing Resources with Apache mod_alias.

This got me through the wordpress install with the wp-admin/install.php. Unfortunately, I still couldn’t access my blog. The default rails error page still kept rearing its ugly head. Turns out that’s due to Passenger, which kept directing my non-file-specific traffic to my rails application (e.g., when trying to access mydomain.com/blog or mydomain.com/blog/wp-admin without a specific php file in the URL).

I found the fix for this at WordPress Answers. My final working configuration is below, with the additional fix in bold:

<VirtualHost x.x.x.x:80>
    ...
    DocumentRoot /srv/www/mydomain.com/public
    Options FollowSymLinks

    # an Alias for the wordpress blog
    Alias /blog /srv/www/mydomain.com/wordpress
    <Directory /srv/www/mydomain.com/wordpress>
        PassengerEnabled off
        # make the WordPress .htaccess file work
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>

    ...
</VirtualHost>

Making Time for Pet Projects

Lately I’ve been having a terrible time keeping any type of motivation or focus to work on my pet projects. It’s not a matter of being unable to come up with ideas (at least, not currently), but rather two problems:

  1. Finding the time
  2. Finishing

Ferdy Chistant tackles how to manage pet projects, which seems to really be about how to choose a good pet project in the first place. Essentially, pick something challenging and worth learning that doesn’t already have a solution.

While this isn’t exactly my problem area, it did lead me to another post that includes a section on Time management (scroll down…further). Unsurprisingly, it boils down to “make time,” but there is plenty of other good info in there, too.

The real answer for me came in yet another post by Ferdy titled Use mini tasks to keep your pet project moving. It might seem completely obvious, but reading it from someone else helps validate the idea. While time management is huge, you’ve got to be realistic in breaking off tasks that are both large and small.

Mini tasks that you can complete (one or more of) in an hour are essential. I find that I typically spend a lot of time digging through my TODO list getting reacquainted with the tasks/problems, then spend more time just getting “in the zone” before anything getting anywhere near productivity. I plan to separate my list into big tasks, mini tasks, and categorize as either research tasks, coding tasks, or bugs. Task management software isn’t necessary–an Excel or Google spreadsheet should do the trick.

One thing I would add to Ferdy’s notes is to have a solid description of the bug. Just like at work, the description of a bug or task needs to make as much sense two days later as it does two weeks or months later.

Having this list will (hopefully) also help me prioritize tasks to avoid losing time with “feature creep” that nobody else is there to keep in check. Now, back to the first problem: how to make the time for it?

Part-of-Speech (POS) Tagging with OpenNLP 1.5.0

Continuing from where I left off, I’m going to quickly touch on part-of-speech tagging before moving on. It’s actually pretty straightforward once you’re set up to run OpenNLP. This all assumes that you’ve already done sentence detection and tokenization. If you haven’t, go back to the beginning. Here are the links to the rest of my posts:

  • How to use the OpenNLP 1.5.0 Parser
  • Making Coreference Resolution your bitch with OpenNLP 1.5.0
  • Getting Started

    model files

    Only one additional model file is needed for part-of-speech tagging.

    (more…)

    The Lemur Toolkit

    I was reading Learning Similarity Metrics for Event Identification in Social Media (pdf) and caught a mention of the Lemur Toolkit, which I hadn’t previously heard about.

    They used it for indexing the text representation of documents and, apparently, handling stemming, stop-words, and computing tf-idf vectors. I’ll have to look into this in the future when working with term vectors to see how easy it is to use.

    The toolkit doesn’t appear to be active (final version from June 2010), but can be found at http://www.lemurproject.org/lemur.php.

    Unable to locate the Javac Compiler with Maven and Eclipse

    Unable to locate the Javac Compiler in:
    C:\Program Files\Java\jre6\..\lib\tools.jar
    Please ensure you are using JDK 1.4 or above and
    not a JRE (the com.sun.tools.javac.Main class is required).
    In most cases you can change the location of your Java
    installation by setting the JAVA_HOME environment variable.

    The solution that worked for me (tested on both 32- and 64-bit Eclipse/Java) was not to change the eclipse.ini, but to instead set the Runtime JRE on the JRE tab of the Run/Debug Configuration dialog to use the appropriate JDK, either as the “Workspace default JRE” or the “Alternate JRE”

    Does that work for anybody else?