You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Barry Scott <ba...@onelan.co.uk> on 2011/07/11 14:21:13 UTC

[users@httpd] HTTPD 2.2.17 issue on Fedora 15 with listening on IPv4

We are porting our application to Fedora 15 and to systemd from SysV init.
The httpd configuraturation we are using work without problem on earlier
Fedora 13 systems.

We are hitting an odd problem with httpd handling requests on localhost:80
over IPv4. The configuration allows access without authenication but we
get a 401 error. However repeat the request using IPv6 and it it works.

If we restart httpd (systemctl restart httpd.service) the problem goes
away. We have a set of identical hardware running identical software
with identical config and not all systems show this problem. Leading me
to expect its a race condition during startup.

Here is a fragment of the httpd.conf file:

<VirtualHost 127.0.0.1:80 [::1]:80>
    ... rewrite rules ...
    <Location /XML>

        #+ localhost auth file
        Order allow,deny
        Allow from 127.0.0.1
        Allow from ::1
        Satisfy Any
        #- localhost auth file

    </Location>
    ...
</VirtualHost>

I test this with:

curl -4 http://localhost:80/XML/
curl -6 http://localhost:80/XML/

I'm willing to debug and patch the code to get to the bottom of the problem
but would like to know if this is a known problem. Any pointers on where
to start looking in the code would be welcome as well.

Barry

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


Re: [users@httpd] HTTPD 2.2.17 issue on Fedora 15 with listening on IPv4

Posted by Barry Scott <ba...@onelan.co.uk>.
On Wednesday 13 July 2011 01:24:34 Jeff Trawick wrote:
> On Mon, Jul 11, 2011 at 8:21 AM, Barry Scott <ba...@onelan.co.uk> wrote:
> > We are porting our application to Fedora 15 and to systemd from SysV init.
> > The httpd configuraturation we are using work without problem on earlier
> > Fedora 13 systems.
> >
> > We are hitting an odd problem with httpd handling requests on localhost:80
> > over IPv4. The configuration allows access without authenication but we
> > get a 401 error. However repeat the request using IPv6 and it it works.
> >
> > If we restart httpd (systemctl restart httpd.service) the problem goes
> > away. We have a set of identical hardware running identical software
> > with identical config and not all systems show this problem. Leading me
> > to expect its a race condition during startup.
> >
> > Here is a fragment of the httpd.conf file:
> >
> > <VirtualHost 127.0.0.1:80 [::1]:80>
> >    ... rewrite rules ...
> >    <Location /XML>
> >
> >        #+ localhost auth file
> >        Order allow,deny
> >        Allow from 127.0.0.1
> >        Allow from ::1
> >        Satisfy Any
> >        #- localhost auth file
> >
> >    </Location>
> >    ...
> > </VirtualHost>
> >
> > I test this with:
> >
> > curl -4 http://localhost:80/XML/
> > curl -6 http://localhost:80/XML/
> 
> How does the client IP address show up in error and access logs?

I'm in the middle of instrumenting the code to find out what is going on.
I've attached an edited log show httpd coming up during boot and failing
followed by systemctl restart httpd.service after boot.
The attached log is the stdout from systemd starting httpd.service.

I have also made a change to the config to use port _default_:8080 for
the public facing server and 127.0.0.1:80 for the internal facing server.
With that change httpd will not start up.

You can see the failure log:

[823] info: [Tue Jul 12 17:51:43 2011] [error] (EAI 9)Address family for hostname not supported: Could not resolve host name 127.0.0.1 -- ignoring!

The lines with QQQ on them are my instrumentation. I've patched
httpd-2.2.17/server/vhost.c and apr-1.4.5/network_io/unix/sockaddr.c.

The instrumentation seems to show me that the httpd and apr code
is fine.

My next step is to instument glibc getaddrinfo to find out why it
returns EAI_ADDRFAMILY. Have you seen issues with getaddrinfo
elsewhere?

We are using kernel-PAE-2.6.38.8-93.fc15.i686 and glibc-2.14-2.i686

I can provide the patches and full config if that is useful.

Barry


Re: [users@httpd] Resource interpreted as .... but transferred with MIME type text/html

Posted by Dirk Verleysen <di...@verleysen.net>.
I changed DefaultType into application/octet-stream but that didn't 
solve it either.

Op 14/07/2011 11:45, Dirk Verleysen schreef:
> I'm new to Apache and I'm having a problem deploying on a Windows Server.
>
> I'm getting the above error message (in Chrome) but the look of the 
> site is without images or stylesheet. Also the Javascripts aren't 
> working.
>
> The Apache server redirects port 80 to my application at port 7777 and 
> adds an extension to the URL with rewrite engine.
>
> Going directly to port 7777 displays me the correct webpage.
>
> Any idea what is wrong ?
>
> Dirk
>
>
> ---------------------------------------------------------------------
> 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
>
>
>



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


Re: [users@httpd] Resource interpreted as .... but transferred with MIME type text/html

Posted by Dirk Verleysen <di...@verleysen.net>.
Got most of the problems solved by changing the DocumentRoot. Now most 
of the files are handled correctly.

Op 14/07/2011 13:02, Dirk Verleysen schreef:
> Tom,
>
> Thanks for your answer and the problems seems to be with the local 
> files that are passed from my application to Apache. When I browse the 
> application port they are passed correctly but going thru Apache they 
> have the text/html type.
>
> I have a Virtual Host defined but maybe I don't need it as I'm only 
> serving one site on this machine. In the network tab I notice that the 
> images come from http://www.mydomain.be/gjppics/banner.png. Is there a 
> way to tell apache that the gjppics directory referes to 
> c:/programdata/data/GJP/pics ?
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
>     ProxyPreserveHost On
>     ServerAdmin info@mydomain.be
>     DocumentRoot "C:/ProgramData/data/GJP"
> <Directory "C:/ProgramData/data/GJP">
>             Order deny,allow
>             Allow from all
> </Directory>
>     ServerName www.mydomain.be
>     ServerAlias mydomain.be
>     ErrorLog "logs/mydomain.be-error.log"
>     CustomLog "logs/dummy-host2.mydomain.be-access.log" common
>     # rewrite incoming requests
>         RewriteEngine On
>         RewriteCond C:/ProgramData/data/GJP%{REQUEST_FILENAME} !-f
>         RewriteRule ^/(.*)$ http://localhost:7777/GJP/$1 [proxy,last]
> </VirtualHost>
>
>
>
>
> Op 14/07/2011 12:31, Tom Evans schreef:
>> On Thu, Jul 14, 2011 at 10:45 AM, Dirk Verleysen<di...@verleysen.net>  
>> wrote:
>>> I'm new to Apache and I'm having a problem deploying on a Windows 
>>> Server.
>>>
>>> I'm getting the above error message (in Chrome) but the look of the 
>>> site is
>>> without images or stylesheet. Also the Javascripts aren't working.
>>>
>>> The Apache server redirects port 80 to my application at port 7777 
>>> and adds
>>> an extension to the URL with rewrite engine.
>>>
>>> Going directly to port 7777 displays me the correct webpage.
>>>
>>> Any idea what is wrong ?
>>>
>>> Dirk
>>>
>>>
>> Some sort of misconfiguration? Sounds like the resources you think are
>> being loaded are not.
>>
>> Right click on the page in Chrome, click 'Inspect element' (it doesn't
>> matter where in the page you click).
>> In the tabbed developer tools that opened at the bottom of the page,
>> click into the 'Network' tab.
>> It should say something like 'No requests captured. Reload the 
>> page...'. Do so.
>>
>> You should now have a long list of the resources chrome tried to load.
>> Find the ones in the list that chrome complained about. Are their mime
>> types correct? Is their content correct?
>>
>> Your apache config may be a start as well...
>>
>> Cheers
>>
>> Tom
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>



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


Re: [users@httpd] Resource interpreted as .... but transferred with MIME type text/html

Posted by Dirk Verleysen <di...@verleysen.net>.
Tom,

Thanks for your answer and the problems seems to be with the local files 
that are passed from my application to Apache. When I browse the 
application port they are passed correctly but going thru Apache they 
have the text/html type.

I have a Virtual Host defined but maybe I don't need it as I'm only 
serving one site on this machine. In the network tab I notice that the 
images come from http://www.mydomain.be/gjppics/banner.png. Is there a 
way to tell apache that the gjppics directory referes to 
c:/programdata/data/GJP/pics ?

NameVirtualHost *:80

<VirtualHost *:80>
     ProxyPreserveHost On
     ServerAdmin info@mydomain.be
     DocumentRoot "C:/ProgramData/data/GJP"
<Directory "C:/ProgramData/data/GJP">
             Order deny,allow
             Allow from all
</Directory>
     ServerName www.mydomain.be
     ServerAlias mydomain.be
     ErrorLog "logs/mydomain.be-error.log"
     CustomLog "logs/dummy-host2.mydomain.be-access.log" common
     # rewrite incoming requests
         RewriteEngine On
         RewriteCond C:/ProgramData/data/GJP%{REQUEST_FILENAME} !-f
         RewriteRule ^/(.*)$ http://localhost:7777/GJP/$1 [proxy,last]
</VirtualHost>




Op 14/07/2011 12:31, Tom Evans schreef:
> On Thu, Jul 14, 2011 at 10:45 AM, Dirk Verleysen<di...@verleysen.net>  wrote:
>> I'm new to Apache and I'm having a problem deploying on a Windows Server.
>>
>> I'm getting the above error message (in Chrome) but the look of the site is
>> without images or stylesheet. Also the Javascripts aren't working.
>>
>> The Apache server redirects port 80 to my application at port 7777 and adds
>> an extension to the URL with rewrite engine.
>>
>> Going directly to port 7777 displays me the correct webpage.
>>
>> Any idea what is wrong ?
>>
>> Dirk
>>
>>
> Some sort of misconfiguration? Sounds like the resources you think are
> being loaded are not.
>
> Right click on the page in Chrome, click 'Inspect element' (it doesn't
> matter where in the page you click).
> In the tabbed developer tools that opened at the bottom of the page,
> click into the 'Network' tab.
> It should say something like 'No requests captured. Reload the page...'. Do so.
>
> You should now have a long list of the resources chrome tried to load.
> Find the ones in the list that chrome complained about. Are their mime
> types correct? Is their content correct?
>
> Your apache config may be a start as well...
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> 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
>
>
>



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


Re: [users@httpd] Resource interpreted as .... but transferred with MIME type text/html

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Jul 14, 2011 at 10:45 AM, Dirk Verleysen <di...@verleysen.net> wrote:
> I'm new to Apache and I'm having a problem deploying on a Windows Server.
>
> I'm getting the above error message (in Chrome) but the look of the site is
> without images or stylesheet. Also the Javascripts aren't working.
>
> The Apache server redirects port 80 to my application at port 7777 and adds
> an extension to the URL with rewrite engine.
>
> Going directly to port 7777 displays me the correct webpage.
>
> Any idea what is wrong ?
>
> Dirk
>
>

Some sort of misconfiguration? Sounds like the resources you think are
being loaded are not.

Right click on the page in Chrome, click 'Inspect element' (it doesn't
matter where in the page you click).
In the tabbed developer tools that opened at the bottom of the page,
click into the 'Network' tab.
It should say something like 'No requests captured. Reload the page...'. Do so.

You should now have a long list of the resources chrome tried to load.
Find the ones in the list that chrome complained about. Are their mime
types correct? Is their content correct?

Your apache config may be a start as well...

Cheers

Tom

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


[users@httpd] Resource interpreted as .... but transferred with MIME type text/html

Posted by Dirk Verleysen <di...@verleysen.net>.
I'm new to Apache and I'm having a problem deploying on a Windows Server.

I'm getting the above error message (in Chrome) but the look of the site 
is without images or stylesheet. Also the Javascripts aren't working.

The Apache server redirects port 80 to my application at port 7777 and 
adds an extension to the URL with rewrite engine.

Going directly to port 7777 displays me the correct webpage.

Any idea what is wrong ?

Dirk


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


Re: [users@httpd] HTTPD 2.2.17 issue on Fedora 15 with listening on IPv4

Posted by Barry Scott <ba...@onelan.co.uk>.
On Thursday 14 July 2011 10:38:44 Barry Scott wrote:
> On Wednesday 13 July 2011 01:24:34 Jeff Trawick wrote:
> > >
> > > <VirtualHost 127.0.0.1:80 [::1]:80>
> > >    ... rewrite rules ...
> > >    <Location /XML>
> > >
> > >        #+ localhost auth file
> > >        Order allow,deny
> > >        Allow from 127.0.0.1
> > >        Allow from ::1
> > >        Satisfy Any
> > >        #- localhost auth file
> > >
> > >    </Location>
> > >    ...
> > > </VirtualHost>
> > >
> 
> 
> I now know what is happening.
> 
> When processing the addresses in the VirtualHost line for 127.0.0.1:80
> in vhost.c get_addresses is called
> get_addresss calls apr_sockaddr_info_get
> apr_sockaddr_info_get call getaddrinfo in glibc.
> 
> getaddrinfo assumes that the system will have working IPv4 external
> connectivity before it can return any answer.
> 
> A modern Linux system will dynamically add and remove network
> interfaces. Which means that getaddrinfo will fail in cases that
> you could arguable expect it to work.
> 
> For example for numeric address and for address defined in /etc/hosts
> where /etc/nsswitch.conf uses file before dns.
> 
> In my specific case the system only has a working lo0 network interface
> at the time that httpd is started and I want to use 127.0.0.1 to provide
> authenication free access from within the system, external access is
> authenticated on _default_:80 as interfaces such as WiFi come up.
> 
> The question is where should a fix be applied; httpd, apr or glibc?
> 
> What are your thoughts?
> 
> I also plan to draw this issue to the systemd developers attention.
> 
> Barry

I raise a bug with patch against glibc.

https://bugzilla.redhat.com/show_bug.cgi?id=721350

Barry


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


Re: [users@httpd] HTTPD 2.2.17 issue on Fedora 15 with listening on IPv4

Posted by Barry Scott <ba...@onelan.co.uk>.
On Wednesday 13 July 2011 01:24:34 Jeff Trawick wrote:
> >
> > <VirtualHost 127.0.0.1:80 [::1]:80>
> >    ... rewrite rules ...
> >    <Location /XML>
> >
> >        #+ localhost auth file
> >        Order allow,deny
> >        Allow from 127.0.0.1
> >        Allow from ::1
> >        Satisfy Any
> >        #- localhost auth file
> >
> >    </Location>
> >    ...
> > </VirtualHost>
> >


I now know what is happening.

When processing the addresses in the VirtualHost line for 127.0.0.1:80
in vhost.c get_addresses is called
get_addresss calls apr_sockaddr_info_get
apr_sockaddr_info_get call getaddrinfo in glibc.

getaddrinfo assumes that the system will have working IPv4 external
connectivity before it can return any answer.

A modern Linux system will dynamically add and remove network
interfaces. Which means that getaddrinfo will fail in cases that
you could arguable expect it to work.

For example for numeric address and for address defined in /etc/hosts
where /etc/nsswitch.conf uses file before dns.

In my specific case the system only has a working lo0 network interface
at the time that httpd is started and I want to use 127.0.0.1 to provide
authenication free access from within the system, external access is
authenticated on _default_:80 as interfaces such as WiFi come up.

The question is where should a fix be applied; httpd, apr or glibc?

What are your thoughts?

I also plan to draw this issue to the systemd developers attention.

Barry

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


Re: [users@httpd] HTTPD 2.2.17 issue on Fedora 15 with listening on IPv4

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jul 11, 2011 at 8:21 AM, Barry Scott <ba...@onelan.co.uk> wrote:
> We are porting our application to Fedora 15 and to systemd from SysV init.
> The httpd configuraturation we are using work without problem on earlier
> Fedora 13 systems.
>
> We are hitting an odd problem with httpd handling requests on localhost:80
> over IPv4. The configuration allows access without authenication but we
> get a 401 error. However repeat the request using IPv6 and it it works.
>
> If we restart httpd (systemctl restart httpd.service) the problem goes
> away. We have a set of identical hardware running identical software
> with identical config and not all systems show this problem. Leading me
> to expect its a race condition during startup.
>
> Here is a fragment of the httpd.conf file:
>
> <VirtualHost 127.0.0.1:80 [::1]:80>
>    ... rewrite rules ...
>    <Location /XML>
>
>        #+ localhost auth file
>        Order allow,deny
>        Allow from 127.0.0.1
>        Allow from ::1
>        Satisfy Any
>        #- localhost auth file
>
>    </Location>
>    ...
> </VirtualHost>
>
> I test this with:
>
> curl -4 http://localhost:80/XML/
> curl -6 http://localhost:80/XML/

How does the client IP address show up in error and access logs?

>
> I'm willing to debug and patch the code to get to the bottom of the problem
> but would like to know if this is a known problem. Any pointers on where
> to start looking in the code would be welcome as well.
>
> Barry
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
Born in Roswell... married an alien...

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