Installation steps and common issues. |
Table of Contents |
---|
Does your server have Softaculous installed? If so, you may alternatively install Blesta through Softaculous. |
Follow these steps to install Blesta on your server.
Visit https://account.blesta.com/client/plugin/download_manager/client_main/ and click to download the latest version.
Unzip the Blesta archive (.zip) file using your favorite compression utility. On Windows, right click and select "Extract All". If the zip is uploaded to or downloaded directly to a Linux server, run the following in your shell:
unzip blesta-vx.x.x.zip |
Upload the contents of the public_html directory to your server where you will be accessing Blesta. Before you continue any further, ensure you've created a database that Blesta can be installed into. You'll need your database host (usually localhost), database name, database user, and database user password to continue with installation.
Blesta may be installed in one of two ways, either via the web in your browser, of via command line.
Follow these steps to install Blesta via the web.
Follow these steps to install Blesta via the command line.
For interactive mode run
php ./index.php install |
For automatic mode run
php ./index.php install -dbhost DATABASE_HOST -dbname DATABASE_NAME -dbuser DATABASE_USER -dbpass DATABASE_PASS -hostname WEBSITE_HOSTNAME |
Parameter | Description |
---|---|
-dbhost | The database hostname (usually localhost) |
-dbname | The database name |
-dbuser | The database user |
-dbpass | The database password |
-hostname | The website hostname. For example, billing.domain.com. The is the hostname where Blesta will be accessed from. If not set, will attempt to detect the hostname from server configuration, which in many cases will not be accurate. |
Once completed, you'll be logged in for the first time automatically. For subsequent logins, see Logging In. You may also want to enable Two-Factor Authentication.
If you do not have a license key, you will be able to activate a free trial during the installation process directly. If you have previously purchased a license key, you will be able to enter it during the installation process. You may obtain a license directly from us at www.blesta.com, from one of our resellers, or directly from your hosting provider. Version 2 license keys are not compatible with version 3, so if you only have a version 2 license key you will need to request a version 3 key for each version 2 license you hold. |
Once installation is complete, a cron job must be created to automate tasks within Blesta. Go to [Settings] > [System] > Automation, and copy the "Cron Command", for use in creating a cron job on your server. Most hosting control panels provide an easy way to create cron jobs, follow the documentation for your control panel to complete this important step. The cron job should run every 5 minutes. Once the cron has been configured, verify that the status icon turns green and displays the last time run on the System Automation page within Blesta.
If using a control panel to configure the cron, you may not need to copy the first part of the cron command "*/5 * * * *" which designates that the cron run every 5 minutes. Your control panel may ask for schedule information separately. |
Using CLI is always recommended, but the cron may be run by accessing https://www.yourdomain.com/blesta/install/path/cron/?cron_key=CRONKEY where CRONKEY is your cron key as displayed under "Update Cron Key" If you do not have mod_rewrite, the URL will need to include index.php, for example: https://www.yourdomain.com/blesta/install/path/index.php/cron?cron_key=CRONKEY where CRONKEY is your cron key as displayed under "Updated Cron Key". |
There are a number of configuration settings that may be set before or after installation.
By default Blesta does not include index.php as part of any URL request, thanks to the use of .htaccess mod_rewrite rules. If your server does not support mod_rewrite Blesta requires index.php to be included in all URLs. To force Blesta to include index.php in all URLs simply rename or delete the .htaccess file included with Blesta in your root web directory.
If so, you may be able to enable pretty URLs by creating the appropriate web server config, and modifying the /lib/init.php file to set define("HTACCESS", true); |
By default the path to the Admin area begins with /admin/. To change this locate routes.php in /installpath/config/routes.php and modify the value of the "Route.admin" configuration. For example, to change the path of the admin area to /staff/ set the following:
Configure::set("Route.admin", "staff"); |
By default the path to the Client area begins with /client/. To change this locate routes.php in /installpath/config/routes.php and modify the value of the "Route.client" configuration. For example, to change the path of the client area to /customers/ set the following:
Configure::set("Route.client", "customers"); |
If your server supports mod_rewrite, you can enable HTTPS redirects by uncommenting the following lines (remove the '#' symbols) from the .htaccess file included with Blesta.
#RewriteCond %{HTTPS} !=on #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L] |
If the credentials are correct you may have MySQL old_passwords enabled. Disable old_passwords for your database or update your user's password:
% mysql % SET SESSION old_passwords=0; % SET PASSWORD FOR 'username'@'localhost' = PASSWORD('password'); |
There is an issue with your web.config file. Try the following web.config file:
<?xml version="1.0"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |
Next, update /lib/init.php and make the following change:
// define("HTACCESS", file_exists(ROOTWEBDIR . ".htaccess")); define("HTACCESS", true); |