As you can see, the new and improved version of this blog has gone live! Getting to this point has been a long journey for me. I'll lightly touch on the history then will talk about the installation of the Roller weblog engine.
Once I had decided that it was time to build a more powerful blog engine (from scratch of course, since I'm a programmer) I knew that it would be done in Java. The problem was I didn't know Java. As I started to learn Java I quickly realized how many things I needed to learn just to do one project. By the time I had learned Java well enough to be capable of writing a blog engine, I had realized that there is a lot more to a blog than a pretty GUI, entries and comments. I had also noticed that nobody else seems to be writing their own blog engines, including other programmers. So, I chose to use a well established blog engine written in Java.
The engine I chose is the Roller Weblogger from Apache. I decided to run it in the Tomcat servlet container because in the near future I'll also be using Zimbra or Scalix which require a hacked version of Tomcat. If I host all my web apps in one servlet container then I only need one IP address. I'm using Tomcat 6.0, Sun Java 6, and MySQL 5.
The installation was pretty simple -- just read the instructions. For me the challenging part was setting up virtual hosts in Tomcat to work the way I want. If a user navigates to http://www.ryandelaplante.com, I want my blog to come up. Roller was designed for hosting multiple blogs and has a master front page that shows the latest posts. From the Server Admin screen, I was able to specify my blog as the "front page" instead of the default. If it weren't for that, my users would have had to go to http://www.ryandelaplante.com/rdelaplante/ to access my blog. Since I no longer need to force people into the /rdelaplante/ folder, setting up a Tomcat virtual host was pretty simple. One thing to note is that some pages require access to /roller-ui/ which is at the same level as /your-blog-name/, so you can't simply make the /your-blog-name/ the root of your domain.
To set up a virtual host for my domain name, I first created a new webapps2 directory for the virtual host instead of using Tomcat's default webapps directory. Now that I think about it, this was probably unnecessary. I could have deleted all the default webapps, and made Roller the ROOT webapp. Anyway, inside of this new directory I created a folder called ROOT and extracted Roller into it. Roller's installation guide had me add various external dependencies such as JavaMail and Hibernate. It also talked about configuring a context.xml file. I don't have much experience with Tomcat so it took me a while to figure out that you have to create a folder called META-INF in the same directory Roller lives in (ROOT), then create a new context.xml file in it. The context.xml file creates resources such as a database connection and SMTP session, then makes them available to the application. Below is my context.xml file:
<Context path="/"
docBase="C:\\Program Files\\Tomcat 6.0\\roller\\ROOT" debug="0">
<Resource name="jdbc/rollerdb" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
username="dbusername"
password="secret"
maxActive="20"
maxIdle="3"
removeAbandoned="true"
maxWait="3000" />
<!-- If you want e-mail features, un-comment the section below -->
<Resource name="mail/Session"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="smtp.for.my.isp.com"
mail.smtp.port="25"
mail.smtp.auth="true"
mail.smtp.user="username-blog@isp.com"
password="secret"
/>
</Context>
You might have noticed the docBase path indicates I'm running on Windows. Until I get myself fully organized with my Solaris servers (one of which has a dead network card) I decided to host the blog off my BBS computer.
The second configuration file I did some work in is Tomcat's conf/server.xml file. I searched for 8080 (the default TCP port) and changed them to 80. I also added the following lines near the end of the file, just before the </Engine> tag:
<Host name="www.ryandelaplante.com" appBase="webapps2">
<Alias>ryandelaplante.com</Alias>
</Host>
The "webapps2" appBase is the virtual domain's private folder for web apps. Since it lives at the same level as the default "webapps" folder, I did not need to specify the full path.
Once I had roller up and running I created a few posts and played with the web based administative tools. I'm quite pleased with Roller. I noticed that there was only one or two themes that came with it. Each blog owner can choose a theme which defines the look & feel of their blog. After searching google for some themes I found the OptionalThemesForRoller wiki page. I downloaded these themes and extracted them to my webapps2/ROOT/themes/ directory. I found that when you switch themes for your blog, none of the graphics seem to display. It turns out in Roller 3.0 or 3.1, themes work a bit differently. A theme's resources (such as graphics and CSS) are supposed to be copied into a private folder specific to your blog for you to customize. Inside the HTML template, there are macros that resolve the full path to the actual resource. My problem was caused by the theme resources not being copied into my blog's private folder. I had to manually copy these files. I think this must be a bug?
After playing with the few themes I could find for Roller, I wasn't happy with any of them. I wanted to create a new theme that took the best parts from each of the sample themes, and that looked better. I ended up going to sites such as Open Source Web Design, Open Web Design, and styleshoot to browse free templates. Once I found a template I liked I spent 3-4 evenings turning the raw HTML and CSS into a Roller theme. Roller uses the Velocity Engine for templating. It enables you to write basic flow control and logic scripts, expose data to templates, write macros, etc... I was able to copy bits of Velocity scripts from the various sample themes into my new theme, and get it working fairly easily. The hardest part was getting all the CSS to work right. Some of Roller's macros inject raw HTML that has some CSS classes and IDs, which were very different from the template's HTML. I had to rework a lot of the CSS to work with Roller's output. I'm quite pleased with the final result. I plan on donating my new theme to the Roller project once I'm satisfied that it works in every scenario.
Working from his home office in Toronto,
Ryan de Laplante can be found developing software in
Java by day, and obsessing with technology by night.
Ryan has been designing and writing software for
IJW since 1998 and is very passionate about his work.





