Skip to content

Commit

Permalink
Add Apache config
Browse files Browse the repository at this point in the history
  • Loading branch information
lologhi committed Jul 17, 2016
1 parent 8ef80ad commit bc29932
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions app/Resources/doc/apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<VirtualHost *:80>
ServerName massapi.ghirardotti.fr
ServerAdmin laurent@ghirardotti.fr

<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>

DocumentRoot /var/www/MassAPI/web
<Directory /var/www/MassAPI/web>
Options FollowSymLinks
Options -MultiViews
AllowOverride None
Require all granted
Allow from All

RewriteEngine On

# remove app.php
RewriteRule "^app.php\/(.*)$" "/$1" [R=301,L]

# Symfony2
RewriteCond "%{REQUEST_FILENAME}" "!-f"
RewriteRule "^(.*)$" "app.php" [QSA,L]

# TODO: See if needed:
<Ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</Ifmodule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
</Directory>

ErrorLog ${APACHE_LOG_DIR}/massapi_error.log
CustomLog ${APACHE_LOG_DIR}/massapi_access.log combined
</VirtualHost>

0 comments on commit bc29932

Please sign in to comment.