Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

See here. As for email, they are not protected in any way, unless something like pgp is uses, which isn't possible with a shop. You should never send your passwrod in an email unless the email doesn't contain any reference to the site it is for.

 

Please post future, non-contribution related questions in the general forum.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

I get "Failed to open file sitemonitor_reference.php" after clicking on the top update button of the admin page as indicated by the step 6 of the readme file.

 

My error_log shows:

 

PHP Warning: fopen(sitemonitor_reference.php) [<a href='function.fopen'>f

unction.fopen</a>]: failed to open stream: Permission denied in /var/www/html/catalog/myadmin/includes/functions/sitemonitor_f

unctions.php on line 308, referer: http://www.mysite.com/myadmin/sitemonitor_admin.php

 

I tried setting sitemonitor_functions.php permissions to 777 but nothing changed. Any clue?

 

thank you all for reading my post

Share this post


Link to post
Share on other sites

It's most likely referring to a server permissions problem. You will need to ask your host to fix that.

Share this post


Link to post
Share on other sites

It's most likely referring to a server permissions problem. You will need to ask your host to fix that.

 

Hi! Thank you for your super fast response!

We'll i am the only one who administer the server. It runs on a fedora machine.

I uploaded the files from my windows machine using WinSCP and connect to the server via putty. This is the directory listing:

 

[root@web functions]# ls -l

total 168

-rw-r--r-- 1 root root 6966 2009-02-22 09:39 compatibility.php

-rw-r--r-- 1 root root 4312 2009-02-22 09:39 database.php

-rw-r--r-- 1 root root 53681 2009-06-24 23:05 general.php

-rw-r--r-- 1 root root 24704 2009-02-22 09:39 html_graphs.php

-rw-r--r-- 1 root root 12826 2009-02-22 09:39 html_output.php

-rw-r--r-- 1 root root 672 2009-02-22 09:39 languages.php

-rw-r--r-- 1 root root 1027 2009-02-22 09:39 localization.php

-rw-r--r-- 1 root root 983 2009-02-22 09:39 password_funcs.php

-rw-r--r-- 1 root root 4733 2009-02-22 09:39 sessions.php

-rwxr-xr-x 1 root root 21275 2009-09-26 21:57 sitemonitor_functions.php

-rw-r--r-- 1 root root 4038 2009-02-22 09:39 validations.php

[root@web functions]#

Share this post


Link to post
Share on other sites

Those are file permissions. You need to look at the owner of the files in the server settings.

Share this post


Link to post
Share on other sites

I changed group and user of sitemonitor_functions.php from root to apache which is the user and group the httpd daemon runs on and I still have the same error.

Permissions of sitemonitor_functions.php and functions folder were set to 777.

httpd were restarted.

php.ini shows safe_mode = off

 

Again same error:

 

[Tue Nov 03 07:26:25 2009] [error] [client 65.74.209.129] PHP Warning: fopen(sitemonitor_reference.php) [<a href='function.fopen'>f

unction.fopen</a>]: failed to open stream: Permission denied in /var/www/html/catalog/admin/includes/functions/sitemonitor_f

unctions.php on line 308, referer: http://www.mysite.com/admin/sitemonitor_admin.php

Share this post


Link to post
Share on other sites

I'm sorry, but server support isn't available in support threads like this. You can ask in the general forum but that's not really a question for these forums so you may not get a response.

Share this post


Link to post
Share on other sites

Jack, thank you.

 

I finally was able to make it work.

This is the part of sitemonitor_functions.php that cause me the problem:

 

function WriteFile($filename, $files)

{

$fpOut = fopen($filename, "w");

 

if (! $fpOut)

{

echo 'Failed to open file '.$filename;

exit;

}

 

because sitemonitor_reference.php did not exist and the page had not permissions to write into my admin folder. So I changed the permissions on the admin folder to 777, run the Update to create the reference file for the first time and then change back the permissions on the folder and sitemonitor files to 755.

Now it's working great.

Hope this helps someone else.

 

Thanks again for this great contribution.

Share this post


Link to post
Share on other sites

Forgive me if the answer is hidden in the last 35 pages of this post. I used the search function but nothing seemed to fit. I have OSCommerce set up top directory, i.e. no /admin directiry. I installed Site monitor per the readme file, but when I get to "Step 5: Go to admin->Sitemonitor->Configure, setup the various settings and click Update." I have the following errors:

 

Warning: require(includes/boxes/sitemonitor.php) [function.require]: failed to open stream: No such file or directory in /home/altern24/public_html/admin/includes/column_left.php on line 21

Warning: require(includes/boxes/sitemonitor.php) [function.require]: failed to open stream: No such file or directory in /home/altern24/public_html/admin/includes/column_left.php on line 21

Fatal error: require() [function.require]: Failed opening required 'includes/boxes/sitemonitor.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/altern24/public_html/admin/includes/column_left.php on line 21

 

Where do I need to edit to get it to point to the correct locations? (Minus the /admin)

 

Scott

Share this post


Link to post
Share on other sites

Forgive me if the answer is hidden in the last 35 pages of this post. I used the search function but nothing seemed to fit. I have OSCommerce set up top directory, i.e. no /admin directiry. I installed Site monitor per the readme file, but when I get to "Step 5: Go to admin->Sitemonitor->Configure, setup the various settings and click Update." I have the following errors:

 

Warning: require(includes/boxes/sitemonitor.php) [function.require]: failed to open stream: No such file or directory in /home/altern24/public_html/admin/includes/column_left.php on line 21

Warning: require(includes/boxes/sitemonitor.php) [function.require]: failed to open stream: No such file or directory in /home/altern24/public_html/admin/includes/column_left.php on line 21

Fatal error: require() [function.require]: Failed opening required 'includes/boxes/sitemonitor.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/altern24/public_html/admin/includes/column_left.php on line 21

 

Where do I need to edit to get it to point to the correct locations? (Minus the /admin)

 

Scott

 

Never mind, lack of sleep had me confusing admin with catalog. :blush:

Share this post


Link to post
Share on other sites

When I try to delete reference file and create a new reference file, run Site monitor, I get the following error message:

 

PHP Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/home/username/public_html) is not within the allowed path(s): (/tmp/:/tmp:/usr/:/var/www/public_html/site/) in /var/www/public_html/site/html/admin/includes/functions/sitemonitor_functions.php on line 162

 

Where is the script pulling up /home/username/public_html?

That is a wrong path.

 

Also where is it pulling up /tmp/:/tmp:/usr/:/var?

This is also a wrong path

Share this post


Link to post
Share on other sites

When I try to delete reference file and create a new reference file, run Site monitor, I get the following error message:

 

PHP Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/home/username/public_html) is not within the allowed path(s): (/tmp/:/tmp:/usr/:/var/www/public_html/site/) in /var/www/public_html/site/html/admin/includes/functions/sitemonitor_functions.php on line 162

 

Where is the script pulling up /home/username/public_html?

That is a wrong path.

 

Also where is it pulling up /tmp/:/tmp:/usr/:/var?

This is also a wrong path

I changed the file permissions on sitemonitor_configure.php to 666 and it no longer shows the wrong path in the error log. But I still get an error:

 

PHP Warning: fopen(sitemonitor_reference.php) [function.fopen]: failed to open stream: Permission denied in /site/html/admin/includes/functions/sitemonitor_functions.php on line 308, referer: http://www.mysite.com/admin/sitemonitor_admin.php

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

Hi Jack,

 

Just installed and its working well.

 

mayne not for this thread, but:

 

When I run the manual check for hacked files, Im shown a list of 33 suspect files that need closer inspection - what should I be looking for ???

 

Thanks


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

The current version is checking for the following:

 

error_reporting(0)

base64_decode

<iframe

 

Hacker code is generally the first or last line in a file, though it can be anywhere.

Share this post


Link to post
Share on other sites

The current version is checking for the following:

 

error_reporting(0)

base64_decode

<iframe

 

Hacker code is generally the first or last line in a file, though it can be anywhere.

 

Thamks Jack,

 

Can I assume that this code found in contributions is safe ? eg the oscthumb.php file in OSC Thumbs contribution.

 

How do I know if the code is supposed to be there or if it is malicious?

 

Thanks


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

No, you can't assume that. The code in many of the files it finds is probably safe, unless you have been hacked. But there is no way to be sure. In a case like that, you need to compare your files with the originals to see if they have been altered. You should always have a complete set of original files on your computer so if you don't, you need to do that. If you don't have a known, clean set, then you would have to download the contribution that added them and use those files for comparison.

Share this post


Link to post
Share on other sites

I get this error .

 

V1.9 - followed the install info.

 

All looks ok until i click on configure and i get this error ???

 

 

Warning: opendir(/home/~~~~~/public_html/administrator/) [function.opendir]: failed to open dir: Permission denied in /home/~~~~~/public_html/admin/includes/functions/sitemonitor_functions.php on line 232

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/~~~~~/public_html/admin/includes/functions/sitemonitor_functions.php on line 234

 

Warning: closedir(): supplied argument is not a valid Directory resource in /home/~~~~~/public_html/admin/includes/functions/sitemonitor_functions.php on line 246

Share this post


Link to post
Share on other sites

The problem is with how the permissions are set on your server. You will need to ask your host to make a change so that it works.

Share this post


Link to post
Share on other sites

Hi

 

thanks for this great contribution!

 

I installed, fixed some problems already by reading this thread and it's working fine now. But i have one problem that i cannot fix:

 

When the cronjob executes, i always receive mails with the same found differences. I go to admin, delete and create a new reference file, and one hour later with the next execution of the cronjob the same mails arrive, with the same found differences. IT seems that the cronjob works with an outdated reference file. Can there be any issue with caches? Or what could be the problem here?

 

Thanks for any advices!

Oliver

 

[edit] oh, i just found an old reference file in ~_path (root directory). I have no idea how this file comes in the root! The new and actual reference file is in the public-html/catalog/admin/. Why does the cronjob work with the file in the root??

Edited by BackyardRacing

Share this post


Link to post
Share on other sites

You need to change the cron job syntax so that it cd's into the admin directory before running the script. Your host can help with that.

Share this post


Link to post
Share on other sites

You need to change the cron job syntax so that it cd's into the admin directory before running the script. Your host can help with that.

 

That helped! thanks a lot!

Share this post


Link to post
Share on other sites

HI JACK, thanks for this Contri

 

 

I run my store in Localhost, while I installed this add-on , two Warning appear:

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No error in C:\AppServ\www\catalog\admin\includes\functions\sitemonitor_functions.php on line 162

 

Warning: readdir(): supplied argument is not a valid Directory resource in C:\AppServ\www\catalog\admin\includes\functions\sitemonitor_functions.php on line 164

Reference file creation failed.

 

 

Thanks

Share this post


Link to post
Share on other sites

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No error in C:\AppServ\www\catalog\admin\includes\functions\sitemonitor_functions.php on line 162

It's trying to access /home/username/public_html. Do you have that location on your server? Perhaps changing the SiteMonitor settings will help?

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Where is the record of the files kept? Are they in a database table, or in a text file? I couldn't find any sql in the package.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×