Archives

Setting up Cronjob

Set up cron job in cPanel

Here are 2 popular methods of running a cron job via cPanel.

For example:

0 0 * * * php -q /home/youraccountusername/public_html/pathtoyourfile.php

0 0 * * * wget -q -O/dev/null http://www.websiteurl.com.sg/pathtoyourfile.php

 

Step 1. Login to the cPanel.

cPanel-Login-SS

Step 2. Click on Cron Jobs under the Advanced panel.

cronjob1

Step 3. To set up a cron job:

Common Settings – commonly used time and date interval. The cPanel will give suggestions on what cron job you may want to use.

cronjob3

Minute –  This drop-down menu allows you to select the number of minutes between running the cron job, or the minute each hour on which you wish to run the cron job.
Hour – This drop-down menu allows you to select the number of hours between running the cron job, or the hour each day on which you wish to run the cron job.
Day – This drop-down menu allows you to select the number of days between running the cron job, or the day of the month on which you wish to run the cron job.
Month – This drop-down menu allows you to select the number of months between running the cron job, or the month of the year in which you wish to run the cron job.
Weekday – This drop-down menu allows you to select the day(s) of the week on which you wish to run the cron job.

cronjob2

Note: If you do not wish to receive an email notification of a specific cron job, add the following
line to the command: >/dev/null 2>&1

Step 4. Click Add New Cron Job button to save the changes.cronjob4

Configuring Amazon S3 for Cloud Storage

Before you start syncing files to S3, you need to setup con job on your server:

Please Go to Admin dashboard –> System Admin –> Tasks to get the command line that you need to setup cronjob (see screenshot). You can setup cron via cpanel or ssh. Contact your hosting if you don’t know how to do that. Normally, the command line will be “wget -qO- ‘https://domain.com/cron/task/run?key=3FSE@’ &> /dev/null . Send this command line to your hosting if you want to ask them to help you.

0711e61310dcbd53884091501fdcf7cd

Sync missing images, fonts, css and js to Amazon S3

If S3 is enabled and you find out some resources like CSS, font…are missing like the below screenshot. Please follow the below instructions to fix.

7e81c0e91d98a64c8483c4dee1583a6d

Go to admin dashboard –> System Admin –> Storage System –> Manage Storage Services. Click on “Synchronise webroot directory”, and you will see below popup.

Check Image, font, Cascading style sheets, Javascript then checking the folders under “Webroot” that you have not synced/transferred to S3 before.

For example, in the below picture you will transfer files (images, fonts, CSS and js) in “img” and “js” folder to S3

d7ed6bb137b3f6b30aa561db6b7a7018

Click OK to start Sync progress. You need to wait for a few minutes or may a few hours in case you have a lot of files that need to upload from selected folders to S3. The cronjob that you set up above will do this job so that you can close the web browser by clicking on “OK” button to sync.

Transfer data to S3: In the setting page you will see a button called “Transfer”, please click on this button if you enable S3 after the site has launched a long time ago to manually transfer all data such image, video… that uploaded by members before s3 is enabled to Amazon.

Clear caches: If you have any problems after s3 is enabled. Clear caches and then try again.

Mailing Template & SMTP Mail Settings

This article is about mooSocial’s Mailing template and how to configure the mailing system.

I/How to configure your mailing system:

e1f0e8a038b49991e7e96b1fe43dcc2d.jpg

1. Enter your From Name, ex: mooSocial

Enter your “From Address”, email address that you want the emails from the system to come from.

2. Check on Send Through SMTP server. (If you intended to use built-in mail, skip this step)

SMTP Host: enter your Host.

SMTP Username: enter your SMTP server username. Ex: http://mail.socialloft.com

SMTP Password: enter your SMTP server password.

SMTP Port: enter your SMTP server’s port. Ex: 25

3. Email Queue, 2 options, Yes to enable email queue or No to send emails immediately.

4. Choose between TLS & SSL or none of them.

5. Input numbers of emails you want to send each time Background Mail Task is running.

Then click on Save Changes button below to save all the settings.

II/ Manage Mailing Template:

You can configure Mails content that will send to users. There are many templates of emails for cases or roles.

7bf4203800d37f4f85b4464f9eed1fbb.jpg

#Mail templates manager layout.

Let’s take a look at the Templates list:

6bbeafcc77f18720771fcc2945a6db62.jpg

#Templates.

Now we take example on Welcome Mail:

First, select Welcome at Choose Email field to config, this email template is used for sending to new Members signed up.

8800231e0eb99da8c1aba9747b8451c7.jpg

#1: Select Language for the template.

#2: Emails Templates.

#3: Description of the template.

#4: Subject of the Email Template.

#5: Message to users.

#6 Save Changes button.

*In #5: Message to users[header] and [footer] are templates, they will display in your emails sent to users, you can config them by selecting Choose Emails field.

System requirements

Minimum:

  • PHP 5.3 with short tags enabled or PHP 5.4+ to PHP 7.4 (not tested with php 8 yet)
  • MySQL 5 to MysQL8
  • PHP extensions: MySql PDO, GD2, Curl, libxml, exif, zlib (if you need to export theme)
  • Magic quotes must be disabled
  • Memory Limit: 128M+

Recommended:

  • Apache server with mod_rewrite