This repository houses code originally developed by Luca Chiarabini run by an external server to provide additional functionality to the RopeWiki site.
Before beginning the repository, these changes were made to the original code recovered from Luca's computer:
- Moved passwords and other sensitive information in the code to passwords.h, which is not included in this repository
- Identified the minimum number of files for the build to succeed, out of the thousands of files in the original folder
The RopeWiki codebase is upgraded to use Visual Studio 2017. (The original work by Luca was in VS2008).
'rw.exe' listens for FastCGI commands on port 9001. Nginx is a commonly paired HTTP server that will forward incoming requests using this protocol, and is what Luca chose for the RW server to use. Instructions to configure nginx are in the 'Installation steps' below.
This repo does not include data files that are necessary for RopeWiki Explorer. Documentation will have to be added for how to acquire this data.
It's likely that there will be more bugs due to the differences between compilers. Specifically, the change from 'char' types defaulting to 'signed' now instead of 'unsigned' is likely to be an issue.
- download nginx: http://nginx.org/en/download.html
- unzip and place in c:\ folder
- edit conf\nginx.conf file
- add following lines under 'location /' tag:
fastcgi_pass 127.0.0.1:9001;
include fastcgi_params; # need this line, or query string will be empty
-
copy nginx.bat file to the AWS server from the RopeWiki development folder
-
edit nginx.bat file and modify the path of the nginx.exe to where it was placed above
-
run the nginx.bat file and make sure the nginx.exe process starts. You may have to enable permissions
-
install Microsoft Visual C++ 2010 Redistributable Package (x86) package
-
edit environment variable PATH (for some reason the files above are installed in folder not in the PATH):
- add new: C:\Windows\SysWOW64 (note: this step may not be necessary)
-
open windows firewall: create 'new rule...', open Port 80, give some name (e.g. 'Web Access')
-
create new folder c:\rw
-
copy following files inside:
- rwr.exe (rwr.exe is release version; rw.exe is debug version)
- GPSBabel.exe
- gdal111.dll
- geos.dll
- geos_c.dll
- iconv.dll
- libcurl.dll
- libeay32.dll
- libexpat.dll
- libmysql.dll
- libpq.dll
- openjp2.dll
- phantomjs.exe
- phantomjs.js
- proj.dll
- spatialite.dll
- ssleay32.dll
- xerces-c_2_8.dll
- zlib1.dll
-
run rwr.exe and make sure it starts up ok. You should see the line 'Actively Listening'
-
test from a KML/GPX download link from RopeWiki.com.
-
if that does not succeed, you can test from a local web browser on the server, with something like this URL: "http://localhost/rwr?gpx=on&filename=Behunin_Canyon&url=http://ropewiki.com/images/c/cb/Behunin_Canyon.kml"
-
You should see in the rw.exe output that it received the command, and the web browser should give you a "Behunin_Canyon.gpx" file to download.
To have RopeWiki point to a new RWServer, the server URL must be updated in the ropewiki.com MediaWiki content at the following locations:
- For Templates, a global variable is set as its own template, named 'RWServerUrl', which resolves to "http://luca.ropewiki.com". Usage of this template throughout the ropewiki.com site should be as follows: {{RWServerUrl}}
- For the .js code, a similar global variable is named at the top of the Common.js file. (http://ropewiki.com/MediaWiki:Common.js)
- Also, similar variable at the top of ropewiki.com/PDFScript (this page is called by ropewiki.com/PDFList)
This original codebase was created by Luca Chiarabini. Michelle Nilles brought the code back online and installed to an AWS server provided by Dav, and also brought the code to a state that could be distributed publicly and published here to Github. Some of this document attributed to Ben on GitHub was written by Fredrik.
Working / Tested:
- KML->GPX conversion commands are working.
- ZIP/PDF download (pop-up link to right of canyon name):
- PDF: Page
- PDF: Map
- ZIP: Page+Maps
Not working / TODO:
- Update MediaWiki version so RopeWiki searchbar handles partial matches and spaces correctly
- Wikiloc waypoint downloading not working; needs sign-in account (example: map here: http://ropewiki.com/Matacanes_(upper) )
- Descente-canyon kml downloading not working; site is redesigned (example: map here: http://ropewiki.com/Vero )
- BluuGnome kml downloading not working; now charges $2.25 for GPX file downloads. Not sure if Luca scraped it off the public page or not (example: http://ropewiki.com/Not_Imlay_Canyon)
- ZIP: P+M+Links (http://localhost/rwr?filename=Behunin_Canyon+.zip&zipx=Behunin_Canyon&bslinks=on&summary=off&docwidth=1903&ext=.rw) - took long time, produced truncated zip
- we have not tried to run the 'httprobot' executable.
- Waterflow analysis broke when loading and is turned off in code.
- Check other errors in the RWR.exe output window and fix as needed
- Replace FastCGI and nginx with a more integrated webserver
- Implement watchdog/heartbeat to alert if RWR.exe crashes