httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chandler <a...@chandlerfamily.org.uk>
Subject Re: [users@httpd] Very old problem without any new solution
Date Thu, 19 Aug 2004 08:08:29 GMT
On Thursday 19 August 2004 01:50, Stanislas de Ionecum wrote:
> Ok,
> but you have not replied my question, I guess...
>
> I would to actually *allow* directory listing and allow to see *any*
> content. This means

Did you read the manual for mod_autoindex - and what did you not understand?
...
> if I enter:
> http://myvirtualsite
>
> I get Forbidden from IE and I get the localhost page from Mozilla, rather
> than myvirtualsite


I don't know what that is - but I have suspicions about how well 127.0.0.2 
works as a loopback interface.  See comments below about how to avoid using 
it. So ...

First question.  Does communications with 127.0.0.2 actually work, and if so 
does the name myvirtualsite resolve to that address.

...
>
> # ALL MY VIRTUAL HOSTING HERE
> NameVirtualHost 127.0.0.1
> NameVirtualHost 127.0.0.2
>
> <virtualhost 127.0.0.1>
> ServerName localhost
> DocumentRoot D:/local_site
> </virtualhost>
>
> <virtualhost 127.0.0.2>
> ServerName myvirtualsite
> DocumentRoot D:/pages_perso/websites/myvirtualsite
> </virtualhost>
>
> >From: Alan Chandler <alan@chandlerfamily.org.uk>
...
> >There are two sorts of virtual hosting IP based and named based.  You only
> >need to use NameVirtualHost to specify on which interfaces on the machine
> >you
> >will be using named based virtual hosting.



Second question.  Do you understand the difference between IP based virtual 
hosting and named based.  You could get away without needing IP address 
127.0.0.2 and used named based totally on 127.0.0.1

In /etc/hosts

make the line look like this

127.0.0.1  localhost myvirtualsite  

In you httpd.conf

NamedVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1 >
 ServerName localhost
...
</VirtualHost>
<VirtualHost 127.0.0.1>
 ServerName myvirtualsite
...
</VirtualHost>

In the above - you could get at the site from outside by changing /etc/hosts 
to put you outside ip address and put several names for it in that line, and 
then replacing all the 127.0.0.1 by * in the httpd.conf file as shown above.

What this tells apache, is do named based virtual hosting on ALL interfaces 
(127.0.0.1 and the external ip address of the machine). [ Although  you still 
need a DNS somewhere so that the client browser can resolve the virtual host 
name into the IP address of your machine]

-- 
Alan Chandler
alan@chandlerfamily.org.uk
First they ignore you, then they laugh at you,
 then they fight you, then you win. --Gandhi

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message