Home → Installation and Upgrade Manual → HelpSpot 5 Installation → .env Config (Self Hosted)
1.10. .env Config (Self Hosted)
HelpSpot Configuration
## Enable debugging output in the web front end APP_DEBUG=false ## The base url of the HelpSpot application (without a trailing slash) APP_URL=https://example.org ## Database type mysql or mssql DB_CONNECTION=mysql ## The DNS name or IP of the database server DB_HOST=localhost ## The port for the database server DB_PORT=3306 ## The database name for the helpspot database DB_DATABASE=helpspot ## The database user name DB_USERNAME=some_user ## The database user password DB_PASSWORD=some_pass ## The selected queue driver. Database is default. QUEUE_CONNECTION=database
Any other configuration setting you used to put into config.php
can also be added into the .env
file.
To convert old settings to new settings, you can use this formula:
Used to be this in config.php:
define('cHD_FOOBAR', 'some-value');
Can now be this within .env:
cHD_FOOBAR="some-value"
Secondary Portals
Secondary portals can optionally use their own .env
file as well. If the Portal Path is, for example, /var/www/helpspot/public/some-portal
, you can add a .env
file to that path: /var/www/helpspot/public/some-portal/.env
.
Any items added here will over-ride the settings from the main .env
file configuration file.
If .env
files are used in secondary portals, it will be important to configure the web server to not serve .env
files if requested. Blocking requests for any "dot-file" (files that start with a period) is a common configuration:
Nginx:
## Disable access to all dot files, except for ".well-known", ## which is used for SSL generation location ~* /\.(?!well-known\/) { deny all; access_log off; log_not_found off; }
Apache:
## Disable access to all dot files, except for ".well-known", ## which is used for SSL generation <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC] RewriteCond %{SCRIPT_FILENAME} -d [OR] RewriteCond %{SCRIPT_FILENAME} -f RewriteRule "(^|/)\." - [F] </IfModule>
The New Configuration File
The new configuration file (.env
) looks like this:
APP_DEBUG=false APP_URL=https://example.org DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=helpspot DB_USERNAME=some_user DB_PASSWORD=some_pass QUEUE_CONNECTION=database
Maping old config to new config
The following configurations are no longer defined within a configuration file:
- cDBCHARSET
- cDBCOLLATION
- SEARCH_ENGINE
- cSEARCHHOST
- cSEARCHPORT
- cBASEPATH
- cDATADIR
The following configurations map to the new configuration fields:
cDBTYPE
=>DB_CONNECTION
(note that valid values now aremysql
orsqlsrv
- Valuemssql
for database type is no longer valid)cDBHOSTNAME
=>DB_HOST
DB_PORT
=> This is a new value. Note that sqlserver value127.0.0.1,1433
will need to be split into two values (hsotname and port are separate)cDBUSERNAME
=>DB_USERNAME
cDBPASSWORD
=>DB_PASSWORD
cDBNAME
=>DB_DATABASE
cHOST
=>APP_URL
cDEBUG
=>APP_DEBUG
Fresh Installations
New installations can create a new .env
file (or copy the .env.example
file and replace values as needed).
Updates
We've provided a script to that reads the old config.php file (assuming it's located at C:\Program Files (x86)\helpspot\helpspot\config.php
) and generates a .env
file:
Working directory: C:\Program Files (x86)\helpspot\helpspot
Command: ..\php\php.exe -c ..\php\php.ini hs config:convert
. This command creates (or over-write) file C:\Program Files (x86)\helpspot\helpspot\.env
For testing, you can run ..\php\php.exe -c ..\php\php.ini hs config:convert --dump
to see the text output it would otherwise create.
Hidden Settings
Setting MAINTENANCE_MODE=true
can be used within the .env
file to force maintenance mode.