apache 2 virtual directory the xampp approach

This tutorial is based on a solution to a problem encountered.

Operating environment: Windows XP

I always want to place my project on a separate directory under my documents for easy access. When I think of a solution I have come to this approach

  • allow directory navigation since my sandbox(the folder/directory) I will use does not contain any php/html only folders
  • create another pseudo domain for the sandbox for easy access

First I need to think of a directory to place my files/folders/directories d:\sandbox\ will be ideal since my documents are all in that directory.

All of my projects are placed on their particular folder under sandbox. I need to edit the following files:

httpd.conf
I have just copied this part to allow directory navigation. You don’t want this enabled in your enterprise application though.

<Directory “C:/x2/xampp/htdocs”>
#
# 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.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

Eliminated all of comments to simplify it and added the sandbox folder/directory. Note and a warning: also that use a forward slash rather than windows backslash to do this. Normal directory path in windows will be d:\sandbox.

<Directory “D:/sandbox”>

Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All

Order allow,deny
Allow from all

</Directory>

httpd-vhosts.conf
My http daemon or the apache program I’m using is listening on port 8080. Apache 2 has included this part in extras folder in the installation path. How to set up port in apache tutorial is in here.

<VirtualHost *:8080>
DocumentRoot D:/sandbox
ServerName sandbox
</VirtualHost>

hosts
The full path is C:\WINDOWS\system32\drivers\etc>hosts. You can see a tutorial on this one in here.

# have stripped off the comments

127.0.0.1 localhost
127.0.0.1 testground.com
127.0.0.1 sandbox.testground.com
127.0.0.1 sandbox

6 thoughts on “apache 2 virtual directory the xampp approach

  1. Pingback: accessing virtual host from another machine on a local network « me looking so small in this world

  2. Pingback: XAMMPLite Virtual Directory And WordPress Permalinks | More Than Scratch The Surface

  3. Pingback: XAMMPLite Virtual Directory And WordPress Permalinks | thisispopup.com

  4. Pingback: Wordpress – From Development Server To Production Server | King Luddite

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s