cf.Objective

Speaking at cf.Objective

Recommended Books

Blog

Adding Meta Data to an Entire Site in Mura

This is mostly for my own reference...isn't that how most blog posts start these days? :)

As some of you know, when I'm not busy with consulting, I play music in a variety of projects. Earlier I needed to update the meta "keywords" and "description" for my band's website (currently running Mura 5.5) -- the meta data is the same for every page across the site, so I was looking for one site-wide place where I can make such a change. My first thought was "there's probably a site-wide setting for that in the Mura Admin", but after poking around for a few minutes, that didn't seem to be the case. I suppose it's possible that the meta data is hard-coded into the site theme (though unlikely), so let's check there. Mura has a site-specific directory where it stores the themes, like so:

/[sitename]/includes/themes/[theme name]

...and underneath there, you'll find a variety of files composing that theme (css, images, some CF templates for headers/footers, etc). Among these is html_head.cfm which contains all the things you'd typically find in the section of a website, and in there we find:

<meta name="description" content="#HTMLEditFormat($.getMetaDesc())#" />
<meta name="keywords" content="#HTMLEditFormat($.getMetaKeywords())#" />

....Okay, so the meta data isn't hard-coded, and there isn't a site-wide setting for it either. After a bit more searching, I found this link discussing "converting a third-party theme to a Mura theme" (not the most obvious of places for info about meta data, but hey it contains the answers I needed). About halfway down the page is this blurb:

Notes: Unless you specify otherwise on a specific page, Meta data content cascades down to the content nodes below. This means you don't have to set the meta data content on every page unless you specifically want to.

So let's to back to Mura Site Manager...my site content is laid out like so:

Mura Site Manger screenshot

As you can see, everything is below "Home", so let's click on "Home", then go to "Meta Data" and add the new keywords and description.

Success! So although the answer I needed was listed as part of "converting third-party themes", the answer applies to pretty much any theme in Mura, regardless of where it came from. As long as the theme html_head.cfm file includes these lines:

<meta name="description" content="#HTMLEditFormat($.getMetaDesc())#" />
<meta name="keywords" content="#HTMLEditFormat($.getMetaKeywords())#" />...this should work just fine.

-Nolan

Beginning Adventures in CentOS: Installing Apache and MySQL

Here it is, the first of the promised "Beginning Adventures with CentOS" blog posts...

I started a new project yesterday. This particular client is running CentOS 5.5 32-bit, Tomcat 5.7, Apache, and a combination of MySQL and SQL Server. One of my first tasks is to build a VMWare image that mirrors that (or gets as close as possible without losing a lot of time) so we have a playground for some development work. I've installed Ubuntu on a desktop once or twice, but that was at least a year ago, and the Ubuntu installer did all the work for me really (which I greatly appreciated). So let's see how different installing CentOS in VMWare is from that experience...

I downloaded the DVD ISOs (2 discs total) for CentOS

Making a new guest in VMWare is easy enough. And with that "express install" option, VMWare automagically installed CentOS for me! Wow, that was even easier than the Unbuntu install I did last year! :) Firefox comes pre-installed too, so it's easy to tell if I have a working internet connection inside this new VM -- Firefox pop up and sees Google.com, so that's taken care of too.

So now we need to move onto the "real" stuff -- installing Apache, MySQL, and Tomcat...

Let's open Firefox again and go to "http://localhost"....instead of the default "Apache is running" web page, I get "Problem loading page". So either Apache isn't installed, or it's just not running. Fortunately CentOS has some similarities to Windows, and there is a "Services" screen in CentOS, just like in Windows. The Apache service is actually named "httpd" (which kind of baffles me, but that's a separate discussion), and we do indeed have a service called "httpd" there, so we just need to check it, and click "start". Now let's go back to Firefox and do "http://localhost" again. Success! We now have the "Apache is running" web page.

Next up, MySQL and Tomcat. Since I'm more familiar with MySQL, let's start with that one...

After checking the Services control panel, it doesn't seem that MySQL came pre-installed with CentOS (I was only half-suspecting it might be). I could use the "Add / Remove Programs" menu, but since the whole point of this is to learn something, let's try to install it from the Linux command line instead. On my Ubuntu machine, you install things with the "apt-get" command, so let's try that on CentOS and see what happens:

>apt-get mysql

...and "Command not found". Okay so it's not "apt-get". After a bit of thinking/Googling..."yum" is the command we're looking for, so let's try this again:

>yum install mysql

And that comes back with "You need to be root to perform this command".

Delving back into my "just enough to get in trouble" pile of knowledge, I remember that sometimes you can use this "sudo" command to bypass not having enough permission to do certain tasks. So let's try...

>sudo yum install mysql

"nolan is not in the sudoers file. This incident will be reported."

Hmm....well, I just built this box few hours ago, and "nolan" was the account I used to do everything else. Maybe this is where I should have typed "sudo su" instead of "sudo"? Nope, that also doesn't work. Though this one does:

> su -
> yum install mysql

Success! Admittedly this is one of those areas where I just sort of "brute force" my way through variations on the "sudo" and "su" command until I find one that works. Like I said, I'm not a Linux guy, and I've never fully understood the detailed specifics of what "sudo" does. (That alone could probably be its own blog post...I could certainly use something to reference in the future when I forget...again...)

MySQL should now be installed, let's double-check...a quick look at the Services control panel, I do indeed see a process called "mysqld", which is MySQL (though again, why it's not called "mysql" is somewhat puzzling...there's probably a really long geeky answer as to why, if I wanted to look it up.) Let's test that MySQL is indeed working:

>mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Ah...forgot to start the MySQL service. I could go back to the Services GUI and do that, but just for practice, let's try it from a command line:

>service mysqld start
Starting MySQL: [ OK ]

>mysql
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Success again! We're on a roll! We still have to install Tomcat, not to mention configuring everything, setting up user accounts, etc, but this is a pretty good stopping point. We'll work on that in a different blog entry....

(If there are any experienced Linux guys reading this far, feel free to chime in with feedback on what I did wrong. I'd appreciate any tips you feel like sharing.)

-nolan

Beginning Adventures with CentOS

I'm a full time freelance consultant, and as such I deal with lots of development teams with varying skill sets. One recurring event I've run into is, senior developers that (for whatever reason) don't want to post their questions on a forum or email list. I suspect its because of...

a) laziness (but I don't wanna open another window!) b) stubbornness (I'll fix it myself if it's the last thing i do!) or c) I don't want people "out there" to see me asking such a basic question on the internet, they'll think I don't know anything...which really is ridiculous.

We were ALL junior developers at one point. If you search the BACFUG archives you'll find me asking all kinds of introductory questions. Ask any of the C++ programmers I worked with at my first job and you'll hear several of them say "yeah Nolan had about 100 questions about how pointers and linked lists worked". The same is true of any other senior developers. Besides, nobody knows EVERYthing.

Having been guilty of all 3 myself, I can definitely relate. So in the interest of a) blogging more (one of my resolutions for 2012), and b) eating my own dog food, I'll just come out and say it:

I'm not a Linux guy.

As of a year ago, my Linux experience was about like so:

* I had installed Ubuntu on a desktop at home, to try and wane myself off Windows, and learn something new. It didn't really work -- I still use that Windows box, though mostly for iTunes and gaming. But I have started using the Ubuntu machine as my "main internet surfing" computer.

* I can FTP and Telnet from a Linux terminal and get what I need.

* I took an "Intro to Unix" class in college where we went over vi, bash and korn shell, cron jobs, and a few other odds and ends, some of which I've had to revisit since then, but only sporadically.

* Though I'm quite comfortable with a DOS command line, I've never had to do THAT much at a Linux command prompt.

...there are probably other points I could add to that list, but basically you get the idea. I'm the first to describe my Linux skills as "just enough to get myself in trouble". :)

Over the last 18 months, I've been thrown onto several CentOS projects for clients. And while I'm definitely learning more "Linux stuff", I'd still put myself in that "knows just enough to get in trouble" category. But if I'm in that category, there are probably other people that feel the same way. So why not blog about it?!

Starting today, I'm going to blog my "beginning adventures with CentOS". If you're a mid to senior level Linux guy, these will all bore you to tears. If you're like me, and still trying to make Linux stuff "click", then maybe you'll find these posts of interest.

And away we go....

-nolan

Tomorrow at SACCFUG -- Template Method Design Pattern

Tomorrow (January 10) at the Sacramento ColdFusion User Group, I'll be giving a demo of the Template Method Design Pattern. This is a really useful technique when dealing with things like vendor or client-specific versions of an algorithm in your application.

Also note, this will be the first meeting at our new location! The fine folks at AcademyX (180 Promenade Circle, Sacramento, CA) have agreed to host us for a while.

More details are available at the SACCFUG website.

Hope to see you there!
-nolan

Speaking at cf.Objective

I was very pleased to receive an email last week stating that my presentation got approved, and now it's official...I'm speaking at this year's cf.Objective conference in Minneapolis!

I'll be giving my talk on "Intro to Model View Controllers Without A Framework" that I gave at NCDevCon in September (as well as a few local user groups). If you're still not quite sure what to make of CFComoponents, or what all the fuss is about with MVC frameworks like Model-Glue or ColdBox, then this is the place to be. This will be an updated version of my talk, including more info on "Service Layers", and probably some additional sample code too.

Two years ago was my first trip to cf.Objective (I couldn't make it last year); it was a great experience. I'm hoping to meet more people in the CF community, and am especially looking forward to the Arm Wrestling BoF Session. :)

See you there!
-Nolan

More Entries

Search

Recent Comments

Beginning Adventures in CentOS: Installing Apache and MySQL
Eden Crane said: What you are doing so far sounds good to me. 'su -' is good,... [More]

Flex training in San Francisco
John Gag said: Nice, hopefully I can come down and check out your presentat... [More]

Back from CFinNC!
Roger Austin said: There is a very good chance there will be CFinNC 2.0, but we... [More]

Beginning Adventures in CentOS: Installing Apache and MySQL
Eden Crane said: What you are doing so far sounds good to me. 'su -' is good,... [More]

Flex training in San Francisco
John Gag said: Nice, hopefully I can come down and check out your presentat... [More]

Back from CFinNC!
Roger Austin said: There is a very good chance there will be CFinNC 2.0, but we... [More]



BlogCFC was created by Raymond Camden. This blog is running version 5.9.7. Contact Blog Owner