Guest User

Untitled

a guest
Feb 23rd, 2018
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. # Bolt Setup
  2.  
  3. ## Installation
  4.  
  5. ```
  6. composer create-project bolt/composer-install:^3.4 <MYPROJECT> --prefer-dist
  7. ```
  8.  
  9. ## Permissions
  10.  
  11. ```
  12. chgrp -R www-data app/cache/ app/database/ public/thumbs/ extensions/ public/extensions/ public/files/ public/theme/
  13. chmod -R ug+rwx app/cache/ app/database/ public/thumbs/ extensions/ public/extensions/ public/files/ public/theme/
  14. ```
  15.  
  16. ## Configuration
  17.  
  18. ```
  19. vim /var/www/MYBOLTAPP/app/config/config.yml
  20. ```
  21.  
  22. ```yaml
  23. # database:
  24. # driver: sqlite
  25. # databasename: bolt
  26.  
  27. database:
  28. driver: mysql
  29. username: bolt
  30. password: your_bolt_password
  31. databasename: bolt
  32. ```
  33.  
  34. ## Database
  35. ```
  36. mysql -u root -p
  37. ```
  38. ```
  39. MariaDB [(none)]> CREATE DATABASE bolt;
  40. MariaDB [(none)]> GRANT ALL PRIVILEGES ON bolt.* TO 'bolt'@'localhost' IDENTIFIED BY 'your_bolt_password';
  41. MariaDB [(none)]> FLUSH PRIVILEGES;
  42. MariaDB [(none)]> \q
  43. ```
  44.  
  45. ## Web Server
  46.  
  47. ```nginx
  48. server {
  49. server_name bolt.test;
  50.  
  51. # Logging
  52. access_log /var/log/nginx/bolt-access.log;
  53. error_log /var/log/nginx/bolt-error.log;
  54.  
  55. # Site root
  56. root /var/www/html/bolt/public;
  57. index index.php;
  58.  
  59. # Default prefix match fallback, as all URIs begin with /
  60. location / {
  61. try_files $uri $uri/ /index.php?$query_string;
  62. }
  63.  
  64. # Bolt dashboard and backend access
  65. #
  66. # We use two location blocks here, the first is an exact match to the dashboard
  67. # the next is a strict forward match for URIs under the dashboard. This in turn
  68. # ensures that the exact branding prefix has absolute priority, and that
  69. # restrctions that contain the branding string, e.g. "bolt.db", still apply.
  70. #
  71. # NOTE: If you set a custom branding path, change '/bolt' & '/bolt/' to match
  72. location = /bolt {
  73. try_files $uri /index.php?$query_string;
  74. }
  75. location ^~ /bolt/ {
  76. try_files $uri /index.php?$query_string;
  77. }
  78.  
  79. # Generated thumbnail images
  80. location ^~ /thumbs {
  81. try_files $uri /index.php; #?$query_string;
  82.  
  83. access_log off;
  84. log_not_found off;
  85. expires max;
  86. add_header Pragma public;
  87. add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
  88. add_header X-Koala-Status sleeping;
  89. }
  90.  
  91. # Don't log, and do cache, asset files
  92. 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)$ {
  93. access_log off;
  94. log_not_found off;
  95. expires max;
  96. add_header Pragma public;
  97. add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
  98. add_header X-Koala-Status eating;
  99. }
  100.  
  101. # Don't create logs for favicon.ico, robots.txt requests
  102. location = /(?:favicon.ico|robots.txt) {
  103. log_not_found off;
  104. access_log off;
  105. }
  106.  
  107. # Redirect requests for */index.php to the same route minus the "index.php" in the URI.
  108. location ~ /index.php/(.*) {
  109. rewrite ^/index.php/(.*) /$1 permanent;
  110. }
  111.  
  112. # Block access to "hidden" files
  113. # i.e. file names that begin with a dot "."
  114. location ~ /\. {
  115. deny all;
  116. }
  117.  
  118. # Apache .htaccess & .htpasswd files
  119. location ~ /\.(htaccess|htpasswd)$ {
  120. deny all;
  121. }
  122.  
  123. # Block access to Sqlite database files
  124. location ~ /\.(?:db)$ {
  125. deny all;
  126. }
  127.  
  128. # Block access to Markdown, Twig & YAML files directly
  129. location ~* /(.*)\.(?:markdown|md|twig|yaml|yml)$ {
  130. deny all;
  131. }
  132.  
  133. include php.conf;
  134. }
  135.  
  136. ```
Add Comment
Please, Sign In to add comment