Javascript not working

I have just moved from a VPS to a dedicated server.

My problem is that a JavaScript that was working fine on the VPS now wont run.

What and where do I need to go check to see if the server is set to run JavaScript

Server details:

Operating system CentOS Linux 5.3
Webmin version 1.470
Virtualmin version 3.69.gpl GPL
Theme version 7.1

Thanx
Shane

JavaScript is processed by the browser – similar to how HTML works.

So if it’s not working, the server isn’t at fault :slight_smile:

If you’re using a browser such as Firefox, you can go into Tools -> Error Console, then reload the page, to get a list of JavaScript errors.

If the permissions on the file are preventing Apache from seeing it, or it’s not where it should be, those are issues that could cause what you’re seeing.
-Eric

I definitely think its permissions as it used to run on my laptop on the other server.

So I guess I will have to go check all the logs again to see if there is anything there and maybe go to the scripts support page if I can find one as its an add-on for OsCommerce

Thanx for the reply

Yup, if your web apps ever aren’t working as expected – the first thing you should do is tear into the Apache logs – they’re full of all kinds of useful into! :slight_smile:
-Eric

here is a copy of the log file,

[Wed Jun 03 19:39:00 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Wed Jun 03 19:39:09 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Wed Jun 03 19:39:22 2009] [error] [client 41.177.26.203] attempt to invoke directory as script: /home/recipes/cgi-bin/ [Wed Jun 03 19:41:10 2009] [error] [client 41.177.26.203] attempt to invoke directory as script: /home/recipes/cgi-bin/ [Thu Jun 04 20:29:27 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:29:28 2009] [error] [client 41.177.26.203] File does not exist: /home/recipes/public_html/favicon.ico [Thu Jun 04 20:29:31 2009] [error] [client 41.177.26.203] File does not exist: /home/recipes/public_html/favicon.ico [Thu Jun 04 20:31:12 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:31:44 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:31:54 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/index.cgi [Thu Jun 04 20:32:05 2009] [error] [client 41.177.26.203] attempt to invoke directory as script: /home/recipes/cgi-bin/ [Thu Jun 04 20:32:57 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/index.cgi [Thu Jun 04 20:33:05 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:37:03 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:37:04 2009] [error] [client 41.177.26.203] File does not exist: /home/recipes/public_html/favicon.ico [Thu Jun 04 20:37:07 2009] [error] [client 41.177.26.203] File does not exist: /home/recipes/public_html/favicon.ico [Thu Jun 04 20:37:21 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/index.cgi [Thu Jun 04 20:40:32 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:40:51 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 20:42:01 2009] [error] [client 41.177.26.203] File does not exist: /home/recipes/public_html/welcome_2.gifa [Thu Jun 04 21:35:20 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 21:36:26 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 21:37:49 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Thu Jun 04 21:37:54 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi [Fri Jun 05 00:20:08 2009] [error] [client 41.177.26.203] script not found or unable to stat: /home/recipes/cgi-bin/install.cgi

says it cant find it, if I just go to cgi-bin tells me that access denied so the path is right.

If I go to the directory install.cgi is there.

Is it maybe the cgi-bin setting here that’s at fault

Directory /home/recipes/cgi-bin

or must I use

Directory /home/recipes/public-html/cgi-bin

Thanx for the help so far

Shane

or must I use

Directory /home/recipes/public-html/cgi-bin

Why would you use that path? That removes all the security benefits of having a separate cgi-bin.

I’m guessing this is a permissions or ownership problem. Scripts must be owned by the user, and generally need to have 750 or less privileges (so, 777 is right out).

Regarding cgi path, was just wonndering as they both exist on the server.

I will check the permissions on the scripts

Scripts are all set to 750 with the domains user as owner, no change.

I even thought maybe it is not seeing the script, but if I copy the path used in the page it shows the contents of the script file. So it can find it.

No I am not sure as this site worked on the old VPS system

Well, I’m not really sure what exactly isn’t working here.

What specifically isn’t working? What kind of errors are you seeing in your browser?
-Eric

Its a script that’s supposed to run scrolling images of products.

this is one of the working script

http://www.ebooksgalore.co.za/dbs/

and here is the non working one

http://musthav.co.za/db/

They are both on the same dedicated server,
just running under different virtual domains

Yeah, there’s a coding error of some sort going on :slight_smile:

The JavaScript code being executed is called using “window.onload …” – and what’s likely happening is that the JavaScript parser is bailing out before that.

I see this error in the Error Console:

“Error: uncaught exception: [Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: http://musthav.co.za/db/carousel/i/carousel.js :: anonymous :: line 145” data: no]”

What does that error mean exactly?

I’m not really sure :slight_smile:

To figure that out, I’d recommend going through and making sure all your images are there as you’d expect, then I’d inspect the HTML, CSS, and JavaScript code associated with the non-working site and try to troubleshoot where the issue is.
-Eric