No announcement yet.

Nginx setup without fastcgi

  • Filter
  • Time
  • Show
Clear All
new posts

    Nginx setup without fastcgi

    I'm working on a site that uses the fastcgi setup on a self-hosted nginx server. It was originally set up following instructions on this forum thread: so the setup is very similar. For example the nginx site config has:

    location ~ \.mvc$ {
       fastcgi_read_timeout    300;
       fastcgi_pass  ;
       fastcgi_param           MvCONFIG_LIBRARY /var/www/sites/;
       include                 fastcgi_params;
    and mivavm is started via a command like this:

    /usr/bin/spawn-fcgi -p 8005 -n -- /var/www/sites/ &
    The mivavm itself was from the fastcgi version from the Miva downloads page:

    All of that worked fine up until mivavm 5.33 - unfortunately it's compiled for centos7, but the server I'm working on is centos6 and there's no fastcgi mivavm available. So we have to switch from fastcgi to something else. I'm not a server admin so I don't really know what the something else is.

    I spoke to Miva support and they told me to use the Linux x64 download, which I did, but as expected, the attempt to run mivavm via the above command fails (it says it can't find/load, so I had to revert back to the 5.32 fastcgi setup.

    Has anyone gotten a non-fastcgi nginx setup running on nginx? If so can you give me some steps for how to switch? My thinking is that:

    A) I have to modify the .mvc block in the site config, because everything there is regarding fastcgi
    B) I have to modify the command I'm using to run mivavm, because that's also fastcgi

    The cgi-bin folder is pretty much ready to go with the new 5.33 files, I just don't know how to make them work

    Miva Empresa is produced in CGI and FastCGI formats. The FastCGI only came to exist a couple years ago, so most of the documentation for the 22 preceding years will be geared towards CGI. If I remember correctly, Nginx does not have a method to serve CGI requests, as it's intended to be used in a scenario where it serves static content, or where the handing of dynamic page generation requests falls to some other handler which takes over from there, whether that be a PHP FPM daemon, other FastCGI scripts running under some launcher / process manager, and same for Empresa, etc. To move to CGI, something has to step in for the handling of those requests; in our environment we use Apache for that role due to nearly universal use of htaccess rewrites by our customers, although no rewrites, no Apache, and nginx+FastCGI with URI management would be the optimal config for performance.

    If you're on CentOS 6, I'd have to think you had been running CGI in the past, as there'd be no reason to ever deploy a CentOS 6 server after the time Empresa FastCGI came to exist, so perhaps the old configs are still on it somewhere.

    In any case, your easiest route may be to just install the CentOS 6 apache, set up the same site listening on localhost, set up CGI support (i.e. ScriptAlias), and proxy the Miva Merchant requests back to it. That's well beyond the scope of just a few lines in a forum post though; it would really require your system administrator to configure and deploy.
    David Hubbard
    [email protected]


      To add onto this, we had to move onto CentOS 7 due to file locking limitations on older versions.
      David Carver
      Miva, Inc. | Software Developer


        Thank you both! Actually this server was set up from scratch for us maybe 3 or 4 years ago specifically so we could run Miva on nginx. Not sure why centos6 was chosen at the time, maybe the hosting company still favored it because they were more familiar. I didn't specify the OS in my request when they set up the server, I just knew I wanted to try nginx.

        Anyway, I did some reading about adding apache to centos6 and doing a reverse proxy with nginx/apache. Again I'm no server expert but it seemed to me like it would have worked just fine. But as it turns out our host offered to set up a centos7 server for us, so we're going that route instead (sticking with just nginx, no apache).