Page 1 of 1

Resolve Domain Name / VHosts?

PostPosted: 01. April 2007 02:38
by nwlibrarian
I have a domain name for my server, but the default htdocs goes to the Xampp login from the original installation. I was wondering how I set the domain name to hit the subfolder inside htdocs for the site that I want it to. I know there's some sort of setting in Apache, but I just can't find it.

In short, I'd like my domain name to hit the subfolder in htdocs. Then I'd like the 127.0.0.1 hit the xampp login. Is there anyway to do that?

PostPosted: 01. April 2007 07:33
by FunnyMaker
Just move the login from the htdocs til you need them... :)
For example: from htdocs to newfolder. ^_^

Vhosts

PostPosted: 01. April 2007 15:19
by nwlibrarian
Yes, but isn't there something with being able to establish a virtual directory in Apache like IIS? I have seen some documentation on this, but not sure how it translates to Xampp. The domain name should resolve to the folder I designate not to the root of htdocs. I'm pretty sure it involves setting up the file "httpd-vhosts.conf" but I'm not sure what I'm setting up.

What I'm trying to do is set up an Intranet where our domain hits the folder I designate.

PostPosted: 01. April 2007 15:20
by Wiedmann
I'm pretty sure it involves setting up the file "httpd-vhosts.conf" but I'm not sure what I'm setting up.

http://httpd.apache.org/docs/2.2/vhosts/name-based.html

VHosts...Last Step

PostPosted: 01. April 2007 19:18
by nwlibrarian
Thank you Wiedmann. That info. you sent helped tremendously. I am hung up on one final step however. Now I get an Access Denied when I try to go to the page. I've placed a simple generic index.htm page inside the folder I want. The error message indicates I do not have read/write access. From what I checked I can't find anything. Do I still have to edit the "httpd-vhosts.conf" file @ "C:\Program Files\xampp\apache\conf\extra"?

Thank you very much in advance for your patience with a rookie.

--nwlibrarian.

PostPosted: 01. April 2007 20:09
by Wiedmann
Do I still have to edit the "httpd-vhosts.conf" file @ "C:\Program Files\xampp\apache\conf\extra"?

I don't know, what you have exactly made in the meantime.

No edits yet

PostPosted: 01. April 2007 22:02
by nwlibrarian
I haven't edited anything in that file yet (httpd-vhosts.conf). I've only edited (httpd.conf). Now I'm guessing it is seeing that directory, but the fact I'm getting an access error makes me wonder.

PostPosted: 08. April 2007 02:47
by april
Yes, you have to go into httpd-vhosts.conf file and add a virtual host structure similar to this:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

When you take a look at it you'll see the examples. NameVirtualHost *:80 already exists, but just has to be uncommented.

If it still doesn't work:
1. Clear your browser cache. It will screw you over by serving up a cache file that doesn't reflect the changes you've made.

2. check to make sure you have created the path (folders) for DocumentRoot and that you have typed it correctly.

3. make sure you have the correct spelling for your server name and that you have added it to Windows hosts file.

4. Make sure you restart the server as changes won't take place in Apache until you do.

Take a look at this link as well.
http://www.heritage-tech.net/336/setting-up-multiple-apache-local-web-sites-on-your-computer/