]> BookStack Code Mirror - devops/blob - config/apache/bookstack.conf
Debian 13 script: Fixed mysql use for mariadb, removed composer use
[devops] / config / apache / bookstack.conf
1 <VirtualHost *:80>
2
3         # This is a simple example of an Apache VirtualHost configuration
4         # file that could be used with BookStack.
5         # This assumes mod_php has been installed and is loaded.
6         #
7         # Change the "docs.example.com" usage in the "ServerName" directive
8         # to be your web domain for BookStack.
9         #
10         # Change the "/var/www/bookstack/public/", used twice below, to the
11         # location of the "public" folder within your BookStack installation.
12         #
13         # This configuration is only for HTTP, Not HTTPS.
14         # For HTTPS we recommend using https://certbot.eff.org/
15
16         ServerName docs.example.com
17         DocumentRoot /var/www/bookstack/public/
18
19         <Directory /var/www/bookstack/public/>
20                 Options Indexes FollowSymLinks
21                 AllowOverride None
22                 Require all granted
23                 <IfModule mod_rewrite.c>
24                         <IfModule mod_negotiation.c>
25                                 Options -MultiViews -Indexes
26                         </IfModule>
27
28                         RewriteEngine On
29
30                         # Handle Authorization Header
31                         RewriteCond %{HTTP:Authorization} .
32                         RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
33
34                         # Redirect Trailing Slashes If Not A Folder...
35                         RewriteCond %{REQUEST_FILENAME} !-d
36                         RewriteCond %{REQUEST_URI} (.+)/$
37                         RewriteRule ^ %1 [L,R=301]
38
39                         # Handle Front Controller...
40                         RewriteCond %{REQUEST_FILENAME} !-d
41                         RewriteCond %{REQUEST_FILENAME} !-f
42                         RewriteRule ^ index.php [L]
43                 </IfModule>
44         </Directory>
45
46         ErrorLog ${APACHE_LOG_DIR}/error.log
47         CustomLog ${APACHE_LOG_DIR}/access.log combined
48
49 </VirtualHost>