Re: LocationMatch inside VirtualHost? [solved: bug]

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

 



Viaduct Productions wrote:

On 14-Apr-09, at 9:45 AM, André Warnier wrote:

a) a first "NameVirtualHost *:80" somewhere,
and then
b) a second "NameVirtualHost *:80" line, without having seen in-between, <VirtualHost> sections that would correspond to the first "NameVirtualHost *:80".
So it warns you that something is missing there.
c) after it finds the second "NameVirtualHost *:80" line however, it does find your corresponding <VirtualHost> sections, so it is happy then.

Is that clearer ?

I would think the entry of NameVirtualHost right above the VirtualHosts, would do the trick. There is only one entry now, and it's coming up twice as previously noted.


 My vhosts are registering twice in apachectl
-S.

Now that is interesting. It would tend to confirm the guess that somewhere, you have a duplicated "Include" directive, which somehow reads a certain configuration file one too many times.

No. There is one include line at the bottom of httpd.conf. It points directly to my users/rich.conf:

Include /private/etc/apache2/users/rich.conf

That included file is the only place NameVirtualHost is located, right above my VirtualHosts.

Very little of this makes any sense.
I can assure you that it most probably does make a lot of sense.
It is just that you are still overlooking something that would make it all fall into place logically.

It makes little sense to me, because of the single include, the single NameVirtualHost and the single list of VirtualHosts. And, they are in that order.

Maybe this :
Apache basically has only /one/ configuration file, the one indicated by the initial "-f" command-line parameter of the httpd program. By default that is "httpd.conf" in the ServerRoot directory. But on different platforms, depending on the Apache distribution, it may be another name somewhere else.
Anyway, Apache starts there, and basically sticks with that file.

It would be httpd.conf then? A locate finds it in the original folder, and nowhere else. That httpd.conf doesn't have the custom include to rich.conf, where the VirtualHosts are.

Only, whenever in that file it finds an "Include" directive, it will read the included file (or files) at that point, just as if the content of that included file(s) had been in httpd.conf in the first place. If in the included file(s), there is another "Include", it will do this again, recursively. When it gets to the end of the included file(s), it resumes with the next line of the current file, just after the "Include".

Yes, very clear.  We use that all the time in my middleware.

What you may have overlooked, is a line like
Include /some/directory/*.conf
which would read /all/ the *.conf files present in that directory, at this point.

There are no other includes.

Then later there is an
Include /some/directory/somefile.conf
(from the same directory) and oops, the same file is read and included again.

Still no other includes.  Even in the includes.

And it just happens that this file starts with a "NameVirtualHost *:80".


httpd.conf:
    NameVirtualHost count:  0
    Includes: 1, to rich.conf

rich.conf
    NameVirtualHost count: 1
    includes: 0


Ok, then let's start one level higher-up.
How do you start Apache, on that system ?  And what kind of system is it ?

if the start command is something like "/etc/init.d/apache2 start", then you might as well include that script here right away.

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux