MS4W安裝(MS4W=MapServer for Windows)php
經過apache-install.bat安裝apache。html
•Introduction 簡介java
•Design 設計python
•Contents 目錄mysql
•How to Install MS4W 如何安裝MS4Wgit
•Password Protection Configuration for Applications 密碼保護web
•MS4W Applications MS4W應用sql
•Additional Support 其餘支持apache
•About this Document 關於本文檔windows
Introduction
簡介
Welcome to MS4W, the quick and easy installer developed by Gateway Geomatics for setting up MapServer For Windows and its accompanying applications (e.g. GeoMoose, Mapbender, OpenLayers, etc.). The purpose of this package is to allow novice to advanced MapServer users to quickly install a MapServer development environment on their Windows systems. The reasons for needing to do this are diverse but, in general, this package supports: developers who want to get to a stable state quickly, trainers who need an easily-installed configuration identical across multiple installs, and novices who need help just getting all the needed bits and pieces together.
歡迎使用MS4W,這是由Gateway Geomatics開發的快速簡便的安裝程序,用於爲Windows及其附帶應用程序(如Geomoose、MapBender、Openlayers等)設置MapServer。此軟件包的目的是容許新手到高級MapServer用戶在其Windows系統上快速安裝MapServer開發環境。須要這樣作的緣由是多種多樣的,但總的來講,這個軟件包支持:想要快速進入穩定狀態的開發人員,須要在多個安裝中輕鬆安裝相同配置的培訓人員,以及須要幫助的新手,只需將全部須要的零碎部分集中在一塊兒。
The MS4W package is designed to perform a full installation of Apache, PHP, MapServer CGI, MapScript (CSharp, Java, PHP, Python), and to provide the capability to install additional applications easily and quickly. The simplest way to do this on Windows is to provide a predetermined directory structure and force everything into that mold.
MS4W包被設計爲完成Apache、PHP、MaServer CGI、MapScript(CpHARP、Java、PHP、Python)的完整安裝,並提供方便且快速地安裝附加應用程序的能力。在Windows上執行此操做的最簡單方法是提供預先肯定的目錄結構,並強制全部內容進入該模具。
The directory structure, while fixed within itself, is designed to be somewhat portable. While the ms4w_xxx.zip file needs to be installed at the root of a hard drive, it doesn't have to be the C:/ drive. Moving the package to the root of a different drive is simple - just copy it there. To move it to a subdirectory is more difficult - you'll need to search for /ms4w in all the files and replace it with your new path.
雖然目錄結構自己是固定的,但它設計得有點可移植性。雖然ms4w_xxx.zip文件須要安裝在硬盤驅動器的根目錄下,但它沒必要是c:/drive。將包移動到另外一個驅動器的根目錄很是簡單-只需複製到那裏。要將其移動到子目錄更困難-您須要在全部文件中搜索/ms4w並將其替換爲新路徑。
The design also accommodates simple upgrades to the core package and to applications, without affecting the local configuration or the configuration of other installed applications.
該設計還能夠對核心軟件包和應用程序進行簡單升級,而不會影響本地配置或其餘已安裝應用程序的配置。
The following are included in the base package:如下包含在根包中:
Tip小提示:
If your server needs support for a specific version of PHP, Python, Apache, MapServer, GDAL, Oracle, ECW, Microsoft SQL Server, or any of MS4W's hundreds of libraries, or a specific Windows version, or an entire MS4W package in x64 or 32bit, please contact Gateway Geomatics.
若是您的服務器須要支持特定版本的php、python、apache、mapserver、gdal、oracle、ecw、Microsoft SQL Server或任何MS4W的數百個庫,或特定的Windows版本,或X64或32位的整個MS4W包,請與網關geomatics聯繫。
MapServer version 7.4.0-dev (MS4W 4.0.0) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
Compiled, packaged, documented, and tested by Gateway Geomatics. Please help support this great product that is downloaded over 6,000 times a month by organizations of all sizes - please contact us directly at info@gatewaygeomatics.com for custom builds or requests. Thank you in advance for your generous support!
由Gateway Geomatics編譯、打包、記錄和測試。請幫助支持這個偉大的產品,每月由各類規模的組織下載超過6000次-請直接聯繫咱們info@gatewaygeomatics.com以獲取定製版本或請求。感謝您的大力支持!
Library versions used to build this version of MapServer:
用於生成此版本MapServer的庫版本:
apache-ant-1.7.0 apr-1.6.5 apr-iconv-1.2.2 apr-util-1.6.1 berkeley-db-18.1.25 bzip2-1.0.6 cairo-1.14.12 curl-7.63.0 expat-2.2.6 fcgi-2.4.0 fits-3.450 freetype-2.9.1 freexl-1.0.5 fribidi-0.19.1 gdal-2.4.0 geos-3.7.1 gettext-runtime-0.17-source giflib-5.1.2 harfbuzz-1.9.0 hdf-4.2.14 hdf5-1.10.2 httpd-2.4.38 jbigkit-1.6 libecwj2-3.3 libgeotiff-1.4.3 libiconv-1.15 libjpeg-turbo-git-20180802 libKML-git-20180824 libpng-1.6.35 librttopo-1.1.0-RC1 libspatialite-5.0.0-beta0 libspatialite-tools-4.4.0-RC0 libsvg-0.5.0 libsvg-cairio-0.5.0 libtiff-git-20180817 libxml2-2.9.8 lua-5.1.5 mapcache-1.7dev mapserver-git-master-20190109 mod_fcgid-2.3.9 mod_h264_streaming-2.2.7 mod_wsgi-4.6.5 mrsid-9.5.4 mysql-6.1.11 netcdf-c-4.6.2 openssl-1.0.2q oracle-12.2.0.1.0 pcre-8.42 pixman-0.34.0 poppler-0.51.0 postgresql-10.5 proj-5.2.0 protobuf-3.6.1 protobuf-c-1.6.1 Python-3.7.0 readosm-1.0.0e shapelib-1.4.1 spatialite-tools-4.4.0-RC0 sqlite-3.24.0 swig-1.3.39 swigwin-3.0.12 szip-2.1.1 uriparser-0.7.5 xerces-c-3.2.1 zlib-1.2.7
See the OGR formats page for full driver descriptions.有關完整的驅動程序說明,請參閱「OGR格式」頁。
Note注意:
If you require a specific data format or an updated supported version, please contact Gateway Geomatics for custom build information.
若是您須要特定的數據格式或更新的支持版本,請聯繫Gateway Geomatics以獲取自定義編譯信息。
Supported Formats: PCIDSK -raster,vector- (rw+v): PCIDSK Database File netCDF -raster,vector- (rw+s): Network Common Data Format PDF -raster,vector- (rw+vs): Geospatial PDF MBTiles -raster,vector- (rw+v): MBTiles EEDA -vector- (ro): Earth Engine Data API DB2ODBC -raster,vector- (rw+): IBM DB2 Spatial Database ESRI Shapefile -vector- (rw+v): ESRI Shapefile MapInfo File -vector- (rw+v): MapInfo File UK .NTF -vector- (rov): UK .NTF OGR_SDTS -vector- (rov): SDTS S57 -vector- (rw+v): IHO S-57 (ENC) DGN -vector- (rw+v): Microstation DGN OGR_VRT -vector- (rov): VRT - Virtual Datasource REC -vector- (ro): EPIInfo .REC Memory -vector- (rw+): Memory BNA -vector- (rw+v): Atlas BNA CSV -vector- (rw+v): Comma Separated Value (.csv) NAS -vector- (rov): NAS - ALKIS GML -vector- (rw+v): Geography Markup Language (GML) GPX -vector- (rw+v): GPX LIBKML -vector- (rw+v): Keyhole Markup Language (LIBKML) KML -vector- (rw+v): Keyhole Markup Language (KML) GeoJSON -vector- (rw+v): GeoJSON GeoJSONSeq -vector- (rw+v): GeoJSON Sequence ESRIJSON -vector- (rov): ESRIJSON TopoJSON -vector- (rov): TopoJSON OGR_GMT -vector- (rw+v): GMT ASCII Vectors (.gmt) GPKG -raster,vector- (rw+vs): GeoPackage SQLite -vector- (rw+v): SQLite / Spatialite ODBC -vector- (rw+): ODBC WAsP -vector- (rw+v): WAsP .map format PGeo -vector- (ro): ESRI Personal GeoDatabase MSSQLSpatial -vector- (rw+): Microsoft SQL Server Spatial Database PostgreSQL -vector- (rw+): PostgreSQL/PostGIS MySQL -vector- (rw+): MySQL OpenFileGDB -vector- (rov): ESRI FileGDB XPlane -vector- (rov): X-Plane/Flightgear aeronautical data DXF -vector- (rw+v): AutoCAD DXF CAD -raster,vector- (rovs): AutoCAD Driver Geoconcept -vector- (rw+v): Geoconcept GeoRSS -vector- (rw+v): GeoRSS GPSTrackMaker -vector- (rw+v): GPSTrackMaker VFK -vector- (ro): Czech Cadastral Exchange Data Format PGDUMP -vector- (w+v): PostgreSQL SQL dump OSM -vector- (rov): OpenStreetMap XML and PBF GPSBabel -vector- (rw+): GPSBabel SUA -vector- (rov): Tim Newport-Peace's Special Use Airspace Format OpenAir -vector- (rov): OpenAir OGR_PDS -vector- (rov): Planetary Data Systems TABLE WFS -vector- (rov): OGC WFS (Web Feature Service) WFS3 -vector- (ro): OGC WFS 3 client (Web Feature Service) HTF -vector- (rov): Hydrographic Transfer Vector AeronavFAA -vector- (rov): Aeronav FAA Geomedia -vector- (ro): Geomedia .mdb EDIGEO -vector- (rov): French EDIGEO exchange format GFT -vector- (rw+): Google Fusion Tables SVG -vector- (rov): Scalable Vector Graphics CouchDB -vector- (rw+): CouchDB / GeoCouch Cloudant -vector- (rw+): Cloudant / CouchDB Idrisi -vector- (rov): Idrisi Vector (.vct) ARCGEN -vector- (rov): Arc/Info Generate SEGUKOOA -vector- (rov): SEG-P1 / UKOOA P1/90 SEGY -vector- (rov): SEG-Y ODS -vector- (rw+v): Open Document/ LibreOffice / OpenOffice Spreadsheet XLSX -vector- (rw+v): MS Office Open XML spreadsheet ElasticSearch -vector- (rw+): Elastic Search Walk -vector- (ro): Walk Carto -vector- (rw+): Carto AmigoCloud -vector- (rw+): AmigoCloud SXF -vector- (rov): Storage and eXchange Format Selafin -vector- (rw+v): Selafin JML -vector- (rw+v): OpenJUMP JML PLSCENES -raster,vector- (ro): Planet Labs Scenes API CSW -vector- (ro): OGC CSW (Catalog Service for the Web) VDV -vector- (rw+v): VDV-451/VDV-452/INTREST Data Format GMLAS -vector- (rwv): Geography Markup Language (GML) driven by application schemas MVT -vector- (rw+v): Mapbox Vector Tiles TIGER -vector- (rw+v): U.S. Census TIGER/Line AVCBin -vector- (rov): Arc/Info Binary Coverage AVCE00 -vector- (rov): Arc/Info E00 (ASCII) Coverage NGW -raster,vector- (rw+s): NextGIS Web HTTP -raster,vector- (ro): HTTP Fetching Wrapper
Oracle - see the GDAL Plugins section of this document to enable
Tip
"ro" means read-only "rw" means read and one-time creation only "rw+" means read, create and update "w+" means write-only "v" means that it supports virtual files
See the GDAL formats page for full driver descriptions.
有關完整的驅動程序描述,請參閱gdal格式頁。
Note注意:
If you require a specific data format or an updated supported version, please contact Gateway Geomatics for custom build information.
若是您須要特定的數據格式或更新的支持版本,請聯繫Gateway Geomatics以獲取自定義構建信息。
Supported Formats: VRT -raster- (rw+v): Virtual Raster DERIVED -raster- (ro): Derived datasets using VRT pixel functions GTiff -raster- (rw+vs): GeoTIFF NITF -raster- (rw+vs): National Imagery Transmission Format RPFTOC -raster- (rovs): Raster Product Format TOC format ECRGTOC -raster- (rovs): ECRG TOC format HFA -raster- (rw+v): Erdas Imagine Images (.img) SAR_CEOS -raster- (rov): CEOS SAR Image CEOS -raster- (rov): CEOS Image JAXAPALSAR -raster- (rov): JAXA PALSAR Product Reader (Level 1.1/1.5) GFF -raster- (rov): Ground-based SAR Applications Testbed File Format (.gff) ELAS -raster- (rw+v): ELAS AIG -raster- (rov): Arc/Info Binary Grid AAIGrid -raster- (rwv): Arc/Info ASCII Grid GRASSASCIIGrid -raster- (rov): GRASS ASCII Grid SDTS -raster- (rov): SDTS Raster DTED -raster- (rwv): DTED Elevation Raster PNG -raster- (rwv): Portable Network Graphics JPEG -raster- (rwv): JPEG JFIF MEM -raster- (rw+): In Memory Raster JDEM -raster- (rov): Japanese DEM (.mem) GIF -raster- (rwv): Graphics Interchange Format (.gif) BIGGIF -raster- (rov): Graphics Interchange Format (.gif) ESAT -raster- (rov): Envisat Image Format FITS -raster- (rw+): Flexible Image Transport System BSB -raster- (rov): Maptech BSB Nautical Charts XPM -raster- (rwv): X11 PixMap Format BMP -raster- (rw+v): MS Windows Device Independent Bitmap DIMAP -raster- (rov): SPOT DIMAP AirSAR -raster- (rov): AirSAR Polarimetric Image RS2 -raster- (rovs): RadarSat 2 XML Product SAFE -raster- (rov): Sentinel-1 SAR SAFE Product PCIDSK -raster,vector- (rw+v): PCIDSK Database File PCRaster -raster- (rw+): PCRaster Raster File ILWIS -raster- (rw+v): ILWIS Raster Map SGI -raster- (rw+v): SGI Image File Format 1.0 SRTMHGT -raster- (rwv): SRTMHGT File Format Leveller -raster- (rw+v): Leveller heightfield Terragen -raster- (rw+v): Terragen heightfield GMT -raster- (rw): GMT NetCDF Grid Format netCDF -raster,vector- (rw+s): Network Common Data Format HDF4 -raster- (ros): Hierarchical Data Format Release 4 HDF4Image -raster- (rw+): HDF4 Dataset ISIS3 -raster- (rw+v): USGS Astrogeology ISIS cube (Version 3) ISIS2 -raster- (rw+v): USGS Astrogeology ISIS cube (Version 2) PDS -raster- (rov): NASA Planetary Data System PDS4 -raster- (rw+vs): NASA Planetary Data System 4 VICAR -raster- (rov): MIPL VICAR file TIL -raster- (rov): EarthWatch .TIL ERS -raster- (rw+v): ERMapper .ers Labelled L1B -raster- (rovs): NOAA Polar Orbiter Level 1b Data Set FIT -raster- (rwv): FIT Image GRIB -raster- (rwv): GRIdded Binary (.grb, .grb2) MrSID -raster- (rov): Multi-resolution Seamless Image Database (MrSID) JP2MrSID -raster- (rov): MrSID JPEG2000 MG4Lidar -raster- (ro): MrSID Generation 4 / Lidar (.sid) RMF -raster- (rw+v): Raster Matrix Format WCS -raster- (rovs): OGC Web Coverage Service WMS -raster- (rwvs): OGC Web Map Service MSGN -raster- (rov): EUMETSAT Archive native (.nat) RST -raster- (rw+v): Idrisi Raster A.1 INGR -raster- (rw+v): Intergraph Raster GSAG -raster- (rwv): Golden Software ASCII Grid (.grd) GSBG -raster- (rw+v): Golden Software Binary Grid (.grd) GS7BG -raster- (rw+v): Golden Software 7 Binary Grid (.grd) COSAR -raster- (rov): COSAR Annotated Binary Matrix (TerraSAR-X) TSX -raster- (rov): TerraSAR-X Product COASP -raster- (ro): DRDC COASP SAR Processor Raster R -raster- (rwv): R Object Data Store MAP -raster- (rov): OziExplorer .MAP KMLSUPEROVERLAY -raster- (rwv): Kml Super Overlay PDF -raster,vector- (rw+vs): Geospatial PDF Rasterlite -raster- (rwvs): Rasterlite MBTiles -raster,vector- (rw+v): MBTiles PLMOSAIC -raster- (ro): Planet Labs Mosaics API CALS -raster- (rwv): CALS (Type 1) WMTS -raster- (rwv): OGC Web Map Tile Service SENTINEL2 -raster- (rovs): Sentinel 2 MRF -raster- (rw+v): Meta Raster Format PNM -raster- (rw+v): Portable Pixmap Format (netpbm) DOQ1 -raster- (rov): USGS DOQ (Old Style) DOQ2 -raster- (rov): USGS DOQ (New Style) PAux -raster- (rw+v): PCI .aux Labelled MFF -raster- (rw+v): Vexcel MFF Raster MFF2 -raster- (rw+): Vexcel MFF2 (HKV) Raster FujiBAS -raster- (rov): Fuji BAS Scanner Image GSC -raster- (rov): GSC Geogrid FAST -raster- (rov): EOSAT FAST Format BT -raster- (rw+v): VTP .bt (Binary Terrain) 1.3 Format LAN -raster- (rw+v): Erdas .LAN/.GIS CPG -raster- (rov): Convair PolGASP IDA -raster- (rw+v): Image Data and Analysis NDF -raster- (rov): NLAPS Data Format EIR -raster- (rov): Erdas Imagine Raw DIPEx -raster- (rov): DIPEx LCP -raster- (rwv): FARSITE v.4 Landscape File (.lcp) GTX -raster- (rw+v): NOAA Vertical Datum .GTX LOSLAS -raster- (rov): NADCON .los/.las Datum Grid Shift NTv1 -raster- (rov): NTv1 Datum Grid Shift NTv2 -raster- (rw+vs): NTv2 Datum Grid Shift CTable2 -raster- (rw+v): CTable2 Datum Grid Shift ACE2 -raster- (rov): ACE2 SNODAS -raster- (rov): Snow Data Assimilation System KRO -raster- (rw+v): KOLOR Raw ROI_PAC -raster- (rw+v): ROI_PAC raster RRASTER -raster- (rw+v): R Raster BYN -raster- (rw+v): Natural Resources Canada's Geoid ARG -raster- (rwv): Azavea Raster Grid format RIK -raster- (rov): Swedish Grid RIK (.rik) USGSDEM -raster- (rwv): USGS Optional ASCII DEM (and CDED) GXF -raster- (rov): GeoSoft Grid Exchange Format BAG -raster- (rwv): Bathymetry Attributed Grid HDF5 -raster- (rovs): Hierarchical Data Format Release 5 HDF5Image -raster- (rov): HDF5 Dataset NWT_GRD -raster- (rw+v): Northwood Numeric Grid Format .grd/.tab NWT_GRC -raster- (rov): Northwood Classified Grid Format .grc/.tab ADRG -raster- (rw+vs): ARC Digitized Raster Graphics SRP -raster- (rovs): Standard Raster Product (ASRP/USRP) BLX -raster- (rwv): Magellan topo (.blx) PostGISRaster -raster- (rws): PostGIS Raster driver SAGA -raster- (rw+v): SAGA GIS Binary Grid (.sdat, .sg-grd-z) XYZ -raster- (rwv): ASCII Gridded XYZ HF2 -raster- (rwv): HF2/HFZ heightfield raster OZI -raster- (rov): OziExplorer Image File CTG -raster- (rov): USGS LULC Composite Theme Grid E00GRID -raster- (rov): Arc/Info Export E00 GRID ZMap -raster- (rwv): ZMap Plus Grid NGSGEOID -raster- (rov): NOAA NGS Geoid Height Grids IRIS -raster- (rov): IRIS data (.PPI, .CAPPi etc) PRF -raster- (rov): Racurs PHOTOMOD PRF RDA -raster- (ro): DigitalGlobe Raster Data Access driver EEDAI -raster- (ros): Earth Engine Data API Image SIGDEM -raster- (rwv): Scaled Integer Gridded DEM .sigdem IGNFHeightASCIIGrid -raster- (rov): IGN France height correction ASCII Grid DB2ODBC -raster,vector- (rw+): IBM DB2 Spatial Database GPKG -raster,vector- (rw+vs): GeoPackage CAD -raster,vector- (rovs): AutoCAD Driver PLSCENES -raster,vector- (ro): Planet Labs Scenes API NGW -raster,vector- (rw+s): NextGIS Web GenBin -raster- (rov): Generic Binary (.hdr Labelled) ENVI -raster- (rw+v): ENVI .hdr Labelled EHdr -raster- (rw+v): ESRI .hdr Labelled ISCE -raster- (rw+v): ISCE raster HTTP -raster,vector- (ro): HTTP Fetching Wrapper
If you already have MS4W installed please do the following:
The "Apache MS4W Web Server" service is stopping. The "Apache MS4W Web Server" service has stopped. Removing the "Apache MS4W Web Server" service The "Apache MS4W Web Server" service has been removed successfully.
Please read through the following instructions before starting your installation.
To install the MS4W .zip file, use a compression program (e.g. 7zip) to extract the package at the root of a drive, e.g., drive C:/. If successful, you should have a new directory named 'ms4w' at the root of the drive you chose (e.g. C:/ms4w).
Warning
If you are using the setup.exe installer: Some applications may have a problem if you install MS4W in a path containing spaces. It is therefore not recommended to install MS4W in a path that contains spaces. It is always best to install MS4W at the root of a drive, such as C:/ or D:/
Be sure to follow the instructions in the local file /ms4w/REQUIREMENTS.txt to install the C++ Redistributable on your system before proceeding.
Start your MS4W Apache Web Server by running /ms4w/apache-install.bat (open a Command Prompt window and execute it at the command line - it is not recommended to just double-click the file). This file installs Apache as a Windows service (called "Apache Web Server") so that it starts whenever your machine is restarted. When executed, the following message should be displayed in the command window:
Installing the Apache MS4W Web Server service The Apache MS4W Web Server service is successfully installed. Testing httpd.conf.... Errors reported here must be corrected before the service can be started. The Apache MS4W Web Server service is starting. The Apache MS4W Web Server service was started successfully.
This means that Apache is running and installed as a service.
Note for Windows 10, 8, 7 and Vista Users:
In order to run the apache-install.bat file, you must do the following:
To test that Apache is running properly, open your Web browser and find your local host Web service by entering one of the following URLs:
http://localhost/ or http://127.0.0.1/
You should now see the main MS4W page in your Web browser. This gives you general information about your install along with configuration information. If this is your first time using MS4W it is very important that you review the listed "Features" installed within MS4W, and test them by selecting each link found on this page.
Technically, at this point, MS4W is installed! However, as you may have noticed from the MS4W main index.html page, there are no applications running. What this means is that there are no Web applications like GeoMoose or OpenLayers found within MS4W's Web-accessible directory, /ms4w/apps/. The MS4W-configured Web applications can be found on https://ms4w.com/release/apps/ as separate zip files.
To install these Web application into /ms4w/apps/ all that is required is to unzip the Web application compressed file at the same root directory as MS4W (e.g., C:/).
Two things should happen when uncompressing this file. First, the Web application directory should appear within /ms4w/apps/. Second, a new httpd_*.conf file should be added to /ms4w/httpd.d/httpd_*.conf. (The /httpd.d/ directory contains Apache configuration files that define which files on your computer/server are Web-accessible. For each Web application that you install, a new configuration file will be found.)
The definitions of these Web-accessible directories are called Web Aliases. In order to activate a Web Alias you must restart Apache. To test your latest installed application, go to the MS4W main index.html page (i.e., http://localhost/). In the applications section you should now find a link to the application you just installed. Select the link to the recently installed application to see if it is configured correctly. Another option is to find the Web Alias for your application and call it from your Web browser directly. For example, if you have installed the latest MS4W version of GeoMoose, the Web Alias is "geomoose2". To go to the GeoMoose index page, simply enter http://localhost/geomoose2/.
Note: Applications with configuration files (e.g., GeoMoose and OpenLayers) generally do not require any editing of their files in order to work. Just unzip to the appropriate driver root and restart Apache.
WARNING: It is very possible that you may wish (but not encouraged!) to run multiple versions of the same product. For example, GeoMoose 2.8.0 vs. GeoMoose 2.8.1. When installing these ms4w GeoMoose application packages, you will notice when unzipping GeoMoose that the httpd_geomoose2_ms4w.conf file found under ./ms4w/httpd.d/ will be overwritten by the GeoMoose you are currently installing. The reason for this is that the GeoMoose Alias stays the same from version to new version of GeoMoose. So, if you overwrite the httpd_geomoose2_ms4w.conf when unzipping and then restart Apache, you will get the latest version of GeoMoose that you just installed. To run both GeoMoose versions simply follow the instructions in Step 7.
You also can create new Web Alias(es). To configure your own personal Web Alias(es), follow the instructions in /ms4w/httpd.d/README_HTTPD.txt
Oracle Spatial support in MapServer is handled by two methods: 1) natively in MapServer, or 2) through the GDAL library.
Make sure you have Oracle 10g or 11g or 12c client software installed on your machine (the same machine that you are running MS4W on).
Warning
Since the default MS4W package is 32-bit, you must install the Oracle 32-bit client, in order to allow MapServer and its tools to communicate with Oracle (even if the Oracle server is x64). If you need a full x64 custom MS4W build please contact Gateway Geomatics.
For direct access to Oracle Spatial, replace the existing libmap.dll in /ms4w/Apache/cgi-bin/ with the one in the /ms4w/msplugins/oracle/ folder.
If this is successful, executing the following at the commandline (after setting /ms4w/setenv.bat) "mapserv -v" should return a string that contains "INPUT=ORACLESPATIAL".
Note
It is possible that MapServer/Apache may have trouble locating your Oracle client dll (oci.dll). If you are having trouble connecting, try copying your oci.dll (possibly from a path such as /oracle/product/12.1.0/client/BIN) into the cgi-bin directory (/ms4w/Apache/cgi-bin/)
Tip
Setting the Windows environment variables ORACLE_HOME and TNS_ADMIN will help MapServer/GDAL connect to your Oracle instance.
For access to Oracle Spatial through the GDAL library, move the ogr_OCI.dll plugin file up from /ms4w/gdalplugins/ignored/oracle12/ into /ms4w/gdalplugins/
If this is successful, executing the following at the commandline (after setting /ms4w/setenv.bat) "ogrinfo --formats" should list the OCI driver.
Restart Apache to be safe.
For mapfile configuration see https://mapserver.org/input/vector/oracle.html (note that the LAYER syntax differs depending if you use native access or through GDAL). Here are some examples:
## Connect through OGR
LAYER NAME "park-ogr" TYPE POLYGON STATUS ON CONNECTION "OCI:user/pass@SID" CONNECTIONTYPE OGR DATA "PARK" CLASS NAME "Parks" STYLE COLOR 255 0 0 OUTLINECOLOR 120 120 120 END END END # Layer
Tip
In the CONNECTION parameter you can specify a different HOST or PORT with the syntax: "OCI:username/password@host:port/SID"
## Connect through MapServer's OracleSpatial type
LAYER NAME "park-native" TYPE POLYGON STATUS ON CONNECTIONTYPE oraclespatial CONNECTION "user/pass@SID" DATA "ORA_GEOMETRY FROM (SELECT ORA_GEOMETRY FROM PARK)" CLASS NAME "Parks" STYLE COLOR 255 255 0 OUTLINECOLOR 120 120 120 END END END # Layer
A read-only, native MapServer driver that connects to Microsoft SQL Server 2008's spatial capabilities is available in MS4W as of version 2.3.0.
The plugin exists in /ms4w/msplugins/mssql/msplugin_mssql2008.dll
Modify your SQL Server 2008 layer in your mapfile to use the CONNECTIONTYPE PLUGIN parameter and point to the appropriate plugin using the PLUGIN parameter. Use the CONNECTION parameter to specify the required connection parameters to access SQL Server, and use the DATA parameter to specify the table that holds the spatial information:
LAYER ... CONNECTIONTYPE PLUGIN PLUGIN "C:/ms4w/msplugins/mssql/msplugin_mssql2008.dll" CONNECTION "server=mysqlserver2008.com;uid=dbusername; pwd=dbpassword;database=Roads Database; Integrated Security=false" DATA "the_geom from roads" TYPE LINE STATUS ON CLASS ... END END
Test your layer, possibly by using the shp2img commandline utility with the '-all_debug 5' switch
The associated RFC document with the original notes on this support is RFC 38
MS4W >= 1.5.0 includes pre-built support files for CSharp, Java, PHP, and Python mapscript. In order to make use of these, however, they must be installed and configured in the appropriate locations on your system.
Warning
As of the MS4W 4.0.0 release, PHPMapScript uses the SWIG MapScript API.
// required SWIG include (contains MapServer constants for PHP7) include("C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php");
As of MS4W 4.0, Python is distributed as part of the base MS4W install. To call Python, open a Command Prompt window and cd to /ms4w/ and then execute setenv.bat. You should see a message displayed such as:
GDAL, mapserv, Python, PHP, and commandline MS4W tools path set
Next, in the same window, execute python --version. You should see a response such as:
Python 3.7.0
Tip
As of MS4W 4.0, Python MapScript is already installed for you, (you can see the mapscript files inside /ms4w/Python/Lib/site-packages). You can jump to the "Testing the Configuration" steps below.
Warning
The Python mapscript support files included in this distribution are built for Python 3.7.x; they will not work with 2.7 Python versions. It is strongly recommended that you use the Python instance that is distributed inside MS4W (at /ms4w/Python/).
Tip
As of MS4W 4.0, mod_wsgi is installed for you. (you can see the mod_wsgi files inside /ms4w/Python/Lib/site-packages). For configuring the module, edit /ms4w/Apache/conf/httpd.conf and look for the section "mod_wsgi settings" around line# 617
You have a couple of additional options here:
This may be the preferred approach if you have multiple Python installations on your machine.
Add a "shebang line" to the top of each python cgi script in /ms4w/apache/cgi-bin. This line must be the first line in the script, and it must begin with #! followed by the path to your systems python executable. For example:
#!C:\ms4w\Python\python.exe -u
The -u option shown above causes the script to use unbuffered output, which is generally what you need in web-serving contexts.
This approach obviates the need to edit every python script in your cgi-bin directory; however, it may be problematic if you have multiple Python installations.
Add the following line to the end of ms4w/Apache/conf/httpd.conf:
ScriptInterpreterSource Registry
You may also want to add these:
SetEnv PYTHONUNBUFFERED 1 PassEnv PYTHONPATH
The first of the above lines causes your python scripts to use unbuffered output (which you probably want), while the second passes the value of your system's PYTHONPATH environment variable through to Apache's environment (if set).
Follow these steps to test your Python MapScript installation:
Move the file /ms4w/msplugins/mapscript/python/test-cgi-mapscript.py into the /ms4w/Apache/cgi-bin/ folder.
Open the file in a text editor.
Edit the first line of that script to point to your proper Python path.
In your web browser goto http://127.0.0.1/cgi-bin/test-cgi-mapscript.py
The script tests that the Python CGI is working, and that the mapscript module can be successfully imported.
If successful you will see an HTML page listing several environment settings on your machine, as well a list of the Python MapScript module attributes at the bottom of the page.
Python Troubleshooting:
Python MapScript is handled through the SWIG API for MapServer: https://mapserver.org/mapscript/mapscript.html
See the previous section to configure GDAL for Oracle connections: Steps to Enable Oracle 10g or 11g or 12c Support in MS4W
As of MS4W 3.2.0, an old ECW version 3.3 SDK is used to read and display ECW files in MS4W. If you require more recent functionality from the newer v5+ SDK, please contact Gateway Geomatics for a custom build quote.
For access to ECW files through the GDAL library, move the gdal_ECW_JP2ECW.dll plugin file up from /ms4w/gdalplugins/ecw/ into /ms4w/gdalplugins/
If this is successful, executing the following at the commandline (after setting /ms4w/setenv.bat) "gdalinfo --formats" should list the "ECW" and "JP2ECW" drivers.
ECW -raster- (rw): ERDAS Compressed Wavelets (SDK 3.x) JP2ECW -raster,vector- (rw+v): ERDAS JPEG2000 (SDK 3.x)
For display in MapServer, after moving the plugin, follow the regular Raster Data document. Here is an example mapfile configuration:
LAYER NAME "ecw" TYPE RASTER STATUS ON DATA "00203065F09.ecw" CLASS NAME "ECW test" END END
MS4W contains GDAL bindings for CSharp, Java, and Python, and are located at /ms4w/gdalbindings
Note
Since the MS4W 4.0 release, Python is included in the base MS4W (after you run setenv.bat you can call Python). If you have your own Python instance instead: Python 3.7 is required for the Python GDAL module in MS4W, and you must have C:/python-3.7.x in your PATH to use the utilities.
The Python GDAL module and its utilities are installed in /ms4w/gdalbindings/python/gdal/. To run the utilities:
python gdal_merge.py
gdal_merge.py notes:
In order to use FastCGI you must do the following:
Open /ms4w/Apache/conf/httpd.conf in a text editor
Uncomment line#178, such as:
LoadModule fcgid_module modules/mod_fcgid.so
At the bottom of the file you will see a commented "<IfModule fcgid_module>" section. If you want to use FastCGI directives (listed on the mod_fcgid page) you can uncomment the section and add your directives, such as:
<IfModule fcgid_module> FcgidMinProcessesPerClass 0 FcgidIdleScanInterval 1 FcgidProcessLifeTime 10 </IfModule>
If you are connecting to an Oracle database using FastCGI, you must also add your Oracle Bin directory (where the 'oci.dll' file exists) to the PATH variable above, such as:
<IfModule fcgid_module> ... FcgidInitialEnv PATH "c:/oracle/product/10.2.0/client/BIN" ... </IfModule>
Save the file and restart apache (execute /ms4w/apache-restart.bat)
Change your CGI application to point to "/fcgi-bin/mapserv.exe" instead of the usual "/cgi-bin/mapserv.exe"
Add the following parameter to your layer for which you want this FastCGI connection:
PROCESSING "CLOSE_CONNECTION=DEFER"
Try the application. If successful you should see the "mapserv.exe" process in the Windows Task Manager remain open while the user interacts with your application.
Notes:
The MapCache Apache module and the mapcache_seed.exe utility (as of MS4W 3.1.0) are included. In order to use the MapCache Apache module you must do the following:
Note
For information about MS4W's included HTTPS certificate bundle, and specific tips for MapCache, see the later section Certificates for HTTPS of this document.
Open /ms4w/Apache/conf/httpd.conf in a text editor
Uncomment line#184, and change to your correct path, such as:
LoadModule mapcache_module "C:/ms4w/Apache/cgi-bin/mod_mapcache.dll"
Around line#412 of your httpd.conf file you will see a "<IfModule mapcache_module>" section. Modify the path to the included MapCache configuration (XML) file, such as:
<IfModule mapcache_module> <Directory "/ms4w/apps/mapcache/"> AllowOverride None Options None Require all granted </Directory> MapCacheAlias /mapcache "C:/ms4w/apps/mapcache/mapcache.xml" </IfModule>
Modify the mapcache.xml file. Please see the associated MapCache docs for assistance.
Save your httpd.conf file and restart apache (execute /ms4w/apache-restart.bat)
If the module was successfully loaded your /ms4w/Apache/logs/error_log.txt file should contain a message similar to:
[notice] Apache/2.4.38 (Win32) mod-mapcache/1.6.1 configured -- resuming normal operations
Test your MapCache configuration by following steps in the associated MapCache testing docs
The MapCache seeding utility is also included. To run the mapcache_seed.exe file be sure to first execute the /ms4w/setenv.bat file in your command window.
Notes:
this module was tested with the cache types: disk, sqlite, tiff, and berkeleyDB. You should follow the MapCache Cache Types docs for assistance, or contact Gateway Geomatics for assistance/custom builds/configurations.
the module was tested on Windows 10; if you are using an older version of Windows and require this module you should consider upgrading, or contact Gateway Geomatics for assistance/custom builds/configurations. .
as this module is still in development, feedback is more than encouraged, it is required. Please send your MapCache questions to the MapServer-users mailing list. You are also encouraged to contact Gateway Geomatics directly for custom builds and to help fund the development and maintenance of MS4W.
The mod_wsgi Apache module is included, as of the MS4W 4.0.0 release. In order to use the mod_wsgi Apache module you must do the following:
Open /ms4w/Apache/conf/httpd.conf in a text editor
Around line#617, make sure the paths are correct, such as:
# mod_wsgi settings LoadFile "c:/ms4w/python/python37.dll" LoadModule wsgi_module "c:/ms4w/python/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win32.pyd" WSGIPythonHome "c:/ms4w/python"
Save your httpd.conf file and restart apache (execute /ms4w/apache-restart.bat)
If the module was successfully loaded your /ms4w/Apache/logs/error_log.txt file should contain a message similar to:
[notice] Apache/2.4.38 (Win32) mod_wsgi/4.6.5 Python/3.7 configured -- resuming normal operations
To test that Apache has loaded the module, at your Command prompt, cd into the /ms4w/Apache/bin/ directory. Then execute the following:
httpd -t -D DUMP_MODULES
You should see a list of loaded modules, and mod_wsgi should be listed near the end, such as:
setenvif_module (shared) version_module (shared) fcgid_module (shared) mapcache_module (shared) wsgi_module (shared)
You can use your file explorer and see the mod_wsgi files inside the folder: /ms4w/Python/Lib/site-packages
The H264 Streaming Module is included for Apache (as of MS4W 3.1.0). One of the features of this module is enabling your viewers to immediately jump to any part of the video regardless of the length of the video or whether it has all been downloaded yet. In order to use the H264 Streaming Module you must do the following:
Open /ms4w/Apache/conf/httpd.conf in a text editor
Uncomment line#183, such as:
LoadModule h264_streaming_module modules/mod_h264_streaming.so
Around line#608 of your httpd.conf file you will see a "<IfModule h264_streaming_module>" section. You can leave this section as-is (no changes are needed):
<IfModule h264_streaming_module> AddHandler h264-streaming.extensions .mp4 </IfModule>
Save your httpd.conf file and restart Apache (execute /ms4w/apache-restart.bat)
To test that Apache has loaded the module, at your Command prompt, cd into the /ms4w/Apache/bin/ directory. Then execute the following:
httpd -t -D DUMP_MODULES
You should see a list of loaded modules, and the H264 Streaming Module should be listed near the end, such as:
log_config_module (shared) mime_module (shared) negotiation_module (shared) setenvif_module (shared) h264_streaming_module (shared)
To test the module on an actual video file:
Download this mp4 file locally (right-click and Save Link As): https://gatewaygeomatics.com/dl/mapserver-6-0-visualization.mp4
Copy the file into the folder /ms4w/Apache/htdocs/
Open a Command prompt window, and cd into /ms4w/ and execute setenv.bat
Execute the following command in that same window:
wget -S -O mapserver-6-0-visualization.mp4 "http://127.0.0.1/mapserver-6-0-visualization.mp4?start=0&end=5"
You should see a response as follows (notice the mention of the "X-Mod-H264-Streaming" and also that the size of the video is very small (click on the saved file now in /ms4w/mapserver-6-0-visualization.mp4 and view it, only the first 5 seconds of the video should be loaded):
1 HTTP/1.1 200 OK 2 Date: Mon, 10 Jul 2017 15:10:31 GMT 3 Server: Apache/2.4.27 (Win32) mod_fcgid/2.3.9 4 X-Mod-H264-Streaming: version=2.2.7 5 Content-Length: 574375 6 Last-Modified: Thu, 03 Dec 2015 02:15:30 GMT 7 ETag: "451ed18-525f4f7037480;574375" 8 Accept-Ranges: bytes 9 Keep-Alive: timeout=5, max=100 10 Connection: Keep-Alive 11 Content-Type: video/mp4 100%[====================================>] 574,375 547.77M/s ETA 00:00
Now test the module in your Web browser, by going to: http://127.0.0.1/mapserver-6-0-visualization.mp4?start=0&end=5
Read more about the module's parameters: http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Testing-Version2
As described earlier, MS4W is designed so you can easily include your application's Apache settings in the /ms4w/httpd.d/ folder (see the README_HTTPD.txt inside that folder for more information). The following examples will use the existing MS4W "MapServer CGI Viewer" application; the CGI viewer's Apache settings are stored in the file "httpd_cgi_viewer.conf" inside the /ms4w/httpd.d/ folder. The contents of the file is:
Alias /cgi/ "/ms4w/apps/cgi-viewer/htdocs/" <Directory "/ms4w/apps/cgi-viewer/htdocs/"> AllowOverride None Options Indexes FollowSymLinks Multiviews Order allow,deny Allow from all </Directory>
Note
If you would prefer to make your application changes directly in the /ms4w/Apache/conf/httpd.conf file you can, or also include them in an .htaccess file inside your application's folder.
Let's say one of the filenames has changed (from "viewer-index.html" to "ttt.html"), but we want to make sure the old url works. MS4W loads the mod_rewrite module by default (more about mod_rewrite: https://httpd.apache.org/docs/2.4/rewrite/), so we can add a few lines into our "httpd_cgi_viewer.conf" to call this rewrite, such as:
Alias /cgi/ "/ms4w/apps/cgi-viewer/htdocs/" <Directory "/ms4w/apps/cgi-viewer/htdocs/"> AllowOverride None Options Indexes FollowSymLinks Multiviews Order allow,deny Allow from all RewriteEngine On RewriteBase "/cgi/" RewriteRule "^viewer-index.html$" "ttt.html" </Directory>
We can alternatively use the Redirect directive through the mod_alias module, which is loaded by MS4W by default (read more about mod_alias at https://httpd.apache.org/docs/2.4/mod/mod_alias.html) such as:
Alias /cgi/ "/ms4w/apps/cgi-viewer/htdocs/" <Directory "/ms4w/apps/cgi-viewer/htdocs/"> AllowOverride None Options Indexes FollowSymLinks Multiviews Order allow,deny Allow from all </Directory> Redirect 301 "/cgi/viewer-index.html" "/cgi/ttt.html"
Tip
Be sure to always restart the Apache service after any changes made to conf files (execute apache-restart.bat at the commandline, after executing setenv.bat in the same window)
TinyOWS and demo data are included (as of MS4W 3.1.0), giving you full WFS-Transaction support (making data changes in an MS4W map that is then saved to the underlying database). In order to use TinyOWS you must do the following:
Make sure that you have PostgreSQL and PostGIS installed locally, or have connection details for accessing it remotely. This has been tested with PostgreSQL 10.5 and PostGIS 2.4.4
First we must create a database and load some sample data:
Open /ms4w/apps/tinyows/demo/install-demo-data.bat in a text editor
If necessary, modify the PG-PORT, PG-SUPERUSER-NAME, and PG-SUPERUSER-PASSWORD for your installation (lines ~17-19). Save your changes.
Open a Command prompt window, and cd into /ms4w/ and execute setenv.bat
cd into /ms4w/apps/tinyows/demo/ and execute the following in that same window:
install-demo-data.bat
Verify that a new database was created ("tinyows"), and that there is a spatial table ("frida").
Tip
You can use QGIS to view your new "frida" PostGIS layer (through Layer/Add Layer /Add PostGIS Layers)
Next we must configure TinyOWS:
Open /ms4w/apps/tinyows/config.xml in a text editor
If necessary, modify the online_resource and pg connection parameters, for your installation. Refer to the TinyOWS documentation for parameter descriptions. Save your changes.
to test this configuration, in the same Command prompt window, execute the following (change the drive path if necessary):
set TINYOWS_CONFIG_FILE=C:/ms4w/apps/tinyows/config.xml
once that is set, execute the following in the same Command prompt window to see details about your TinyOWS configuration:
tinyows.exe --check
the response should be something like:
TinyOWS version: 1.1.0 FCGI support: Yes Config File Path: C:/ms4w/apps/tinyows/config.xml (TinyOWS XML) PostGIS Version: 2.4.4 PostGIS dsn: host=localhost user=postgres password=postgres dbname=tinyows port=5432 Output Encoding: UTF-8 Database Encoding: UTF8 Schema dir: /ms4w/apps/tinyows/schema/ Display bbox: Yes Estimated extent: No Check schema: Yes Check valid geoms: Yes Available layers: public.frida (31467) -> tows:frida [RW]
Note that Apache sets this same environment variable TINYOWS_CONFIG_FILE in the file /ms4w/httpd.d/httpd_tinyows.conf
Next we should configure the demo HTML application:
Finally we are ready to test a WFS-T transaction to your database:
in a Web browser, goto http://127.0.0.1/tinyows/demo/tinyows.html (or modify that address if need be)
click on the "Draw Feature" icon on the top-right of the map, and click anywhere on the map to generate a polygon (to close the polygon double-click).
now click on the "Save Changes" icon, you should see a message in the right panel of that page as:
Transaction successfully completed
Changes to the "frida" layer should be saved to the database.