2

I'm using MapCache with MapServer. When I use the link to MapCache the map is served but I look in the /tmp/mapcache directory and no files are list. I've made the /tmp/mapcache directory world writable and still no luck.

Here is my mapcache.xml

<mapcache mode="combined_mirror">
   <cache name="disk" type="disk">
           <base>/tmp/mapcache</base>
      <symlink_blank/>
   </cache>

   <source name="vmap0" type="wms">
      <getmap>
         <params>
            <FORMAT>image/jpeg</FORMAT>
            <LAYERS>default</LAYERS>
         </params>
      </getmap>

      <http>
         <url>http://192.168.112.225/cgi-bin/mapserv?transparent=true&map=/usr/lib/cgi-bin/osm-bw.map</url>
      </http>
   </source>

   <tileset name="mirror">
      <source>vmap0</source>
      <cache>disk</cache>
      <grid>WGS84</grid>
      <grid>g</grid>
      <format>png</format>
      <metatile>5 5</metatile>
      <metabuffer>10</metabuffer>
              <!--<expires>3600</expires>-->
   </tileset>


   <default_format>png</default_format>

   <service type="wms" enabled="true">
      <full_wms>assemble</full_wms>
      <resample_mode>bilinear</resample_mode>
      <format>png</format>
      <maxsize>4096</maxsize>
      <forwarding_rule name="catch all">
            <http>
              <url>http://192.168.112.225/cgi-bin/mapserv?transparent=true&map=/usr/lib/cgi-bin/osm-bw.map</url>
            </http>
      </forwarding_rule>
   </service>
   <service type="wmts" enabled="true"/>
   <service type="tms" enabled="true"/>
   <service type="kml" enabled="true"/>
   <service type="gmaps" enabled="true"/>
   <service type="ve" enabled="true"/>
   <service type="demo" enabled="true"/>

   <errors>report</errors>
   <lock_dir>/tmp</lock_dir>
   <log_level>debug</log_level>

</mapcache>

The Apache mapcache.conf

<IfModule mapcache_module>
   Header add Access-Control-Allow-Origin "*"
   <Directory /mapcache>
      Order Allow,Deny
      Allow from all
   </Directory>
   MapCacheAlias /mapcache "/etc/apache2/mods-enabled/mapcache.xml"
</IfModule>

If I run mapcache_seed with this xml file it seems to generate the cache files properly

2
  • 1
    Did you chown ww-data:www-data /etc/apache2/mods-enabled/mapcache.xml?
    – ThomasG77
    Commented Oct 16, 2021 at 22:57
  • No I did not but I did just now. It didnt make a difference. However the file is world readable and mapcache is returning an image. Its just not writing the image to disk. Commented Oct 18, 2021 at 17:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.