Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SiteMonitor


Jack_mcs

Recommended Posts

The permission settings actually had me gone crazy when trying to have Sitemonitor working properly...I was getting a lot of timeouts errors and writing permission errors.

The only way I could solve them was to CHMOD 666 most of the contribution files including reference file and text files, besides, I have to CHMOD777 the admin directory whenever Sitemonitor has to create the reference file from scratch and create the daily log .txt file, otherwise it is surefire error.

 

I really believe my host is to blame for all the above...

 

I tried exactly what you suggested: no way, situation stays just as I described in my previous posting.

There is, however, another very weird thing I have noticed, showing there is definitely something which does not work correctly: if, after getting 128 suspected files listed by the "manually check for hacked files" function, I exclude them all by ticking the main "exclude" box, then deselect the only hacker's file from exclusion list and update the exclude file, here is what happens

 

1) the hacker's file grows fairly big in dimensions and if verified it shows the update with all the 127 excluded files has happened correctly

 

2) when I run the manual check for hacked files again and tick "use exclude file" the ONLY file which gets actually excluded is just the one that should not (the hacker's file), whereas I still am presented with all the remaining 127 files I previously excluded!!

I'm sorry to say I don't have a solution for you. I am fairly positive the problem lies with the permissions but this sort of problem requires more testing than can be done in a support thread. The next thing I would try would be to contact the host and ask them to change the user for the account so that the permissions can be changed locally. As long as that doesn't introduce any other security problem, like having to use 777, it should solve the problem.

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I have searched "curl" and read all the posts but still don't get it.

 

I just installed the site monitor. I read from the "read me" file" below:

 

IMPORTANT NOTE:

There is a place in the configure file to load the username and password of

admin. This is needed in order to allow curl to be used. It is possible for someone

to obtain that login information.

Otherwise,the curl options in the sitemonitor_configure.php file can be ignored (set to blank spaces).

 

I do not want to use curl.

 

I am not good at osc, not sure where and what to do for "setting to blank spaces"? Could you please provide me a straight forward instruction? I really appreciate it.

Link to comment
Share on other sites

IMPORTANT NOTE:

There is a place in the configure file to load the username and password of

admin. This is needed in order to allow curl to be used. It is possible for someone

to obtain that login information.

Otherwise,the curl options in the sitemonitor_configure.php file can be ignored (set to blank spaces).

 

I do not want to use curl.

 

I am not good at osc, not sure where and what to do for "setting to blank spaces"? Could you please provide me a straight forward instruction? I really appreciate it.

"can be ignored" means you don't have to use it if you don't want to.

"(set to blank spaces)" means to erase the entry in that box so nothing is there.

 

If you are still confused, please type that part that you don't understand.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

"can be ignored" means you don't have to use it if you don't want to.

"(set to blank spaces)" means to erase the entry in that box so nothing is there.

 

If you are still confused, please type that part that you don't understand.

 

I get it now, thank you!

Link to comment
Share on other sites

Great contribution! Thanks for all the hard work!

 

I was using version 2.6 for over a year with no issues. I just upgraded to version 2.8 for the better security features, but now it's timing out or running out of memory. I keep increasing the time and memory limits in the php.ini, but even though that helps it run longer, it eventually times out or runs out of memory. I have all the same config settings in v2.8 that I had in v2.6 (ie, the same excluded directories). But with v2.8, unless I exclude the image directory, I cannot get it to complete the run. Can you please check what changed from v2.6 to v2.8 that would cause the same store to run so much longer?

 

Thanks again for great contribution.

Chuck

Link to comment
Share on other sites

Great contribution! Thanks for all the hard work!

 

I was using version 2.6 for over a year with no issues. I just upgraded to version 2.8 for the better security features, but now it's timing out or running out of memory. I keep increasing the time and memory limits in the php.ini, but even though that helps it run longer, it eventually times out or runs out of memory. I have all the same config settings in v2.8 that I had in v2.6 (ie, the same excluded directories). But with v2.8, unless I exclude the image directory, I cannot get it to complete the run. Can you please check what changed from v2.6 to v2.8 that would cause the same store to run so much longer?

 

Thanks again for great contribution.

Chuck

You're welcome.

 

As for changes, the code was added to fix the long time problem of deleted files causing an incomplete report and that might cause it to take a little longer. My guess is that with 2.6 you were right on the edge of timing out and this was enough to put it over. But that is the reason for the addition of instances in this latest version. You can run multiple instances of the script now, allowing each to check a certain part of the shop, so all files can be checked and no timeouts should occur. If you only want to run one instance though, you will need to cut back on the files being monitored, as before.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack

 

Thanks for such an easy to install add-on.

My admin folder is renamed and under htaccess but in the sitemonitor options I left blank the fields Admin Directory:, Admin Username:, and Admin Password: because to tell you the truth I don't know what curl is...will still sitemonitor check my admin space?

 

Thank you!

Link to comment
Share on other sites

Thanks for such an easy to install add-on.

My admin folder is renamed and under htaccess but in the sitemonitor options I left blank the fields Admin Directory:, Admin Username:, and Admin Password: because to tell you the truth I don't know what curl is...will still sitemonitor check my admin space?

As long as it is not listed in the Exclude List box.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You're welcome.

 

As for changes, the code was added to fix the long time problem of deleted files causing an incomplete report and that might cause it to take a little longer. My guess is that with 2.6 you were right on the edge of timing out and this was enough to put it over. But that is the reason for the addition of instances in this latest version. You can run multiple instances of the script now, allowing each to check a certain part of the shop, so all files can be checked and no timeouts should occur. If you only want to run one instance though, you will need to cut back on the files being monitored, as before.

 

Thanks Jack. I split it into 2 runs and now it works fine. Might be a good thing to note into the instructions.

Quick question: As I split the directories into the 2 separate instances, can I assume if I exclude a directory (ie, admin), all the sub-directories within admin are also excluded, or do I need to explicitly list all the sub-directories too?

 

Thanks for your help!

Chuck

Link to comment
Share on other sites

Thanks Jack. I split it into 2 runs and now it works fine. Might be a good thing to note into the instructions.

Quick question: As I split the directories into the 2 separate instances, can I assume if I exclude a directory (ie, admin), all the sub-directories within admin are also excluded, or do I need to explicitly list all the sub-directories too?

It excludes that directory and any directories within it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks Jack. The 2 instances run fine manually from the admin, but there seems to be an issue with the cron jobs running multiple instances. I setup 2 separate cron jobs for the 2 instances 0 & 1, but both reports are coming out for instance 0. Have you tried running multiple instances via cron? Here is the syntax I'm running: .../catalog/admin/sitemonitor.php&instance=0 and .../catalog/admin/sitemonitor.php&instance=1 Is this the correct syntax? FYI, I'm running the sitemonitor_hacker_cron and several other cron jobs successfully. Any idea what's wrong?

 

Thanks,

Chuck

Link to comment
Share on other sites

Thanks Jack. The 2 instances run fine manually from the admin, but there seems to be an issue with the cron jobs running multiple instances. I setup 2 separate cron jobs for the 2 instances 0 & 1, but both reports are coming out for instance 0. Have you tried running multiple instances via cron? Here is the syntax I'm running: .../catalog/admin/sitemonitor.php&instance=0 and .../catalog/admin/sitemonitor.php&instance=1 Is this the correct syntax? FYI, I'm running the sitemonitor_hacker_cron and several other cron jobs successfully. Any idea what's wrong?

Try running them manually by going to those urls in the shop. If they work, then there is something wrong with the cron jobs (though they look correct). If they fail, it is in the code (though I run multiple instances in my shop).

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try running them manually by going to those urls in the shop. If they work, then there is something wrong with the cron jobs (though they look correct). If they fail, it is in the code (though I run multiple instances in my shop).

 

Hi Jack,

 

I figured out what was wrong. The cron example in the readme.txt has an '&', but the correct syntax should be '?'. Thus it works fine when I changed it to: .../sitemonitor.php?instance=1. Just letting you know so you can correct the readme.txt example to: php /home/username/public_html/catalog/admin/sitemonitor.php?instance=X.

 

BTW, I was wondering why the report keeps showing "New Files: Found a new file named admin/sitemonitor_reference_0.php", even though I just ran the 'Delete Reference File'. Shouldn't the report show no new or changed files?

 

Cheers,

Chuck

Edited by csiemons
Link to comment
Share on other sites

Just installed SiteMonitor on my 2.3.1 installation.

 

I get this error when I try to update:

 

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 666 bytes) in /home/xxxxxx/public_html/xxxx/admin/includes/functions/sitemonitor_functions.php on line 416

 

Should I be talking to my web host?

 

Any help would be appreciated.

Link to comment
Share on other sites

I figured out what was wrong. The cron example in the readme.txt has an '&', but the correct syntax should be '?'. Thus it works fine when I changed it to: .../sitemonitor.php?instance=1. Just letting you know so you can correct the readme.txt example to: php /home/username/public_html/catalog/admin/sitemonitor.php?instance=X.

 

BTW, I was wondering why the report keeps showing "New Files: Found a new file named admin/sitemonitor_reference_0.php", even though I just ran the 'Delete Reference File'. Shouldn't the report show no new or changed files?

Thank you for pointing out the mistake. I have made the change for the next version. The fix for that showing as a new file was posted recently.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I get this error when I try to update:

 

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 666 bytes) in /home/xxxxxx/public_html/xxxx/admin/includes/functions/sitemonitor_functions.php on line 416

 

Should I be talking to my web host?

Answered in the install instructons and many times in this thread - you are monitoring too many files.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thank you for pointing out the mistake. I have made the change for the next version. The fix for that showing as a new file was posted recently.

 

Hi Jack,

 

As far as running the cron job with instances, I forgot to mention the cron job needs to be run with curl and not php.

Here is the command line that worked with my host: /usr/bin/curl -s http://www.yourwebsite.com/catalog/admin/sitemonitor.php?instance=1

 

Cheers,

Chuck

Link to comment
Share on other sites

As far as running the cron job with instances, I forgot to mention the cron job needs to be run with curl and not php.

Here is the command line that worked with my host: /usr/bin/curl -s http://www.yourwebsite.com/catalog/admin/sitemonitor.php?instance=1

That's something specific to your host.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

That's something specific to your host.

 

True, but I use a popular host, so it might be worth mentioning this option in the readme instructions to help you reduce your support efforts later. :)

 

Thanks for all your help! Everything is working well now.

 

Chuck

Link to comment
Share on other sites

Jack, thank you for all of your contributions and for putting up with our stupid questions :) With that being said, I have one for you:

 

When I first installed the contrib, I was getting an 'Undefined Variable' error. I searched this thread and found this solution. Worked like a charm. Now, however, when I attempt to do anything from the SiteMonitor admin section, I get an 'Error 500 - Internal server error' message. I did some searching on this thread and it seems that this may be caused by the script parsing to many files. In the SiteMonitor configure section I have excluded as many directories as I can think of with no luck. Is there something I am missing here? Any help would be greatly appreciated.

 

Thank you in advance.

Link to comment
Share on other sites

Jack, thank you for all of your contributions and for putting up with our stupid questions :) With that being said, I have one for you:

 

When I first installed the contrib, I was getting an 'Undefined Variable' error. I searched this thread and found this solution. Worked like a charm. Now, however, when I attempt to do anything from the SiteMonitor admin section, I get an 'Error 500 - Internal server error' message. I did some searching on this thread and it seems that this may be caused by the script parsing to many files. In the SiteMonitor configure section I have excluded as many directories as I can think of with no luck. Is there something I am missing here? Any help would be greatly appreciated.

 

Thank you in advance.

That error, when encountered with SiteMonitor, is almost always due to monitoring too many files, as you mention. If you are sure you have excluded all of the major directories and your start direcotry is just for the directory holding your shop, then you will need to contact your host and ask them to look at the reason for the failure. They don't need to fix it but to see what the problem is. Some host will do that - some won't.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

When I try to delete files out of the admin section of Site Monitor I get this error:

 

Failed to write to file - %s

 

When I manually execute the SiteMonitor I get this error:

 

Undefined variable: current_display_errors in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 909

 

Also no matter how many files or directories I try to exclude I still get this error:

 

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 822

 

How do I correct these three errors?

Link to comment
Share on other sites

When I try to delete files out of the admin section of Site Monitor I get this error:

 

Failed to write to file - %s

 

When I manually execute the SiteMonitor I get this error:

 

Undefined variable: current_display_errors in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 909

 

Also no matter how many files or directories I try to exclude I still get this error:

 

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 822

 

How do I correct these three errors?

 

 

 

I fixed the error:

Undefined variable: current_display_errors in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 909

 

In sitemonitor_functions.php $current_display_errors was mispelled. It was $cuurent_display_errors instead. After I corrected it, the error disappeared.

 

I still don't know what to about the other two errors though.

Link to comment
Share on other sites

This is better;

 

 $php_files = (glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'));
 if (!empty($php_files)) {
   $messageStack->add(ERROR_IMAGES_HAS_PHP, 'error');
   foreach ($php_files as $filename) {
     echo $messageStack->add($filename);
   }
 }

Thanks for the suggestion. I'll take a look at it for the next version.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I fixed the error:

Undefined variable: current_display_errors in /var/www/vhosts/sparklespot.com/httpdocs/catalog/admin_new/includes/functions/sitemonitor_functions.php on line 909

 

In sitemonitor_functions.php $current_display_errors was mispelled. It was $cuurent_display_errors instead. After I corrected it, the error disappeared.

 

I still don't know what to about the other two errors though.

Thanks for pointing out the error.

 

As for the timeout, I just found some problems in the configure setup file that will cause a timeout even if the override option is used. I don't have time to go through all of the changes right now but this one may help. In sitemonitor_configure_setup.php, delete this code

  $exclude_hacked_files_array = array();

 GetListAllFiles($start_dir, 1, 1, $exclude_hacked_files_array, strlen($start_dir), $start_dir);
 $exclude_hacked_files_selector = array();

 $exclude_hacked_files_selector[] = array('id' => 0, 'text' => TEXT_MAKE_SELECTION);
 for ($i = 0; $i < count($exclude_hacked_files_array); ++$i) {
     $exclude_hacked_files_selector[] = array('id' => $i+1, 'text' => $exclude_hacked_files_array[$i]);
 }

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...