Wednesday, August 26, 2009

Installatie XAMPP op stick

Voor een ontwikkelomgeving heb ik besloten een compleet drupal.org ontwikkel systeem te instaleren op een memory stick. Compleet dus inclusief mysql, de webserver met php zodat ik een compleet ‘plug and play’ Drupal ontwikkel systeem op een portable stick heb. Hiervoor dus XAMPP op een USB stick installeren.Leidraad voor de complete installatie was de instructie “Simple install of Drupal on XAMPP” http://Drupal.org/node/307956 (Versie: August 17, 2009 - 19:25)

Op het ontwikkel systeem moest een Drupal 6 versie komen. (Een aantal van mijn sites zijn ook Drupal versie 6 ) Dit is gelukkig ook de versie die op bovengenoemde pagina beschreven staatIn bovengenoemde instructie op de Drupal website staat ook dat niet de laatste XAMPP (1.7.2) maar 1.7.1 geïnstalleerd moet worden in verband met een nieuwe nog niet ondersteunde php versie. Dus (met een ietwat verouderde browser Internet Explorer 6.0 ) naar een betrouwbare 1.7.1. versie XAMPP op zoek.Op Sourceforge http://sourceforge.net/projects/XAMPP/ onder files ( http://sourceforge.net/projects/XAMPP/files/ ) geen 1.7.1 op mijn scherm te zien. Door de oude browser, de schermresolutie en/of andere settings waren de oudere XAMPP versies niet allemaal zichtbaar. Het was het niet mogelijk op de pagina verder omlaag te scrollen tot de juiste versie. Gelukkig met een nieuwe Firefox (3.5.1) wel en daarna downloaden dus.

De volgende hindernis was de XAMPP decompressie. Na 28% bevroor het uitpakken van XAMPP zodat ik aan een correcte download van het .exe bestand begon te twijfelen. Proces afgebroken en maar de .zip versie gedownload. Weer hetzelfde probleem.Uiteindelijk maar ondertussen gaan wat anders gaan doen. Na een paar uur kwam ik terug bij mijn computer. Blijkbaar was het wel gelukt aangezien Apache, mysql en phpadmin daarna goed werkten.Oorzaken mogelijk de trage computer en USB stick

Bij inpluggen van mijn portable app ontwikkel systeem op een USB stick moet ik blijkbaar wel om Skype denken, maar daar tot nu toe nog geen last van gehad.

Monday, August 24, 2009

Drupal multi domain setup


Recently I created a Drupal multi domain site installation using Domain Access module domain-6.x-2.0-rc8.tar.gz to run an affiliated network of sites from a single Drupal installation. See http://drupal.org/project/domain

To get it working you also must change some files so it is important that you really read the README.txt and the INSTALL.txtThe only big problem where the cookies as the sites had different top level domain names.
In the config.php you needed to setup a cookie domain in a one domain Drupal configuration you can set it to the domain of the site.

In a Drupal multi site installation this gave problems. (e.g. Can not login in other domains.)
I expected that the safest way was using a special cookie domain using a crossdomain.xml
(In the README.txt and INSTALL.txt file there are also other suggestions.)

For the crossdomain cookies you need to create a crossdomain.xml file containing something like this

<?xml version="1.0"?>
<!-- http://www.a.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="www.a.com" />
<allow-access-from domain="www2.a.com" />
<allow-access-from domain="www.b.com" />
<allow-access-from domain="www.c.net" />
</cross-domain-policy>


However, i tried this and it was not successful and I needed to try something else..

All the sites use the same IP : I did set the cookie domain to the IP address of the server.
(e.g. $cookie_domain="1.2.3.4" ).
This worked very well.
However there are some disadvantages.

  • security: if other sites are running on the same IP
  • change of IP
    if the IP address of the server changes you need to change the configuration file.server has multiple IP
  • E.g. if the IP address of the server changes often (server in local net connected to Internet via provider and with a provider that changes often the IP.
  • if the server is known by multiple IP addresses this will not work.
    Examples
    • server with multiple net interface and domains resolving to the Drupal install with different IPs
    • server in LAN that is also available by on Internet under a different IP by opening port in router.