Location of virtual root folders.

January 14, 2010 at 08:10:14
Specs: winXp, 3.2ghz/4gbddr
I have a web serevr set up. Its running Xampp
on XP. I have never done this before all the
information I have cam from reading off the web
so please consider. I have my main site
running and I also added a virtual host by
adding to my httpd config file. Everything
works but I don't know where I am supposed to
put the virtual document root directories. I put
it inside of htdocs? But I wont to offer it to a
friend and use a seperate cgi-bin and I may
wont to add a few more in the future. So if I am
doing it wrong it will be easyer to fix now than
if I have 3 friends with there sites in the wrong
place. Thanks in advance for reading my
newbie queston.

See More: Location of virtual root folders.

Report •

#1
January 14, 2010 at 14:08:39
I've never used Xamp or whatever, but I have played around with virtual domains using Apache. For example, I had setup something similar to below

NameVirtualHost 127.0.0.2

<VirtualHost 127.0.0.2:80>
    ServerName virtual.testhost.net #made up domain
    DocumentRoot "C:/www/virtual/htdocs"

    ErrorLog logs/error_virtual.log
    CustomLog logs/access_virtual.log common

    ScriptAlias /cgi-bin "C:/www/virtual/htdocs/cgi-bin"    

    AddType text/html .html
    AddOutputFilter INCLUDES .html

    <Directory "C:/www/virtual/htdocs">
        Options ExecCGI Includes Indexes MultiViews
        AllowOverride None
        Order deny,allow
        Allow from localhost
    </Directory>
    
    <Directory "C:/www/virtual/htdocs/cgi-bin">
        Options ExecCGI Includes Indexes MultiViews
        AllowOverride None
        Order deny,allow
        Allow from localhost
    </Directory>
    
</VirtualHost>

I then edited my hosts file "c:\winnt\system32\drivers\etc\hosts

127.0.0.1 testhost.net
127.0.0.2 virtual.testhost.net

That way, I could spoof my hosted site locally using a browser instead of using localhost or 127.0.0.1 as the address.

I don't know if that will offer any help to you or not, but hopefully, you'll be able to configure your server(s) as needed.

Good luck.


Report •

#2
January 14, 2010 at 19:09:02
Thanks shutat for the post.

I didn't realize that I had to
name the cgi-bin like the root folder.

Back to the drawing board this weekend LOL


Report •
Related Solutions


Ask Question