handling subdirectories location

Francis Daly francis at daoine.org
Wed Jun 10 21:37:38 UTC 2015


On Wed, Jun 10, 2015 at 05:00:56PM -0300, Thiago Farina wrote:
> On Mon, Jun 8, 2015 at 9:59 PM, Francis Daly <francis at daoine.org> wrote:

Hi there,

> OK. Based on your response I will hold on on what I was trying to do for now.
> 
> It seems it is not the way I should go.

Ok.

I was intrigued to see what was happening, so I fetched the gocart zip
file, extracted it to /usr/local/nginx, did

  mv gocart-GoCart-324eccb gc

and looked in the "gc" directory. There seems to be one main php file
which is intended to handle everything, so I added the following to
nginx.conf:

==
  include fastcgi.conf;
  index index.php index.html;
  location ^~ /gc/ {
    root .;
    error_page 404 = /gc/index.php;
    location = /gc/index.php {
      fastcgi_pass unix:php.sock;
    }
  }
==

reloaded nginx.conf, then pointed my browser at http://localhost:8000/gc/

I see a page which asks for database details in order to do an
installation; I give the details and I see that 29 tables are added in
my database before I get the http response content of

"""
Fatal error: Call to undefined function locale_get_default() in
/usr/local/nginx/gc/gocart/migrations/003_gocart2_3.php on line 252
"""

Rather than solve it properly, I edit that line of that file to hard-code
a valid locale, and go back to the /gc/ url. It invites me to login and
says my cart is empty. The "login" page invites me to log in, or register,
and has a "forgot password" link. All links seem to do something useful.

Now there are also ".htaccess" files below the directory "gc", which say
"Deny from all"; so presumably this nginx config will allow some files
be fetched that the gocart authors would prefer not be fetched -- extra
config will be needed to cater for those.

But, unless I'm missing something, it looks like it is working, to the
extent that "things that should succeed do succeed".

If you're still willing to test, does that work for you?

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list