Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Bolt Setup
- ## Installation
- ```
- composer create-project bolt/composer-install:^3.4 <MYPROJECT> --prefer-dist
- ```
- ## Permissions
- ```
- chgrp -R www-data app/cache/ app/database/ public/thumbs/ extensions/ public/extensions/ public/files/ public/theme/
- chmod -R ug+rwx app/cache/ app/database/ public/thumbs/ extensions/ public/extensions/ public/files/ public/theme/
- ```
- ## Configuration
- ```
- vim /var/www/MYBOLTAPP/app/config/config.yml
- ```
- ```yaml
- # database:
- # driver: sqlite
- # databasename: bolt
- database:
- driver: mysql
- username: bolt
- password: your_bolt_password
- databasename: bolt
- ```
- ## Database
- ```
- mysql -u root -p
- ```
- ```
- MariaDB [(none)]> CREATE DATABASE bolt;
- MariaDB [(none)]> GRANT ALL PRIVILEGES ON bolt.* TO 'bolt'@'localhost' IDENTIFIED BY 'your_bolt_password';
- MariaDB [(none)]> FLUSH PRIVILEGES;
- MariaDB [(none)]> \q
- ```
- ## Web Server
- ```nginx
- server {
- server_name bolt.test;
- # Logging
- access_log /var/log/nginx/bolt-access.log;
- error_log /var/log/nginx/bolt-error.log;
- # Site root
- root /var/www/html/bolt/public;
- index index.php;
- # Default prefix match fallback, as all URIs begin with /
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- # Bolt dashboard and backend access
- #
- # We use two location blocks here, the first is an exact match to the dashboard
- # the next is a strict forward match for URIs under the dashboard. This in turn
- # ensures that the exact branding prefix has absolute priority, and that
- # restrctions that contain the branding string, e.g. "bolt.db", still apply.
- #
- # NOTE: If you set a custom branding path, change '/bolt' & '/bolt/' to match
- location = /bolt {
- try_files $uri /index.php?$query_string;
- }
- location ^~ /bolt/ {
- try_files $uri /index.php?$query_string;
- }
- # Generated thumbnail images
- location ^~ /thumbs {
- try_files $uri /index.php; #?$query_string;
- access_log off;
- log_not_found off;
- expires max;
- add_header Pragma public;
- add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
- add_header X-Koala-Status sleeping;
- }
- # Don't log, and do cache, asset files
- location ~* ^.+\.(?:atom|bmp|bz2|css|doc|eot|exe|gif|gz|ico|jpe?g|jpeg|jpg|js|map|mid|midi|mp4|ogg|ogv|otf|png|ppt|rar|rtf|svg|svgz|tar|tgz|ttf|wav|woff|xls|zip)$ {
- access_log off;
- log_not_found off;
- expires max;
- add_header Pragma public;
- add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
- add_header X-Koala-Status eating;
- }
- # Don't create logs for favicon.ico, robots.txt requests
- location = /(?:favicon.ico|robots.txt) {
- log_not_found off;
- access_log off;
- }
- # Redirect requests for */index.php to the same route minus the "index.php" in the URI.
- location ~ /index.php/(.*) {
- rewrite ^/index.php/(.*) /$1 permanent;
- }
- # Block access to "hidden" files
- # i.e. file names that begin with a dot "."
- location ~ /\. {
- deny all;
- }
- # Apache .htaccess & .htpasswd files
- location ~ /\.(htaccess|htpasswd)$ {
- deny all;
- }
- # Block access to Sqlite database files
- location ~ /\.(?:db)$ {
- deny all;
- }
- # Block access to Markdown, Twig & YAML files directly
- location ~* /(.*)\.(?:markdown|md|twig|yaml|yml)$ {
- deny all;
- }
- include php.conf;
- }
- ```
Add Comment
Please, Sign In to add comment