My question is not very clear but I will try to explain it.. When we call a wms layer from geoserver in Qgis for example we write http://adresse/geoserver/wms? and we find all layers which we have published.. I'd like to do the same: write a mapserver_adresse and get layers which I publish with mapserver (I do not want to write the mapfile name in the adresse).. Is-it possible and where I should start? Thanks
Best How To :
You have to write a script in the same location in which is the executable mapserv. In this script you set the variable MS_MAPFILE=/path/your/mapfile and than execute mapserv.
On linux this would look so:
Do not forget the #! /bin/bash, otherwise mapserver will refuse to work.
Save this script in the same location where is mapserv and make it executable, i.e:
chmod +x /usr/lib/cgi-bin/your_script
Now you can use it as a wms server in qgis with this address:
If you want to hide the "cgi-bin" part as well, can do it with apache.
See also all other environment variables which are recognized by mapserver: