HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   500 Internal Server error on ISPConfig w/ Shopping Cart (http://www.howtoforge.com/forums/showthread.php?t=53908)

midcarolina 25th August 2011 14:20

500 Internal Server error on ISPConfig w/ Shopping Cart
 
Hi,

The site that was on my Host Gator reseller plan is now on my own server. When folks try to check-out (PayPal integrated portal), they receive a 500 internal server error. This only happened when I moved to my server with Fedora 14 x84_64 ISPConfig 3. I contacted the theme designer (WordPress) and this was their quote:

"There is a mod_security rule that is missing that is keeping the cart button from working."

Any help would be great!

till 25th August 2011 14:27

mod_security is not installed on a ispconfig 3 system by default. So if you installed it manually and the designer told you to install a specific rule, then you should try that. If the designer ahs not send you the rule, ask him to send you the rule.

But I dont think that a 500er error is caused by mod_security. Instead you should take a look into the error.log of the website to see what the reason for the errormessage is.

midcarolina 25th August 2011 18:32

Hi Till,

I install mod_security package for Fedora 14 x86_64 first, then did a "dummy" check-out to get a better error log. Here is the outcome after the attempt:

http://hostwithsupport.com/bronze-hosting/
[Thu Aug 25 08:23:22 2011] [error] [client 70.155.163.2] PHP Warning: require(../language/.php): failed to open stream: No such file or directory in /var/www/clients/client1/web1/web/wp-content/themes/mk4/ajCart/cart.php on line 15, referer: http://hostwithsupport.com/bronze-hosting/
[Thu Aug 25 08:23:22 2011] [error] [client 70.155.163.2] PHP Fatal error: require(): Failed opening required '../language/.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/clients/client1/web1/web/wp-content/themes/mk4/ajCart/cart.php on line 15, referer: http://hostwithsupport.com/bronze-hosting/
[Thu Aug 25 08:23:22 2011] [error] [client 70.155.163.2] PHP Warning: Unknown: open(/var/lib/php/session/sess_nf4qqbjgd577hvrn2rqdg03ju0, O_RDWR) failed: Permission denied (13) in Unknown on line 0, referer: http://hostwithsupport.com/bronze-hosting/
[Thu Aug 25 08:23:22 2011] [error] [client 70.155.163.2] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0, referer: http://hostwithsupport.com/bronze-hosting/
[Thu Aug 25 08:23:22 2011] [error] [client 70.155.163.2] ModSecurity: Warning. Operator GE matched 15 at TX:outbound_anomaly_score. [file "/etc/httpd/modsecurity.d/base_rules/modsecurity_crs_60_correlation.conf"] [line "38"] [msg "Outbound Anomaly Score Exceeded (score 15): The application is not available"] [hostname "hostwithsupport.com"] [uri "/wp-content/themes/mk4/ajCart/cart.php"] [unique_id "TlY@un8AAAEAABTVK3IAAAAI"]
[Thu Aug 25 08:23:39 2011] [error] [client 178.203.174.30] PHP Warning: session_start(): open(/var/lib/php/session/sess_7eq8blaus5bfv85f4cqm1o9nn5, O_RDWR) failed: Permission denied (13) in /var/www/clients/client1/web1/web/wp-content/themes/mk4/functions.php on line 10, referer: http://clicks.thespecialsearch.com/x...ahRsEnoabBj4k=
[Thu Aug 25 08:23:39 2011] [error] [client 178.203.174.30] PHP Warning: Unknown: open(/var/lib/php/session/sess_7eq8blaus5bfv85f4cqm1o9nn5, O_RDWR) failed: Permission denied (13) in Unknown on line 0, referer: http://clicks.thespecialsearch.com/x...ahRsEnoabBj4k=
[Thu Aug 25 08:23:39 2011] [error] [client 178.203.174.30] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0, referer: http://clicks.thespecialsearch.com/x...ahRsEnoabBj4k=

Any instructions on a resolution would be welcome with open arms. The theme designer has no idea!

Thanks in advance

erosbk 25th August 2011 18:44

Run this from root:

find / -name sess_*

See where sess_ files are being saved for your client/s (location differs between clients), and see if are in the correct path.

In your log, all sess_ files are being searched in /var/lib/php/session

But, I think that ISPConfig sets another path for that (/tmp of each client). Maybe the site has a wrong value for session.save_path (it could be correct when the page was working in another hosting...)

See other answer please, I am not an expert in this... yet :P

Regards

Edit: As I see, your clients are in /var/www/clients/client1/web1/web, if you didn't change default values of ispconfig, path for sessions should be /var/www/clients/client1/web1/web/tmp... the solution should be just modify the value of the variable in the site.. you could see which file has that value with this from root:

find /var/www/clients/client1/web1/web/ -type f -exec grep -i "/var/lib/php/session" {} \; -print

It should show you every file in /var/www/clients/client1/web1/web/ that has in content "/var/lib/php/session", next, you have to edit those files to point session path to correct directory.

midcarolina 25th August 2011 21:24

This was the result of that command line:

[root@webserver ~]# find /var/www/clients/client1/web1/web/ -type f -exec grep -i "/var/lib/php/session" {} \; -print
[root@webserver ~]#

Nothing.

erosbk 25th August 2011 22:52

[Thu Aug 25 08:23:39 2011] [error] [client 178.203.174.30] PHP Warning: Unknown: open(/var/lib/php/session/sess_7eq8blaus5bfv85f4cqm1o9nn5, O_RDWR) failed: Permission denied (13) in Unknown on line 0, referer: http://clicks.thespecialsearch.com/x...ahRsEnoabBj4k=
[Thu Aug 25 08:23:39 2011] [error] [client 178.203.174.30] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0, referer: http://clicks.thespecialsearch.com/x...ahRsEnoabBj4k=

This lines are showing that your php site is trying to access in /var/lib/php/session.

Maybe you have a function ini_set changing the path, or it is being readed from a mysql database, or from a script outside of home directory of the user.

Did you search for sess_* files? did it find any to see where are being them saved? do you have only one site running on your host?


edit: you could try to find "session.save_path" this in your scripts, if your php code is changing it in real time, it could be done with ini_set... just replace the string in the previous command to search inside files.

midcarolina 26th August 2011 03:14

As you saw in my previous response, the command for sess_* files showed no results. I am sorry, but honestly I did not understand a word of the remainder of what you said. You seemed to have jumped from here to there. No clear step by step instructions were provided. While I appreciate your help greatly, in this instance, I am going to need some step by step instruction that applies specifically to Fedora 14 x86_64 and ISPConfig 3.

Thanks.

erosbk 26th August 2011 04:27

I will try to be a little more clear, please forgive my poor english.

Your site is using sessions. Session are temporary files created by the site in a directory, and read back by the site to work properly. In this case, your site is using sessions to keep user data (i.e. username, shopping cart items, etc). Every site that works with sessions, needs to know where to save this temporary files, that are named always with the prefix sess_ plus a random string (i.e. sess_7eq8blaus5bfv85f4cqm1o9nn5 in your log file).

By default, every hosting server has a pre-defined directory where to save this files (most of them)... in a default ISPConfig 3 hosting server, this place is the /tmp folder inside the client folder. In your case, sess_ files should be created in: "/var/www/clients/client1/web1/tmp".

You can change this in realtime if you want to save sess_ files in another directory, php allows you to do it with the variable: session.save_path. This is what I think is happening here. In some place, your site is forced to use a different path to save sess_ files, as you could see in the log file, your site is trying to save them in /var/lib/php/session directory. As your site has no rights to access that directory, the file is not being created. When your site try to read it, the file doesn't exist, so, it logs an error in the log file.

With the "find" functions I posted, I was trying to guide you to identify where in your site this path is being changed by your site, without success at this moment. If you can find where this value is being changed, you can modify it to point to the right directory.

Are you using the site as fast-cgi? I hope this help you to solve your problem. Again, sorry for my bad english. I think that this is what is happening to you, I am not an expert.

Toucan 28th August 2011 01:30

Like the other guys have said - data is saved to a real place on the server. Sometimes reference by a base directory.

This is written often to a config file automatically when I site is created.

You have copied the site from another server with another base directory. Hence this file path has been written wrong for the new server.

As in the previous post, something like:
/var/www/clients/client1/web1/tmp"
is used in ispconfig setup - but this will not be what was written to the config file when originally setup on the original server.

So when the site is copied to the new server the configuration files are possibly wrong.

I'd suggest having a real close look at the site's configuration files. Probably something like configuration.php and look for references to thing like 'base directrory = /whatever/etc...'

Hope this has helped rather than clouding more!

midcarolina 28th August 2011 15:02

Yes,

This helped the situation some. I changed the file path in the php.ini file. Now I am getting a white screen with no errors. The temp session files are showing up fine in the path that I set, and opening one of these sessions shows the information on what someone is trying to purchase, etc., yet the cart will not direct you to PayPal. Strange. Used to work great.


All times are GMT +2. The time now is 18:19.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.