For speeding up a MediaWiki site which has content that uses a lot of templates but otherwise pretty much has static content when the templates have done their jobs I'd like to setup a squid server see
https://www.mediawiki.org/wiki/Manual:PurgeList.php
and
https://www.mediawiki.org/wiki/Manual:Squid_caching
and then fill the squid server's cache "automatically" by using a script doing wget/curl calls that hit all pages of the Mediawiki. My expecation would be that after this procedure every single page is in the squid cache (if I make it big enough) and then each access would be done by squid.
How would i get this working? E.g.:
- How do I check my configuration?
- How would I find out how much memory is needed?
- How could I check that the pages are in the squid3 cache?
What I tried so far
I started out by finding out how to install squid using:
and
I figured out my ip address xx.xxx.xxx.xxx (not disclosed here) via ifconfig eth0
in /etc/squid3/squid.conf I put
http port xx.xxx.xxx.xxx:80 transparent vhost defaultsite=XXXXXX
cache_peer 127.0.0.1 parent 80 3130 originserver
acl manager proto cache_object
acl localhost src 127.0.0.1/32
# Allow access to the web ports
acl web_ports port 80
http_access allow web_ports
# Allow cachemgr access from localhost only for maintenance purposes
http_access allow manager localhost
http_access deny manager
# Allow cache purge requests from MediaWiki/localhost only
acl purge method PURGE
http_access allow purge localhost
http_access deny purge
# And finally deny all other access to this proxy
http_access deny all
Then I configured my apache2 server
# /etc/apache2/sites-enabled/000-default.conf
Listen 127.0.0.1:80
I added
$wgUseSquid = true;
$wgSquidServers = array('xx.xxx.xxx.xxx');
$wgSquidServersNoPurge = array('127.0.0.1');
to my LocalSettings.php
Then I restarted apache2 and started squid3 with
service squid3 restart
and did a first access attempt with
wget --cache=off -r http://XXXXXX/mediawiki
the result is:
Resolving XXXXXXX (XXXXXXX)... xx.xxx.xxx.xxx
Connecting to XXXXXXX (XXXXXXX|xx.xxx.xx.xxx|:80... failed: Connection refused.