Server Setup - techtalk/SpecLog-Resources GitHub Wiki
To set up a SpecLog server, you need to initialize the server database and configure a service URL and port where the server should listen to requests from clients.
- .NET 4.5 runtime installed on the server machine
- Microsoft SQL Server 2008 (or later, any edition) accessible from the server machine for hosting repositories
You can install SpecLog using the installer wizard or by copying the files from another installation's /Server
directory. To use the installer:
- Download the SpecLog installer from here.
- Run the installer on the server.
- Click on Next and accept the EULA.
- Enable the SpecLog Server installer option on the Custom Setup page.
Note: The SpecLog Management feature includes administrative command line tools, and is automatically installed along with the SpecLog server. This option is available separately to allow these tools to be installed without installing the server as well. - Choose whether to you want to send anonymous analytical data to the development team at TechTalk to help improve SpecLog.
-
Initialize SpecLog server database with the SpecLog ServerManager tool
- Open a command prompt with administrator permissions
- Change directory to the SpecLog server folder, e.g.:
>cd C:\Program Files\TechTalk\SpecLog\Server
- initialize the SpecLog server database with the command line, e.g.:
>SpecLog.ServerManager.exe initialize http://myserver:4242 /connection:"Data Source=MyServer;Database=SpecLog;Trusted_Connection=True"
- The first parameter is the URL of the SpecLog server service (e.g http://mySpecLogServerUrl:4242) that is written to the
admin.sltoken
file that is generated when initializing the server database. The SpecLog server service URL is configured in step 5. If you change the server URL later, you can update the generatedadmin.sltoken
file manually. - The second parameter (
/connection:
) specifies a a standard ASP.NET connection string for SQL Server. The SQL server needs to be installed already and running. The user specified in the connection string needs to have admin permissions on the SQL server. The database specified in the connection string will be created or overwritten (if existing already) on the server. You can also omit the/connection:
parameter - in that case the connection string specified inSpecLog.Server.exe.config
will be used (see step 3). Example for using a local SQL Express instance:/connection:localhost\SQLExpress;Database=SpecLog;Trusted_Connection=True
. Make sure the user account running the console has sufficient permissions for the SQL Server instance. - Backup the
admin.sltoken
file generated during initialization. It is required for managing users on the server with SpecLog.UserManager.exe - Use
>SpecLog.ServerManager.exe help initialize
for a detailed description of the parameters
-
Set the database connection string in the
SpecLog.Server.exe.config
file, e.g.:<connectionStrings> <add name="database" connectionString="Data Source=MyServer;Database=SpecLog; Trusted_Connection=True" /> </connectionStrings>
-
Configure the desired service connection settings for the SpecLog server service in the
<appSettings/>
element of theSpecLog.Server.exe.config
file:<appSettings> <add key="ServiceUrlPort" value="4242" /> <!-- Optional: the port on which SpecLog services communicate; default: 4242 --> <add key="SecureUrlSchema" value="false" /> <!-- Optional: whether services use transport level security (SSL); default: false --> <add key="ReducedSecurity" value="false" /> <!-- Optional: whether request and response urls have to match; default: false --> <!-- Optional: the folder for plugin repositories; default: <CommonApplicationData>\TechTalk\SpecLog --> <!-- <add key="PluginRepositoryFolder" value="C:\ProgramData\TechTalk\SpecLog" /> --> </appSettings>
-
Refer to Secure Server Connection if you want run the server using SSL/https.
-
Configure the
SpeclogServerUrl
key in the files:SpecLog.UserManager.exe.config
andSpecLog.AccessManager.exe.config
according to theServiceUrlPort
configured in step 4 and the service URL configured in step 2. -
The default logging on the server is configured to log events to
%LOCALAPPDATA%\SpecLog\syncservice.log
. If you want to change this (e.g. to use EventLog or to send e-mails) edit theservice.entlib.config
file in the server folder. -
Test the server installation by running the server service from the console:
>SpecLog.Server.exe /console
-
Install the SpecLog service component as windows service. The service will be configured by default to run as "Network Service".
- Open a command prompt (as administrator)
- Change directory to the SpecLog server folder (e.g.:
C:\Program Files\TechTalk\SpecLog\Server
- Run the following command:
> %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe SpecLog.Server.exe
-
Review service credentials and start the installed service ("TechTalk SpecLog") from windows service manager.
- The service user account has to have sufficient permissions to open a TCP port.
- Depending on the database authentication settings, you might also need to adjust permissions of the service user account for the database.
- You can also start the service from a command prompt:
> net start SpecLog
-
After evaluation: install server license key or use per-user licensing.
To allow the server to run without requiring administrator permissions, execute the following command from an administrator command prompt (required only once):
> netsh http add urlacl url=http://+:4242/ user=%USERDOMAIN%\%USERNAME%
This allows the server to run under the selected user's account.
You can enable a secure server connection using https for communication between client and server.
An administrator user token (e.g. admin.sltoken
) is required to manage users on the server. An administrator user is created when initializing the server database. If you lose this token, you can re-create a new admin user and token using the SpecLog ServerManager (provided that you have access to the server database) using the following command:
>SpecLog.ServerManager.exe resetadmin http://MyServerURL
The existing admin user is overwritten and the previously generated admin.sltoken
file is no longer valid on the server.
To analyse problems during setup, we recommended you first run the server from the console instead of as a service, as all errors are logged to the console in this case. Use the following command to run the server from an admin console (cmd - Run as administrator):
>SpecLog.Server.exe /console
Logs are generated using Microsoft's Enterprise Library and can be configured in service.entlib.config
for troubleshooting purposes. For example, the following configuration changes cause the server to write detailed logs to: %LOCALAPPDATA%\SpecLog\service.log
- Change
filter="Information"
tofilter="All"
<add name="FlatFileTraceListener" fileName="%LOCALAPPDATA%\SpecLog\service.log"
filter="All"
rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="1024"
traceOutputOptions="None"
formatter="Text Formatter" header="----------------------------------------"
footer="----------------------------------------"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging" />
- Add
<add name="FlatFileTraceListener" />
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="Console Writer Trace Listener" />
<add name="FlatFileTraceListener" />
<!-- <add name="Email Trace Listener" />-->
</listeners>
</allEvents>
- Add
<add name="FlatFileTraceListener" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="EventLogListener" />
<add name="FlatFileTraceListener" />
</listeners>
</errors>
Note: Don't forget to disable extend logging once you have finished analysing and troubleshooting!
Note: Don't forget to configure regular server backups!