Hi, Is there a way of making a given ikiwiki instance accessible both from the LAN where it's server is and from the WAN?

Say I have ikiwiki installed on a server connected to a router. That router has port forwarding and dyndns configured so I could open ikiwiki from outside the LAN. Trying to open normal ikiwiki pages, from outside the LAN, or with a proxy, works. However, the Editing and Preferences pages, for example, redirect to http://192.168.x.x/~username/ikiwiki/ikiwiki.cgi?page=posts%2Fhello_world&do=edit (in the case of the edit page), which of course only exists inside the LAN, and fails loading.

Editing the "url" and "cgiurl" directives in the .setup file to point to the dyndns address makes it work from the outside, but I can't edit the pages from inside the LAN anymore with this configuration. The normal pages, once again, are accessible. Edit or Preferences, on the other hand, redirect to the public address, which I can't open from inside the same LAN it points to.

For this reason I ask, is there an way to have multiple urls point to the same ikiwiki page, namely a LAN IP url and a public IP one? Thanks in advance.

I don't think one can alter IkiWiki to have multiple URLs, because the URL is built in to the CGI when the CGI is generated.

  1. Use the external hostname (say, foo.com) for the URL, and tell your local machine that foo.com has an IP of 192.168.x.x, thus making it accessible from within the LAN.
  2. Give the URL as a relative-absolute URL; that is, rather than "http://foo.com/ikiwiki.cgi" give it as "/ikiwiki.cgi". This doesn't always work, though.
  3. Build two versions of the site from the same git repo. One for access from inside, and one for access from outside. Both setup files would need to be identical, apart from

    • the destination directory
    • the URLs
    • the git-update file name; one would need to call it something other than post-update.

    Then one would make a new "post-update" file which calls both of the ikiwiki post-update scripts, so that both versions of the site are updated when you make a change. Then set up your web-server to point to the "external" directory for the external site, and the "internal" directory for the internal site; easy enough to do if you use virtual hosts.

Yes, I know the third one is somewhat complex... I use the idea myself in order to make two versions of a site where one is editable and the other is not, but that's not what you're aiming for, I know.

Comment by kerravonsen [dreamwidth.org] Mon Oct 8 22:02:09 2012