Author Topic: 500 Internal Server Error  (Read 3931 times)

mrsdonovan

  • Newbie
  • *
  • Posts: 5
500 Internal Server Error
« on: October 10, 2007, 07:04:16 pm »
I am running CalemEAM on a commercial webserver under LAMP.

The env.sh, setup.sh and all the database scripts have successfully run, which is apparent from the calem.log and the DB has 117 tables.  However, when I attempt to hit the front page for the first time, I get a "500 Internal Server Error" and the calem.log reports each time I try refreshing the page:

2007-10-10 17:47:22,003 DEBUG main - sid=; aid=, Post data:
2007-10-10 17:47:22,003 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=

I have set the permissions of all the files to 777 but it didn't make any difference.

Clues to the problem?

Sean.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
500 Internal Server Error
« Reply #1 on: October 10, 2007, 10:20:05 pm »
Take a look at the server and php error logs. There might be errors in those logs.
Calem Community Forum Admin

mrsdonovan

  • Newbie
  • *
  • Posts: 5
500 Internal Server Error
« Reply #2 on: October 11, 2007, 08:36:06 am »
Lots of these:

[Wed Oct 10 18:20:16 2007] [error] [client 70.74.27.208] malformed header from script. Bad header=Cache-Control: php5.cgi

I think the problem is that php is running in "CGI mode" for permissions purposes.   Any way around that?
 
Sean.

mrsdonovan

  • Newbie
  • *
  • Posts: 5
500 Internal Server Error
« Reply #3 on: October 11, 2007, 09:23:20 am »
I think I figured out at least part of the problem.  When I run index.php with this command:

/usr/local/php5/bin/php index.php

All the URLs in the resulting HTML file are messed up, i.e.

//Set the url
calemRootUrl='http:///CalemEAM';
calemRequestUrl='http:///CalemEAM/index.php';
calemSoapUrl='http:///CalemEAM/CalemSoapService.php';


Those are not going to work...  If I had the wrong permissions when running setup.sh, would that cause that sort of problem?

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
500 Internal Server Error
« Reply #4 on: October 11, 2007, 10:38:49 am »
I don't think setup.sh will cause the calemRootUrl malformat. Review CalemEAM/server/conf/calem.custom.php and compare with calem.custom.sample.php.

Per http://support.positive-internet.com/php.php, some configuration will be necessary to run PHP in CGI mode. CalemEAM does not seem to be configured to work with CGI mode PHP. Is running PHP as a module of Apache an option to you?
Quote
[Wed Oct 10 18:20:16 2007] [error] [client 70.74.27.208] malformed header from script. Bad header=Cache-Control: php5.cgi
Calem Community Forum Admin

mrsdonovan

  • Newbie
  • *
  • Posts: 5
500 Internal Server Error
« Reply #5 on: October 11, 2007, 01:13:51 pm »
Hmm, I tried it on two other servers.  

The first one also ran PHP in CGI mode and I got the same thing "500 Internal Server Error", although the server didn't report similar errors, log/calem.log did :

2007-10-11 13:52:09,988 DEBUG main - sid=; aid=, Post data:
2007-10-11 13:52:09,988 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=

Which is obviously missing the sid and aid data.

(FYI - You can tell PHP is running in CGI mode because phpinfo.php reports "Server API  CGI")

The second server runs PHP as an apache module but all it produced was a blank screen.  Even stranger, there were no errors in the server's logs or in calem.log.  I knew something was wrong when running "PHP createSchema.php" from the command line did nothing (I ended up copying the DB over from another test installation)

All three servers I tried are running LAMP, php5, have PDO, all the chart includes and 755 as the permissions of all the files.  

I think the author needs to take CalemEAM and make sure it works on a variety of linux production servers before it will get wide spread use.

mrsdonovan

  • Newbie
  • *
  • Posts: 5
500 Internal Server Error
« Reply #6 on: October 11, 2007, 01:30:03 pm »
And since I'm flinging out suggestions,

- I suggest the database setup is just a gzipped SQL file ready to import.  Most production webservers don't give access to the command line and it is a lot easier to import a 12kb SQL file then running three bash scripts.  Most other PHP/MYSQL scripts provide blank DB files and access to the database is readily available through phpMyAdmin.
- The env.sh file also needs to be documented better, because it is uber important to get everything started.  Try something like this:

# HOME_DIR is the root location of your website.  In windows that is /opt/lampp
# and in linux either /var/www/html if you have root access, or /home/<username>/www on a production server
HOME_DIR=/opt/lampp

# This is the location of your php exe file and on linux is usually /usr/local/bin
PHP_EXE=$HOME_DIR/bin/php

# This is the location of your CalemEAM root directory and could also be /$HOME_DIR/CaleamEAM
CALEM_HOME=$HOME_DIR/htdocs/CalemEAM

#exports the above
export CALEM_DIR=$CALEM_HOME/

- Make separate windows and Linux distributions.  Having extra .bat and .dll or .sh files all over the place is a waste.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
500 Internal Server Error
« Reply #7 on: October 11, 2007, 08:12:53 pm »
Thank you for the suggestions. We have created issues to track some of them. We will further evaluate your other suggestions.

http://www.calemeam.com/apps/mantis/view.php?id=59 (DB scripts to ship)
http://www.calemeam.com/apps/mantis/view.php?id=60 (Make your comments into the source code).

Back to the setup on the server with PHP as Apache module, when you copied the database over, we still need to run 'deploy.sh' under CalemEAM/bin to complete the setup. 'deploy.sh' will initialize the system for use. When this is done you may try log in again.
Calem Community Forum Admin