Skip to content

Instantly share code, notes, and snippets.

@mssoylu
Last active January 5, 2017 16:20
Show Gist options
  • Save mssoylu/aac9ff9198d2aa6c1f4dc0f5d0561ba7 to your computer and use it in GitHub Desktop.
Save mssoylu/aac9ff9198d2aa6c1f4dc0f5d0561ba7 to your computer and use it in GitHub Desktop.
Apache2 Virtualhost Basics
Symfony3.2 Virtualhost
.htpasswd
PHP cancel for directory
<VirtualHost dys.com:80>
ServerName dys.com
DocumentRoot /var/www/dys/root/web
# <Directory "/var/www/dys/root/web/uploads">
# AllowOverride None
# RemoveHandler .php .phtml .php3
# RemoveType .php .phtml .php3
# php_flag engine off
# </Directory>
<Directory /var/www/dys/root/web>
Options Indexes Multiviews FollowSymLinks
AuthType Digest
AuthName "staff"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
# for production app.php
</IfModule>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment