Archive for the ‘Work’ category

Getting symfony running on 1&1 shared hosting

September 30th, 2007

This is mainly for my own record. I’ve been playing with the Symfony PHP framework to see if it’s suitable for a new project I’m working on, but had a little bit of trouble getting it working on my 1&1 shared server.

The first problem was fairly easy to fix – the default version of PHP on the server is 4, but symfony needs 5.0+. A quick entry into the .htaccess file for the site fixes this. Add “AddType x-mapp-php5 .php ” and all is well. It’s a pain to have to remember to type “php5 symfony”to get things working, but no big stress.

The next issue is to get the images to show up in the test index.php page. I installed symfony using the PEAR packages, so the symfony_data/web/sf directory wasn’t visible as it was way outside the web root for the domain. A simple link fixed that. First, I needed to get the directory for my php/symfony data directory using the pear5 comand
> pear5 config-show
Configuration (channel pear.php.net):
=====================================

<snip>
PEAR executables directory bin_dir /kunden/homepages/18/d96003440/htdocs/local/bin
PEAR documentation directory doc_dir /kunden/homepages/18/d96003440/htdocs/local/lib/php/docs
PHP extension directory ext_dir /kunden/homepages/18/d96003440/htdocs/pear/ext
PEAR directory php_dir /kunden/homepages/18/d96003440/htdocs/local/lib/php
PEAR Installer cache directory cache_dir /kunden/homepages/18/d96003440/htdocs/pear/cache
PEAR data directory data_dir /kunden/homepages/18/d96003440/htdocs/local/lib/php/data
<snip>

Next I created a link in the web directory for my new application to the symfony web/sf/ directory in my applications web directory (the bolded one above):

cd web

ln -s /kunden/homepages/18/d96003440/htdocs/local/lib/php/data/symfony/web/sf/

Hit the URL http://www.servername/app/web/app_dev.php and all was well. Now to crack on with some development.

Google’s directions are getting more flexible.

June 29th, 2007

I hadn’t noticed this last week, but the last set of directions I tried with Google Maps are much more flexible than before.

Directions from Thatcham to the City (not that you’d want to drive that route).

It’s possible to drag the blue route line around to different roads, add and remove destinations, all with real-time updates to the description of the route.

Very nice. We just need it linked in with real time traffic and roadworks info and it would be perfect

Time to rewrite Windows?

January 15th, 2006

Isn’t it about time that Microsoft just did the deed and rewrote Windows from the ground up? They’ve been bashed many, many times by various malware writers and it’s getting to the stage that its not very funny any more, even to a Linux zealot like me.
It seems that Microsoft’s next version of Windows, Vista, needs a patch already. Good to see them shipping it, but for an OS that is months away from shipping, the supposed latest and greatest in PC goodness, it’s pretty crappy to have a security hole exposed based on 6+ year old code.  It’s even crappier to have a product manager explaining that the code originates from 1990 and that it ‘has been ported’.  It wasn’t ported, it was left lying around, they’re just tacking new stuff onto the old.

I think it’s called turd-polishing.
Microsoft Ships First Vista Security Patches

Linux-Based SMB server

January 11th, 2006

Roberto is looking to produce his own personal linux distribution that contains enough features that would make it appealing to a small to medium business.  I’ve been thinking about the same thing myself, and came up wth a similar feature set.  He doesn’t like SE Linux, and who can blame him, but now that Novell have open sourced AppArmor that might make building a secure server a little easier.

I was also thinking of using Nagios or something like that for remote monitoring of sites, something that could enable a nice recurring revenue by charging support on a monthly basis.  £25 per month x 50 customers  is a healthy income and a good incentive to keep development going

Interesting times :)

Doing battle with Mambo and Google Sitemaps

January 3rd, 2006

I think I’ve just managed to do something that has been baffling me for 2 or 3 days now, that is, to get Google sitemaps to verify a Mambo based web site that I’m building for a friend. The problem was that we were using the SEF (search engine friendly) component in Mambo to deliver nice, static looking URLs in preference to the dynamic type that Mambo produces. An example:

http://www.theopenconsultinggroup.com/content/view/29/51/ -

This is a page of content from the site after SEF has done it’s business.

http://www.theopenconsultinggroup.com/index.php?option=com_content&task=view&id=29&Itemid=51 -

This is the same page as published by Mambo without SEF enabled.As you can see, there’s a big difference, and Google notices the difference. From my reading, the former URL is far more preferable to GoogleBot since it’s not plagued by question marks and ampersands, so that what we’ll provide. Enable SEF in the Global configuration, rename htaccess.txt to .htaccess and all URLs are rewritten nicely.

Is that the end of it? Not really. The home page for the OCG is pretty static, with a javascript menu as the topmenu. This is generated from the database dynamically and it works well – as you add pages, they appear without having to change anything as long as you assign them a place in the menu. The problem with this is that Google (and it seems most search engine) don’t like javascript links – they prefer a nice standard text link with alt text. I could change the system, and might still do, to a CSS based template but in the meantime I thought I’d suggest a sitemap to Google to see if it would trawl it.

Having signed into with Google sitemaps with my regular Google account, I added the Open Consulting Group as a project and used the filename supplied to create an empty file in the root of the web site. Then I tried to verify my access with Google Sitemaps. Nothing. I left it for a few days to see if anything would happen, but the GoogleBot just wasn’t verifying. Crapola.

Finally tonight I had a play with the .htaccess file in the mambo root directory. I commented out the rewriting conditions and rules temporarily and ran a verify with Google again and instantly we were verified – still not being crawled (yet) by the bot, but at least we’re in the picture. I uncommented the conditions and rules after verification and we’re back to where we were. The problem was with the SEF feature of always returning some content, ever if the URL you requested is invalid. As an example, here’s the bot looking for my unique file to verify that it’s my web site…

66.249.72.45 – - [03/Jan/2006:21:41:30 +0100] “HEAD /google66b6xxxxxxxxx51x.html HTTP/1.1″ 200 0 www.theopenconsultinggroup.com “-” “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)” “-”

So far, that’s good. It sees that the file is there. Now comes trouble.

66.249.72.45 – - [03/Jan/2006:21:41:32 +0100] “HEAD /GOOGLE404probeddb8db1a52266114.html HTTP/1.1″ 200 0 www.theopenconsultinggroup.com “-” “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)” “-”

Two seconds later it tried to retrieve what must be an invalid URL from the site, but it gets a status of 200 – OK. The SEF function is rewriting the request to the homepage and Apache is serving something up – this is a no-no in terms of the verification process. The fact the Google knows there there isn’t a web page with that name, yet one is being returned (due to SEF) stopped the verification.

I disabled the rewriting by commenting out the following three lines in the .htaccess file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

These state that “for filenames or directories that don’t exist, just go to index.php” (in a nutshell). Commenting these out, then re-verifying, ensured the the sitemaps verification went through (for now).
So there lies the problem. How do I get Google to verify my right to have a sitemap on the OCG homepage, yet still be able to run SEF within Mambo. I suspect I need a little mod_rewrite voodoo, I just need to figure it out or invoke the Lazyweb.

Bad Behavior has blocked 1674 access attempts in the last 7 days.

Page optimized by WP Minify WordPress Plugin