Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<VirtualHost> on win32?

Status
Not open for further replies.

dkdude

Programmer
Jun 16, 2003
849
DK
Hi,

This is what I've put in my httpd.conf

Code:
<VirtualHost *:80>
   ServerName id.me
   ServerAlias [URL unfurl="true"]www.id.me[/URL]
   ServerAdmin admin@localhost
   DocumentRoot "C:/htdocs/customers/id/www"
   ErrorLog  "C:/htdocs/customers/id/logs/error.log"
   CustomLog "C:/htdocs/customers/id/logs/access.log"
</VirtualHost>

I've created the above folders on my drive.

My 'main' server configuration looks like this:
Code:
ServerAdmin admin@localhost
ServerName localhost:80
DocumentRoot "E:/Programmer/xampp/htdocs"

I've been through the FAQs in here w/o getting it working. I was hoping to make separate hosts for each of my customers -in the above example I though I could just type in Can't make it spin.

Any advice is greatly appreciated. Thanks ;-)
 
Do you have a NameVirtualHost directive? Please give more details of "Can't make it spin" - what exactly happens and is there anything in the error logs? Seeing that your virtual hosts are outside of the main server's document root, you'll probably also need directory containers for the vitual hosts' document roots. And lastly, of course apache must be able to have filesystem read permissions to those directories.
 
Hi smah,

"Can't make it spin" means that when I type in IE, I'm directed to that ms page saying " is an unknown domain/host.

All I have done is what I posted. And when the <VirtualHost> directive is set, I can't even see localhost.

I should add, that it's all on the same PC/XP pro. So I don't think I need to set permissions, since localhost works fine (w/o the <VirtualHost> directive).

I don't have a <NameVirtualHost> directive. I will look into it.

Thanks
 
Hi smah,

"Can't make it spin" means that when I type in IE, I'm directed to that ms page saying " is an unknown domain/host.

All I have done is what I posted. And when the <VirtualHost> directive is set, I can't even see localhost.

I should add, that it's all on the same PC/XP pro. So I don't think I need to set permissions, since localhost works fine (w/o the <VirtualHost> directive).

In case it matters, the distro is XAMPP.

I don't have a <NameVirtualHost> directive. I will look into it.

Thanks
 
Hi

Just because Apache serves a virtual host, does not mean you browser knows where to search for that virtual host. So you have to mention it in your hosts file, or configure a local domain name server.

Feherke.
 
We need some help here. There are many reasons things don't spin or flat out ain't workin'. When people use terms like that, we have nothing to go on so instead of answering your questions we have to ask a few of our own and we don't get anywhere especially if our questions get ignored. Here are a few things we need to know:

1. Is an FQDN?
2. Is DNS pointing to your IP address?
3. Is that IP static?
4. Does your ISP block port 80?
5. Is your server on a network?
6. If so, is all http traffic being forwarded to your server?
7. Is the local IP static?

Apache can be configured as a single server or sveral virtual servers. If you use virtual servers (virtualhosts), the main server gets ignored and the first vhost defined becomes the default. To setup for virtual hosting, you need to make sure two directives exist and/or are uncommented:

UseCanonicalName Off
NameVirtualHost *:80

In order to tell apache who can do what in each of your vhost's directories, you need to create directory containers just like the ones used by the main server. Place all your vhost containers at the bottom of your httpd.conf file. You can also create a file called vhosts.conf and put it in the directory specified by the Include directive. This will make it a lot easier to manage your vhosts.

Now we can get to more interesting questions:

8. Is apache running?
9. Did you restart it after you last edited httpd.conf?
10. Do your logs contain any helpful information?
11. Can you ping, trace or dig your domain name?

As you can see, We can't be of much help unless we know if we are talking about an isp, network or apache problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top