-
Notifications
You must be signed in to change notification settings - Fork 11
API Site Setup Instructions
jotok edited this page May 6, 2015
·
17 revisions
#Instructions for Setting Up a Server for PatentsView API
- Download the code
- Use your favorite tool to get the code from Github: https://github.com/CSSIP-AIR/PatentsView-API and put it at
c:\PatentsView-API
. - Using the Windows Server Manager, add the Web Server (IIS) role.
- 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
. - Install PHP via the Web Platform Installer
- http://www.microsoft.com/web/gallery/install.aspx?appid=PHP53 and click the "Install Now" button.
- Run the
php53.exe
file that was downloaded. - On the "Prerequisites" page, deselect the drivers for SQL Server.
- Click install.
- It will probably say that it failed to install "PHP Manager for IIS", so we will install it manually.
- Install PHP Manager
- Go to: http://phpmanager.codeplex.com/releases/view/69115
- Download "PHP Manager 1.2 for IIS 7 - x64"
- Run the download
- Configure IIS
- 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.
- Set up sites
- These instructions are for just one model for setting up the sites in IIS. You may want to do it differently.
- Copy the contents of
c:\PatentsView-API
toc:\qm\current
and to (assuming this is for version 1)c:\qm\v1
. - Create a virtual directory called
api
off of the default site and point it toc:\qm\current\querymodule\public_html
. - Create a virtual dir off the
api
vdir calledv1
and point it toc:\qm\v1\querymodule\public_html
. - Edit the
c:\qm\current\querymodule\public_html/web.config
file and change the name of the rewrite rule from "slim" to "slimCurrent". - Go into the URL Rewrite for the
v1
vdir and remove the "slimCurrent" rule. 1. Do this for all other vN directories.
- Create the updated HTML version of the API documentation. This step requires the jinja2 package for python.
- On a dev or test server, in the
PatentsView-API\doc
directory, run this command:make_doc.py > ..\public_html
- The rest of these steps are for the production server.
- Get the latest code from github into
c:\PatentsView-API
. - It is a good idea, though not necessary, to stop the web site (in IIS) prior to updating.
- Copy the contents of
c:\PatentsView-API\querymodule
toc:\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. - Create a virtual dir off the
api
vdir calledvX
and point it toc:\qm\vX\querymodule\public_html
. - 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">
- Go into the URL Rewrite for the
v1
vdir and remove the "slimCurrent" rule. - Do this for all other vN directories.
- Edit the
c:\qm\vX\querymodule\public_html\web.config
and delete thehttpProtocol
section. -
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. - 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.
- Note: Be sure to use the database name as defined in the config.php from the prior step; it may not be PVSupport.
- Start the web site if you had stopped it before.