# Official VirtualHost configuration for Apache 2.x # Note: This is meant to be tailored for your needs, expires headers might for instance not work for dev. # Params: %IP_ADDRESS%, %PORT%, %HOST%, %HOST_ALIAS%, %BASEDIR%, %ENV% and %PROXY% # NameVirtualHost %IP_ADDRESS% ServerName %HOST% ServerAlias %HOST_ALIAS% DocumentRoot %BASEDIR%/web DirectoryIndex index.php # Enabled for Dev environment # LogLevel debug 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 ## eZ Publish ENVIRONMENT variables, used for customizing index.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 ".*" ENVIRONMENT=%ENV% # 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, supported on 2015.01 and higher #SetEnv CUSTOM_CLASSLOADER_FILE "../ezpublish/autoload.php" # Whether to use Symfony's ApcClassLoader. # Possible values: 0 or 1 # Defaults to 0 if omitted, supported on 5.2 and higher #! Not supported as of 2015.01, use CUSTOM_CLASSLOADER_FILE instead for this. #SetEnv USE_APC_CLASSLOADER 0 # Prefix used when USE_APC_CLASSLOADER is set to 1. # Use a unique prefix in order to prevent cache key conflicts # with other applications also using APC. # Defaults to "ezpublish" if omitted, supported on 5.2 and higher #! Not supported as of 2015.01, use CUSTOM_CLASSLOADER_FILE instead for this. #SetEnv APC_CLASSLOADER_PREFIX "ezpublish" # Whether to use debugging. # Possible values: 0 or 1 # Defaults to 0 if omitted, unless ENVIRONMENT is set to: "dev", supported on 5.2 and higher #SetEnv USE_DEBUGGING 0 # Whether to use Symfony's HTTP Caching. # Disable it if you are using an external reverse proxy (e.g. Varnish) # Possible values: 0 or 1 # Defaults to 1 if omitted, unless ENVIRONMENT is set to: "dev", supported on 5.2 and higher #SetEnv USE_HTTP_CACHE 1 # Whether to use custom HTTP Cache class if USE_HTTP_CACHE is enabled # Value must be a autoloadable cache class # Defaults to to use "EzPublishCache", supported on 2015.01 and higher #SetEnv HTTP_CACHE_CLASS "\Vendor\Project\MyCache" # Defines the proxies to trust. # Separate entries by a comma # Example: "proxy1.example.com,proxy2.example.org" # By default, no trusted proxies are set, supported on 5.2 and higher #SetEnv TRUSTED_PROXIES "%PROXY%" RewriteEngine On # Uncomment in FastCGI mode or when using PHP-FPM, to get basic auth working. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Needed for ci testing, remove in prod. RewriteCond %{REQUEST_URI} ^/php5-fcgi(.*) RewriteRule . - [L] # If using cluster, uncomment the following two lines: ## For 5.4 and higher: #RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index.php [L] #RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* /index_cluster.php [L] ## Versions prior to 5.4: #RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_cluster.php [L] #RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* /index_cluster.php [L] RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* - [L] RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* - [L] RewriteRule ^/design/[^/]+/(stylesheets|images|javascript|fonts)/.* - [L] RewriteRule ^/share/icons/.* - [L] RewriteRule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L] RewriteRule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L] RewriteRule ^/packages/styles/.+/thumbnail/.* - [L] RewriteRule ^/var/storage/packages/.* - [L] # Makes it possible to place your favicon at the root of your # eZ Publish instance. It will then be served directly. RewriteRule ^/favicon\.ico - [L] # Uncomment the line below if you want your favicon be served # from the standard design. You can customize the path to # favicon.ico by changing /design/standard/images/favicon\.ico #RewriteRule ^/favicon\.ico /design/standard/images/favicon.ico [L] RewriteRule ^/design/standard/images/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] # Uncomment the following lines when using popup style debug in legacy #RewriteRule ^/var/([^/]+/)?cache/debug\.html.* - [L] # Following rule is needed to correctly display assets from eZ Publish5 / Symfony bundles RewriteRule ^/bundles/ - [L] # Additional Assetic rules for environments different from dev, # remember to run php ezpublish/console assetic:dump --env=prod RewriteCond %{ENV:ENVIRONMENT} !^(dev) RewriteRule ^/(css|js|font)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L] # Conditions for enabling webdav and soap interfaces from legacy ## Symlink files into your web folder and correct domain names to be valid server aliases #RewriteCond %{HTTP_HOST} ^webdav\..* #RewriteRule ^(.*) /webdav.php [L] #RewriteCond %{HTTP_HOST} ^soap\..* #RewriteRule ^(.*) /soap.php [L] # For 5.x versions prior to 5.2, enable this to use dev env based on ENVIRONMENT variable set above #RewriteCond %{ENV:ENVIRONMENT} "dev" #RewriteRule .* /index_dev.php [L] # Prevent access to website with direct usage of app.php in URL RewriteRule ^/(.+/)?index\.php - [R=404,L] RewriteRule .* /index.php # Everything below is optional to improve performance by forcing # clients to cache image and design files, change the expires time # to suite project needs. # eZ Publish appends the version number to image URL (ezimage # datatype) so when an image is updated, its URL changes to ExpiresActive on ExpiresDefault "now plus 10 years" # A good optimization if you don't change your design often ExpiresActive on ExpiresDefault "now plus 5 days" # Libraries get a new url (version number) on updates ExpiresActive on ExpiresDefault "now plus 90 days" # Same as above for bundled eZ Publish designs ExpiresActive on ExpiresDefault "now plus 7 days" # Icons as used by admin interface, barly change ExpiresActive on ExpiresDefault "now plus 7 days" # When ezjscore.ini/[Packer]/AppendLastModifiedTime=enabled # so that file names change when source files are modified # # Force ezjscore packer js/css files to be cached 30 days # at client side #ExpiresActive on #ExpiresDefault "now plus 30 days" #