Jump to content

IMPORTANT: Make sure your crons/domainsync.php isn't publicly accessible


Redsign

Recommended Posts

If your crons folder isn't outside of your public_html folder, or you don't secure the folder to disallow external access; anyone can visit a certain url and view all the domains registered in your system..

 

Either move the crons folder out of public_html and change the config.php file to point to the path of your WHMCS install, or add an .htaccess file containing:

 

deny from all

Link to comment
Share on other sites

  • 3 months later...
If your crons folder isn't outside of your public_html folder, or you don't secure the folder to disallow external access; anyone can visit a certain url and view all the domains registered in your system..

 

Either move the crons folder out of public_html and change the config.php file to point to the path of your WHMCS install..

 

Now I am confused. According to whmcs docs:

 

The "crons" folder currently contains the domain synchronisation file so this should also be moved outside the public accessible folder tree to prevent outside users from triggering it.

 

WHMCS allows you to do this. If you do move the folders, then you must tell WHMCS where they have been moved to by editing the /crons/config.php file and specifying the path to the WHMCS root directory, for example:

 

I'm confused. Since config.php is in the crons folder then system would have to know where the crons folder is in order to read the new path in config.php. If the system knows where config.php is then it knows where domainsync.php is and no new path is required. So what is going on here? Is there any advantage to moving domainsync.php only and just changing path in config.php keeping it in its default location?

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Ok, I have some clarification on this process. The domainsync.php file is called when you create a cron job in the server. Example, if you move the crons folder to /home/username/crons then when you create the cron job to run x hours/days the command would be something like php -q /home/username/crons/domainsync.php

 

In the domainsync.php all you have to change as stated in the documentation is where your WHMCS installation is located. Example: $whmcspath = '/home/username/public_html/whmcs/';

 

So the only thing that needs to know where the crons folder exist is the cron job you create to execute the domainsync.php file. I hope this clarifies the question because it really helped us. Again I thank the WHMCS support team for clarifying this.

Link to comment
Share on other sites

Ok, I have some clarification on this process. The domainsync.php file is called when you create a cron job in the server. Example, if you move the crons folder to /home/username/crons then when you create the cron job to run x hours/days the command would be something like php -q /home/username/crons/domainsync.php

 

In the domainsync.php all you have to change as stated in the documentation is where your WHMCS installation is located. Example: $whmcspath = '/home/username/public_html/whmcs/';

 

So the only thing that needs to know where the crons folder exist is the cron job you create to execute the domainsync.php file. I hope this clarifies the question because it really helped us. Again I thank the WHMCS support team for clarifying this.

 

The $whmcspath = '/home/username/public_html/whmcs/'; goes to crons/config.php according to:

 

http://docs.whmcs.com/Further_Security_Steps#Move_the_crons_folder

Link to comment
Share on other sites

That is correct losvre. I made a typo while writing the reply.:

 

Ok, I have some clarification on this process. The domainsync.php file is called when you create a cron job in the server. Example, if you move the crons folder to /home/username/crons then when you create the cron job to run x hours/days the command would be something like php -q /home/username/crons/domainsync.php

 

In the /crons/config.php all you have to change as stated in the documentation is where your WHMCS installation is located. Example: $whmcspath = '/home/username/public_html/whmcs/';

 

So the only thing that needs to know where the crons folder exist is the cron job you create to execute the domainsync.php file. I hope this clarifies the question because it really helped us. Again I thank the WHMCS support team for clarifying this.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

EASY WAY:

 

 

1) Move 'crons' folder located at

 

'/whmcs/crons'

 

to

 

/home/username/

 

 

2) Update file 'config.php' from same folder with your actual whmcs path as

 

$whmcspath = '/home/username/public_html/whmcs/';

 

 

3) Create cron (cPanel) pointig to moved cron location as

 

php -q /home/username/crons/domainsync.php

 

 

That's it!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated