I'm running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here's what I'm hoping to do on my dev box:
- I want my source files to live outside of the xampp htdocs dir
- on my local machine I can access the project at http://myproject
- others on my local network can access the project at my.ip.address/myproject
- keep localhost pointing to the xampp's htdocs folder so I can easily add other projects.
I've got 1 & 2 working by editing the windows hosts file, and adding a virtual directory in xampp's apache\conf\extra\httpd-vhosts.conf file. I don't immediately see how to do 3 without messing up 4.
resolved the issue. it was missing the directory tag.
Must be:
greets ;)
To accomplish your list of needs.
1) Make the directory:
2) Edit c:\windows\system32\drivers\etc\hosts so it contains this line:
and add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf:
3) Add the following lines to the end of c:\xampp\apache\conf\httpd.conf:
4) Leave DocumentRoot, Directory, etc in c:\xampp\apache\conf\httpd.conf alone to accomplish this. For reference these lines would be:
Problem resolved in a simplest way and less steps No Need of creating virtual host just change the location of target directory.
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" Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all
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.
Source: http://bytespedia.blogspot.com/2013/12/creating-virtual-directory-in-apache.html
Figured it out: use Alias for #3, instead of VirtualHost, thus:
First enable: LoadModule alias_module modules/mod_alias.so
Tested on WAMP 2.2 and its working: http:// localhost/ddd