...
- In a shell, cd to the directory you uploaded the contents of blesta.
- The CLI installer can be run in interactive mode, or non-interactive mode by passing parameters.
For interactive mode run
Code Block php ./index.php install
Info title Root Web Directory Setting If Blesta is not installed in the document root on your web server, it is important to note that the "Root Web Directory" setting will be inaccurate unless you install Blesta while your current working directory is set to the document root:
Code Block title Installing from the web server's document root cd /to/your/web/server/document/root/ php ./path/to/blesta/index.php install
For automatic mode run
Code Block php ./index.php install -dbhost DATABASE_HOST -dbport DATABASE_PORT -dbname DATABASE_NAME -dbuser DATABASE_USER -dbpass DATABASE_PASS -hostname WEBSITE_HOSTNAME -docroot DOCUMENT_ROOT_PATH With staff user creation (Fully Scripted) v5.10+: php ./index.php install -dbhost DATABASE_HOST -dbport DATABASE_PORT -dbname DATABASE_NAME -dbuser DATABASE_USER -dbpass DATABASE_PASS -hostname WEBSITE_HOSTNAME -docroot DOCUMENT_ROOT_PATH -domain DOMAIN -licensekey LICENSE_KEY -firstname FIRST_NAME -lastname LAST_NAME -email EMAIL -username USERNAME -password PASSWORD
Parameter Description Version Added -dbhost The database hostname (usually localhost) 3.0 -dbport The database port (usually 3306) 3.0 -dbname The database name 3.0 -dbuser The database user 3.0 -dbpass The database password 3.0 -hostname The website hostname. For Parameter Description -dbhost The database hostname (usually localhost) -dbname The database name -dbuser The database user -dbpass The database password -hostname The website hostname. Forexample, 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. 3.0 -docroot The full absolute path to the web server's document root (e.g. /var/www/html/). This should not be set to Blesta's installed directory unless Blesta is installed in document root. If this value is not set, it will be set based on your current working directory, which will not be accurate unless the current working directory is the document root.
Info title Option added in v4.6.0 ".This value can be changed from within Blesta, after installation, under Settings > System > General > "Root Web Directory
".
4.6
-domain (Optional) The domain to be used in template email addresses.
Info This value is used to determine email addresses for templates and can be changed under Settings > Company > Emails.
5.10
-licensekey (Optional) The license key for Blesta. If none is provided, a trial license will befetched.
5.10
-firstname The First Name of the first Staff user.
5.10
-lastname The Last Name of the first Staff user.
5.10
-email The email address for the first Staff user.
5.10
-username The username for the first Staff user.
5.10
-password The password for the first Staff user.
5.10
- Once installation completes, direct your web browser to https://yourdomain.com/path_to_blesta/admin/ to create your administrator user and enter your license key or start a free trial.
...
Note |
---|
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. Please also note that your path to PHP may be different, as it can vary from server to server. On some cPanel servers, the path is /usr/local/bin/php |
Info | ||
---|---|---|
| ||
The cron outputs information about the tasks it is running, and your cron daemon may email your cron user the output of your Blesta crons. To disable that, you can append the following to the end of your cron command: " >/dev/null 2>&1" (remove quotes) |
...
- Submitting data reloads the current page
There is an issue with your web.config file. Try the following web.config file:
Code Block <?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 /core/ServiceProviders/MinphpBridge.php and make the following change:
Code Block // $htaccess = file_exists($rootWebDir . '.htaccess'); $htaccess = true;
Nginx
Warning | ||
---|---|---|
| ||
Please note Nginx is for experienced or advanced users; for beginners we highly recommend Apache or LiteSpeed (Premium) because nginx can be confusing to set-up correctly. |
- For pretty URL's (without /index.php/ in every URI) you will need to add a custom Nginx configuration. For a community provided example configuration, please see https://www.blesta.com/forums/index.php?/topic/9320-nginx-config/ or use the following (recommended) configuration
Code Block # Redirect HTTP to HTTPS server { listen 0.0.0.0:80 default_server ssl http2; # IPv4 listen [::]:80 default_server ssl http2; # IPv6 server_name account.yourdomain.com; # Hostname return 301 https://$host$request_uri; } # Run Blesta on SSL server { listen 0.0.0.0:443 default_server ssl http2; # IPv4 listen [::]:443 default_server ssl http2; # IPv6 server_name account.yourdomain.com; # Hostname root /var/www/account.yourdomain.com; # Installation directory # SSL cert/key pair ssl_certificate /etc/ssl/certs/account.yourdomain.com.crt; ssl_certificate_key /etc/ssl/private/account.yourdomain.com.key; # iFrame protection add_header X-Frame-Options SAMEORIGIN; location / { try_files $uri /index.php; rewrite ^(.*)/install\.php$ /$1/install/ redirect; } location = /index.php { fastcgi_pass unix:/run/php/php7.3-fpm.sock; # PHP socket fastcgi_param SCRIPT_FILENAME $document_root/index.php; # Blesta /index.php fastcgi_param SCRIPT_NAME $fastcgi_script_name; include fastcgi_params; } location ~ /\. { log_not_found off; return 404; } location ~* \.(php|pdt|txt)$ { log_not_found off; return 404; } }
Expand title Here's an additional configuration for systems with TLS 1.3 support (Running OpenSSL 1.1.1+) Code Block server { listen 80 default_server; listen [::]:80 default_server; server_name _; access_log /path/to/.logs/access.log main; error_log /path/to/.logs/errors.log warn; root /path/to/site/public; index index.php index.html; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/lib/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { expires 5d; } if ($scheme != https) { return 307 https://domain.tld$request_uri; } } server { listen 443 ssl; listen [::]:443 ssl; server_name _; access_log /path/to/.logs/access.log main; error_log /path/to/.logs/errors.log warn; root /path/to/site/public; index index.php index.html; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/lib/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { expires 5d; } ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; ssl_dhparam /etc/letsencrypt/dhparam.pem; ssl_buffer_size 8k; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5; ssl_prefer_server_ciphers on; ssl_ecdh_curve secp384r1; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; resolver 8.8.8.8; add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; if ($host != domain.tld) { return 307 https://domain.tld$request_uri; } }
Next, update /core/ServiceProviders/MinphpBridge.php and make the following change:
Code Block // $htaccess = file_exists($rootWebDir . '.htaccess'); $htaccess = true;
Litespeed
- Installation of Blesta times out.
- Increase the timeout by taking the following action: Navigate to WebAdmin CP > Configuration > Server > Tuning, and change Connection Timeout to 300.
Lighttpd
- This sample configuration is community provided:
Edit lighttpd.conf
Code Block server.modules += ( "mod_redirect") server.modules += ( "mod_rewrite") #if blesta install is http://<mydomain>.<mytld>/clients/ url.rewrite-if-not-file = ( "^/clients/(.*)$" => "/clients/index.php" ) url.redirect = ( "^(.*)/clients/install.php$" => "$1/clients/install/" )
...