Skip to content

Instantly share code, notes, and snippets.

@ravinsharma12345
Last active December 20, 2015 20:49
Show Gist options
  • Save ravinsharma12345/6192945 to your computer and use it in GitHub Desktop.
Save ravinsharma12345/6192945 to your computer and use it in GitHub Desktop.
Configuration for Local Virtual Host in Xampp for Windows
#Assumption xampp path is C:\xampp
#configuration for virtual host on local machine for development and staging.
#locate http-vhosts.conf, and paste the configuration below. ( Edit path, port, server name as necessary). In my case is C:\xampp\apache\conf\extra\httpd-vhosts.conf
#make sure the path for the error,and access logs exists; error log and access log are not mandatory.
#add a domain name in your hosts file, in my case is "dev", located under C:\Windows\System32\drivers\etc (Windows 7)
#restart and have fun
<VirtualHost dev:80>
ServerAdmin postmaster@stage
ServerName stage
DocumentRoot "Q:/phpstorm/"
<Directory "Q:/phpstorm/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
# Options Indexes FollowSymLinks Includes ExecCGI
Options All
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
ErrorLog "Q:/phpstorm/logs/error_log"
CustomLog "Q:/phpstorm/logs/access_log" common
</VirtualHost>
<VirtualHost localhost:80>
ServerAdmin postmaster@localhost
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
ErrorLog "C:/xampp/apache/logs/error"
CustomLog "C:/xampp/apache/logs/access" common
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment