Strange behaviour with apache2

From: Alan Chandler (alan_at_chandlerfamily.org.uk)
Date: 08/14/04

  • Next message: Ric Otte: "Re: can't retrieve large numbers of email"
    To: debian-user@lists.debian.org
    Date: Fri, 13 Aug 2004 23:05:39 +0100
    
    

    I have a really strange situation with apache2 and the way it is running a php
    file in some circumstances and offering it up to the browser as text in
    others. The file in question is index.php as the key file using the drupal
    content management system.

    I have authentication set on most directories in my server configuration so
    that if I access the web server from outside it requires authentication. If
    it is from a machine running on the local network it doesn't. The
    configuration is thus

    Alias /drupal /usr/share/drupal

    <Directory /usr/share/drupal/>
            Options +FollowSymLinks
            AllowOverride All
            #
            # Controls who can get stuff from this server.
            #
            AuthType Basic
            AuthName "Chandler Intranet"
            AuthUserFile /etc/apache2/users
            AuthGroupFile /etc/apache2/groups
            Require group family
            Order allow,deny
            Allow from 192.168.0.0/24
            Satisfy any
    </Directory>

    The .htaccess file has (amongst other things)

    DirectoryIndex index.php

    in it, and so in fact does the main server configuration.

    When I access the web server with the url http://myserver/drupal from a
    192.168.0.0/24 address, it works and index.php gets executed as a php script.

    When I access this url from outside I get prompted for a user name and
    password which I enter correctly and then find that the text of index.php not
    sent as html (at least I am prompted by Internet Exlorer to either save or
    open the file. When I choose wordpad, I have recieved the text inside
    index.php)

    Just to convince myself that php can really run, I have another directory
    phptest with an index.php file as follows

    <?php phpinfo(); ?>

    and when I call this up (http://myserver/phptest ) from outside I get a
    detailed web page full of php information.

    I just cannot think what it could be about my apache configuration that
    changes the behaviour dependant on the source of the browser.

    Anyone any ideas?

    Or ... any ideas about I can understand how exactly the apache configuration
    file has been parsed so that I can locate the source of my problem.

    -- 
    Alan Chandler
    alan@chandlerfamily.org.uk
    First they ignore you, then they laugh at you,
     then they fight you, then you win. --Gandhi
    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Ric Otte: "Re: can't retrieve large numbers of email"

    Relevant Pages

    • Help with php5 install under windows
      ... This includes moving php from the ... Enable the PHP scripting language engine under Apache. ... or per-virtualhost web server configuration file. ... The PHP directives register_globals, ...
      (php.general)
    • Re: Forms and PHP V5.0.2 with APACHE V2.0.50
      ... Not relevant to the current issue, but MySQL 4.1 went General Availability ... To use my HOME PC to run a local APACHE web server on which to ... >develop websites that make use of PHP scripts and MySQL databases. ... PHP only reads its configuration on startup. ...
      (comp.lang.php)
    • Re: Apache2 and PHP5 configuration problem: SOLVED
      ... 'server-info' and 'server-status' URL's and based on the info in them, ... However, when I try to use a .php file, a file download dialog pops up. ... I'm clearly missing something in the Apache2 configuration. ... Am I missing some other Apache directive needed to allow access to or execution of PHP scripts? ...
      (Debian-User)
    • Re: Apache + PHP
      ... > Actually first thing is apache is not displaying its default page. ... > First apache has to work to make PHP work. ... you should use the "Test Configuration" option ... Once you get Apache working, then edit httpd.conf to make PHP work. ...
      (comp.lang.php)
    • RE: Virtual hosts and PHP "downloads": php5 and apache22 on FreeBSD6.1-STABLE
      ... Apache web server. ... Subject: Virtual hosts and PHP "downloads": php5 and apache22 on ...
      (freebsd-questions)