Forums / Installing on a Linux/Unix Server / Help Troubleshoot CHROOT setup

Help Troubleshoot CHROOT setup

Started by jnorell on 25 Aug 2011, 7:26 PM · Views: 3,404

Results 1 to 8 of 8
25 Aug 2011, 7:26 PM
#1
jnorell avatar

jnorell

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
0

Help Troubleshoot CHROOT setup

Hello,

I'm trying to setup a zen-cart instance in a chroot environment, and am having a problem with the admin interface - it goes into a redirect loop (login.php) when I try to open the index.

I've checked both configure.php settings and they're correct as best I can tell, and I've checked all the file/directory permissions to the best of my ability. I've found a few posts with the same redirect loop error (which actually comes from my browser, chromium) of "This webpage has a redirect loop" ... "Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects." I've tried all the suggestions I could find on those, but no luck so far.

This chroot setup uses sbox, to check/enhance security and do the chroot. Any pointers to try/check?

Thanks,
Jesse Norell

  • Hosting platform is a debian squeeze server running dtc control panel - I had the site setup under a mod_php security mode and that worked - I then changed the site to sbox_aufs for better security, and am trying to set it up (from scratch - 100% complete reinstall).

  • using zen-cart-v1.3.9h-full-fileset-10262010.zip with no addons, just trying an initial install.

  • I added enable_error_logging.php to admin/includes/extra_configures/ but I don't get any debugging files in the cache directory.

25 Aug 2011, 9:09 PM
#2
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

  1. If you use a browser other than Google Chrome what happens?
  2. Debian has its own rules regarding mod rewrite. It is not an Apache server and does not support standard .htaccess commands.

Vger

26 Aug 2011, 2:41 AM
#3
jnorell avatar

jnorell

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

Vger:

  1. If you use a browser other than Google Chrome what happens?
    Vger

Same problem, a little variation on the message. Eg. Iceweasel prints:

The page isn't redirecting properly

Iceweasel has detected that the server is redirecting the request for this address in a way that will never complete.

*   This problem can sometimes be caused by disabling or refusing to accept cookies.

Tracing the http, my browser is sending requests like:

GET /myadmin/login.php?zenAdminID=2f01583b5bapjs8o7f52bv2sv1 HTTP/1.1

And I get a reply like:

HTTP/1.1 302 Moved Temporarily.
Date: Fri, 26 Aug 2011 02:37:27 GMT.
Server: Apache/2.x.x.
X-Powered-By: PHP/5.3.3-7+squeeze3.
Expires: Thu, 19 Nov 1981 08:52:00 GMT.
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0.
Pragma: no-cache.
Set-Cookie: zenAdminID=eagc7q94p5j6nachrd73e3la93; path=/cgi-bin; domain=.www.domain.com; HttpOnly.
Location: http://www.domain.com/myadmin/login.php?zenAdminID=eagc7q94p5j6nachrd73e3la93.
Vary: Accept-Encoding.
Content-Encoding: gzip.
Content-Length: 20.
Keep-Alive: timeout=15, max=83.
Connection: Keep-Alive.
Content-Type: text/html; charset=iso-8859-1.
.

And that just repeats till the browser gives up.

Vger:

  1. Debian has its own rules regarding mod rewrite. It is not an Apache server and does not support standard .htaccess commands.
    Vger

Hmm... it is running Apache 2.2.16. I've used .htaccess files without problems previously, and I typically use the Apache foundation's documentation, including for mod_rewrite (which doesn't look to be used in any of zen-cart's .htaccess files that I see).

DTC does most of the vhost apache config, including the sbox chroot environment .. just trying to figure out what needs to match up/change between the chroot and actual environment.

Thanks...

26 Aug 2011, 8:55 AM
#4
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

Okay, can you try using either IE, Firefox, Opera or Safari as the browser - and make sure that whatever browser you use will allow cookies? Also make sure to turn gzip off for Zen Cart, even if this means doing it via the db in phpMyAdmin.

Vger

26 Aug 2011, 6:56 PM
#5
jnorell avatar

jnorell

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

Vger:

Okay, can you try using either IE, Firefox, Opera or Safari as the browser - and make sure that whatever browser you use will allow cookies?

I tried Firefox, and it's the exact error as IceWeasel gives (just change "Iceweasel" to "Firefox" in the error text).

The browsers do allow cookies, and both worked with zen-cart before I started this chroot setup.

Vger:

Also make sure to turn gzip off for Zen Cart, even if this means doing it via the db in phpMyAdmin.

Vger

I'll drop the database and run through another install when I get a chance, but I think this means gzip is disabled:

mysql> select * from configuration where configuration_key = 'GZIP_LEVEL';
+------------------+-------------------------+-------------------+---------------------+---------------------------+------------------------+------------+---------------+---------------------+--------------+----------------------------------------+
| configuration_id | configuration_title | configuration_key | configuration_value | configuration_description | configuration_group_id | sort_order | last_modified | date_added | use_function | set_function |
+------------------+-------------------------+-------------------+---------------------+---------------------------+------------------------+------------+---------------+---------------------+--------------+----------------------------------------+
| 298 | Enable GZip Compression | GZIP_LEVEL | 0 | 0= off 1= on | 14 | 1 | NULL | 2011-08-23 13:04:12 | NULL | zen_cfg_select_option(array('0', '1'), |
+------------------+-------------------------+-------------------+---------------------+---------------------------+------------------------+------------+---------------+---------------------+--------------+----------------------------------------+
1 row in set (0.00 sec)

Or do you mean the "Content-Encoding: gzip" in http? I'll have to look into disabling that.

I'll note that each redirect has a different zenAdminID value, would it seem that zen-cart is having a problem storing that on the server for a subsequent lookup/match?

I'll keep looking at the cookies too, and compare to a working site.

Thanks!

26 Aug 2011, 7:34 PM
#6
jnorell avatar

jnorell

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

Hey, I found one issue with the cookie - the path was wrong, set to /cgi-bin/ (which incidentally is the path to sbox), so I put this in admin/includes/configure.php:

define('CUSTOM_COOKIE_PATH', DIR_WS_ADMIN);

And now my browser is sending a cookie back with its HTTP requests. Still in a redirect loop with login.php (which is no longer trying to set a cookie), but I think that's progress. I'm out of time at the moment, I'll keep working on it later.

My current HTTP GET and reply is:

GET /my_admin/login.php HTTP/1.1.
Host: https://www.domain.com.
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0.
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8.
Accept-Language: en-us,en;q=0.5.
Accept-Encoding: gzip, deflate.
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7.
Connection: keep-alive.
Cookie: zenAdminID=s3ffsbmj5hs7p737d4gs3sv0c3.

HTTP/1.1 302 Moved Temporarily.
Date: Fri, 26 Aug 2011 19:25:51 GMT.
Server: Apache/2.x.x.
X-Powered-By: PHP/5.3.3-7+squeeze3.
Expires: Thu, 19 Nov 1981 08:52:00 GMT.
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0.
Pragma: no-cache.
Location: http://www.domain.com/my_admin/login.php.
Vary: Accept-Encoding.
Content-Encoding: gzip.
Content-Length: 20.
Keep-Alive: timeout=15, max=83.
Connection: Keep-Alive.
Content-Type: text/html; charset=iso-8859-1.
.
....................

12 Sep 2011, 3:48 PM
#7
jnorell avatar

jnorell

New Zenner

Join Date:
Aug 2011
Posts:
5
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

Just a follow-up on this issue, the problem was the environment variables coming out of the sbox setup; there'll be a fixed sbox version out soon (looks like it'll be 1.11.6-1), but the latest git versions have it working (as of commit ded0000592 in gplhost.com sbox repo).

For anyone needing a webhosting control panel, I'll say this setup looks very nice, using the dtc package with the sbox_aufs security mode. You get a nice chroot separation for all your accounts. (Note, I'm just an end user, not selling anything, it's all free software.)

24 Jan 2013, 9:56 PM
#8
timbojrjr1 avatar

timbojrjr1

New Zenner

Join Date:
Oct 2012
Posts:
23
Plugin Contributions:
0

Re: Help Troubleshoot CHROOT setup

I had this problem because of seo url's. I changed it to false and everything works now.