This article will guide you through using the Contensive configuration tool to configure your web server to utilize a web application that you will also create. The required server environment is a Windows server (or laptop) with an IIS Web Server and SQL Server Express installed.
- Create an AWS EC2 server instance with Windows Server 2019+ and IIS Web Server. For details see the following article: How to Create an Amazon Windows 2019 Server for Contensive
- Download and install the Configuration Tool from http://contensive.io/downloads.
NOTE: This installs two features, the command line configuration utility and a windows service for managing background tasks.
- Use the configuration tool to first configure a Server Group:
NOTE: A Server Group holds the settings for resources used by all applications in the group like connection strings for Db servers, the file system, etc. A Server Group also holds multiple servers that execute the aforementioned applications. Numerous servers and applications can be contained in one Server Group.
Run command prompt as administrator. Navigate to c:\Program Files (x86)\kma\contensive5. Run 'cc' with no arguments for a list of available commands. Run 'cc --status' (note the double minus) for the status of the current Server Group. You can redo the following instructions at any time to re-configure the Server Group that we are about to create.
run >cc --configure
>> Enter the Server Group Name: (Name the Server Group anything you want like "staging" or the customer's name)
>> Production Server (y/n)?: (This property can be read by applications in order to enable/disable certain features. Enter 'y' if your web app will be for public use, else 'n' if your web app is for testing purposes)
>> Local File System (y/n)?: (Enter 'y' for this example)
>> Enter the drive letter for data storage: (Self-explanatory, enter 'c' or 'd' for example)
>> SQL Server Endpoint: (Enter "(local)" for this example)
>> native sqlserver userId: (The user login for this server group. This login is the credentials used to log into SQL Server Manager.)
>> native sqlserver password: (The password)
>> Use (l)ocal cache or (m)emcached server?: (Enter 'l' for this example)
- Create an application in the Server Group.
NOTE: An application is the solution you are creating. It could be a website with 100 servers, a database program that processes data periodically, etc.
run >cc -n
You will be prompted for the following:- Application Name
Enter a name for your application eg. myApp.
- Admin Route
This will be the path you use for the administration site (where you edit data) if your path is online. The default is "admin".
- Primary Domain Name
Enter a domain name that will be used to reach the application (if applicable). You can change this or add many more later.
- App Files
This is the file folder where the website files such as scripts will run, typically wwwRoot. Enter to accept the default path.
- cdn Files
This is the file path where uploaded files will be stored if they will be available online (this is remote AWS S3 bucket in non-local Server Groups).
- Private Files
This is the file path where the application will store files that should not be mapped to the web server. Enter to accept the default path.
- Temp Files
This is the file path used for files that have a temporary usage. Enter to accept the default path.
- Files url
This is the prefix used within the website programming. Enter to accept the default path.
- Download the default sample website zip file from http://contensive.io/downloads and import it into the new IIS site using IIS Web Deploy 3.6+
- Verify in Server Roles and Features that IIS Management Tools are all installed. If not, be sure to uninstall Web Deployment before installing Web Deploy.
- Restart IIS Manager and the deploy option should now be available when you right-click your site.
- Finally, right-click on the site and select Deploy >> Import. Select the downloaded default website and complete the import.
- If this server will also be used to run background worker processes, verify installation of the Contensive Task Service and start it.
- Open Windows Services and if Contensive Task Service is not in the list, use the windows install utility to add the service
- cd \Program Files\Contensive
- execute \Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe TaskService.exe
- In Windows Services start the task service and change to automatic start.
- To make the command line utility easier to use, add to the system path
- from the command line, search for "environment variables" and click on "Edit the System Environment Variables"
- On the advanced tab, click the [Environment Variables] link
- In System Variables, double click on Path and add the path c:\program files\contensive\
- Create a root account login
- from the command line, run the command > cc -a sitename --addroot
- It will create an account that expires in 1 hour and display the password
- Login to the admin site and setup important initial settings
- If you are getting a red domain error at the top, the current domain needs to added to the domain table. On the top nav, click settings and click domains (or search for domains), and add the current domain with Normal type and add the default landing page and default template.
- Go to settings in the upper-right, and click on Site Settings
- In the email tab
- set a valid email address for both Admin Email Address and Default From Email Address
- check the box [Use AWS Simple Email Service (SES)].
- For Email Spam Footer, enter what every email should include at the bottom to unsubscribe. Link the click with <link>message</link>. If you will include a custom unsubscribe in each email, leave this blank.
- In Security, verify the important settings for this site.
- Allow Plain Text password (false recommended)
- Clear Plain-Text on conversion (true recommended)
- Min length, required characters, block used passwords, and lockup period
- Website tab, Favicon - if the site will include a set of favicon files uploaded manually to the www root directory. Uploading a file here for a simpler quick solution
- Setup a 404 page
- Go to the admin site and create a new page (Content icon, Page Content) with the name "/ErrorPages/404" and the appropriate content.
- Go to this page by going to the domain name /ErrorPages/404
- In the tool panel turn on Widgets and drag a text block (in Content category) on to the page.
- Edit the content
- Go to IIS manager and click on Error Pages
- Click on 404, and add /ErrorPages/404 into "Execute a URL on this site". On the right click Edit Feature Settings and click Custom Error Pages
- This page may be requested frequently and if complex may be a performance problem. If this is the case, after creating the page, use your browser or CURL to request the page and save it to an html file. Save it as an document named ErrorPages-404.html in the root folder and change the iis Custom Error Pages to this url