Setting Up External Cronjob for Authorize.net CIM on Dreamhost

Discussion in 'Payment Systems' started by underwear, Apr 17, 2012.

  1. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Hi there.

    I'm not familiar with Dreamhost and the tutorial that you guys put together for us is via HostGator. Which I am. I'm trying to set up the authorize.net CIM correctly and confused as hell as how to do it right in Dreamhost. Do you have a tutorial or instructions for us folks in this situation with those fine people at Dreamhost? Their support stinks. And it is very hard to know what to do without spending a lot of time trying to decode their documentation. It would really help me out if you could give me some clear and concise instructions.

    Just to be clear - my billing/membership is recurring so I do need to external Cronjob.

    Any help would be greatly appreciated.

    Bryan. (aka; the underwear guy)
    http://underwearsociety.com
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Bryan,
    If you have issues with cron job setup on your hosting Control panel, set cron job from your amember.com account.
    It is more easy, you just need to specify your cron job url.
  3. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Alexander,

    I did set cron job from my amember.com account but wasn't sure if this was technically an external cron job or internal. Like I even know what that means, entirely. As I'm sure you know in order to use Authorize.net's CIM I need to be running an external cron job. When setting it up through my amember.com account . . . this is an external cron job as well?
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes correct :) This is external cron job.
  5. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Great. However, I'm still getting the red 'It has been more than 24 hours . . . .cron job not configured properly. . . serious problems with your script' message. Do you have any idea why I am still getting this? Is it my current version of aMember PRO? Or do I need to leave 'use external Cron Job' unchecked because we went the 'setting it up through my aMember account' route?
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    What happens when you try to open cron job url from your browser?
  7. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Hey, Alexander.

    So, I finally got a response from DreamHost as to what was going on and how to set it up.

    My problem was that I didn't set my account to allow for Shell access. Must be done with Dreamhost. After that was set, the rest of the configuration was a snap.

    We'll see if it runs correctly. If you don't hear from me tomorrow that means that all is well.

    To allow for Shell access:

    Log into your control panel, click manage users, and find your database's username. Click 'edit user'.

    Then click the button next to "shell account" and save the changes.

    To set your Cronjob:

    Once this is done you can set up a cron job by clicking 'Goodies' then selecting 'Cron job'.

    Make sure your username is selected in the top field.

    Give the Cronjob a name for you to reference it by. No worries about special characters or limitations. Just a reference title.

    The next field is going to ask you for 'the command line'. Enter this command provided by aMember (and be sure to insert your url):

    Code:
    /usr/local/bin/wget -o/dev/null -O- http://yoursite.com/amember/cron
    
    After that you are going to have to select 'custom' from the drop down menu for the 'Minutes' setting. Select '00'.

    After that, all the other settings are already set to the correct default 'everyday' settings.

    Press save and voila. You're done.
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Ok. Thanks for the update!
  9. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Ok. We received a report from Dreamhost but the last line of it reads:

    What is the startfile? And does it have something to do with the fact that we are using https for all of our aMember files? Or does that have no effect because when I plug the path as a regular http: url in my browser the page lists, blank but adjusts to https?
  10. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    You should then change URL in the cronjob to https too.

    I will explain shortly what the cronjob does: it just loads given URL every hour. You could simply open that URL every hour in your browser, and it would be the same, but of course that would be little painful to do that every hour 24/7 :)
  11. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Ah-so, Master Alex. :)

    Thanks for your patience. I'll change that bad boy in my members area then, right? As well as within Dreamhost. Yes?
  12. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    No, there must be only ONE cron job set. It is specially serious in your case (with Auth.Net CIM) as customers may be double-billed. Delete cron job either on Dreamhost or on aMember website side.
  13. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    Got it. Thank you for the clarification.
  14. underwear

    underwear Member

    Joined:
    Feb 6, 2012
    Messages:
    46
    One last thing . . . we were getting this error:

    lynx: Can't access startfile https://underwearsociety.com/amember/cron

    This is because we were using a self signed certificate. And, as they DreamHost people explained:

    'this command is failing because lynx has no method that I'm aware of of auto-accepting the cert when it encounters an issue with the certificate's issuer'

    This is different then connecting via https. It is the certificate itself. In order to fix the error I was advised to use the following command line:

    /usr/bin/curl -k https://underwearsociety.com/amember/cron

    This command accesses the startfile and completes without error.

    -Hope that helps anybody else trying to set up their external cronjob on Dreamhost in conjunction with the Authorize.net CIM service/plugin.

    It's been a hoot.
  15. mcfiddish

    mcfiddish New Member

    Joined:
    Aug 20, 2011
    Messages:
    5
    Thank you for this! I just moved my site over to Dreamhost because my previous host (Site5) support went seriously downhill. I had the same issue with lynx and changed the cron job to use curl instead.
    ksing likes this.

Share This Page