Sitemap - impossible to create file
Hello all, Koha 23.11 I'm trying to run the sitemap.pl and keep getting the error: "Impossible to create file". I'm using the shell, directory location /opac/htdocs/ same as robots, and the permissions are all fine. Any idea what the problem might be? -- Christina
Hi Christina. Assuming that your Koha installation was installed using packages, then the way to set up your sitemaps is set out in this email (rather than trying to run the sitemap.pl file directly): https://lists.katipo.co.nz/public/koha/2020-November/055401.html When you run:
$ koha-sitemap --enable <site> $ koha-sitemap --generate <site>
It will generate the sitemap-related files in /var/lib/koha/<site>/sitemap
You shouldn't be looking at a sitemap.xml, but a sitemapindex.xml file like this:
https://donum.numismatics.org/sitemapindex.xml
In our case, we put a reference to it in a robots.txt file:
Sitemap: https://donum.numismatics.org/sitemapindex.xml User-agent: Googlebot Disallow: /cgi-bin/koha/opac-search.pl Disallow: /cgi-bin/koha/opac-export.pl User-agent: * Disallow: /
Our current practice is to store this file in the instance's dir (/var/lib/koha/<site>/robots.txt)
And you need to point it in your apache config: <Location /robots.txt> SetHandler None Require all granted </Location> Alias /robots.txt /var/lib/koha/<site>/robots.txt
(It's from 2020, but I tested the generation part in the Community's development environment - I wasn't able to test the robots.txt part.) I'll create a bug to get the documentation updated - it only describes the script used to generate the sitemaps, not how to set it up for the first time. To keep your sitemap files up to date (for catalog changes), you will also need to set the command up as a cron job so that it is done automatically. Note that there is a bug that was signed off about file naming so that Google actually uses the sitemap (if you are going to use Google Webmaster (now called Google Search Console), then you may wish to look at the change made there until it passes QA and is pushed to main, and previous versions in maintenance releases). https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36977 Hopefully the Koha Community members can share any updated or recommended practices if any of the information above is incorrect or needs updating. David Nind New Zealand On Fri, 12 Jul 2024 at 23:10, Fairlamb, Christina <cjf@wmu.se> wrote:
Hello all,
Koha 23.11
I'm trying to run the sitemap.pl and keep getting the error: "Impossible to create file". I'm using the shell, directory location /opac/htdocs/ same as robots, and the permissions are all fine. Any idea what the problem might be?
-- Christina _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
participants (2)
-
David Nind -
Fairlamb, Christina