Skip to content

Apache VirtualHosts question

Featured Replies

Trying to run two basic websites from a machine on my network. Installed Apache 2 (2.0.54) on a WinXP machine (yes yes I know it's only proper Apache when run on a *nix box, but I really don't have the time!)

I have a static IP from my ISP and both domains are pointed to that from my domain registrar. Could it be a problem with this setup? Both domains have simple frames-based web forwarding? Or some DNS-based problem? Anyway, below is the text I've entered in the config file with regards Virtual Hosts:

# Ensure that Apache listens on port 80

Listen 80

# Listen for virtual host requests on all IP addresses

NameVirtualHost *:80

DocumentRoot /htdocs/abc

ServerName www.abc.co.uk

# Other directives here

DocumentRoot /htdocs/def

ServerName www.def.co.uk

# Other directives here

The store directory name match the domain name as in the example above, except I've obviously changed swapped my real domains for pretend ones here.

At the moment, when I goto both domains, they display the start page from the second VirtualHost :confused: I was under the impression that it read the first VirtualHost entry in the event of any problem?

I'm a bit stumped TBH, and would appreciate any help. A copy of a HTTPD file with VirtualHosts working would be greatly appreciated :thumbup:

Steve

If you want to give up on the nerdy webserver I can talk you through getting IIS working with host headers :D

  • Author

:rofl: that was my fallback position!

If I don't get any takers, I'll throw IIS on and see if I can get that working :D:rolleyes:

Steve

Drop the :80 bit, it's not needed.

Apart from that it looks ok. Have you set up the permissions on both directories too?

Options -Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

Allow from all

Options -Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

Allow from all

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Welcome to BRISKODA. Please note the following important links Terms of Use. We have a comprehensive Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.