On Dec 27, 2007 10:12 PM, Brion Vibber <brion(a)wikimedia.org> wrote:
Mohamed Magdy wrote:
I was trying varnish cache but found that
problem:
The url changes and the backend port is appended to the url which makes
mw
not use the varnish cache.. so instead of
http://mw.wiki/wikistuff , it
changes to
http://mw.wiki:backendport/wikistuff ..which gives errors of
course.. so is there a way to make mediawiki stick to the url without
that
port (port 80 only)?
MediaWiki detects the protocol, hostname, and port as given to it by the
web server and uses those by default when constructing full URLs back to
itself.
In a situation where you've got a front-end proxy between the server and
the outside world, that can indeed give you the backend's configuration.
You'll want to override the autodetected settings like this:
$wgServer = 'http://mw.wiki';
Thank you! it stopped giving the beport.
Note that in default configuration, the proxy cache will probably still
be hitting the backend web server to check for updates to wiki pages.
For best results you may need to configure 'squid mode', which will
allow the proxy to cache anonymous page views, with explicit cache purge
notifications sent when the pages change. I haven't tested myself to
confirm that this works properly with Varnish, though.
How would i know if it works properly? ;)
I added
$wgUseSquid = true;
$wgSquidServers = array('127.0.0.1');
and
http://varnish.projects.linpro.no/wiki/VCLExamplePurging
--user:alnokta