Wednesday 4 December 2013

Creating Virtual Directory in the Apache Server

There are multiple ways of doing this task but i am showing the one that i used to prefer


I'm running Apache Server on Windows 7, and could use help configuring my virtual directory or Changing from default Directory To my Defined Directory. 
I want my source files to live outside of the Apache Server htdocs directory


SOLUTION
Here's what i have done for configuration:
I've done it by editing the C:/xampp/apache/conf/httpd.conf file
Changings that I have done in httpd.conf file
Added this script right after
ScriptAlias /cgi-bin/ "C:/xampp/apache)/"


Alias /projectXYZ "C:/pathtomyproject"
<Directory "C:/pathtomyproject">
  Options Indexes FollowSymLinks MultiViews ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all


</Directory>

Pathtomyproject = Complete path of project

And changed the url of Document Root
DocumentRoot " C:/pathtomyproject "

Now restart the Apache Server by stopping the server.
I have stopped Apache server


And then again started the Apache Server. 




Now your http://localhost point to your defined directory.

0 comments:

Post a Comment