On Fri, 2011-01-14 at 22:10 -0500, Mark Shields wrote: > On Fri, Jan 14, 2011 at 9:57 PM, Michael Sullivan > <[email protected]> wrote: > > On Fri, 2011-01-14 at 21:24 -0500, Mark Shields wrote: > > On Thu, Jan 13, 2011 at 9:01 PM, Michael Sullivan > > <[email protected]> wrote: > > A several years ago I ran a public network out of my > > apartment. I had > > email, www, etc. etc. It all worked fine. Then one > day a > > couple of > > years ago we decided that we could not afford to pay > for a > > public IP > > address anymore, so we had it turned off. I haven't > touched > > apache > > since then, but we still run that box as it's faster > than all > > the others > > and runs distcc well. We had a picture page that I > wrote back > > in 2005 > > and occassionally when we have company over we use > it to show > > them > > pictures that we've taken. I went to the site in my > web > > browser this > > evening, and saw only PHP code printed on the > background > > image. I've > > checked the usual suspects: > > > > carter apache2 # cat /etc/conf.d/apache2 > > # /etc/conf.d/apache2: config file > for /etc/init.d/apache2 > > > > # When you install a module it is easy to activate > or > > deactivate the > > modules > > # and other features of apache using the > APACHE2_OPTS line. > > Every module > > should > > # install a configuration in /etc/apache2/modules.d. > In that > > file will > > be an > > # <IfDefine NNN> where NNN is the option to enable > that > > module. > > # Here are the options available in the default > configuration: > > # USERDIR Enables /~username mapping > > to /home/username/public_html > > # INFO Enables mod_info, a useful module for > debugging > > # PROXY Enables mod_proxy > > # DAV Enables mod_dav > > # DAV_FS Enables mod_dav_fs (you should enable > this when > > you enable > > DAV > > # unless you know what you are doing) > > # SSL Enables SSL > > # SSL_DEFAULT_VHOST Enables default vhost for SSL > (you > > should enable > > this > > # when you enable SSL unless > you know > > what you are > > doing) > > # LDAP Enables mod_ldap > > # AUTH_LDAP Enables authentication through > mod_ldap > > # DEFAULT_VHOST Enables the default virtual host > > in /var/www/localhost/htdocs > > APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D MAILMAN -D > USERDIR" > > > > # Extended options for advanced uses of Apache ONLY > > # You don't need to edit these unless you are doing > crazy > > Apache stuff > > # As not having them set correctly, or feeding in an > incorrect > > configuration > > # via them will result in Apache failing to start > > # YOU HAVE BEEN WARNED. > > > > # ServerRoot setting > > #SERVERROOT=/usr/lib/apache2 > > > > # Configuration file location > > # - If this does NOT start with a '/', then it is > treated > > relative to > > # $SERVERROOT by Apache > > #CONFIGFILE=/etc/apache2/httpd.conf > > > > # Location to log startup errors to > > # They are normally dumped to your terminal. > > #STARTUPERRORLOG="/var/log/apache2/startuperror.log" > > > > # Environment variables to keep > > # All environment variables are cleared from apache > > # Use this to preserve some of them > > # NOTE!!! It's very important that this contains > PATH > > # Also, it will fail if the _value_ of any of these > variables > > contains a > > space > > KEEPENV="PATH" > > > > carter apache2 # cat error_log > > [Tue Jan 11 03:15:22 2011] [notice] Apache/2.2.16 > (Unix) > > configured -- > > resuming normal operations > > [Wed Jan 12 03:00:12 2011] [notice] Graceful restart > > requested, doing > > restart > > [Wed Jan 12 03:00:13 2011] [notice] Apache/2.2.16 > (Unix) > > configured -- > > resuming normal operations > > [Thu Jan 13 19:24:28 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > http://carter.espersunited.com/~michael/camera/ > > [Thu Jan 13 19:43:23 2011] [notice] caught SIGTERM, > shutting > > down > > [Thu Jan 13 19:43:26 2011] [notice] Apache/2.2.16 > (Unix) > > configured -- > > resuming normal operations > > [Thu Jan 13 19:43:44 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > http://carter.espersunited.com/~michael/camera/ > > [Thu Jan 13 19:48:06 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > > http://carter.espersunited.com/~michael/camera/index.php > > [Thu Jan 13 19:49:53 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > > http://carter.espersunited.com/~michael/camera/index.php > > [Thu Jan 13 19:49:56 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > > http://carter.espersunited.com/~michael/camera/index.php > > [Thu Jan 13 19:49:59 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > > http://carter.espersunited.com/~michael/camera/index.php > > [Thu Jan 13 19:50:02 2011] [error] [client > 192.168.2.3] File > > does not > > exist: /home/michael/public_html/camera/$filename, > referer: > > > http://carter.espersunited.com/~michael/camera/index.php > > > > (that $filename reference would have resolved if PHP > were > > executed AS > > PHP instead of plain text) > > > > carter apache2 # > ls /home/michael/public_html/camera/ > > 010105 031706 050706 070707 080905 100304 > 110804 > > 121107 current > > thumbnail.php > > 010506 032008 051610 070905 081710 100507 > 111108 121210 > > current.php thumbnail.php~ > > 011305 032907 060509 071006 090205 101004 > 112004 121809 > > directory.php.bak > > 011409 042608 061608 071405 091105 101405 > 112206 122404 > > index.php > > 020705 042810 063005 072005 092208 102304 > 112504 122405 > > oldindex.html > > 022807 050307 070405 080605 100206 110604 > 120205 > > 123106 test.php > > > > > > See? There ARE files there. > > > > What am I missing here? I looked at > > > http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml > > > > and it said that the browser cache might be full, so > I closed > > the > > browser, deleted the cache directory files, and > reopened the > > browser. > > No change. Please help! > > > > > > > > > > > > Sounds like your Handlers are missing. Do you have this > file, with > > this in it? > > > > > > /etc/apache2/modules.d/70_mod_php5.conf > > <IfModule !mod_php5.c> > > LoadModule php5_module modules/libphp5.so > > AddHandler application/x-httpd-php .php .php5 .phtml > > AddHandler application/x-httpd-php-source .phps > > DirectoryIndex index.php index.phtml > > > > > > > > > > - Mark Shields > > > carter ~ # cat /etc/apache2/modules.d/70_mod_php5.conf > <IfDefine PHP5> > # Load the module first > <IfModule !mod_php5.c> > LoadModule php5_module modules/libphp5.so > > </IfModule> > > # Set it to handle the files > <IfModule mod_mime.c> > AddHandler > application/x-httpd-php .php .php5 .phtml > AddHandler application/x-httpd-php-source .phps > > </IfModule> > > DirectoryIndex index.php index.phtml > > </IfDefine> > > > Is there a way for me to test if the file is even being > loaded? > > > > I'm not sure. Maybe you can find out more info by turning up the > level of logging on Apache: > > > # sed -i 's/LogLevel warn/LogLevel > info/g' /etc/apache2/modules.d/00_default_settings.conf > # /etc/init.d/apache2 restart > > > then: > > > # tail -f /var/log/apache2/error_log > > > And try a php page > > > OR > > > try a php page then > > > # grep -i php /var/log/apache2/error_log
I deleted my error_log (after executing the above sed line), restarted apache, and tried to load my php page, first by IP address, then by hostname: carter apache2 # cat error_log [Fri Jan 14 21:23:54 2011] [info] mod_unique_id: using ip addr 192.168.2.2 [Fri Jan 14 21:23:55 2011] [info] mod_unique_id: using ip addr 192.168.2.2 [Fri Jan 14 21:23:56 2011] [notice] Apache/2.2.16 (Unix) configured -- resuming normal operations [Fri Jan 14 21:23:56 2011] [info] Server built: Jan 13 2011 19:42:02 [Fri Jan 14 21:24:41 2011] [error] [client 192.168.2.3] File does not exist: /home/michael/public_html/camera/$filename, referer: http://192.168.2.2/~michael/camera/index.php [Fri Jan 14 21:27:34 2011] [error] [client 192.168.2.3] File does not exist: /home/michael/public_html/camera/$filename, referer: http://carter.espersunited.com/~michael/camera/index.php And I apologize if I'm sending multiple copies of the same reply; evolution is being stupid, and since I don't get my own posts back, when evolution offers me a chance to restore a message that I thought I had sent earlier, I assume it didn't actually send it, and I send it again...

