Created
October 4, 2016 06:43
-
-
Save ron4stoppable/c749c4062fd35de10e64ceabec0ece2b to your computer and use it in GitHub Desktop.
Virtual host configuration for Apache, with example from Windows environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Virtual host configuration for apache | |
# Windows location : C:\xampp\apache\config\extra\httpd-vhosts.config | |
# | |
# incase you have installed in some other stack or installed in other location, find in appropriate directory | |
# | |
# after setting up the httpd-vhosts.config, add the site name to hosts file located at | |
# 'C:\Windows\System32\drivers\etc\hosts' , it is a text file with no extension, if it do not exist, create the file. | |
# and your site's name at the end of it - | |
# 127.0.0.1 laravel.dev | |
# 127.0.0.1 mysite.dev | |
# | |
# use <VirtualHost site.name:80> to redirect only to the particular URL, if you wish to block all connections | |
# then use <VirtualHost *:80> | |
# --------------------------------- | |
# Use this if its a standalone app build from scratch (i.e. no framework) | |
# VirtualHost for mysite.dev | |
<VirtualHost mysite.dev:80> | |
DocumentRoot "C:\xampp\htdocs\mysite" | |
ServerAdmin ron.cv | |
<Directory "C:\xampp\htdocs\mysite"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
</VirtualHost> | |
# --------------------------- | |
# if using any framework, like laravel, set the document root to the public directory, | |
# or the directory where driving index.php file is located | |
# | |
# VirtualHost for LARAVEL.DEV | |
<VirtualHost laravel.dev:80> | |
DocumentRoot "C:\xampp\htdocs\laravel\public" | |
ServerAdmin laravel.dev | |
<Directory "C:\xampp\htdocs\laravel\"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment