ownCloud 8.2 on ISPconfig 3.0.5.4p9 (Apache, Debian 8, PHP7) - Cron setup

Discussion in 'ISPConfig 3 Priority Support' started by inside83, Jun 4, 2016.

  1. inside83

    inside83 Member

    Hello!

    One of my ISPconfig servers (ISPconfig 3.0.5.4p9 with Apache, Debian 8, PHP7) is running ownCloud 8.2 on one of it's domains.
    Everything works just fine.
    I just want to setup ownCloud's cron job in ISPconfig instead AJAX scheduling method.
    ownCloud's documentation states that I should call for '/var/www/owncloud/cron.php' (in my case '/var/www/clients/client1/web3/web/cron.php') as the 'default web server user (often, www-data or wwwrun)'.
    Defining Background Jobs -  ownCloud 8.2 Server Administration Manual 8.2 documen.png
    I'm confused as the owner of the files in folder '/var/www/clients/client1/web3' is 'web3' user.
    What should I put in 'Command to run (commands are executed via sh, urls via wget)' field on Cron Job page in ISPconfig?
    ISPConfig 3.0.5.4p9.png
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You should alwaysuse the fullpth to a command in cron, so the command is e.g.

    /usr/bin/php -q /var/www/clients/client1/web3/web/cron.php
     
  3. inside83

    inside83 Member

    Thank you for clarifying.
    What about the user? Should I add the cron manually (in cron.d as 'root') or via ISPconfig's interface (as 'web3')?
     
  4. inside83

    inside83 Member

    No joy.
    ownCloud.png
    Should be every 15 minutes.
    ISPConfig 3.0.5.4p9.png
    I've done as you suggested.
    WinSCP.png
    The path is correct.

    Could it be that the path to php is not '/usr/bin/php' for php7?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Check with:

    which php

    and you should check if the file /var/www/clients/client1/web3/web/cron.php is maybe a shell script and starts already with "#/usr/bin/php", in this case, you run it just with:

    /var/www/clients/client1/web3/web/cron.php

    without prepending the PHP interpreter.
     
  6. inside83

    inside83 Member

    Thank you.
    which php returns
    /usr/bin/php
    So that seams to be good path.
    This is the content of /var/www/clients/client1/web3/web/cron.php
    http://paste.ofcode.org/cSn4KJwG7kVeSb9u7ujh6A
    I understand that you are not support for ownCloud but could you, please, help me out.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The command:

    /usr/bin/php -q /var/www/clients/client1/web3/web/cron.php

    should be ok then. Please ensure that this cronjob is not jailed, it has to be a full cronjob.

    as alternative you can try if this is allowed to run from a browser, if that's the case, then just enter the url starting with http://......./cron.php in the command field of the cronjob.
     
  8. inside83

    inside83 Member

  9. inside83

    inside83 Member

    I'm not sure how to check that.
    When I switch to webcron in ownCloud and setup path in ISPconfig like this:
    https://domain.com/cron.php
    It appears that it still doesn't run (screenshot bellow)
    2016-06-07 03_05_09-ISPConfig 3.0.5.4p9.png
    But when I go to 'https://domain.com/cron.php' using browser, iz says:
    '{"status":"success"}'
    and 'Last cron job execution: seconds ago.' in ownCloud.
    So, if the cron from ISPconfig works, it should report so in ownCloud, right?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats an additional PHP version, if you want to run the cron with php 7 and not php 5, then you have to use this path. But ensure that its a full cron and not jailed cron!


    Does it work when you run:

    wget https://domain.com/cron.php

    on the shell? Or do you get an ssl certificate error?
     
  11. inside83

    inside83 Member

    wget https://domain.com/cron.php
    on shell comes up with a certificate error.
    I managed to sort it out by creating cron like this:
    Code:
    */15 * * * * root wget --no-check-certificate -O /var/log/owncloud_cron https://domain.com/cron.php
    It is 'dirty' because doamin.com is hosted on the same server but al least it works.
     
  12. Brett Wilton

    Brett Wilton Member

    Could be your server wget path under Server config under CentOS it was under /bin/wget rather than the define /usr/bin/wget
     

Share This Page