woocommerce api error

Discussion in 'Installation/Configuration' started by ariban99, Apr 29, 2020.

  1. ariban99

    ariban99 Member

    well i appreciate everyone trying to help me. i guess ill run this site on Hostgator that works for the api
    i even deleted my site, created a new one in ispconfig, uploaded all files using a new NON root ssh, (so no not only root can write) but still same error
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    For ssh, possibly you'd be affected by https://git.ispconfig.org/ispconfig/ispconfig3/-/issues/5614 ? But I thought the symptoms on that were to be unable to login at all, and shouldn't affect ftp. In any case, you might check the passwd file inisde your created jail and ensure the home directory field is set correctly, it can't hurt.

    If you're happy with hostgator, that's a solution today. As far as troubleshooting why your server has this issue, if you wished to, it'd definitely be easier by logging in and checking/trying things, you might consider commercial support for that. (We can continue troubleshooting here, too, though things start getting pretty in-depth and it's not as easy to do via a support forum.)
     
  3. ariban99

    ariban99 Member

    commercial support would be great, who can i contact for that?
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  5. ariban99

    ariban99 Member

    Hi
    So i contacted support and he asked me a few questions and logs and he said its not an ISPCONFIG error to fix. so i did ALOT more research and come to this site https://github.com/WP-API/Basic-Auth/issues/35
    when i add SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 to my .htacess it works perfectly.
    based on this, is there a better way to do this on a server side rather than do this in each website .htaccess file?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    That's what you were told here in the thread as well (e.g. in #25 and #28).

    Basically, you used the API without installing a supported auth handler for the API, but that's definitely something the woocommerce support should have told you that you must install a basic auth handler to use basic auth for their API. Probably you can use this one: https://de.wordpress.org/plugins/wp-rest-api-authentication/ or this one https://github.com/WP-API/Basic-Auth

    If you use this same woocommerce API on all your sites, then you can make a custom vhost template for the whole server. But if you plan to host other sites as well, then don't do that and use .htaccess or the apache directives field instead.
     
  7. ariban99

    ariban99 Member

    what is the apache directives field, and how do i use it for the above?
     
  8. ariban99

    ariban99 Member

    i found it in my site under options i simply type in there: SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    or something else has to be done?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    yes
     
  10. ariban99

    ariban99 Member

    this works, thank you! i prefer it this way incase my .htacess files changes via plugins etc...
     

Share This Page