---
title: "Apache: Virutalhosts"
type: "forum-thread"
url: "https://www.webforum.nu/amne/webbservrar/150876-apache-virutalhosts"
topic: "Webbservrar"
topic_url: "https://www.webforum.nu/amne/webbservrar"
author: "Sjodahl"
published: "2006-09-03T18:38:06.000Z"
updated: "2006-09-03T19:34:45.000Z"
replies: 2
views: 324
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/webbservrar/150876-apache-virutalhosts"
---

# Apache: Virutalhosts

## #1 — Sjodahl, 2006-09-03T18:38Z

Lyckas inte riktigt får virtualhosts att fungera som jag tänkt:
Går jag in på IP: 213.213.213.213 kommer jag till samma som om jag får in på 
hostname.se som pekar på 213.213.213.213

Men vill som sagt att om jag går in på IPet så skall jag komma till default doc rooten inte "D:/webb/sites/hostname.se" och får jag in på hostname.se så skall jag komma till rätt mapp.

> NameVirtualHost \*:80
> 
> \#
> \# VirtualHost example:
> \# Almost any Apache directive may go into a VirtualHost container.
> \# The first VirtualHost section is used for requests without a known
> \# server name.
> \#
> \#\<VirtualHost \*:80\>
> \#    ServerAdmin <webmaster@dummy-host.example.com>
> \#    DocumentRoot "D:/Webb/sites/docroot"
> \#    ServerName dummy-host.example.com
> \#    ErrorLog logs/dummy-host.example.com-error_log
> \#    CustomLog logs/dummy-host.example.com-access_log common
> \#\</VirtualHost\>
> 
> \<VirtualHost \*:80\>
> 	ServerAdmin <webmaster@hostname.se>
> 	DocumentRoot "D:/webb/sites/hostname.se"
> 	ServerName hostname.se
> \</VirtualHost\>

Permalänk: https://www.webforum.nu/p/150876

## #2 — GunnarD, 2006-09-03T19:12Z

När du skriver in ip-adressen så gäller första virtuella hosten så du måste skapa en till för domänen.

Alltså minst 2 virtuella host'ar.

Permalänk: https://www.webforum.nu/p/1860908

## #3 — Sjodahl, 2006-09-03T19:34Z

Tackar!

Permalänk: https://www.webforum.nu/p/1860917

---

Tråden på webben: https://www.webforum.nu/amne/webbservrar/150876-apache-virutalhosts
