1、 QGIS MapServer基于 IIS及 Apache服务器 配置手册 第 2 页 1. IIS 6.0 配置步骤: . 3 1.1. 安装 Fastcgi IIS 扩展程序 . 3 1.2. 配置 IIS 扩展映射 . 3 1.3. 配置 MAP FCGI 程序 . 4 1.4. 修改 FCGI 配置文件 . 4 1.5. 测试程序 . 5 1.1.1. 最简单的测试程序( gisServerIIS.html) . 5 1.1.2. 基于 OpenLayers 的测试程序 . 5 2. Apache 服务器配置 . 5 第 3 页 1. IIS 6.0 配置步骤: 1.1. 安装 Fas
2、tcgi IIS 扩展程序 安装文件: fcgisetup_1.5_rtw_x86.msi 安装完后应该在: C:WINDOWSsystem32inetsrv 目录下找到 fcgiext.dll, fcgiext.ini, fcgiconfig.js 等文件 1.2. 配置 IIS 扩展映射 步骤详见下图: 第 4 页 1.3. 配置 MAP FCGI 程序 修改程序 ( qgis_mapserv.exe.fcgi)所在目录的执行权限为“脚本和可执行文件”: 1.4. 修改 FCGI 配置文件 修改文件 ( C:WINDOWSsystem32inetsrvfcgiext.ini) : 在文件中
3、增加以下内容 (参数值可根据需要修改) : Types fcgi=FCGI FCGI ExePath=C:Inetpubwwwrootprojectqgis_mapserv.exe.fcgi ;EnvironmentVars=FcgidMinProcessesPerClass:0,FcgidIdleScanInterval:1,FcgidProcessLifeTime:100 MaxInstances=8 第 5 页 RequestTimeout=360 1.5. 测试程序 注意: 1、 WMS Server 端只处理 UTF8 编码请求,所在在客户端脚本中增加以下内容: 2、 WMS1.3
4、的 BBOX 坐标为倒置,即纬度在前; 1.1.1. 最简单的测试程序 ( gisServerIIS.html) 功能: 完成一次 WMS 请求 代码中以下内容请根据不同机器及应用的情况进行修改: action=“/project/qgis_mapserv.exe.fcgi“ 1.1.2. 基于 OpenLayers 的测试程序 请参见 OpenLayers openlayersexamples wms-fjmiis.html 功能:可进行地图浏览操作,平衡,放大,缩小 2. Apache 服务器配置 基于 Apache/2.2.21 版本 修改: D:ms4wApacheconf httpd
5、.conf 文件, 详细修改请参见以下红色部分内容 (修改后需重启 Apache 服务器) httpd.conf 范例 # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See for detailed information. # In particular, see 第 6 页 # # for a discussion of each configurat
6、ion directive. # # Do NOT simply read the instructions in here without understanding # what they do. Theyre here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the servers
7、control files begin with “/“ (or “drive:/“ for Win32), the # server will use that explicit path. If the filenames do *not* begin # with “/“, the value of ServerRoot is prepended - so “logs/foo.log“ # with ServerRoot set to “d:/ms4w/Apache“ will be interpreted by the # server as “d:/ms4w/Apache/logs/
8、foo.log“. # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., “c:/apache“ instead of “c:apache“). # If a drive letter is omitted, the drive on which httpd.exe is located # will be used by default. It is recommended that you always supply # an explici
9、t drive letter in absolute paths to avoid confusion. # # ServerRoot: The top of the directory tree under which the servers # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to point the Lock
10、File directive # at a local disk. If you wish to share the same ServerRoot for multiple # httpd daemons, you will need to change at least LockFile and PidFile. # ServerRoot “d:/ms4w/Apache“ # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See als
11、o the # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 8089 # # Dynamic Shared Object (DSO) Support 第 7 页 # # To be able to use the functionality of a module which was built a
12、s a DSO you # have to place corresponding LoadModule lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by httpd -l) do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_fo
13、o.so # LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule authn_alias_module modules/mod_
14、authn_alias.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbd_module modules/mod_authn_dbd.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so #Load
15、Module authnz_ldap_module modules/mod_authnz_ldap.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so #LoadModule
16、authz_owner_module modules/mod_authz_owner.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule cache_module modules/mod_cache.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so LoadM
17、odule charset_lite_module modules/mod_charset_lite.so #LoadModule dav_module modules/mod_dav.so #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule dav_lock_module modules/mod_dav_lock.so #LoadModule dbd_module modules/mod_dbd.so #LoadModule deflate_module modules/mod_deflate.so LoadModule d
18、ir_module modules/mod_dir.so #LoadModule disk_cache_module modules/mod_disk_cache.so #LoadModule dumpio_module modules/mod_dumpio.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so #LoadModule ext_filter_module modules/mod_ext_filter.so 第 8 页 #LoadModule fi
19、le_cache_module modules/mod_file_cache.so #LoadModule filter_module modules/mod_filter.so #LoadModule headers_module modules/mod_headers.so #LoadModule ident_module modules/mod_ident.so #LoadModule imagemap_module modules/mod_imagemap.so LoadModule include_module modules/mod_include.so #LoadModule i
20、nfo_module modules/mod_info.so LoadModule isapi_module modules/mod_isapi.so #LoadModule ldap_module modules/mod_ldap.so #LoadModule logio_module modules/mod_logio.so LoadModule log_config_module modules/mod_log_config.so #LoadModule log_forensic_module modules/mod_log_forensic.so #LoadModule mem_cac
21、he_module modules/mod_mem_cache.so LoadModule mime_module modules/mod_mime.so #LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule negotiation_module modules/mod_negotiation.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModu
22、le proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule reqti
23、meout_module modules/mod_reqtimeout.so #LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so #LoadModule speling_module modules/mod_speling.so #LoadModule ssl_module modules/mod_ssl.so #LoadModule status_module modules/mod_status.so #LoadModule substitu
24、te_module modules/mod_substitute.so #LoadModule unique_id_module modules/mod_unique_id.so #LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule version_module modules/mod_version.so #LoadModule vhost_alias_module modules/mod_vhost_alias.s
25、o LoadModule fcgid_module modules/mod_fcgid.so #LoadModule fcgid_module fcgi-bin/qgis_mapserv.fcgi # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # 第 9 页 # User/Group: The name (or #number) of the user/group to run httpd as. # It
26、 is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon # Main server configuration # # The directives in this section set up the values used by the main # server, which responds to any requests that arent handled b
27、y a # definition. These values also provide defaults for # any containers you may define later in the file. # # All of these directives may appear inside containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where
28、 problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. adminyour- # ServerAdmin # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommen
29、d you specify # it explicitly to prevent problems during startup. # # If your host doesnt have a registered DNS name, enter its IP address here. # #ServerName :80 # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but
30、 # symbolic links and aliases may be used to point to other locations. # DocumentRoot “d:/ms4w/Apache/htdocs“ 第 10 页 # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories).
31、 # # First, we configure the “default“ to be a very restrictive set of # features. # Options FollowSymLinks AllowOverride None Order deny,allow Deny from all # # Note that from this point forward you must specifically allow # particular features to be enabled - so if somethings not working as # you
32、might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # # # Possible values for the Options directive are “None“, “All“, # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiVie
33、ws # # Note that “MultiViews“ must be named *explicitly* - “Options All“ # doesnt give it to you. # # The Options directive is both complicated and important. Please see # http:/httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be “All“, “None“, or any combination of the keywords: