Skip to content

Creating a Cpanel WHM add-on domain with dedicated ip address and ssl certifcate

I have recently been migrating a Magento site to a new server which uses cPanel/WHM. The Magento site is setup to run multiple stores off one installation, each of which runs on a separate domain.

Problem: By default cpanel doesn’t allow you to have a dedicated IP address for an addon domain. The reason why a dedicated IP address is needed is because each store requires an SSL certificate and SSL certificates can’t share an IP address.

Solution: You need to edit the addon domain apache config and change the IP address from the main site IP address to another IP address pointing to the server.

1. Create a new account in WHM

2. Go to Addon Domains in cPanel for that account

3. In my scenario the document root for the addon domain needs to be the same as the main domain because it is a multiple store Magento setup

4. Once the addon domain is created you need to edit the addon domain apache config:

vi /var/cpanel/userdata/mainaccount/

You need to change the ip from the main account IP to the addon domain IP: Eg: =>

documentroot: /home/mainaccount/public_html
group: mainaccount
hascgi: 1
homedir: /home/ mainaccount
group: mainaccount
no_cache_update: 0
phpopenbasedirprotect: 1
port: 80

5. Rebuild apache configuration: /usr/local/cpanel/bin/build_apache_conf

6. Restart apache

Magento – Removing session id ?___SID=U from the URL

Today I rolled out a new Magento site and for the first time in almost 2 years of doing Magento development I had the session id appended to the url, namely: ?___SID=U

This was driving me mad and I didn’t want search engines to index the site with the “?___SID=U” in the URL, so I wanted to fix it asap.

Generally when I have a problem, there is usually someone else in the world who has had the same issue, so I searched the web and Magento forums for an answer. I couldn’t find any conclusive answers and seeing as though the Magento technical documentation is notoriously limited I had to find the solution myself.

So, here’s the simple solution:

  1. Go to System > Configuration > Web > Session Validation Settings
  2. Set Use SID on Frontend to “No”

Pretty simple, but I’m sure that it has caused frustration to a number of Magento developers out there so I hope that helps you dudes!

Tags: , , , .

Spotify playback stops on Ubuntu 9.10

Having recently upgraded to Ubuntu 9.10 I experienced some problems with playback on Spotify. And for those of you who didn’t know, Spotify does work on Ubuntu if you run it using Wine.

I found that there are quite few people that are having the same problem on on this thread.

The problem I was experiencing was that every now and then play back would just stop and then if I tried to play another song it would be really poor quality and it would eventually just stop completely.

To fix this I did the following:

  1. Uninstalled wine
  2. sudo aptitude remove wine

  3. Added the latest WineHQ APT Repository to software sources, by following this tutorial
  4. Re-installed wine v1.2
  5. sudo apt-get install wine1.2

  6. Re-installed spotify by running the command
  7. sudo wine "Spotify Installer.exe"

Hope that helps, if not then please let me know

Tags: , .

Ubuntu 9.10 coming soon.

Seeing as though I’m using Ubuntu as my main OS, I decided to show off some of their bling and spread the word that Ubuntu 9.10 is being released in 7 days…and counting!

Tags: , .

Time for twitter

After resisting it for quite sometime now I have finally decide to create a Twitter account.

To keep with the theme of my blog, here is my twitter URL:

Tags: , .

What happened to good old exercise?

Maybe I’m missing something here, but I recently saw two adverts for new “fad” products which apparently help you lose weight.

The first was “Skinny Water“…I mean come on. Okay, so it’s flavoured water that apparently has no calories, helps metabolise fat and boosts immunity. I’m sorry but that sounds like a big crock of sh*t. If you want low calorie water, how about drinking water?

The second amazing new weight loss product that I saw was advertised on the underground. It is a new shoe which Skechers have release called “Shape Ups“. Apparently they have the following benefits:

  1. Weight loss
  2. Body composition
  3. Glutei strength
  4. Low back strength/endurance

Haaibo, now that is amazing…shoes that make you fit. So for the second time…what a crock of sh!t!

What about just eating healthy food, drinking good old tap water and doing exercise in a normal pair of running shoes? I suppose that is just too difficult for the majority of the world’s population. It’s not a wonder that obesity levels are at an all time high.

Tip for the day: Stop being so lazy, get off your fat arse and do some exercise!

Tags: , .

Flex Internal build error

Whilst I was developing in Flex Builder today I came across the following abstract build error messge:
An internal build error has occurred. Please check the Error Log

It seems like this is quite a common problem and I found a number of blog atricles referring to it. It seems that one gets this error due to the following reasons:

  • Having an incompleted switch statement without any cases
  • Missing a semi-colon after a variable declaration
  • Listing a twice with different extensions in your mxml
  • Declaring an import twice in an Actionscript file or embedded Actionscript in an mxml file
  • If certain lines of code are commented out resulting in a trace statements being unreachable

However, the reason why I was getting the error was because I had mistakenly extended a class of itself…eg

public class myClass extends myClass



I found that soultion in a commet by Jules on Michael Imhoff’s blog.

I just had the same error (Uncaught exception in .log, java.lang.StackOverflowException). It appeared after I’d done some work with sed on my object model. Turned out one of the classes extended itself, ie class myClass extends myClass 🙂

Thanks dudes 🙂

One would think that the Flex compiler would have identified this and given a more dexcriptive error message?

Tags: , , .

Wamp php fopen and fsockopen problem on vista

I have finally found a solution to a fopen/fsockopen problem I was having on Vista using Wampserver…I know it’s not ideal to be developing on Windoze, but it’s my work machine so don’t crucify me 🙂

I wanted to access a php file on my localhost using the following code:

$fp = fopen("http://localhost/test/export.php", "r");

but got a [function.fopen] php warning:

Warning: fopen(http://localhost/test/export.php) [function.fopen]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\test\export.php on line 11

I also tried adding “@” before the fopen, but still got the same php warnings

$fp = @fopen("http://localhost/test/export.php", "r");

So instead I tried fsockopen instead, but got another smiliar warning:

Warning: fsockopen() [function.fsockopen]: unable to connect to http://localhost/test/export.php (Unable to find the socket transport “http” – did you forget to enable it when you configured PHP?) in C:\wamp\www\test\export.php on line 11

Now for the solution:

I came across a solution which worked for me on the wampserver forum:

I think I just found the solution here:

It seems by changing ‘localhost’ to ‘’ it works!

So, changing the code to look like this actually works:

$fp = fopen("", "r");

Strange, but true. Thanks to anarchitecton!!!

Tags: , , , .