Re: about the absolutely path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Because it's Windows, I had to stop the "DNS Client" service -- Or, at
least, that seemed to help...  Maybe I should start that again and test.

Also, I was dumb enough to not have all my VirtualHost's in /etc/hosts,
only it's Windows so it's c:\windows\system32\drivers\etc\hosts (in *THIS*
versions of Windows, not the other versions, where it's some other
directory.  Sheesh!)

And, finally, for reasons beyond my ken:
NameVirtualHost *:80 was no good, but
NameVirtualHost 127.0.0.1:80 was good.
Go figure.

Got it to work, but it feels more like Voodoo than anything else.

Thanks to all, and apologies for this off-topic post to wrap this up.

Hope it forestalls at least one post somewhere in the future.

Hmmmmm.  I wonder if I could put something in ?/hosts to do:
[a-zA-Z0-9-]*      127.0.0.1

In other words, if I try to surf to 'example' (not example.com) then I
just want my local Apache VirtualHost settings to kick in, so I can work
on sites locally, without digging around and changing ?/hosts every time.

On Mon, June 6, 2005 3:43 pm, Jochem Maas said:
> Richard Lynch wrote:
>> On Mon, June 6, 2005 1:54 am, yangshiqi said:
>>
>>>I have a php application (let's call it app A) which is developed
>>>separated
>>>in a test domain name, like http://testa.xxx.com <http://testa.xxx.com/>
>>>/.
>>>
>>>But now I have to move it to another app (called B) using
>>>http://testb.xxx.com <http://testb.xxx.com/> /, and the app A becomes
>>> just
>>>a
>>>subsystem of app B.
>>>
>>>The access url is changed to http://testb.xxx.com/a/.
>>>
>>>Then I meet a problem that the app A 's links, the path and other
>>> elements
>>>in it are set like '/Main.php', '/art/logo.gif' by an absolutely path.
>>>
>>>The app A is very independent and I do not want to disperse it to app B.
>>>
>>>So how can I get this effect: when the user input the url, '
>>>http://testb.xxx.com/a/ ', the app A will work fine?
>>>
>>>Can I just modify some configuration about yapache to fit this
>>>requirement?
>>
>
> maybe you could use the apache ProxyPass directive?
>
> ProxyPass testb.xxx.com/a/ testa.xxx.com
>
> or something like that. (I'm just half-remembering
> a cool post by Rasmus L. so the syntax is probably off)
>
>>
>
> ...
>
>> server with VirtualHost settings.  [He says blithely, never having
>> actually got that to work on his own box...]
>>
>> Hmmmm, that reminds me...  Does VirtualHost rely on, like, /etc/hosts
>> having hostnames for all those made-up hostnames I use?  I had assumed
>> all
>
> Richard try something like this (obviously add any required stuff like
> DocumentRoot etc.
>
> # you can do allsorts of stuff with the IP definition.
> #NameVirtualHost 213.*:80
> NameVirtualHost *:80
>
> #  _DEFAULT_ - this vhost gets loaded. if nothing else matches
> # -----------------------------------------------------------------
> <VirtualHost _default_:80>
>          ServerName www.l-i-e.com
>          ServerAlias l-i-e.com
>          DocumentRoot /var/www/l-i-e.com
> </VirtualHost>
>
> <VirtualHost *:80>
> 	ServerName richard.l-i-e.com
> 	ServerAlias rlynch.l-i-e.com
> 	# stuff
> </VirtualHost>
>
> # whats this then!
>
> <VirtualHost 67.139.134.202:80>
>      # if you create a directory
>      # in /var/webroots/ that
>      # matches the domainname given to apache
>      # then the dir will be served.
>
>      <Directory /var/webroots>
>          Options ExecCGI +FollowSymLinks
>      </Directory>
>
>      UseCanonicalName Off
>
>      ServerName %0
>
>      # '%-2+' traps the penultimate and all preceding parts of the FQDN as
> given in the Host: header
>      # but I wasn't having much luck with it.
>      VirtualDocumentRoot /var/webroots/%0
>
>      # some std resources?
>      Alias  /css  /var/webroots/include/css
>      Alias  /js   /var/webroots/include/js
>
>      php_value auto_prepend_file /some/include/file.inc.php
> </VirtualHost>
>
>
>> those hostnames were just internal unique markers for httpd.conf with no
>> real-worl meaning...  Was that just silly of me or what?
>
> Richard, I believe you can have apache do lookups on the given names but
> by default its off at least - I never have any problem putting allsorts
> non-existing domains in the vhost confs, as long as your local HOSTS file
> has a
> suitable entry your rolling.
>
> rgds,
> Jochem
>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux