Resolve Domain Name / VHosts?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Resolve Domain Name / VHosts?

Postby nwlibrarian » 01. April 2007 02:38

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?
nwlibrarian
 
Posts: 5
Joined: 31. March 2007 20:26

Postby FunnyMaker » 01. April 2007 07:33

Just move the login from the htdocs til you need them... :)
For example: from htdocs to newfolder. ^_^
FunnyMaker
 
Posts: 22
Joined: 02. December 2006 09:51

Vhosts

Postby nwlibrarian » 01. April 2007 15:19

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.
nwlibrarian
 
Posts: 5
Joined: 31. March 2007 20:26

Postby Wiedmann » 01. April 2007 15:20

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
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

VHosts...Last Step

Postby nwlibrarian » 01. April 2007 19:18

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.
nwlibrarian
 
Posts: 5
Joined: 31. March 2007 20:26

Postby Wiedmann » 01. April 2007 20:09

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.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

No edits yet

Postby nwlibrarian » 01. April 2007 22:02

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.
nwlibrarian
 
Posts: 5
Joined: 31. March 2007 20:26

Postby april » 08. April 2007 02:47

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/
april
 
Posts: 24
Joined: 09. January 2007 19:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 118 guests