mod_vhost_alias en $_SERVER['document_root']

Pagina: 1
Acties:

  • tombo_inc
  • Registratie: December 2004
  • Laatst online: 10-03 13:21
ik heb mijn apache webserver (onder winXP) nu zo ingesteld dat ie automatisch, afhankelijk van de http-header die hij met de request mee krijgt naar de juiste documentroot voor die site gaat. nu heb ik alleen een raar probleem. als ik gewoon in mijn httpd een aantal vhost containers aanmaak met daarin de benodigde configuratie dan word de PHP $_SERVER['DOCUMENT_ROOT'] variabele goed aangepast naar dus de virtuele docroot. maar als ik nu de makkelijke methode met mod_vhost_alias gebruik (wat ik dus wil) dan redirect de server dus wel naar de goed html pags, maar word de PHP $_SERVER['DOCUMENT_ROOT'] variabele niet aangepast en blijft gewoon op het default staan. dus gewoon de htdocs map en niet de nieuwe virtuele docroot. dat is lastig want ik heb bijvoorbeeld een webbased ftp systeem gemaakt die de $_SERVER['DOCUMENT_ROOT'] variabele gebruikt. en die moet dus wel goed zijn anders werkt bijvoorbeeld dat systeem niet. weet iemand waarom die $_SERVER['DOCUMENT_ROOT'] var niet aangepast word als ik mod_vhost_alias gebruik, en wat ik eraan zou moeten doen?

alvast bedankt, _/-\o_
Tombo

Microsoft Windows: A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition


Verwijderd

PNS > SA

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

Spider.007

* Tetragrammaton

Kun je eens relevante delen van je httpd.conf posten zodat we je probleem beter kunnen inschatten? :)

---
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


  • Osiris
  • Registratie: Januari 2000
  • Niet online
The other thing to `fake' is the document root (configured with DocumentRoot and available to CGIs via the DOCUMENT_ROOT environment variable). In a normal configuration this setting is used by the core module when mapping URIs to filenames, but when the server is configured to do dynamic virtual hosting that job is taken over by another module (either mod_vhost_alias or mod_rewrite) which has a different way of doing the mapping. Neither of these modules is responsible for setting the DOCUMENT_ROOT environment variable so if any CGIs or SSI documents make use of it they will get a misleading value.
Helaas kan dit blijkbaar dus niet via mod_vhost_alias.. :( Ik zou helaas ook niet weten hoe het wél moet :/

  • tombo_inc
  • Registratie: December 2004
  • Laatst online: 10-03 13:21
dus dat wil zeggen dat ik dus met vhost containers in mijn httpd moet werken. dat is voor mij nu nog geen groot probleem omdat ik maar een paar sites host maar ik vraag me toch af hoe grote hosters zoiets dan oplossen :? want mod_vhost_alias is echt gemakkelijk.


dit doe ik dus met vhost containers:

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@mijndomein.com
DocumentRoot "/htdocs/mijndomein"
ServerName www.mijndomein.com
</VirtualHost>
etc etc


en dit met mod_vhost_alias:

VirtualDocumentRoot "D:/webserver/Apache Group/Apache2/htdocs/%0"

Microsoft Windows: A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition