Find the answer to your Linux question:
Results 1 to 5 of 5
Hi Linux Gurus, kindly help me with my problem. I was able to compile and install apache-2.0.47 with php-4.2.3. I am now in the testing stage, which came out with ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2003
    Posts
    15

    Apache php page cannot be loaded


    Hi Linux Gurus,
    kindly help me with my problem.

    I was able to compile and install apache-2.0.47 with php-4.2.3. I am now in the testing stage, which came out with undesirable result.

    On my apache running on a internal server which I intend to be a mail server. Having a single ethernet card (192.168.0.4) running on a RedHat 9.0 with a 2.4.22 kernel.

    here's my problem--whenever i created a php page (ex. debug.php) to test if php module was indeed successfully installed on my apache. Instead of displaying the page content it opens the "download manager" and was trying to download the file, under windows client just a blank page.

    This thing kept on appearing whenever I open a .php page.
    however, this is not the case on an .html page which correctly displayed the content of the requested file.

    Here's the content of my apache access log:

    192.168.0.11 - - [29/Oct/2003:11:36:32 +0800] "GET http://mail.alsterph.com/index.html.ru.cp-1251 HTTP/1.0" 200 1522 "http://mail.alsterph.com/" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.11 - - [29/Oct/2003:11:36:32 +0800] "GET http://mail.alsterph.com/apache_pb.gif HTTP/1.0" 200 2326 "http://mail.alsterph.com/index.html.ru.cp-1251" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.11 - - [29/Oct/2003:11:36:38 +0800] "GET http://mail.alsterph.com/debug.php HTTP/1.0" 200 26 "-" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.11 - - [29/Oct/2003:11:36:42 +0800] "GET http://mail.alsterph.com/debug.php HTTP/1.0" 200 26 "-" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.11 - - [29/Oct/2003:11:36:44 +0800] "GET http://mail.alsterph.com/debug.php HTTP/1.0" 200 26 "-" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.11 - - [29/Oct/2003:11:36:46 +0800] "GET http://mail.alsterph.com/debug.php HTTP/1.0" 200 26 "-" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
    192.168.0.4 - - [29/Oct/2003:11:36:54 +0800] "GET http://mail.alsterph.com/squirrelmail-1.4.2/index.php HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225"
    192.168.0.4 - - [29/Oct/2003:11:40:05 +0800] "GET http://mail.alsterph.com/squirrelmail-1.4.2/index.html HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225"
    192.168.0.4 - - [29/Oct/2003:11:44:29 +0800] "GET http://mail.alsterph.com/squirrelmail-1.4.2/index.php HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225"

    and error log:

    [Wed Oct 29 11:05:15 2003] [notice] caught SIGTERM, shutting down
    [Wed Oct 29 11:05:15 2003] [info] Init: Initializing OpenSSL library
    [Wed Oct 29 11:05:15 2003] [info] Init: Seeding PRNG with 2048 bytes of entropy
    [Wed Oct 29 11:05:15 2003] [info] Init: Generating temporary RSA private keys (512/1024 bits)
    [Wed Oct 29 11:05:15 2003] [info] Init: Generating temporary DH parameters (512/1024 bits)
    [Wed Oct 29 11:05:15 2003] [info] Init: Initializing (virtual) servers for SSL
    [Wed Oct 29 11:05:15 2003] [info] Server: Apache/2.0.47, Interface: mod_ssl/2.0.47, Library: OpenSSL/0.9.7c
    [Wed Oct 29 11:05:15 2003] [info] Init: Initializing OpenSSL library
    [Wed Oct 29 11:05:15 2003] [info] Init: Seeding PRNG with 2048 bytes of entropy
    [Wed Oct 29 11:05:15 2003] [info] Init: Generating temporary RSA private keys (512/1024 bits)
    [Wed Oct 29 11:05:16 2003] [info] Init: Generating temporary DH parameters (512/1024 bits)
    [Wed Oct 29 11:05:16 2003] [info] Init: Initializing (virtual) servers for SSL
    [Wed Oct 29 11:05:16 2003] [info] Server: Apache/2.0.47, Interface: mod_ssl/2.0.47, Library: OpenSSL/0.9.7c
    [Wed Oct 29 11:05:16 2003] [notice] Apache/2.0.47 (Unix) configured -- resuming normal operations
    [Wed Oct 29 11:05:16 2003] [info] Server built: Oct 27 2003 16:24:44

    One more thing, each time i open my newly configured apache...mail.alsterph.com [my apache is a webmail server] it displays my directory contents. these could be a security problem? How can I hide my server contents?

    Thank you very much.

    Rhonneil

  2. #2
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    You are not loading the php module, Add these two lines to your httpd.conf and change libexec/ to the location of your modules.
    Code:
    LoadModule php4_module    libexec/libphp4.so
    and
    AddType application/x-httpd-php .php

  3. #3
    Just Joined!
    Join Date
    Oct 2003
    Posts
    15
    Quote Originally Posted by Ol Man
    You are not loading the php module, Add these two lines to your httpd.conf and change libexec/ to the location of your modules.
    Code:
    LoadModule php4_module    libexec/libphp4.so
    and
    AddType application/x-httpd-php .php
    Thanks for your speedy reply. These are some of my httpd.conf entries which was previously included in it. However, even if these were already included in the httpd.conf file the problem can still be seen.
    ------------------------------------------------------------------------

    <IfModule mod_dir.c>
    DirectoryIndex index.htm index.html index.php default.php index.shtml index.php3 index.php4
    </IfModule>

    <IfModule mod_mime.c>
    TypesConfig /etc/httpd/conf/mime.types
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .shtml
    AddType application/x-httpd-php-source .phps
    </IfModule>

    --------------------------------------------------------------------------
    Download Manager provides the following everytime you open a php page:

    "You have chosen to download a file type: application/x-httpd-php from mail.alsterph.com"

    Aside from those configurations indicated in the article there were no other configuration entries I have added. Only those configuration regarding IP Adresses.

    This is the entry for libphp4.so inside my httpd.conf

    LoadModule php4_module modules/libphp4.so

    When I when I try to locate libphp4.so, it says:

    [root@mail modules]# locate libphp4.so
    /usr/lib/httpd/modules/libphp4.so

    I understand this is a link to /etc/httpd/modules/ so assume this is normal.

    What else should I do?

  4. #4
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    couple of things:
    1) sometimes people endup having apache installed more than once, eg, it was installed with your distro but you didnt know about it. - run:
    Code:
    locate httpd.conf
    - you *should* have 2 of these on your system, 1 will be in the source directory where you upziped the apache source code, the other will be in the conf/ directory of your apache root (you will have specified this on the ./configure line when compiling apache).

    If you have more, then you may be starting one version of apache which is reading one config file, but your modifying the other. - Recommended solution: remove both, start again from source. Chances are its just an RPM that will need removing, and wipe the dir you specified as --prefix= on the apache ./configure line. (providing it wasnt /usr/local/bin or another gen linux dir)


    Failing that:
    ensure that after editing your apache config file, you are 100% stoping apache. Ie, "apachectrl stop" then "apachectrl start". of course, an even better way is "killall httpd" then "/<prefixdir>/apachectrl start" to be 100% sure.

    In your httpd.conf file, your line "AddType application/x-httpd-php .php" - try taking this out of the if block, place it independantly.

    If that fails, remove apache/php totally and start from scratch.

    Follow the instructions here:
    http://www.php.net/manual/en/install.apache2.php
    An important modification i would make to them:
    when you ./configure apache, set --prefix=/usr/local/apache2 as well. make install apache. after than, cd to /usr/local/ and create a symlink between /usr/local/apache/ and /usr/local/apache2/. then proceed to ./configure php, checking your --with-apxs2 is to /usr/local/apache2/bin/apxs or /usr/local/apache/bin/apxs

    Jason

  5. #5
    Just Joined!
    Join Date
    Oct 2003
    Posts
    15
    Quote Originally Posted by Jaguar
    couple of things:
    1) sometimes people endup having apache installed more than once, eg, it was installed with your distro but you didnt know about it. - run:
    Code:
    locate httpd.conf
    - you *should* have 2 of these on your system, 1 will be in the source directory where you upziped the apache source code, the other will be in the conf/ directory of your apache root (you will have specified this on the ./configure line when compiling apache).

    If you have more, then you may be starting one version of apache which is reading one config file, but your modifying the other. - Recommended solution: remove both, start again from source. Chances are its just an RPM that will need removing, and wipe the dir you specified as --prefix= on the apache ./configure line. (providing it wasnt /usr/local/bin or another gen linux dir)


    Failing that:
    ensure that after editing your apache config file, you are 100% stoping apache. Ie, "apachectrl stop" then "apachectrl start". of course, an even better way is "killall httpd" then "/<prefixdir>/apachectrl start" to be 100% sure.

    In your httpd.conf file, your line "AddType application/x-httpd-php .php" - try taking this out of the if block, place it independantly.

    If that fails, remove apache/php totally and start from scratch.

    Follow the instructions here:
    http://www.php.net/manual/en/install.apache2.php
    An important modification i would make to them:
    when you ./configure apache, set --prefix=/usr/local/apache2 as well. make install apache. after than, cd to /usr/local/ and create a symlink between /usr/local/apache/ and /usr/local/apache2/. then proceed to ./configure php, checking your --with-apxs2 is to /usr/local/apache2/bin/apxs or /usr/local/apache/bin/apxs

    Jason
    Thanks for your help i recompile my apache with php4.3.3 and now it's working.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •