Thursday, January 22, 2009

Configuring IIS and Apache to work with multiple IPs

This is a small tip regarding configuration of IIS and Apache to co-exist on the same box listening on port 80 for HTTP traffic on different IPs.

My initial setup had Win Server 2003 with IIS 6.0 serving all domains. Incidentally, there were several different domains all pointing to the same IP address and having IIS configured to bind to All Unassigned IPs across them all.

With the introduction of Apache, I was given a new IP address and wanted to have it used by Apache alone. Turns out that IIS would auto-bind to the new address due to its All Unassigned IPs rule in the configuration. The trick to fix that is to configure IIS' IP listen list. Read the MSDN article about it or just run (via command line): httpcfg.exe set iplisten -i x.x.x.x

Restarting IIS after that is not enough (as advised by the article). I would still get apache reporting: An attempt was made to access a socket in a way forbidden by its access permissions.  : make_sock: could not bind to address x.x.x.x. 

The trick? Reboot the server. Then apache manages to listen to the 2nd address normally.

Monday, January 19, 2009

Translating a Drupal Website

And after many many months of procrastrination and delaying, I'm cornered into doing a Drupal website translation into the 2nd language. In my case, the main site is in bosnian and we're adding an english version to it.

My current understanding of the entire process suggests that I'll end up doing quite a lot of duplication of view and block definitions and even panel 2 definitions. That's just something I hate and therefore have been shying away from. I say that this is *my* current understanding and hence may be wrong (which I suspect is the case).

This post will document the process, questions, thoughts, etc - things I hope will be useful to someone else doing a similar translation.


First of all, I'll explain how the current site is organized. 90% of the site runs through Panels 2. I'm using plenty of Views and there are custom content types via CCK. For example, we have Author, Company and Text content types. Text uses Author reference in one of its drop-downs (in this case the author is often someone else from where the article was obtained; the person entering the article into drupal is one of the few admin writers).

There are many Views used everywhere. A common view definition for filters would be:
- node published = YES
- Author node reference = EDITORIAL TEAM Author
- etc.

The biggest problem so far is whenever I have a view that references an author node (the "editorial team" above) that automatically means that:
- Must translate the bosnian version of Editorial Team into its english equivalent (eg. Editorial Team ENG)
- I must create a duplicate view and redefine the filter to use Author node reference = Editorial Team Eng (after switching manually the edit view URL to .../en/.... from .../bs/... so that the english author appears in the filter drop-down)

This is quite a pain and super-demotivating. I can't help but think that I've made some bad choices somewhere or am doing something wrong entirely to be forced to do these duplications.

(to be continued).