Toon posts:

Apache virtual hosts

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb een website draaien om mn eigen server thuis. Ik heb een domeinnaam aangevraagd bij nxs.nl. Nou wil ik graag een subdomein aanmaken. Ik heb bij nxs een zonefile aangemaakt:

Naam: kj.surfsquad.nl
Type: A
Waarde: 83.118.12.106

En de config van apche heb ik het volgende ingevuld.

<VirtualHost kj.surfsquad.nl>
ServerAdmin admin@surfsquad.nl
DocumentRoot "c:/webserver/www/kj"
ServerName kj.surfsquad.nl
</VirtualHost>

Als ik nu kj.surfsquad.nl intyp gaat hij nog steeds naar surfsquad.nl ipv. surfsquad.nl/kj. Iemand enig idee hoe dit dan wel moet ?

  • rvm
  • Registratie: November 2000
  • Niet online

rvm

Ik zie nergens NameVirtualHost staan, zie:
http://httpd.apache.org/docs/vhosts/name-based.html

Verwijderd

Topicstarter
Daar had ik al staan: NameVirtualHost surfsquad.nl

dan werkt het ook niet ?!

Verwijderd

Volgens mij moet het zo:

NameVirtualHost kj.surfsquad.nl
<VirtualHost kj.surfsquad.nl>
ServerAdmin admin@surfsquad.nl
DocumentRoot "c:/webserver/www/kj"
ServerName kj.surfsquad.nl
</VirtualHost>

Dan zou het moeten werken.

  • BalusC
  • Registratie: Oktober 2000
  • Niet online

BalusC

Carpe diem

Een doodsimpele hobbyserver met slechts een vhosts probleem in apache maakt dit nog geen Professional Networking & Servers topic :X Anders neem je voortaan de stickies door om te begrijpen waar het subforum voor dient B) sys:/tweakers/net/PNS/readme.txt

Apache == Software
Professional Networking & Servers > Software Algemeen dus :)

[ Voor 12% gewijzigd door BalusC op 15-10-2004 11:53 ]


  • Spider.007
  • Registratie: December 2000
  • Niet online

Spider.007

* Tetragrammaton

Verwijderd schreef op 15 oktober 2004 @ 11:38:
Daar had ik al staan: NameVirtualHost surfsquad.nl

dan werkt het ook niet ?!
With the NameVirtualHost directive you specify the IP address on which the server will receive requests for the name-based virtual hosts. This will usually be the address to which your name-based virtual host names resolve. In cases where a firewall or other proxy receives the requests and forwards them on a different IP address to the server, you must specify the IP address of the physical interface on the machine which will be servicing the requests. If you have multiple name-based hosts on multiple addresses, repeat the directive for each address.
Oftewel; volg gewoon het genoemde voorbeeld
NameVirtualHost *

<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

---
Prozium - The great nepenthe. Opiate of our masses. Glue of our great society. Salve and salvation, it has delivered us from pathos, from sorrow, the deepest chasms of melancholy and hate


Verwijderd

Topicstarter
nej nog steeds niet hij komt nog steeds op de frontpage.. hij gaat steeds naar de index.php ! en hij moet het mapje kj pakken !

Het zou wel op deze manier moeten kunnen toch ?

  • rvm
  • Registratie: November 2000
  • Niet online

rvm

Post eens een linkje naar je volledige Apache config.
Heb je dit gelezen:
If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.
Vergeet ook niet je Apache server te herstarten nadat je wijzigingen aanbrengt in de config file.
Als NameVirtualHost wordt aangeraden het IPnr te gebruiken ipv de hostname. Sterretje kan ook als er maar 1 IPnr bij je server hoort.
Pagina: 1