Why can't I load JavaScript files server side?

108 views
Skip to first unread message

Joost van der Meijden

unread,
Sep 19, 2013, 9:03:03 AM9/19/13
to ape-p...@googlegroups.com
Hello,

I am trying to load javascript file on the server side but till now with no effect.
On the internet I see much copy / paste from people who start APE server like this:
_   ___ ___
  /_\ | _ \ __|
 / _ \|  _/ _|
/_/ \_\_| |___|
AJAX Push Engine

Bind on port 6969

Version : 1.1.1
Build   : May 30 2011 23:37:06
Author  : Weelya (con...@weelya.com)

[Module] [spidermonkey] Loading module : Javascript embeded (0.01) -
Anthony Catel
[JS] Loading script /var/ape/framework/mootools.
js...
[JS] Loading script /var/ape/framework/Http.js...
[JS] Loading script /var/ape/framework/userslist.js...
[JS] Loading script /var/ape/utils/utils.js...

But when I start APE server I don't get a list of JS files which are loaded. Can someone help me out?

Maybe there's a difference in the version (I have 1.1.2 and the above is from 1.1.1).

   _   ___ ___
  /_\ | _ \ __|
 / _ \|  _/ _|
/_/ \_\_| |___|
AJAX Push Engine

Bind on port 6969

Version : 1.1.2
Build   : Sep 19 2013 13:27:22
Author  : Weelya (c***@***elya.com)

Joost van der Meijden

unread,
Sep 19, 2013, 9:06:43 AM9/19/13
to ape-p...@googlegroups.com
Btw, I've set scripts_path to /etc/ape/scripts/ in the javascript.conf file. This is the location where APE is installed.

Nicolas Guibert

unread,
Sep 19, 2013, 9:17:16 AM9/19/13
to APE Project
The list of included files are in main.ape.js

Hope this helps.


2013/9/19 Joost van der Meijden <j.vanderm...@gmail.com>
Btw, I've set scripts_path to /etc/ape/scripts/ in the javascript.conf file. This is the location where APE is installed.

--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/
 
---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--




Nicolas Guibert
Games in Mind Ltd
Managing director
7 Spencer Walk
UK Mobile: +44 (0)7638 657 537
French Mobile: +33 (0)7 53 17 20 13

Louis Charette

unread,
Sep 19, 2013, 9:33:15 AM9/19/13
to ape-p...@googlegroups.com
Make sure the ape.conf point to JavaScript.conf correctly. 

The version number doesn't changed anything. 

Envoyé de mon iPhone

Le 2013-09-19 à 09:06, Joost van der Meijden <j.vanderm...@gmail.com> a écrit :

Btw, I've set scripts_path to /etc/ape/scripts/ in the javascript.conf file. This is the location where APE is installed.

--

Joost van der Meijden

unread,
Sep 20, 2013, 4:00:34 AM9/20/13
to ape-p...@googlegroups.com
I do not see an option in /etc/ape/bin/ape.conf for javascript directory. This is my ape.conf:
uid {
        # "aped" switch to this user/group if it run as root
        user = daemon
        group = daemon
}


Server {
        port = 6969
        daemon = no
        ip_listen = 127.0.0.1
        domain = auto
        rlimit_nofile = 10000
        pid_file = /var/run/aped.pid
}

Log {
        debug = 1
        use_syslog = 0
        syslog_facility = local2
        logfile = ./ape.log
}

JSONP {
        eval_func = Ape.transport.read
        allowed = 1
}

Config {
#relative to ape.conf
        modules = ../modules/lib/
        modules_conf = ../modules/conf/
}

Op donderdag 19 september 2013 15:33:15 UTC+2 schreef Louis Charette:

Joost van der Meijden

unread,
Sep 20, 2013, 4:01:17 AM9/20/13
to ape-p...@googlegroups.com, ioa.g...@googlemail.com
I added my personal file already to main.ape.js. Thnx :)

Op donderdag 19 september 2013 15:17:16 UTC+2 schreef Nicolas Guibert:

Louis Charette

unread,
Sep 20, 2013, 6:48:18 AM9/20/13
to ape-p...@googlegroups.com
It's the "modules_conf" path sorry. The lib path is where "lib_modspidermonkey.so" is located. 

Envoyé de mon iPad

Joost van der Meijden

unread,
Sep 20, 2013, 7:04:10 AM9/20/13
to ape-p...@googlegroups.com
This won't work:


Config {                                              
#relative to ape.conf
        modules = ../modules/lib/
        modules_conf = ../modules/conf/
}


Op vrijdag 20 september 2013 12:48:18 UTC+2 schreef Louis Charette:

Joost van der Meijden

unread,
Sep 20, 2013, 8:19:09 AM9/20/13
to ape-p...@googlegroups.com
I also got lots of errors at reinstall.

libape-spidermonkey.c:28:19: error: jsapi.h: No such file or directory
libape-spidermonkey.c:48: error: expected declaration specifiers or ‘...’ before ‘JSObject’
libape-spidermonkey.c:48: error: expected declaration specifiers or ‘...’ before ‘JSObject’
libape-spidermonkey.c:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
libape-spidermonkey.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ape_sm_stub’
libape-spidermonkey.c:82: error: expected specifier-qualifier-list before ‘jsval’
libape-spidermonkey.c:87: error: expected declaration specifiers or ‘...’ before ‘JSObject’
libape-spidermonkey.c:87: error: expected declaration specifiers or ‘...’ before ‘JSObject’
libape-spidermonkey.c:93: error: expected specifier-qualifier-list before ‘JSObject’
libape-spidermonkey.c:109: error: expected specifier-qualifier-list before ‘JSRuntime’
libape-spidermonkey.c:116: error: expected specifier-qualifier-list before ‘JSObject’
libape-spidermonkey.c:124: error: expected specifier-qualifier-list before ‘JSObject’
 

and that's just the begin

Louis Charette

unread,
Sep 20, 2013, 8:40:28 AM9/20/13
to ape-p...@googlegroups.com
Hum, could be related. But just to be sure, make sure there's not error in "main.ape.js if you added some custom code. Try to revert to the default file if you made any modification just to be sure. 

On which system are you installing ape?

Envoyé de mon iPhone
--

Joost Van Der Meijden

unread,
Sep 20, 2013, 9:32:24 AM9/20/13
to ape-p...@googlegroups.com
I made a reinstall so that has nothing to do with it I think. I'm installing it on my macbook. 
You received this message because you are subscribed to a topic in the Google Groups "APE Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ape-project/0PABlmcGGkE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ape-project...@googlegroups.com.

Louis Charette

unread,
Sep 20, 2013, 10:24:29 AM9/20/13
to ape-p...@googlegroups.com
Ok. I tried compiling on my mac (Mountain Lion) and I got the same errors. I had to make a symlink for gcc and g++ to make it work:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2

Here's a compiled source I just made. It should work, but MySQL might not if you don't have the library installed : http://ape-project.org/static/downloads/unstable/APE_Server-1.1.2-OSXMountainLion.zip

  - Louis

Joost van der Meijden

unread,
Sep 20, 2013, 11:47:13 AM9/20/13
to ape-p...@googlegroups.com
Thnx!!!! you're the best!!! :D :D :D \o/

Op vrijdag 20 september 2013 16:24:29 UTC+2 schreef Louis Charette:

Louis Charette

unread,
Sep 20, 2013, 11:49:54 AM9/20/13
to ape-p...@googlegroups.com
You took the thing I built or you recompiled yourself?

Envoyé de mon iPhone

Joost Van Der Meijden

unread,
Sep 20, 2013, 12:40:59 PM9/20/13
to ape-p...@googlegroups.com
I took the zip you made for me. But it was just to make it work localy. On the live I will use a stable version. 

Thnx for your support! Worked all day with a friend on it. Thnx a ton!

Joost van der Meijden

unread,
Sep 26, 2013, 12:24:49 PM9/26/13
to ape-p...@googlegroups.com
How can I check if MySQL thing is installed? Cause I got the error: ../scripts/application/biedingen.js:28:TypeError: Ape.MySQL is not a constructor

Using code:

var sql = new Ape.MySQL('localhost', 'user', 'password', 'database');
 sql.onConnect = function() {
        Ape.log('Connected to mysql server');
 }

peter.r...@verpeteren.nl

unread,
Sep 26, 2013, 1:10:11 PM9/26/13
to ape-p...@googlegroups.com
Hoi Joost

From the previous posts, I recalled that you compiled from source and
that there was a problem with some symlinks to libraries.


$cat ./modules/mysql.mk
HAS_MYSQL = yes

That file written by ./build.sh, the content is depending if the
mysqlclient-dev library was available ("/usr/include/mysql/mysql.h")

You might want to run the build process again.

Peter Reijnders



Joost van der Meijden schreef op 2013-09-26 18:24:
> --
> --
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To post to this group, send email to ape-p...@googlegroups.com
> To unsubscribe from this group, send email to
> ape-project...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ape-project?hl=en [1]
> ---
> APE Project (Ajax Push Engine)
> Official website : http://www.ape-project.org/ [2]
> Git Hub : http://github.com/APE-Project/ [3]
>
> ---
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to ape-project...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out
> [4].
>
>
> Links:
> ------
> [1] http://groups.google.com/group/ape-project?hl=en
> [2] http://www.ape-project.org/
> [3] http://github.com/APE-Project/
> [4] https://groups.google.com/groups/opt_out

Joost Van Der Meijden

unread,
Sep 26, 2013, 1:39:56 PM9/26/13
to ape-p...@googlegroups.com
I used the builded version from the download link. But I'm not that good in installing servers. I'm just a programmer.

If I understand it right I should excecute this line in my terminal and then it should work fine: $cat ./modules/mysql.mk HAS_MYSQL = yes ?

When I'm not understanding it right can you tell me in Dutch what I should do?

Thnx for your quick reaction!
Joost van der Meijden


> HAS_MYSQL = yes
> Git Hub : http://github.com/APE-Project/
>
> --- You received this message because you are subscribed to a topic in the Google Groups "APE Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ape-project/0PABlmcGGkE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ape-project...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Louis Charette

unread,
Sep 26, 2013, 1:47:23 PM9/26/13
to ape-p...@googlegroups.com
That's the way to test if MySQL is working. 

What Peter said if mostly for Linux & Debian. On Debian/Ubuntu it's much simpler. Just install libmysqlclient-dev with apt-get. On OSX, it's a bit different.

To build with MySQL support on OSX, you need to install MySQL first (http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg) and then move or link things around (APE isn't looking for MySQL at the same place it's installed. I should edit the build file for OSX). From my old notes, those command will move things around once APE is installed:

sudo mkdir /usr/include/mysql/
sudo cp -R /usr/local/mysql/include/* /usr/include/mysql
sudo cp /usr/local/mysql/lib/libmysqlclient_r.* /usr/lib


If you're using the OSX binaries I sent you, I didn't test if mysql was actually working, but I don't think it will I'll have to rebuild later when I get home.


  - Louis


--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/
 
---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Louis Charette

unread,
Sep 26, 2013, 2:52:13 PM9/26/13
to ape-p...@googlegroups.com
FYI, the link to download MySQL for OSX should be : http://dev.mysql.com/downloads/mysql/5.6.html#downloads


  - Louis

Louis Charette

unread,
Sep 26, 2013, 10:17:39 PM9/26/13
to ape-p...@googlegroups.com
Somehow I can't build an OSX anymore. Probably because I updated to XCode5 since? MySQL doesn't work on the version I built for you the other day.  I don't get that same error when I try it, but it still doesn't work. 

Let me know if you find something.


  - Louis


On Thursday, September 26, 2013 1:47:23 PM UTC-4, Louis Charette wrote:
That's the way to test if MySQL is working. 

What Peter said if mostly for Linux & Debian. On Debian/Ubuntu it's much simpler. Just install libmysqlclient-dev with apt-get. On OSX, it's a bit different.

To build with MySQL support on OSX, you need to install MySQL first (http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg) and then move or link things around (APE isn't looking for MySQL at the same place it's installed. I should edit the build file for OSX). From my old notes, those command will move things around once APE is installed:

sudo mkdir /usr/include/mysql/
sudo cp -R /usr/local/mysql/include/* /usr/include/mysql
sudo cp /usr/local/mysql/lib/libmysqlclient_r.* /usr/lib


If you're using the OSX binaries I sent you, I didn't test if mysql was actually working, but I don't think it will I'll have to rebuild later when I get home.


  - Louis


Le 2013-09-26 à 12:24, Joost van der Meijden <j.vanderm...@gmail.com> a écrit :

How can I check if MySQL thing is installed? Cause I got the error: ../scripts/application/biedingen.js:28:TypeError: Ape.MySQL is not a constructor

Using code:

var sql = new Ape.MySQL('localhost', 'user', 'password', 'database');
 sql.onConnect = function() {
        Ape.log('Connected to mysql server');
 }

--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/
 
---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project+unsubscribe@googlegroups.com.

Louis Charette

unread,
Sep 27, 2013, 3:07:59 PM9/27/13
to ape-p...@googlegroups.com
Turn out Apple depreciated gcc 4.2 (required to build APE and Spidermonkey) in Xcode 5. So I can't build APE on my mac anymore without rewriting part of the code to fix the errors. 

I guess you best bet for now would be to use a debian server or virtual machine...


  - Louis


For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/
 
---
You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ape-project...@googlegroups.com.

Joost Van Der Meijden

unread,
Sep 27, 2013, 3:58:15 PM9/27/13
to ape-p...@googlegroups.com
Okay, thnx for your support! I'll install it on my ubuntu server. That will also work right? 
You received this message because you are subscribed to a topic in the Google Groups "APE Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ape-project/0PABlmcGGkE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ape-project...@googlegroups.com.

Louis Charette

unread,
Sep 27, 2013, 4:02:06 PM9/27/13
to ape-p...@googlegroups.com
You shouldn't have any problems ;)
Reply all
Reply to author
Forward
0 new messages