Skip to content

API Site Setup Instructions

jotok edited this page May 6, 2015 · 17 revisions

#Instructions for Setting Up a Server for PatentsView API

Initial Setup

  1. Download the code
  2. Use your favorite tool to get the code from Github: https://github.com/CSSIP-AIR/PatentsView-API and put it at c:\PatentsView-API.
  3. Using the Windows Server Manager, add the Web Server (IIS) role.
  4. While going through that wizard, be sure to include: 1. .NET 3.5 Framework. 1. HTTP Activation - which is under the .NET 4.5 group. Clicking that will confirm to add a slew of other features. 1. If you get a warning on the confirmation screen that you need to specify a different source for missing files, specify the source: C:\Windows\WinSxS.
  5. Install PHP via the Web Platform Installer
  6. http://www.microsoft.com/web/gallery/install.aspx?appid=PHP53 and click the "Install Now" button.
  7. Run the php53.exe file that was downloaded.
  8. On the "Prerequisites" page, deselect the drivers for SQL Server.
  9. Click install.
  10. It will probably say that it failed to install "PHP Manager for IIS", so we will install it manually.
  11. Install PHP Manager
  12. Go to: http://phpmanager.codeplex.com/releases/view/69115
  13. Download "PHP Manager 1.2 for IIS 7 - x64"
  14. Run the download
  15. Configure IIS
  16. Run the PHP Manager 1. It will say the it has some recommendations. Accept those, which are to set index.php as a default doc and to monitor changes to the php.ini file.
  17. Set up sites
  18. These instructions are for just one model for setting up the sites in IIS. You may want to do it differently.
  19. Copy the contents of c:\PatentsView-API to c:\qm\current and to (assuming this is for version 1) c:\qm\v1.
  20. Create a virtual directory called api off of the default site and point it to c:\qm\current\querymodule\public_html.
  21. Create a virtual dir off the api vdir called v1 and point it to c:\qm\v1\querymodule\public_html.
  22. Edit the c:\qm\current\querymodule\public_html/web.config file and change the name of the rewrite rule from "slim" to "slimCurrent".
  23. Go into the URL Rewrite for the v1 vdir and remove the "slimCurrent" rule. 1. Do this for all other vN directories.

Add New Version

  1. Create the updated HTML version of the API documentation. This step requires the jinja2 package for python.
  2. On a dev or test server, in the PatentsView-API\doc directory, run this command: make_doc.py > ..\public_html
  3. The rest of these steps are for the production server.
  4. Get the latest code from github into c:\PatentsView-API.
  5. It is a good idea, though not necessary, to stop the web site (in IIS) prior to updating.
  6. Copy the contents of c:\PatentsView-API\querymodule to c:\qm\current\querymodule and to (assuming this is for version X) c:\qm\vX\querymodule. When copying to current, it will ask to overwrite files - go ahead and do that.
  7. Create a virtual dir off the api vdir called vX and point it to c:\qm\vX\querymodule\public_html.
  8. Edit the c:\qm\current\querymodule\public_html/web.config file and change the name of the rewrite rule from "slim" to "slimCurrent".
  • <rule name="slimCurrent" patternSyntax="Wildcard">
  1. Go into the URL Rewrite for the v1 vdir and remove the "slimCurrent" rule.
  2. Do this for all other vN directories.
  3. Edit the c:\qm\vX\querymodule\public_html\web.config and delete the httpProtocol section.
  4. Special Note: The app\config.php file does not (or at least should not) be in Github, so you will need to make any necessary changes to it, for the current and new version, by hand; a good start would be to copy the pre-existing one from the prior version directory. This is intentional so as to prevent accidentally getting a config.php that has setting for development or test in it. The config-sample.php could be used as an example.
  5. If using the same PVSupport as the prior version of the API, as defined in the config.php, then truncate the PVSupport.QueryDef and PVSupport.QueryResults tables. Otherwise create new PVSupport DB with the name in the config.php file for the current version; the scripts are in the DBScripts folder.
  6. Note: Be sure to use the database name as defined in the config.php from the prior step; it may not be PVSupport.
  7. Start the web site if you had stopped it before.
Clone this wiki locally