forked from ezsystems/ezplatform-ee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvhost.template
118 lines (93 loc) · 5.08 KB
/
vhost.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Official VirtualHost configuration for Apache 2.x template
# See Readme.md for how to generate your config manually, or in automated deployments.
# Note: This is meant to be manually tailored for your needs, expires headers might for instance not work for your dev setup.
# NameVirtualHost %IP_ADDRESS%
<VirtualHost %IP_ADDRESS%:%PORT%>
ServerName %HOST_NAME%
ServerAlias %HOST_ALIAS%
DocumentRoot %BASEDIR%/web
DirectoryIndex app.php
# Request size limit in bytes, 0 to disable
LimitRequestBody %BODY_SIZE_LIMIT%
# Request timeout limit in seconds, 0 to disable
TimeOut %TIMEOUT%
# Enabled for Dev environment
# LogLevel debug
# "web" folder is what we expose to the world, all rewrite rules further down is relative to it.
<Directory %BASEDIR%/web>
# If using php configured in FastCGI mode, you might also need to add "ExecCGI" to the line below
Options FollowSymLinks
AllowOverride None
# Depending on your global Apache settings, you may need to uncomment and adapt:
# for Apache 2.2 and earlier:
#Allow from all
# for Apache 2.4:
#Require all granted
</Directory>
## eZ Platform/Symfony ENVIRONMENT variables, used for customizing app.php execution (not used by console commands)
# Environment.
# Possible values: "prod" and "dev" out-of-the-box, other values possible with proper configuration
# Defaults to "prod" if omitted (uses SetEnvIf so value can be used in rewrite rules)
SetEnvIf Request_URI ".*" SYMFONY_ENV=%SYMFONY_ENV%
# Optional: Whether to use custom ClassLoader (autoloader) file
# Needs to be a valid path relative to root web/ directory
# Defaults to bootstrap.php.cache, or autoload.php in debug if env value is omitted or empty
SetEnv SYMFONY_CLASSLOADER_FILE "%SYMFONY_CLASSLOADER_FILE%"
# Optional: Whether to use debugging.
# Possible values: 0, 1 or ""
# Defaults to enabled if SYMFONY_ENV is set to "dev" if env value is omitted or empty
SetEnv SYMFONY_DEBUG "%SYMFONY_DEBUG%"
# Optional: Whether to use Symfony's HTTP Caching.
# Disable it if you are using an external reverse proxy (e.g. Varnish)
# Possible values: 0, 1 or ""
# Defaults to disabled if SYMFONY_ENV is set to "dev" or SYMFONY_TRUSTED_PROXIES is set,
# and if this env value is omitted or empty
SetEnv SYMFONY_HTTP_CACHE "%SYMFONY_HTTP_CACHE%"
# Optional: Whether to use custom HTTP Cache class if SYMFONY_HTTP_CACHE is enabled
# Value must be a autoloadable cache class
# Defaults to to use provided "AppCache" if env value is omitted or empty
SetEnv SYMFONY_HTTP_CACHE_CLASS "%SYMFONY_HTTP_CACHE_CLASS%"
# Optional: Defines the proxies to trust
# Needed when using Varnish as proxy, if so disable SYMFONY_HTTP_CACHE.
# Separate entries by a comma, example: "proxy1.example.com,proxy2.example.org"
# Defaults to not be set if env value is omitted or empty
SetEnv SYMFONY_TRUSTED_PROXIES "%SYMFONY_TRUSTED_PROXIES%"
<IfModule mod_rewrite.c>
RewriteEngine On
# For FastCGI mode or when using PHP-FPM, to get basic auth working.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Needed for ci testing, you can optionally remove this.
RewriteCond %{ENV:SYMFONY_ENV} "behat"
RewriteCond %{REQUEST_URI} ^/php5-fcgi(.*)
RewriteRule . - [L]
# Cluster/streamed files rewrite rules. Enable on cluster with DFS as a binary data handler
#RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /app.php [L]
RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* - [L]
# Makes it possible to place your favicon at the root of your eZ Platform instance.
# It will then be served directly.
RewriteRule ^/favicon\.ico - [L]
# Give direct access to robots.txt for use by crawlers (Google, Bing, Spammers...)
RewriteRule ^/robots\.txt - [L]
# Platform for Privacy Preferences Project ( P3P ) related files for Internet Explorer
# More info here : http://en.wikipedia.org/wiki/P3p
RewriteRule ^/w3c/p3p\.xml - [L]
# The following rule is needed to correctly display assets from eZ Platform / Symfony bundles
RewriteRule ^/bundles/ - [L]
# Additional Assetic rules for environments different from dev,
# remember to run php app/console assetic:dump --env=prod
RewriteCond %{ENV:SYMFONY_ENV} !^(dev)
RewriteRule ^/(css|js|font)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L]
RewriteRule .* /app.php
</IfModule>
# Everything below is optional to improve performance by forcing
# clients to cache image and design files, change the expires time
# to suite project needs.
<IfModule mod_expires.c>
<LocationMatch "^/var/[^/]+/storage/images/.*">
# eZ Platform appends the version number to image URL (ezimage
# datatype) so when an image is updated, its URL changes too
ExpiresActive on
ExpiresDefault "now plus 10 years"
</LocationMatch>
</IfModule>
</VirtualHost>