Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mediawiki not using Squid

Status
Not open for further replies.

BenyG

Programmer
Jul 8, 2003
77
0
0
GB
Dear all,

I have Apache 2.0.55 (Ubuntu), PHP 5.1.2, Mediawiki 1.9.3 and Squid 2.5.12.

Squid is acting as a reverse proxy and is listening on port 80 and Apache is listening on port 85 so that I can still bypass squid for testing on another machine on the LAN.

Meidawiki is not using Squid, or is ignoring Squid despite the relevant variables being set in LocalSettings.php:

$wgUseSquid = true;
$wgSquidServers = array('127.0.0.1');

There are two reasons why I think it is not using Squid:

1. The non-static wiki pages are never cached and other content like JPGs are cached fine.
2. Mediawiki is not using the X-Forwarded-for header on the pages - at the top of the page the IP address is always 127.0.0.1 .

I have looked up how to setup Mediawiki for use with Squid on many sites and they all point to just adding these two lines, I have even changed the values in DefaultSettings.php in case it is using those instead!

I know there are other ways for Apache to extract the X-forwarded-for header for PHP scripts, but it would be better to usethe functionality within Mediawiki.

Does anyone have any ideas? Please let meknow if you require more information.

Thanks,


Benjamin
 
what have the people at mediawiki and squid suggested?
 
I have already posted tosome Mediawiki sites,no responce as yet. This isnt a Squid issue as Squid works fine,

Benjamin
 
I don't think that we can safely say that this is a php problem. since many many people use mediawiki and squid without problems, i must assume that there is something unique about your setup. Perhaps your php installation is corrupt (have you noticed erratic behaviour on other sites?) But more likely you have something in your mediawiki/apache/squid configuration that is wrong. Help on that kind of thing is outside the scope of this forum.

But i'll give what advice I can (treat with a pinch of salt as i've never used this in anger).

i am assuming that you have still got apache listening on port 80? you need something like this in your httpd.conf file (if you are using virtual hosts. if not, you just need the first line).

Code:
Listen 127.0.0.1:80

MyVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
    ServerName mydomain.com
    [other directives]
</VirtualHost>

and remember for the squid config you need to make sure that it is only listening to port 80 on the external IP

lastly i have read that the top contributors box stops the cache from working. you might try setting the nav_menu to false in extensions/awc/top_ten/config.php
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top