This guide gives you step by step instructions for setting up the OptiTune Management Server (OTMS) on a Windows Server.
Table of Contents
The OptiTune management server requires the following
Windows Server 2016
Microsoft SQL Server 2017 (Express or Standard)
Xeon class CPU
8GB RAM (16 GB recommended)
25GB Free Hard Disk Space
It is recommended to install the SQL Database on an SSD, preferably a PCI Express NVMe SSD if one is available.
Follow these steps to download and extract the OptiTune Management Server:
Visit the download page and download the OptiTune Management Server. It is packaged as a zip file.
Extract the contents to a directory on your Windows 2016 Server (e.g. to "C:\otdownload").
Copy the "optitune" folder from "C:\otdownload\optitune" to "C:\optitune".
Once copied, the contents of C:\optitune should look like the following:
IIS Website Setup
First, you will need to install an IIS Website for OptiTune.
IIS Role Installation
If you have not already installed the IIS role on the server, you need to do so.
Start the "Server Manager" from the desktop
Go to the "Manage" link at the top right and select "Add Roles or Features"
Click the checkbox next to "Web Server (IIS)"
A dialog box will come up, click "Add Features".
Select "ASP.NET 4.6".
Expand WCF Services, and select "HTTP Activation"
Click "Add Features"
Select "Named Pipe Activation", and "TCP Activation" as well
Scroll down and also select "SMTP Server", if you are going to use the built in SMTP server on the windows server. Accept the defaults for the dialog box that comes up. Finally, click "Next".
Important - click on every single checkbox (including their child check boxes), but leave FTP Server blank, and the defaults for "Management Tools". The selection should match the image above when you are done. You will be prompted with several pop ups while clicking on the check boxes, and you should accept the defaults. Finally, click Next.
Finally, click on the "Restart the destination server automatically if required" checkbox, and click on "Install" to add the IIS Role and SMTP server on the Windows Server.
The computer may restart after the installation has finished.
Wait for the installation to complete.
Once the installation has finished, click on "Close"
Go to the Start Menu, select "Settings", and then select Windows Updates. Check for Windows updates, and make sure all the latest updates are installed.
OptiTune Website Setup
Finally, start "IIS Manager" (not the 6.0 version, but the latest one):
You will see a Default Web Site already created. Right click on it, and select "Remove", and answer "Yes" to confirm the removal of the default site.
Next, you will need to copy the OptiTune server binaries to a new directory on your computer. The recommended location is C:\optitune, but you can choose a different location if needed.
The C:\optitune directory should look like the above image.
Next, go back to IIS, and you will need to add an App Pool and IIS Website.
Click on "Application Pools" at the top left, and then click on "Add Application Pool" at the top right
Enter "optitune" for the name of the application pool, and click OK
Click on the new "optitune" application pool, and then click on "Advanced Settings..." on the right
Change "Enable 32-Bit Applications" to "True"
Change "Start Mode" to "AlwaysRunning".
Change "Idle Time-out (minutes)" to "0"
Change "Load User Profile" to True
Change "Disable Overlapped Recycle" to True
Change "Regular Time Interval (minutes)" to "5760"
Finally, press OK to save the changes
Now, we will create the OptiTune website.
Right click on "Sites", and select "Add Website"
Enter "optitune" for the site name
Click on "Select..." next to the application pool, and select the "optitune" application pool you created earlier. Press OK.
Select the path where you copied the OptiTune website files (C:\optitune\web in this case), and finally press OK.
Important OptiTune requires the use of an SSL certificate. If you have one ready and already installed in IIS, you can change the binding type to HTTPS in the above dialog, and select it here.
Otherwise, you will need to install an SSL certificate later, and change the binding of the website to only have the HTTPS protocol with your website certificate on port 443. Otherwise, the OptiTune agent will not be able to connect to the OptiTune server.
The "optitune" website has now been created, but we still have to setup SQL Server and the OptiTune database in order for it to function.
After creating the website under IIS, you will need to setup appropriate folder permissions.
In File Explorer, navigate to the C Drive and click on "optitune". Right click on it, and select "Properties".
Click on the "Security" tab, and then click "Edit".
Click on "Add..."
Type in "IIS APPPOOL\Optitune" without quotes and press OK.
Click on the new "optitune" user, and then make sure the "Modify" permission is allowed. Finally, press OK.
The application pool "optitune" you created before will now have write access to the "C:\optitune" folder.
SQL Server Database Setup
You will need the latest MS SQL 2017 Database Server. If you don't have a paid version, you can download and install the free version (SQL 2017 Express), which can support databases up to 10GB in size.
Also, you will need to install the management tools for SQL Server:
Once you have installed SQL Server and SSMS (using the default installation options), start up SSMS to create the OptiTune database.
SQL Server Setup
Visit the following webpage to download and run the SQL Server 2017 Express Edition setup
Wait for it to download the installation files
The SQL setup wizard will launch:
Select "New SQL Server stand-alone installation..." at the top
Read and accept the EULA, and click "Next"
Click "Use Microsoft Update to check for updates" and click "Next"
Leave the default install options as is, and click Next
Leave the default options, and click Next
Leave the default options, and click Next
Press the "Add Current User" button to add the current user, if it has not already been done.
Press the "FILESTREAM" tab, and check the first two check boxes. Then, press Next
Accept the agreement, and press Next
Accept the agreement, and press Next
Wait for the installation to complete
Install SQL Server Management Studio (SSMS)
If you have not already installed SSMS, download and run it from:
Wait for the install to finish
OptiTune Database Setup
Right Click "Databases", and select "New Database..."
Enter the name "optitune", and click on the "Filegroups" icon at the top left.
Press the "Add Filegroup" buton, and under the name type "Files". The screen should match what is shown above.
Go back to the General page, and click "Add" at the bottom. Enter "optitune_files" for the name, and select "FILESTREAM Data" for the type. Finally, press OK to create blank database.
Select the "optitune" database on the left
Press the "open" icon, and select the schema script that is included in the OptiTune install package, which would typically be: c:\optitune\optitune-schema.sql
Important - make sure the "optitune" database is selected in the drop down in the top left (to the left of the "execute" button), and then click on "Execute" to create the optitune schema.
Verify that you can expand the "Tables" folder of the database, and that you see some new tables that were created by the script.
Next, right click on the "Logins" folder under "Security", and select "New Login"
Type in "IIS APPPOOL\optitune" (without quotes) in the Login Name text box.
Click on "User Mapping" on the left, and then click on the "optitune" checkbox in the top right section of the screen. Click on "db_owner" as well. Finally, press OK to add the IIS App pool user to SQL server, mapped to the OptiTune database.
You should then see the new IIS App Pool user added to SQL server.
Geo Location Setup
OptiTune includes the ability to perform basic geo location of computers based on IP address.
You will need to signup for an account at https://lite.ip2location.com/ and download the DB11 CSV database to c:\optitune\ip2location\IP2LOCATION-LITE-DB11.CSV before starting the import. You can repeat this process every few months, as this geo location database will be updated periodically.
To start the import, open SSMS and navigate to the OptiTune database.
Go to Databases > optitune > Programmability > Stored Procedures, and click on dbo.ImportAndCacheIP2Location.
Rick click on dbo.ImportAndCacheIP2Location, and select "Execute stored procedure..." Press OK to begin importing location data from c:\optitune\ip2location. If you are not using C:\optitune, you will need to modify the stored procedure with the correct path before executing the stored procedure.
It will take several minutes to complete.
Finally, once you have setup the OptiTune Database and OptiTune Website, you will need to further edit the web.config file located at C:\optitune\web\Web.config
Here is an example web.config, note that it will vary depending on your version of the OptiTune management server. The areas highlighted in yellow must be examined and customized as needed. You can also search for **customize** to find settings that can be customized.
<?xml version="1.0" encoding="UTF-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <!-- Define the custom configuration sections in the <configSections> element... --> <configSections> <sectionGroup name="OptiTune"> <section name="RelayServers" type="Optitune.RemoteConnect.RelayServerConfigSection" /> </sectionGroup> </configSections> <appSettings> <!-- Optitune Settings --> <add key="DebugMode" value="2" /> <add key="DebugDir" value="C:OptituneLogs" /> <!-- **customize** writeable location to store logs --> <add key="LogFile" value="C:OptituneLogsOptituneSystem.log" /> <!-- **customize** name of OptiTune system log file --> <add key="LogCategories" value="31" /> <!-- Set to "1" to have secure pages check for https protocol initially, otherwise "0" --> <add key="checkhttps" value="1" /> <!-- The interval in minutes that OptiTune should check for periodic events --> <add key="PeriodicEventsInterval" value="15" /> <!-- Chart Control Settings --> <add key="ChartImageHandler" value="storage=memory;timeout=60;deleteAfterServicing=false;privateImages=false;"/> <!-- Static Content Settings, used mostly for mail templates --> <add key="StaticContentUrl" value="https://manage.opti-tune.com" /> <!-- **customize** the https address of your OptiTune server --> <!-- Dynamic Content, webpages, management console, used mostly for mail templates --> <add key="DynamicContentUrl" value="https://manage.opti-tune.com" /> <!-- **customize** the https address of your OptiTune server --> <!-- Don't allow autocomplete for the login page --> <add key="AllowLoginAutoComplete" value="0" /> <!-- These values must be specified to allow the compilation of nsis based installers for the OptiTune agent --> <add key="NSISDirectory" value="C:optitunensis" /> <!-- **customize** --> <add key="TempDirectory" value="C:optituneinstallers" /> <!-- **customize** --> <!-- Twilio Credentials --> <add key="TwilioSid" value="XXXX"/> <!-- **customize** --> <add key="TwilioAuthToken" value="XXXX"/> <!-- **customize** --> <add key="TwilioFromNumber" value="4255555555"/> <!-- **customize** --> </appSettings> <!-- Provide the custom configuration settings OUTSIDE of <system.web>. You can have multiple relay servers. --> <OptiTune> <RelayServers> <Servers> <add name="relay.opti-tune.com" /> </Servers> </RelayServers> </OptiTune> <connectionStrings> <!-- **customize** The first line is if you are using a windows account in SQL server, the second is for an SQL user account --> <add name="Optitune" connectionString="Server=localhostSQLEXPRESS;Database=Optitune;Trusted_Connection=Yes;MultipleActiveResultSets=True;ConnectionTimeout=1200;"/> <!--<add name="Optitune" connectionString="Server=localhost;Database=Optitune;UserId=optitune;Password=mypassword123;MultipleActiveResultSets=True;ConnectionTimeout=1200;"/>--> </connectionStrings> <!-- Content Removed For Clarity... --> <system.net> <mailSettings> <smtp> <!-- **customize** Install the SMTP service on this server, or supply your own SMTP server details here --> <network defaultCredentials="true" host="localhost" port="25" /> </smtp> </mailSettings> </system.net> <runtime> <gcAllowVeryLargeObjects enabled="true" /> <!-- This allows us to allocate arrays larger than 2GB in size --> </runtime> <!-- Console directory permissions --> <location path="console"> <system.web> <authorization> <allow roles="MasterAdmin" /> <allow roles="Admin" /> <deny users="*" /> </authorization> </system.web> </location> <!-- Content Removed For Clarity... --> </configuration>
The only two fields which must be customized in all cases are StaticContentUrl and DynamicContentUrl. The rest may be left as is if you followed the instructions in this guide carefully.
<!-- Static Content Settings, used mostly for mail templates --> <add key="StaticContentUrl" value="https://manage.opti-tune.com" /> <!-- **customize** the https address of your OptiTune server --> <!-- Dynamic Content, webpages, management console, used mostly for mail templates --> <add key="DynamicContentUrl" value="https://manage.opti-tune.com" /> <!-- **customize** the https address of your OptiTune server -->
SMTP Server Setup
If you want OptiTune to be able to send alert emails, you will need to either install the SMTP server on Windows, or provide SMTP server connection details.
<system.net> <mailSettings> <smtp> <!-- **customize** Install the SMTP service on this server, or supply your own SMTP server details here --> <network defaultCredentials="true" host="localhost" port="25" /> </smtp> </mailSettings> </system.net>
The default settings above assume that there is a local SMTP server running on the same server as IIS hosting the OptiTune website. If you want to use a relay server on a different machine (e.g. gmail), you can find the documentation for this configuration element here: https://msdn.microsoft.com/en-us/library/ms164242(v=vs.100).aspx
Local SMTP Server configuration
If you elect to use the local Windows SMTP server that is installed on the same server as IIS, follow these instructions to complete the setup of SMTP
Search for "IIS 6.0", and launch the result found from the start screen
The screen shown above will come up. You will need to enable the SMTP service, and configure it. Right click on "SMTP Virtual Server #1", and select "Properties".
Click on the "Delivery" tab
Enter the full DNS name of the optitune website, for example optitune.mycompany.com, and press OK. Then, click on the "Security" tab.
Click on Object Types and click on the Groups checkbox. Then, enter "IIS_IUSRS" Then press OK.
Finally, press OK.
Next, you will need to enable the SMTP service to start automatically, and start the service.
Open the "Services" administrative tool, and locate the "Simple Mail Transport Protocol (SMTP)" service. This was installed above when you added the IIS role to the server.
Right click on "Simple Mail Transport Protocol (SMTP)" and select Properties.
Set the startup type to "Automatic", and press the "Start" button. Then press OK.
Your SMTP server should be up an running. You can test it from the "mail templates" page in the OptiTune website to see if it works.
If you want to allow the management server to send SMS text messages, you will need to sign up for an account at https://www.twilio.com and fill in the following fields in web.config
<!-- Twilio Credentials --> <add key="TwilioSid" value="XXXX"/> <!-- **customize** --> <add key="TwilioAuthToken" value="XXXX"/> <!-- **customize** --> <add key="TwilioFromNumber" value="4255555555"/> <!-- **customize** -->
The TwilioSid and TwilioAuthToken are credentials for your Twilio Account, and TwilioFromNumber is the authorized mobile number that will send the text messages, and appear on the caller id.
Importantly, you need to install an SSL certificate for the OptiTune website, and set the "optitune" website to use it in its "bindings".
In IIS manager, click on the "optitune" website, and then click on "bindings" at the right part of the screen.
Type in the host name, and select the SSL certificate you installed with IIS. The vendor of your SSL certificate will be able to provide you with detailed instructions for generating the certificate request and completing the certificate request in IIS.
Press OK to add the binding for the OptiTune website. Finally, remove the http binding for the OptiTune website, and check that the firewall rules for the server allow HTTPS incoming.
Setting up your account
Finally, navigate to your brand new OptiTune website, using its https:// prefix, for example https://optitune.mycompany.com
In this screenshot, we have navigated to the website on the local webserver, for illustration purposes. You will need to remove the http binding, and add the https binding described above, and navigate using the real url to setup your organization. The OptiTune agent needs to access this server using the HTTPS protocol, so you must install an SSL certificate before proceeding.
Click on "Register Account", and enter the registration code you received when you purchased OptiTune licenses to complete the setup of your first organization in OptiTune, or leave the registration code field blank to use monthly billing.
To complete the OptiTune installation, all sections of this document need to be followed carefully. If you have any questions or problems deploying the website, please contact us at firstname.lastname@example.org