因工作需要前几天在Linux上部署了ArcGIS API for javascript的离线包,其实这个和在IIS下部署大同小异,就是Copy和改写计算机名称等,详细步骤如下
-
<apache_tomcat_home>/webapps/arcgis_js_api/library
Configuration options for normal build:
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\esri\esri.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with"<myserver>:8080/arcgis_js_api/library/2.3/arcgis/"
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\dojo\dojo\dojo.xd.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:/arcgis_js_api/library/2.3/arcgis/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:/arcgis_js_api/library/2.3/arcgis/'
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis\js\dojo\dojo\dojo.xd.js.uncompressed.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis/'
Configuration options for compact build:
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\esri\esri.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with"<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/"
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\dojo\dojo\dojo.xd.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Open
<apache_tomcat_home>\webapps\arcgis_js_api\library\2.3\arcgis_compact\js\dojo\dojo\dojo.xd.js.uncompressed.js
in a text editor. - Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, and replace this text with'<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/'
- Now you shoudl be able to access the ArcGIS JavaScript. library from your Web server using the following URL:
http://<myserver>:8080/arcgis_js_api/library/2.3/arcgis/
andhttp://<myserver>:8080/arcgis_js_api/library/2.3/arcgis_compact/
- Change the ArcGIS Services Directory "View In JavaScript" URL. Instructions are given in "Configuring the REST API" in the ArcGIS Server REST SDK. On Windows, the location is
<Installation Location>\DeveloperKit\Help\REST\index.html
. On UNIX and Linux, the location ishttp://<myserver>:8399/<instance>/sdk/rest/index.html
wheremyserver
is your server name andinstance
is the instance name (arcgis is the default).- Find the "JavaScript. API" section for either .NET or Java for more information about parameter values.
- For .NET, the parameters to change in
rest.config
are<ArcGIS>
and<ArcGISCSS>
. Replaceserverapi.arcgisonline.com
with your server domain name. - For Java, the parameters to change in
rest-config.properties
arejsapi.arcgis
andjsapi.arcgis.css
. Replaceserverapi.arcgisonline.com
with your server domain name.
- Test your install. You can use the following test code to validate your JSAPI library install.