Flemming Lemche Flemming Lemche - 1 year ago 106
Apache Configuration Question

Apache Virtual Host doesn't work

I'm trying to get Apache Virtual Host to work but it wont catch the domains and goes out on the internet instead.

I've enabled the Virtual Host in the Config file:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

My httpd-vhosts.conf file looks like this:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "//nas/Web Design/Sites"

<VirtualHost *:80>
ServerAdmin webmaster@fdn.dk
DocumentRoot "//nas/Web Design/Sites/Fdn"
ServerName fdn.dk
ServerAlias www.fdn.dk
ErrorLog "logs/fdn/error.log"
CustomLog "logs/fdn/access.log" common

http://Localhost works fine but when i type fdn.dk or www.fdn.dk the browser tries to find the site on the internet instead of looking at my local folder.

What is wrong...??
I tried to find a solution on the internet but without luck.

Do I need to change something in the host file ???

Kind Regards

Answer Source

Yes, you need to add that domain name to /etc/hosts file if you are using an operating system that has it. Or to C:\WINDOWS\system32\drivers\etc\hosts if you are using Windows.

Example of record: www.fdn.dk

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download