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)
-   -   Magento Commerce with Fast-CGI and suExec (http://www.howtoforge.com/forums/showthread.php?t=34035)

doughold 22nd April 2009 20:52

Magento Commerce with Fast-CGI and suExec
 
I have been able to sucessfully install the platform and can access the homepage and user front end just fine. However, when I try to log in to the back end I am getting a 500 internal error message. This is from the users log file:

Code:

[Wed Apr 22 14:30:14 2009] [warn] mod_fcgid: read data timeout in 40 seconds
[Wed Apr 22 14:30:14 2009] [error] [client <MY IP>] Premature end of script headers: index.php

This is from the Apache log file:
Code:

[Wed Apr 22 14:28:54 2009] [notice] mod_fcgid: call /var/www/tt.westechsolutions.com/web/index.php with wrapper /var/www/php-fcgi-scripts/web35/.php-fcgi-starter
[Wed Apr 22 14:30:14 2009] [notice] mod_fcgid: process 1556 going graceful shutdown, sending SIGTERM
[Wed Apr 22 14:30:20 2009] [notice] mod_fcgid: process /var/www/tt.westechsolutions.com/web/index.php(1571) exit(communication error), terminated by calling exit(), return code: 0

This is my .htaccess file:
Code:

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#  Options -MultiViews

## you might also need to add this line to php.ini
##    cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

#    php_value memory_limit 64M
    php_value memory_limit 128M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

    php_flag session.auto_start off

############################################
## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

    php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    ###SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # Don't compress images
    #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    AddDefaultCharset Off
    #AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

    Order allow,deny
    Allow from all

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none

It seems very strange to me that the main site works and the admin section doesn't. Although I feel like it might have something to do with the rewrites that the .htaccess file does. I am not very familiar with FCGI/SuEXEC yet so bear with me if I missed something obvious.

till 23rd April 2009 10:47

Are there any additional errors in the error.log file which is located in the log directory of this specific website?

doughold 23rd April 2009 16:09

Unfortunately there is nothing else in the log that shows up when the script fails. I've read in a few places that SuExec doesn't work with php directives in the .htaccess file, so I had commented those out but it didn't help.

falko 24th April 2009 15:26

What happens when you completely remove the .htaccess file?

What's in /var/www/php-fcgi-scripts/web35/.php-fcgi-starter?

doughold 24th April 2009 16:07

I get a 404 error when I got to /admin b/c it was using url rewrites and that directory doesn't exist.

My .php-fcgi-starter is:
Code:

#!/bin/sh
PHPRC="/etc/php5/cgi/"
export PHPRC
PHP_DOCUMENT_ROOT="/var/clients/client10/web35"
export PHP_DOCUMENT_ROOT
PHP_FCGI_CHILDREN=8
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi $1


falko 25th April 2009 11:50

What's the output of
Code:

ls -la /var/clients/client10/web35/
?
What's the output of
Code:

ls -l /usr/bin/php-cgi
?

Have you tried to restart Apache?

doughold 26th April 2009 00:26

Code:

drwxr-xr-x  6 root  root    4096 2009-04-22 14:20 .
drwxr-xr-x  3 root  root    4096 2009-04-15 20:15 ..
drwxr-xr-x  2 web35 client10 4096 2009-04-22 15:19 cgi-bin
lrwxrwxrwx  1 web35 client10  48 2009-04-15 20:15 log -> /var/log/ispconfig/httpd/tt.westechsolutions.com
-rw-r--r--  1 web35 client10  751 2009-04-22 18:19 php.ini
drwxr-xr-x  2 web35 client10 4096 2009-04-15 20:15 ssl
drwxrwxrwx  2 web35 client10 4096 2009-04-15 20:15 tmp
drwxr-xr-x 14 web35 client10 4096 2009-04-24 10:06 web

Code:

root@ispconfig3:~# ls -la /usr/bin/php-cgi
lrwxrwxrwx 1 root root 25 2008-09-21 09:08 /usr/bin/php-cgi -> /etc/alternatives/php-cgi


falko 26th April 2009 13:32

Have you tried to restart Apache?

If that doesn't help, try this:
Code:

chown web35:client10 /var/clients/client10/web35

doughold 28th April 2009 00:45

I have restarted apache (and even the whole server) and it didn't help. Additionally, I ran the code you suggested and that didn't help either. I also ran:

Code:

root@ispconfig3:~# chown web35:client10 /var/clients/client10/web35
root@ispconfig3:~# chown -R web35:client10 /var/clients/client10/web35/web
root@ispconfig3:~# chmod -R 755 /var/clients/client10/web35/web

To make sure all files were rwx by the web35 user. This didn't help either.

falko 28th April 2009 16:47

Hm, I have no idea what's wrong... :(


All times are GMT +2. The time now is 08:01.

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