Skip to content

Instantly share code, notes, and snippets.

@kholmatova
Created February 15, 2018 17:39
Show Gist options
  • Save kholmatova/a7d4ad65e579014adf953a44efdae3a2 to your computer and use it in GitHub Desktop.
Save kholmatova/a7d4ad65e579014adf953a44efdae3a2 to your computer and use it in GitHub Desktop.
httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
# ServerAdmin [email protected]
# DocumentRoot "/opt/lampp/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "logs/dummy-host.example.com-access_log" common
#</VirtualHost>
#localhost
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs"
ServerName localhost
<Directory "/opt/lampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/localhost.local-error_log"
CustomLog "logs/localhost.local-access_log" common
</VirtualHost>
#My custom host
<VirtualHost *:80>
DocumentRoot "/home/nargiza/www/test1.local/public_html"
ServerName test1.local
<Directory "/home/nargiza/www/test1.local/public_html">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/test1.local-error_log"
CustomLog "logs/test1.local-access_log" common
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment