Hi,
I did not find any info relative to this topic in the doc. I have two virtual hosts on a server, accessed by two different domain names. From the outside they look exactly as two different servers. From the inside, they have two different web homes, two different SVN home of repositories, etc.
For MediaWiki, I wonder whether it is possible to use the same principle: to have the software installed only once, and use it from two different virtual hosts (by configuring two different databases, two different directories for extensions, etc.)
As far as I know, I have instead to install MediaWiki twice. So I cannot use the package in my OS's packaging system...
Any thought/confirmation on this?
Regards,
On Sat, Dec 12, 2009 at 11:22 AM, Florent Georges lists@fgeorges.org wrote:
Hi,
I did not find any info relative to this topic in the doc. I have two virtual hosts on a server, accessed by two different domain names. From the outside they look exactly as two different servers. From the inside, they have two different web homes, two different SVN home of repositories, etc.
For MediaWiki, I wonder whether it is possible to use the same principle: to have the software installed only once, and use it from two different virtual hosts (by configuring two different databases, two different directories for extensions, etc.)
Sure.
What you'll need is two separate docroots with separate index.php and LocalSettings.php files (where you define the databases as needed). The rest can be symlinks to files in one directory.
I might have left something out, but I hope the above will at least give you a place to start.
Good luck!
Florent Georges wrote:
Hi,
I did not find any info relative to this topic in the doc. I have two virtual hosts on a server, accessed by two different domain names. From the outside they look exactly as two different servers. From the inside, they have two different web homes, two different SVN home of repositories, etc.
For MediaWiki, I wonder whether it is possible to use the same principle: to have the software installed only once, and use it from two different virtual hosts (by configuring two different databases, two different directories for extensions, etc.)
As far as I know, I have instead to install MediaWiki twice. So I cannot use the package in my OS's packaging system...
Any thought/confirmation on this?
Regards,
Yes you can.
There are several methods outlined at http://www.mediawiki.org/wiki/Manual:Wiki_family
Basically, you can put in LocalSettings.php if ($_SERVER['host'] == "domain1.com") require("LocalSettings_domain1.php"); else if ($_SERVER['host'] == "domain2.com") require("LocalSettings_domain2.php"); else die("No such wiki");
And have files LocalSettings_domain1.php and LocalSettings_domain2.php, each pointing to a different database, different upload folder... You can also set some options at the main one to share them.
Beware of mediawiki OS packages, though. It's sad to say this, but generally they don't do a good job with mediawiki. We recommend to stick with the official version from mediawiki.org and be susbscribed to either this list or mediawiki-announcements to keep it up to date.
Platonides wrote:
Yes you can.
There are several methods outlined at http://www.mediawiki.org/wiki/Manual:Wiki_family
Thanks for the pointer and infos, Platonides and Lucas. I will read them carefully and do some trial on a virtual box.
if ($_SERVER['host'] == "domain1.com") ...
This sounds well adapted to my real problem, thanks for the idea!
Beware of mediawiki OS packages, though. It's sad to say this, but generally they don't do a good job with mediawiki.
Is there anything I should know in particular? The server I have to install MediaWiki on is using Ubuntu. Is there anything wrong with its packaging of MediaWiki?
Thanks!
Florent Georges wrote:
Beware of mediawiki OS packages, though. It's sad to say this, but generally they don't do a good job with mediawiki.
Is there anything I should know in particular? The server I have to install MediaWiki on is using Ubuntu. Is there anything wrong with its packaging of MediaWiki?
Thanks!
First issue is that latest ubuntu, released on October only provides mediawiki 1.13.3, while latest stable version is 1.15.1. The 1.13 branch was released in August 2008 and has ended its one-year support from mediawiki developers.
Sure, the package maintainers keep it secure by patching the security issues (in fact they backported to a custom version the mediawiki security releases 1.13.4 and 1.13.5).
You are given an outdated version, for no real security benefit, since in the event of a bug, the fix would be first released from mediawiki, and then backported there.
That needs the admin to keep an eye on it instead of relying in the package manager, but the steps for upgrading mediawiki are just download and extract the new files in the folder and -if it's a major upgrade- run the maintenance/upgrade.php script (which would have to run manually also if using apt).
Since it's written in an interpreted language, it doesn't have the issues of compiled binaries.
Installation of MediaWiki is done via a friendly web page on both methods. Apt does add mediawiki to the web space for cherokee and apache, but that doesn't make the install significantly easier since you can directly extract mediawiki in the web folder of your choice.
On the other hand, they move the mediawiki files over the filesystem, so instead of having "everything in one folder", it's spread in /etc/, /var/lib/mediawiki/, /usr/share/doc/mediawiki/...
Any documentation will refer to the official location, so this redistribution often results in a user unable to locate its files.
Also, your users will likely want the features they see on wikipedia, which runs the bleeding edge mediawiki version (currently, 1.16 alpha). If they were added on a more recent version, you are out of luck (some people even have their wiki running in trunk).
You are also likely to want to install mediawiki extensions. With an old version, you are restricted to the extension version which existed with your mediawiki was released (or check if you are lucky and a more recent one also work). Extensions will need /some/ manual supervision since neither your package manager nor mediawiki-announce will notify you (although ubuntu has a mediawiki-extensions package with a few extensions, perhaps you don't want any other one).
Running old software also the inconvenience that when you ask for help, the regulars like to begin the answers with "You should upgrade" :)
Finally, if you already have the wiki installed, as seems to be your case, downgrading isn't supported by mediawiki so if the package version has a major version different than the version you have installed, you should stick with the newer version (on contrary, upgrading is a well-supported path).
Am I biased? Probably :) I'm not against FHS, but the default mediawiki structure (needed for people which doesn't have root access) works correctly. Mediawiki packages have historically given some unhappy customers. They are fine if you are ok with the above limitations. But given how easy it is to keep it up to date, and being MediaWiki such a robust software I don't find them worth.
Platonides wrote:
Hi,
Thank you for this detailed response!
Is there anything I should know in particular? The server I have to install MediaWiki on is using Ubuntu. Is there anything wrong with its packaging of MediaWiki?
First issue is that latest ubuntu, released on October only provides mediawiki 1.13.3, while latest stable version is 1.15.1. The 1.13 branch was released in August 2008 and has ended its one-year support from mediawiki developers.
Yes, that's the traditional point in developer communities regarding packaging systems maintained outside the communities themselves. So that's what I first checked, and on my Ubuntu Server 9.10 the version seems to be 1..15.0. Ok, that's neither the very latest one release 1.15.1, nor the latest trunk revision (but he, do I really want to run a trunk in production, for a product I am not a developer of? :-/)
I think I haven't changed anything regarding APT on that server, but maybe I did, hence the difference...
Installation of MediaWiki is done via a friendly web page on both methods.
Mmh, that's more a cons than a pro for me, as I install them from scripts (so we can replicate the entire environment in several copies: dev, test, prod, etc.) I send an HTTP request from the scripts to simulate the user behind a browser, but that seems quite fragile to me. Maybe I should instead save a copy of LocalSettings.php and simply copy it instead...
On the other hand, they move the mediawiki files over the filesystem, so instead of having "everything in one folder", it's spread in /etc/, /var/lib/mediawiki/, /usr/share/doc/mediawiki/...
Any documentation will refer to the official location, so this redistribution often results in a user unable to locate its files.
From a maintenance PoV, I think this is a good thing, as this integrate better in the system's backups, right management, which partitions are in read-write or read-only, etc. But I do not have any strong opinion here.
Also, your users will likely want the features they see on wikipedia, which runs the bleeding edge mediawiki version
And same for extensions, yes. But that's not a problem for me, I am such a dictator ;-) I like to wait a see (at least a bit) before adding new features in prod.
Running old software also the inconvenience that when you ask for help, the regulars like to begin the answers with "You should upgrade" :)
Yes, I know that (from both camps, depending on the soft :-)
Finally, if you already have the wiki installed [...]
Nothing in prod, only in the dev environment, so migration is not an issue. But thanks for the info about unsupported downgrading migration.
Am I biased? Probably :) I'm not against FHS, but the default mediawiki structure (needed for people which doesn't have root access) works correctly. Mediawiki packages have historically given some unhappy customers. They are fine if you are ok with the above limitations. But given how easy it is to keep it up to date, and being MediaWiki such a robust software I don't find them worth.
Thanks again for those interesting thoughts. I do not know exactly where, but at some point I think I've been convinced installing directly from a release would be the best option for me.
Interestingly enough, I do not thing that's because of any of the above points ;-), but rather because I need to maintain MediaWiki for several virtual hosts on the same system, and to be able to install any of them from automatic scripts. I guess that will be easier to control everything I need if I install everything myself than relying on the APT package (in particular the exact version I install).
Some soft are easy to use in this kind of configuration. For instance you install the SVN softs once, then create separate homes for repositories for different hosts. For MediaWiki, I feel it is easier to install it once per host, and this is not possible with a system like APT.
Thanks again, regards,
Florent Georges wrote:
Platonides wrote:
Hi,
Thank you for this detailed response!
Is there anything I should know in particular? The server I have to install MediaWiki on is using Ubuntu. Is there anything wrong with its packaging of MediaWiki?
First issue is that latest ubuntu, released on October only provides mediawiki 1.13.3, while latest stable version is 1.15.1. The 1.13 branch was released in August 2008 and has ended its one-year support from mediawiki developers.
Yes, that's the traditional point in developer communities regarding packaging systems maintained outside the communities themselves. So that's what I first checked, and on my Ubuntu Server 9.10 the version seems to be 1..15.0.
My fault, I thought I was checking the version of Ubuntu 9.10 but was instead seeing the version at 9.4. It's nice to see they updated it.
Ok, that's neither the very latest one release 1.15.1, nor the latest trunk revision (but he, do I really want to run a trunk in production, for a product I am not a developer of? :-/)
1.15.1 is a bugfix over 1.15.0 so if they independently fixed their version, it's ok I guess.
MediaWiki trunk is very stable. But I don't recommend to blindly run it on a production site.
I think I haven't changed anything regarding APT on that server, but maybe I did, hence the difference...
Installation of MediaWiki is done via a friendly web page on both methods.
Mmh, that's more a cons than a pro for me, as I install them from scripts (so we can replicate the entire environment in several copies: dev, test, prod, etc.) I send an HTTP request from the scripts to simulate the user behind a browser, but that seems quite fragile to me. Maybe I should instead save a copy of LocalSettings.php and simply copy it instead...
Create the database and insert there the content of maintenance/tables.sql (read the comments at the beginning). You may want to take care on the collation when you create the tables.
You can use (or require) a base LocalSettings and change just the dbname and paths.
On the other hand, they move the mediawiki files over the filesystem, so instead of having "everything in one folder", it's spread in /etc/, /var/lib/mediawiki/, /usr/share/doc/mediawiki/...
Any documentation will refer to the official location, so this redistribution often results in a user unable to locate its files.
From a maintenance PoV, I think this is a good thing, as this integrate better in the system's backups, right management, which partitions are in read-write or read-only, etc. But I do not have any strong opinion here.
The only things to backup in MediaWiki are the database, the images/ folder and LocalSettings.php
The webserver only needs write access to images/ math/ and, if using the web installer, config/ (which can be completely deleted after install).
Thanks again for those interesting thoughts. I do not know exactly where, but at some point I think I've been convinced installing directly from a release would be the best option for me.
Interestingly enough, I do not thing that's because of any of the above points ;-), but rather because I need to maintain MediaWiki for several virtual hosts on the same system, and to be able to install any of them from automatic scripts. I guess that will be easier to control everything I need if I install everything myself than relying on the APT package (in particular the exact version I install).
That's funny. :) Use whatever fits you better.
Some soft are easy to use in this kind of configuration. For instance you install the SVN softs once, then create separate homes for repositories for different hosts. For MediaWiki, I feel it is easier to install it once per host, and this is not possible with a system like APT.
Thanks again, regards,
You are welcome.
On Sat, Dec 12, 2009 at 5:24 PM, Florent Georges lists@fgeorges.org wrote:
Is there anything I should know in particular? The server I have to install MediaWiki on is using Ubuntu. Is there anything wrong with its packaging of MediaWiki?
It's afaik not up-to-date with some security holes. I doesn't take much time to install the official package. In fact it's just a
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_15/phase3/ /wherever/it/should/be
to get a checkout at the current version 1.15
mediawiki-l@lists.wikimedia.org