You are here: Foswiki>Tasks Web>Item12186 (15 Jun 2015, GeorgeClark)Edit Attach

Item12186: Multiple installation on one server

pencil
Priority: Low
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: InstallerTasks
Branches:
Reported By: RaymondWesterik
Waiting For: GeorgeClark
Last Change By: GeorgeClark
I want to have two different Foswiki-installations on one server, a Windows-server. Is that possible, and if yes, what is the best way to realize this? We've used the Windows-installer to install the first Foswiki-installation and on top of that copied the 1.1.4-files. But how to install the second one? I'm not that familiar with Apache, so I don't know how to run two apache instances via two different ports (but maybe that's not the way to go....).

Thanx!

-- RaymondWesterik - 24 Oct 2012

I've not tried it on windows, but Apache has "Virtual Hosts". It can choose a configuration based upon the hostname in the request. It's easy with http:// but gets a bit more difficult if you are using https:// because the request is encrypted.

Copy the foswiki installation to another path. I'm not familiar with where the windows installer puts things, but if it was in C:\www\foswiki\..., then make a copy in C:\www\foswiki2\... Then take a look at the ApacheConfigGenerator. Add a hostname and it will generate the <VirtualHost> statement. Run the generator twice for your two hostnames, setting the file paths appropriately for the two installation directories.

In Apache, you'll probably have to enable the Name based virtual hosts:
# Use name-based virtual hosting.
NameVirtualHost *:80
...
Include <your first foswiki virtual host config file>
Include <your second foswiki virtual host config file>

(In the future, please ask support questions in the Support.WebHome web ... Thanks)

-- GeorgeClark - 24 Oct 2012

Thanx for your reply George. We're using "http" so that won't be the problem. I did some testing for one virtual host, but did not succeed. Assume ports are 8080 and 8181. Just to be sure, the following statements must be put in httpd.conf, right? (where the "NameVirtualHost" is the actual name I assume?):

NameVirtualHost *:8080
NameVirtualHost *:8181
...
Include <your first foswiki virtual host config file>
Include <your second foswiki virtual host config file>

And in - let's say - Foswiki_1.conf en Foswiki_2.conf I put the code that is generated by the AppacheConfigGenerator? Then I'll have the "Listen" statement in Foswiki_1.conf and Foswiki_2.conf, listening to the two different ports. Then the "Listen"-statement in httpd.conf has to be dimmed I guess?

You see, many question but I hope you can help me. Thanx!

-- RaymondWesterik - 30 Oct 2012

See apache documentation: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

You should have a single NameVirtualHost statement for port 8080 (or whatever).

Then the two configurations. Apache looks for the hostname part of the url to select the host. wiki1.com wiki2.com matching against the ServerName or ServerAlias statements in the host.

-- GeorgeClark - 30 Oct 2012

Why ApacheConfigGenerator is not automatically generating 'ServerName' and 'ServerPath' entries? I was unable to start new Foswiki instance without them.

-- RomanAndrzej - 15 Jun 2015

From what I can tell ServerPath is used to support very old HTTP 1.0 clients. I've never seen it and never had to use it.

And ApacheConfigGenerator does include the ServerName directive. From the generator:
Some people use Name Based virtual hosting. If you want to define a virtual host, enter the qualified hostname here, otherwise leave blank. You can also enter an optional port number. (Port not needed on most systems) Example: foswiki.myhost.com If you are not defining a "vhost", leave hostname and port blank.

Setting this task to No Action. We try to make ApacheConfigGenerator cover most common configurations, but there will always be a configuration that falls outside the norm. ApacheConfigGenerator also falls outside the Foswiki release process.

-- GeorgeClark - 15 Jun 2015
 

ItemTemplate edit

Summary Multiple installation on one server
ReportedBy RaymondWesterik
Codebase
SVN Range
AppliesTo Engine
Component InstallerTasks
Priority Low
CurrentState No Action Required
WaitingFor GeorgeClark
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r6 - 15 Jun 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy