Structure of the appsettings.json file
{
"ConnectionStrings": {
"DefaultConnection": "server=127.0.0.1;port=3306;database=db;uid=user;pwd=<user_password>",
"Provider": "MySql"
},
"EmailSender": {
"Host": "<smtp_host>",
"Port": <smtp_port>,
"EnableSSL": true,
"UserName": "<email_address>",
"Password": "<email_password>"
},
"ServerSettings": {
"ServerUrl": "https://<you_domain_name>",
"ServerFullName": "Hideez Enterprise Server",
"ServerShortName": "HES",
"CompanyName": "Hideez Group Inc."
},
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
Replace the following settings in this file with your own:
<user_password>
- Password for the user on MySQL server<smtp_host>
- Host name of your SMTP server (example:smtp.example.com
)<smtp_port>
- Port number of your SMTP server (example:123
)<email_address>
- Your email adress (example:[email protected]
)<email_password>
- Password to access the SMTP server (example:password
)<you_domain_name>
- you fully qualified domain name (FQDN) of your HES site (example:hideez.example.com
)
If you use MS SQL instead of MySQL, the connection string should look like this:
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1,1433;Initial Catalog=db;User ID=user;Password=password",
"Provider": "MsSql"
},
Replace the following settings in this file with your own:
password
- Password for the user on MS SQL server
Important note: by default, .Net Core uses ports 5000 and 5001. Therefore, if only one domain is running on the server, port numbers can be skipped. But if it is supposed to run a few sites on one computer, then it is necessary to specify different ports for each site in json file.
For example, for a site to listen to ports 6000 and 6001, after "AllowedHosts": "*" add the following (via comma):
,
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:6000"
},
"Https": {
"Url": "https://localhost:6001"
}
}
}
The basic format of a connection string includes a series of keyword/value pairs separated by semicolons. The equal sign (=) connects each keyword and its value. To include values that contain a semicolon, single-quote character, or double-quote character, the value must be enclosed in double quotation marks. If the value contains both a semicolon and a double-quote character, the value can be enclosed in single quotation marks. The single quotation mark is also useful if the value starts with a double-quote character. Conversely, the double quotation mark can be used if the value starts with a single quotation mark. If the value contains both single-quote and double-quote characters, the quotation mark character used to enclose the value must be doubled every time it occurs within the value.
Last modified 2mo ago