Install the software¶
The final installation step is to install and run the GRA software. We recommend deploying the GRA in Docker.
Install and run the GRA in Docker¶
The GRA Docker image requires a Linux container, if you are running Docker on a platform other than Linux please ensure that you have Linux containers selected. If you don’t currently have a Web site running on your Docker server you can forward port 80 from the server directly into the Docker container.
- Create a directory on the Web server to contain the shared GRA files, for example
/gra/shared
in Linux orc:\gra\shared\
in Windows. - Place your
appsettings.json
file into the shared directory that you just created. - From a prompt (a
bash
shell,command prompt
orPowerShell
window) start the Docker image with a command similar todocker run -d -p 80:80 --name gra --restart unless-stopped -v /gra/shared:/app/shared mcld/gra
- details of that command:-d
tells Docker to run the container in the background-p 80:80
says to forward port 80 from the local server to port 80 in the container--name gra
provides a name for the container to make it easier to reference while it’s running (e.g. if you have to stop the container you can withdocker stop gra
)--restart unless-stopped
will restart the container if it should stop unless you explicitly stop it-v /gra/shared:/app/shared
tells Docker to share the/gra/shared
directory on the local server with the/app/shared
directory inside the containermcld/gra
is the image to run - this will download and run themcld/gra:latest
image from Docker Hub
- Launch a Web browser on the server and navigate to the URL you defined for this install of the GRA (for the above example,
http://localhost/
will work). - At this point you should see the initial GRA setup screen.
- You can continue the GRA setup process either directly in this Web browser or you can navigate to the Web server using the URL you defined for this install of the GRA.
In the case that there is already a Web site running on your server you will need to forward a different port into the Docker container. If you chose to forward port 2001 from your server into the GRA container you’d use -p 2001:80
in step 3 above and then in step 4 you’d access the site by navigating to http://localhost:2001/
.
The software should create a “logs” directory inside the shared
directory which you can review to see if there are any errors written out to the log file.
Install and run the GRA on a Windows Server¶
The GRA is an ASP.NET Core application so review the Host ASP.NET Core on Windows with IIS instructions from Microsoft and ensure that IIS is installed with the Web Sockets feature enabled and the appropriate ASP.NET Core hosting bundle is installed.
Set up the GRA as the only site on the server¶
If this Web server is configured solely for the Great Reading Adventure, you can utilize the default Web site for your GRA installation.
- Delete existing default files placed in
c:\inetpub\wwwroot\
such asiisstart.htm
andwelcome.png
. - Unzip the GRA files into
c:\inetpub\wwwroot\
. Ensure that the files are placed in that directory directly and not in a subdirectory (you should see files such asappsettings.json
andGRA.dll
inc:\inetpub\wwwroot\
). - Create a new folder named
shared
inc:\inetpub\wwwroot
. - Right-click on the
c:\inetpub\wwwroot\shared
directory and select Properties. - Choose the Security tab and then click the Edit button next to To change permissions, click Edit.
- If you are using IIS 7.5 or later (it shipped starting with Windows 7 and Windows Server 2008 R2), select Add in the Permissions for wwwroot window and in the Enter the object names to select box, enter in
IIS AppPool\DefaultAppPool
and click OK (theIIS AppPool\DefaultAppPool
user is a local user on this machine, so ensure that the From this location box has the name of the Web server and not your domain - you can change this by clicking Locations… and select the server). You may also potentially use theIIS_IUSRS
group if you prefer. - Ensure all the checkboxes (including Modify) are selected except Full control and Special permissions in the Allow column.
- Select OK to close this window and OK to close the wwwroot Properties window.
- Ensure you have updated the configuration in the
appsettings.json
file - or if you are using a configuration override file, ensure it’s namedappsettings.json
and placed into theshared
folder. See the configuration section of this document for more details. - Launch a Web browser on the server and navigate to the URL
http://localhost/
. - At this point you should see the initial GRA setup screen.
- You can continue the GRA setup process either directly in this Web browser or you can navigate to the Web server name or IP address in a browser on another system to continue.
Set up the GRA as an additional site on the server¶
If you are deploying the Great Reading Adventure to a Web server which is already hosting one or more Web sites, you must create a new Web Site specifically for the GRA.
Because this Web server is already serving out files through the default Web Site, you must differentiate your GRA Web site somehow. Methods for doing so include:
- Setting up a separate host name for your GRA Web site (for example:
http://gra.<your domain>
. This method utilizes the HTTP Host Header Field. - Setting up a separate IP address on the Web server and putting your GRA site there.
- Setting up the GRA on a different port number so that you’ll access it via
http://<your Web server>:<GRA port>/
.
Your system administrator can help you select the correct approach.
- Create a directory on the Web server to contain the GRA files. For example,
c:\inetpub\gra\
. - Unzip the GRA files into that directory. Ensure that the files are placed in that directory directly and not in a subdirectory (you should see files such as
appsettings.json
andGRA.dll
inc:\inetpub\gra\
). - Create a new folder named
shared
in the directory you created above. - Right-click on the
shared
directory and select Properties. - Choose the Security tab and then click the Edit button next to To change permissions, click Edit.
- If you are using IIS 7.5 or later (it shipped starting with Windows 7 and Windows Server 2008 R2), select Add in the Permissions for wwwroot window and in the Enter the object names to select box, enter in
IIS AppPool\DefaultAppPool
(or the name of the App Pool into which you are deploying) and click OK (theIIS AppPool\DefaultAppPool
user is a local user on this machine, so ensure that the From this location box has the name of the Web server and not your domain - you can change this by clicking Locations… and select the server). You may also potentially use theIIS_IUSRS
group if you prefer. - Ensure all the checkboxes (including Modify) are selected except Full control and Special permissions in the Allow column.
- Select OK to close this window and OK to close the Properties window.
- Ensure you have updated the configuration in the
appsettings.json
file - or if you are using a configuration override file, ensure it’s namedappsettings.json
and placed into theshared
folder. See the configuration section of this document for more details. - Open up the Internet Information Services Manager on the Web server.
- Expand the Server under Connections.
- Right-click on Sites and choose Add Web Site….
- Enter an appropriate site name such as
SummerReading
. - Enter the physical path where you put the GRA files under Physical path (we used
c:\inetpub\gra
above). - In the Binding section you will either need to assign an IP address, a host name, or select a different port as defined above.
- Select OK to close the Add Web Site window.
- Launch a Web browser on the server and navigate to the URL you defined for this install of the GRA.
- At this point you should see the initial GRA setup screen.
- You can continue the GRA setup process either directly in this Web browser or you can navigate to the Web server using the URL you defined for this install of the GRA.
Troubleshooting a Windows installation¶
- Did you modify the
appsettings.json
or provide an override file in thesettings
directory to configure the database connection and authorization code? - Did you install the ASP.NET Core Hosting Bundle?
- Did you restart IIS after installing it?
- Are you sure the
shared
directory has write permissions for the process running IIS? Once the application starts, it will create a “logs” directory there so you will know if the Web server can write to this directory once you see the “logs” directory present. Check that “logs” directory to see if there are any errors written out to the log file. - If the Web process can write to the
shared
directory, you can edit theWeb.config
fileaspNetCore
tag to setstdoutLogEnabled="true"
andstdoutLogFile=".\shared\stdout"
. When you restart IIS it should write a log file starting with “stdout” that you can examine to see if any errors are being written to it. - Microsoft’s Troubleshoot ASP.NET Core on IIS page will walk you through some typical troubleshooting steps.