1

I installed MapServer and MapCache on Ubuntu (see here). Now I would like to prevent the direct access to MapServer - requests should only be allowed via MapCache. I thought I could achieve this by accessing MapServer via localhost (in mapcache.xml / source) and allowing MapServer to only serve to localhost. The former works fine, but how to allow MapServer only serving to localhost?

7
  • This is not a MapServer nor GIS question. It is all about configuring security settings of Apache httpd.apache.org/docs/2.2/howto/access.html. Deny from all - Allow from localhost should work for you.
    – user30184
    Dec 2 '14 at 11:17
  • I already tried that, but it had no effect.
    – Mark
    Dec 2 '14 at 12:23
  • How it did not have an effect? Despite deny from all you are still seeing the server from outside? Did you reload Apache?
    – user30184
    Dec 2 '14 at 12:24
  • Yes, I reloaded Apache. I added <Directory "/mapserver"> Order allow,deny Deny from all </Directory> to the Apache configuration. MapServer is still accessible: 78.47.251.2/cgi-bin/mapserv
    – Mark
    Dec 2 '14 at 12:33
  • I would suppose that mapserver is in directory /cgi-bin but I am no Apache master. They are in the main stackexchange.
    – user30184
    Dec 2 '14 at 14:04
2

I figured it out (thanks to user30184):

<Directory "/usr/lib/cgi-bin">
 <Files mapserv>
  Order deny,allow
  Deny from all
  Allow from localhost
 </Files>
</Directory>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.