Skip to content

Instantly share code, notes, and snippets.

@AntoscencoVladimir
Last active April 1, 2017 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntoscencoVladimir/6909af046edc1ae7ed2d6634e2ccc3a7 to your computer and use it in GitHub Desktop.
Save AntoscencoVladimir/6909af046edc1ae7ed2d6634e2ccc3a7 to your computer and use it in GitHub Desktop.
Dynamically configured mass virtual hosting
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
<VirtualHost *:80>
# Store sites in yourPath/sites/others
# example.loc , example2.loc etc.
ServerAlias *.loc
VirtualDocumentRoot "/home/antoscenco/sites/others/%0"
<Directory "/home/antoscenco/sites/others/*">
DirectoryIndex index.php index.html index.htm
Require all granted
</Directory>
</VirtualHost>
#Symfony
<VirtualHost *:80>
# Store sites in yourPath/sites/symfony
# example.local , example2.local etc.
ServerAlias *.local
VirtualDocumentRoot "/home/antoscenco/sites/symfony/%0/web"
<Directory "/home/antoscenco/sites/symfony">
DirectoryIndex app.php
Require all granted
</Directory>
</VirtualHost>
#add your sites in /etc/hosts file like
127.0.0.1 example.loc
127.0.0.1 example.local
etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment