Although Search engine Spiders are a good thing (e.g. GoogleBot, YahooSlurp etc) as if they dont spider your website, you will probably not appear on search results, but at the same time, they also cause a lot of un-necessary management to be done on the developer side of things. Here are a few of the things I have noticed :-
1) They cause a lot of un-necessary active sessions created on the server if you have session management turned on (which most sites do).
2) There is a growing number of bots and its really hard to tell which ones to block and which ones not.
3) You do want the major search engines to spider you but you don’t necessarily want every search engine to spider you and it becomes hard to maintain this list (for a developer).
Apart form the above, another major problem is when someone intentionally tries to download/crawl your website using a custom written script or using a site downloader and in this case, the Browser/Referrer is mostly spoofed as someting they are not. These crawlers most probably do not even respect the existence of a robots.txt file.
My question is, apart from checking the name of the bot and restricting their session to like a few seconds , what other checks do people put in place to solve these hurdles ?
I had to re-install ColdFusion 9 on my MacOS today and having installed CF approx. a million times before, I thought it would only take few minutes.
Here is what I did :-
1) Went to /Applications/ -> Moved existing “ColdFusion 9″ folder to Trash.
2) Ran the CF Installer and everything went well. But finally, the installer got stuck at “Installing WebServer Connectors” – I waited a few minutes but then gave up.
3) Repeat Steps 1 and 2.
4) I then decided to try the installation with the in-built webserver. That worked, but I could not load any pages at all in browser. Basically, Apache was not working.
5) I opened Terminal. Ran the command “sudo apachectl start” – It says “Already running”. At this point, I was wondering whats wrong.
6) Ran the command “sudo apachectl restart” and it appeared as if it got restarted. No changes.
7) Did some Search and ran this command. “sudo apachectl configtest” to make sure the Apache config was fine. Turns out it was throwing this error.
httpd: Syntax error on line 241 of /private/etc/apache2/httpd.conf: /private/etc/apache2/httpd.conf:241: <Files> was not closed.
I think this surely must have been done by the CF Installer. I opened the httpd.conf file and sure enough, it was broken.
<Files "rsrc">
Order allow,deny
Deny from all
Satisfy All
<DirectoryMatch ".*\.\.namedfork">
Order allow,deny
Deny from all
Satisfy All
</DirectoryMatch>
Once I fixed this by closing the </Files> tag, Apache and CF both started working again.
Anyone else seen this before? I have seen this first time and its hard to believe that CF Installer actually messes up the Apache Config file.
I was assigned a task, recently, whereby I was given a list of about 100 domain names and I had to create all those websites on a fresh installation of IIS 6.0. Naturally, I started looking for some kind of tool that would do this for me. After spending some time on search and asking a few people, I realized , there is no such tool (correct me if I am wrong here).
So, I thought of writing a little ColdFusion script that would do this for me. Turns out it wasnt that bad at all and it worked like a charm. More »
This post of mine is coming after a long time, I know. The reason for this has been lack of time, being very busy with other things etc. I will try to be more frequent here hereafer.
Anyways, in a recent project, I had the requirement to show Twitter statuses on the homepage of the website I was working on. The first thing I did was, went straight to RiaForge and searched for any Twitter related CFC’s. I did find a couple of them and they all looked pretty good. However, since I only wanted to get the stautses and not the other fancy stuff like direct messages etc, I thought there must be an easier way of doing it.
That’s when I thought if the statuses are available as RSS feeds, I am done. CFFEED can do everything for me.
<cfset feedurl = "http://twitter.com/statuses/user_timeline/15172848.rss" />
<cffeed source="#feedurl#" properties="statusmeta" query="statuses" />
Thats it. The code above gives me a feed of my status updates in a ColdFusion query, which I can now use to display as I want. There are too many columns in the query with lots of useful information. I ended up using just the “rsslink” and “title” columns as those were the only 2 I wanted for my requirement.
Its nice to know that Twitter publishes these rss feeds and even nicer that I can use this in one line of code.
If you are using ColdFusion XPath functions to search/parse XML strings, you will probably have come across this one at some point. Not all, but most of the XML files have namespaces in them e.g. xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”. If you use Xpath on a string that contains namespaces, chances are that you will get back the namespaces as well and sometimes you dont want these at all. You just want to deal with the real data. More »
This weekend, I thought of revisiting the Coldfusiondocs.com application which I didn’t get the time to even touch for last so many months. I thought using Cairngorm to re-write the app would be ideal as it’s the most widely used Flex framework around.
So, I went ahead and re-wrote the whole thing using Cairngorm (took me one full day) and in the process optimized/fixed the existing minor problems as well. And I also thought that, since this is a project for the community, why not release the code to the community as well. So, for those who are interested, here is the Project with the source code. And yes, project contributors are most welcome. There is loads we can do with it.
A note for those code critics : I am not a Flex guru and definitely not a Cairngorm guru. So, please keep the code critics to be postive ones please. This doesn’t mean my code is bad, it just means it “might” not be the best code around. Also remember, this is not a paid project anyways.
I have been using ColdBox for a few months now and I absolutely love it. Althought I havent used all the features it has to offer, I like the URL rewriting feature a lot.
In one of my projects, my routes.cfm had quite a few routes added that looked like this.
addRoute(pattern="contactus", handler ="ehPages", action="dspStatic")
Now, basically, what this does is sends the request to dspStatic action which reads the contents of the page from database and passes on to the view. I wanted to set a variable for which pagename to get from the database in the route file itself so I could share the same action for different pages. Thats when I looked at “matchVariables” attribute. I used it as documented and it wasnt working.
Apparently, it was introduced in 2.6.3 and I was using 2.6.2 . Thanks to Luis for clarifying this to me. But there is also an undocumented way of doing this with earlier versions.
addRoute(pattern="contactus", handler ="ehPages", action="dspStatic", pagename="contactus")
So, you can pass your extra variables in the route file and they would be available in the request scope. Thats pretty cool I think!
I thought this little tip might save someone some troubleshooting/debugging time.
This is a great news for the CF community. Railo has gone open source 2 days ago. And they have a brand new website www.getrailo.org . Railo is an open source CFML engine that is amazingly fast and supports all the existing CF frameworks/applications. For a complete list of compatibility, follow this link.
Its pretty easy to get started with Railo, just download a zip file, extract and start the server. Thats it! For a full list of downloads, go here. I have played around with it a little bit and it looks pretty promising. I hope to do some more Railo in the coming time, so expect a few more blog posts on Railo here.
And here is the official Railo documentation and thanks to Mike @Railo who has been kind enough to help me set up the Railo documentation on my CF docs site as well, which is located here.
I think this is the best time to be in the CFML world!
I am pleased to see this, really. Adobe has announced free ColdFusion curriculum which can be used by anyone to learn and teach ColdFusion. The curriculum covers 2 main areas.
Introduction to ColdFusion 8 [PDF]
This course covers the basics of ColdFusion and focuses on best practices and design, while stressing the importance of usability, optimization, and performance.
Advanced ColdFusion 8 Development [PDF]
This course is designed to teach you how to take full advantage of Adobe ColdFusion 8 while building web applications. The course focuses on best practices and design, stressing the importance of usability, code reuse, performance, and scalability.
I think this is a great step forward in promoting CF and getting more and more users into the ColdFusion world.
This post is just a little tip that I think can take a lot of time in trying to solve.
I was building a variable , using cfsavecontent, to process later on and there was absolutely nothing wrong with the code according to me, as below :- More »