OwnCloud and Zpanel

I have messed around with OwnCloud several times in the past.  My latest experimentation with it coincided with a need that my clients have run into several times.  That would be affordable housing of their pictures.

As we all know most of the cloud companies such as Amazon, Google, and Dropbox will give you a small amount of free storage to get you hooked.  5 gigs for two out of three mentioned companies.  When you go over your limit you then must make a decision about your pictures.

  1. Do you store them offline?
  2. Do you store some offline and some online?
  3. Do you use multiple free services?
  4. Do you pay for storage?

I don’t like to pay.  I’m cheap that way but I feel that the money I save from things I don’t need can be put towards things that I do need.

This is where owncloud comes in.  I could setup my own dropbox like server to sync stuff.  I could do this locally or I could do this on  a cloud server.  Especially on one that I have on 24/7.

I utilize a lot of cloud resources due to my insanely huge electrical bills. Take your electric bill and times it by 5.6 and that is how much a person would be paying where I lived.

During these tests I figured I could use my server with zpanel installed on it to test out another owncloud setup.  Prior to this I had it setup on a virtual machine on my desktop and on it’s own EC2 instance.  All worked without a hitch.

Unfortunately, that didn’t happen with zpanel.  I was constantly getting a blank screen when I clicked on anything on the user menu.  I checked the logs and came up with this message:  warning: shell_exec() has been disabled for security reasons

A little digging and I find out that this is a security issue with sushosin and it’s suppose to do that.  One can disable this security but then you have a big hole in your webserver.  I did disable the issue.  I did it by commenting out the sushosin section in the vhost file for the specific domain I was working with.  After that it worked fine.


How to setup a cron job in zPanel

ZPanel LogoYes, zPanel and not cPanel.  The open source alternative to cPanel.   Setting up a cron job in zPanel is a little more difficult than setting it up in cPanel.  Hopefully the talented folks working on the newer versions can make this process a little easier.

Recently I was in the need to transfer a web program from my cPanel server to my zPanel server.  It requires a cron job in order to run correctly.  Normally, you just click the cron job link and fill in the line in cPanel.  zPanel looks like it is the same way but there are a few peculiarities I ran into.  Let me first start off with the correct steps and then I can tell you where I ran into issues.

  1. Make sure your php file is located in the domain directory.  You can’t keep it in the main directory.  For example pcprime_org\cron.php and not \cron.php or home\cron.php
  2. Be sure to change the permissions on “/var/spool/cron” to 777.  If you installed zPanel then you would know how to change the directory permissions.  If not, then ask your webhost to change it for you.
  3. You can’t add any parameters at the end of the line.  In other words nothing after the end of the directory line.

From a poster in the zPanel forums named kotakomputer:

Re: [Cron] Your script does not appear to exist at that location…

Thanks jd1pinoy, take 2 days for me to figure it out.

For those experience this Cron issue, here are the summaries:

  1. make sure /var/spool/cron owned by apache:apache and permissions 770
  2. make sure /var/spool/cron/apache owned by apache:apache and permissions 660
  3. the right Script path is: your_domain_com/CRONFILE.php or your_domain_com/SUBFOLDER/SUBFOLDER/CRONFILE.php

Example for WHMCS Script path is: your_domain_com/admin/cron.php

I didn’t follow his instructions but I think it is very similar to what I have written.  I kept getting this error message “your script does not appear to exist at this location.  I tried so many variations that I was beginning to forget which ones I had already tried.  At some point I got another error message which led me to finding this info.  I managed to not have the php file in the right location – this also required me to delete and reinstall everything in my domain directory and I didn’t have permissions set properly.  I just don’t know enough to know why all these steps were needed in the first place then again I have been quite satisfied with zpanel thus far.

I am putting this information here like I do many other posts – to make it easier to find if someone else runs into a similar situation or I run into the same situation and can’t remember the fix.
Updated: 9/17/2013
I updated zpanel to 10.1.0 over the weekend.  It must have broken my cron jobs because I have not gotten them to work since.  When I figure out the problem I will report back.
Update 2 on 9/17/2013
I think everything is back to normal.  I think the permissions on the /var/spool/cron got changed during the install process.  Once I chmod -R on the folder it LOOKS like the cron is working again.  My next job isn’t scheduled till tomorrow.
Update 3 on 9/18/2013
It didn’t work.