Skip to content

Commit 2260a2c

Browse files
Merge pull request #19 from PxTools/feature/PXWEB2-832-install-documentation
Updated installation instructions
2 parents 55a9a8c + 63903b3 commit 2260a2c

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed
Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Install PxWebApi 2.0 on your IIS server
1+
# Install PxWeb 2 on your IIS server
22

3-
This instruction guides you in how to install PxWeb 2.0 on IIS.
3+
This instruction guides you in how to install PxWeb 2 on IIS.
44

55
## Prerequisites
66

77
- A supported Windows server with IIS installed.
8-
- ApiUrl to your PxWebapi2 installation.
8+
- The [URL Rewrite module](https://www.iis.net/downloads/microsoft/url-rewrite) must be installed on your IIS.
9+
- ApiUrl to your PxWebApi 2 installation.
910
If your tables endpoint is at `https://your.api.server/PxWeb/api/v2/tables`
1011
then your ApiUrl is `https://your.api.server/PxWeb/api/v2` (omit a trailing slash, one is added automatically)
1112

@@ -14,23 +15,53 @@ This instruction guides you in how to install PxWeb 2.0 on IIS.
1415
1. Download the [zip file for the latest release](https://github.com/pxtools/PxWeb2/releases/latest) from GitHub.
1516
It is found inside the Asserts heading.
1617
Make sure to _Unblock_ it if its block by right clicking on it in _File Explorer_ and check the `Unblock` checkbox.
17-
1. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
18-
1. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
18+
2. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
19+
3. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
1920

2021
```js
2122
baseApplicationPath: "/pxweb2/"
2223

2324
apiUrl: "your api url"
2425
```
2526

26-
1. In `index.html`, adjust the `<base>` tag:
27+
4. In `index.html`, adjust the `<base>` tag:
2728

2829
```html
2930
<base href="/pxweb2/">
3031
```
3132

32-
1. I didnt need this: Ensure the web server rewrites (if needed) static file requests correctly to that subpath.
33+
5. In `web.config`, adjust the `Content-Security-Policy` to allow calls to your PxWebApi 2 installation. Within the `Content-Security-Policy` replace the text `https://enter-your-api-domain-here` with the domain of your PxWebApi (for example https://api.scb.se):
3334

34-
1. In IIS find the folder and convert it to application. ( Concider using a separate Application pool for this :-) )
35+
```html
36+
<add name="Content-Security-Policy" value="default-src 'self'; connect-src 'self' https://api.scb.se; script-src 'self'" />
37+
```
38+
39+
1. In IIS find the folder and convert it to an application. (Consider using a separate Application pool for this)
3540

3641
1. Open "http(s)://"server adress"/pxweb2 .
42+
43+
## Troubleshooting
44+
45+
### Problem running PxWeb on localhost
46+
47+
If you are trying to run PxWeb directly on the server under localhost you might get an error looking like this in the console of your browser:
48+
49+
```
50+
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
51+
```
52+
53+
#### Solution
54+
55+
Change localhost in the URL to the computer name of the server.
56+
57+
### PxWeb refuses to connect to PxWebApi
58+
59+
If you get an error message looking like this in the console of your browser:
60+
61+
```
62+
Refused to connect to 'https://your-api-url' because it violates the following Content Security Policy directive: "connect-src 'self' https://enter-your-api-domain-here".
63+
```
64+
65+
#### Solution
66+
67+
You need to enter the domain of your PxWebApi in the Content Security Policy section in web.config, see step 5 of the installation steps above.

0 commit comments

Comments
 (0)