Okay, I have a PHP file in the CGI-BIN directory in a client account. I used the ISPConfig panel to setup a cron job, and I typed in the following command: /usr/bin/php /var/www/clients/client2/web3/cgi-bin/test.php the command is shown in syslog: (web3) CMD (/usr/bin/php /var/www/clients/client2/web3/cgi-bin/test.php #domain.com) (CRON) Error (grandchild ###### exited with exit status 17) ISPConfig runs with jailed client accounts. Is there any chance to be able to add cron jobs via ISPConfig panel or will I always have to use the root account to add them via SSH with crontab ?
Why did you put a .php file in cgi-bin? If you want to run a php file with cron, put it in the web directory and then enter http://yourdomain.rld/test.php in the command field of the cronjob in ispconfig.
But when you put it in cgi-bin, your visitor can run it as well. If you dont want it to be accessible by the visitor, then you have to put it e.g into the private folder. You have these options: 1) Put the script in the web folder and run it by http://.... URL cron. As protection you can e.g. add a get parameter that only you know e.g.: http://yourdomain.rld/test.php?secret=12345 ain in your script add the line: if($_GET['secret'] != '12345') die('direct access not allowed'); 2) Set the cron to "Full cron" in client settings before you create the cronjob and put the script into the private folder and use the cron command: /usr/bin/php /var/www/clients/client2/web3/private/test.php 3) Set the cron type to jailed cron in client settings, then create the cronjob as in 2) and add php to the jail wth jk_cp command, so that /usr/bin/php command exists inside the jail.
thanks for the tips! one thing I would really like to know however, is how a HTTP visitor can run a script that is inside the cgi-bin directory and therefore not reachable by brower?
As soon as you enable cgi support, then the cgi- bin directory is reachable trough the website by http.
I don't have CGI support active, but how would http access work? can you inform about the URL? http://domain.com/ ... ? does it get mapped? like http://domain.com/cgi-bin ? I'm clueless
You can simply make the script not accessible on webpage by .htaccess file like this: <Files cron.php> Order Deny,Allow Deny from All </Files>
Thank you. I got a feeling the CRON jobs are still an area of ispconfig that could use some more clarity and hand-holding