Apache Virtualhost Windows Xampp

From MS Computech
Revision as of 14:05, 3 December 2008 by Snifer (talk | contribs) (New page: 1> Edit hosts 127.0.0.1    yourhost.com 127.0.0.1    yourhost2.com <br> 2> edit extra\httpd-vhost.conf <br>#<br># Virtual Hosts<br>#<br># If yo...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1> Edit hosts

127.0.0.1    yourhost.com

127.0.0.1    yourhost2.com


2> edit extra\httpd-vhost.conf


#
# Virtual Hosts
#
# 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.2/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.


  1. # Use name-based virtual hosting.
    #
    NameVirtualHost 202.44.53.102:80

  1. # 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 /www/docs/dummy-host.example.com
    ## ServerName dummy-host.example.com
    ## ServerAlias www.dummy-host.example.com
    ## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
    ## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
    ##</VirtualHost>
    1. <VirtualHost *:80>
      ## ServerAdmin [email protected]
      ## DocumentRoot /www/docs/dummy-host2.example.com
      ## ServerName dummy-host2.example.com
      ## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
      ## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
      ##</VirtualHost>
    1. Virtual Host
      # MSCOMPUTE.COM

<VirtualHost 202.44.53.102:80>
ServerAdmin [email protected]
ServerName www.mscompute.com
ServerAlias *.mscompute.com mscompute.com

  1. Indexes + Directory Root.
    DirectoryIndex index.html index.php index.htm
    DocumentRoot C:/xampp/htdocs/mscompute/htdocs
  1. CGI Directory
    ScriptAlias /cgi-bin/ C:/xampp/htdocs/mscompute/cgi-bin/
    <Location /cgi-bin>
    Options +ExecCGI
    </Location>


# Logfiles
ErrorLog C:/xampp/htdocs/mscompute/logs/error.log
CustomLog C:/xampp/htdocs/mscompute/logs/access.log combined
</VirtualHost>

    1. Dmzstrom.com >> Redirect
      #
      <VirtualHost xx.xx.xx.xx:80>
      ServerAdmin [email protected]
      ServerName www.host.com
      ServerAlias *.host.com host.com
  1. Indexes + Directory Root.
    DirectoryIndex index.html index.php index.htm
    DocumentRoot C:/xampp/htdocs/host/htdocs/
  1. CGI Directory
    ScriptAlias /cgi-bin/ C:/xampp/htdocs/host/cgi-bin/
    <Location /cgi-bin>
    Options +ExecCGI
    </Location>


# Logfiles
ErrorLog C:/xampp/htdocs/host/logs/error.log
CustomLog C:/xampp/htdocs/host/logs/access.log combined
</VirtualHost>

  1. host2.com
    <VirtualHost xx.xx.xx.xx:80>
    ServerAdmin [email protected]
    ServerName www.host2.com
    ServerAlias *.host2.com host2.com
  1. Indexes + Directory Root.
    DirectoryIndex index.html index.php index.htm
    DocumentRoot C:/xampp/htdocs/host2/htdocs/
  1. CGI Directory
    ScriptAlias /cgi-bin/ C:/xampp/htdocs/host2/cgi-bin/
    <Location /cgi-bin>
    Options +ExecCGI
    </Location>


# Logfiles
ErrorLog C:/xampp/htdocs/rapid4dl/logs/error.log
CustomLog C:/xampp/htdocs/rapid4dl/logs/access.log combined
</VirtualHost>


  1. # host3.com

    <VirtualHost xx.xx.xx.xx:80>
    ServerAdmin [email protected]
    ServerName host3.com
    ServerAlias *.host3.com host3.com
  1. Indexes + Directory Root.
    DirectoryIndex index.html index.php index.htm
    DocumentRoot C:/xampp/htdocs/host3/htdocs/
  1. CGI Directory
    ScriptAlias /cgi-bin/ C:/xampp/htdocs/host3/cgi-bin/
    <Location /cgi-bin>
    Options +ExecCGI
    </Location>


# Logfiles
ErrorLog C:/xampp/htdocs/host3/logs/error.log
CustomLog C:/xampp/htdocs/host3/logs/access.log combined
</VirtualHost>