So close, but failed - Neko

213 views
Skip to first unread message

Jens Heldt

unread,
Jan 13, 2013, 3:38:31 AM1/13/13
to haxe...@googlegroups.com
I've spent about two hours trying to deploy Neko on shared hosting at alwaysdata.com.

Their servers are Linux 64-bit, but I assumed the same two lines needed to be added to the apache config to get it going:
LoadModule neko_module /home/azonicrider/neko/mod_neko2.ndll
AddHandler neko-handler .n

Yet when I view my website, it just states "Bad Gateway". If I comment out the LoadModule line, that error doesn't appear.

I've done several tests to make sure Neko is found in the right directory.

Maybe someone has had success with deploying Neko on apache Linux?

Andreas Mokros

unread,
Jan 13, 2013, 4:51:17 AM1/13/13
to haxe...@googlegroups.com
Hi.

On Sun, 13 Jan 2013 00:38:31 -0800 (PST)
Jens Heldt <balfa...@gmail.com> wrote:
> Yet when I view my website, it just states "Bad Gateway". If I
> comment out the LoadModule line, that error doesn't appear.

Did you restart apache?
What does it say in the error log?

--
Mockey

Jens Heldt

unread,
Jan 13, 2013, 5:23:24 AM1/13/13
to haxe...@googlegroups.com
Take a look: https://docs.google.com/file/d/0B8yyQQd93Xz6UlpYU0JHTkdlWDQ/edit

I've kinda spotted the error

Andreas Mokros

unread,
Jan 13, 2013, 6:28:04 AM1/13/13
to haxe...@googlegroups.com
Hi.

On Sun, 13 Jan 2013 02:23:24 -0800 (PST)
Jens Heldt <balfa...@gmail.com> wrote:
> I've kinda spotted the error

Yes:
libneko.so: cannot open shared object file: No such file or directory
So, did you install libneko?

--
Mockey

Jens Heldt

unread,
Jan 13, 2013, 7:05:49 AM1/13/13
to haxe...@googlegroups.com
What do you mean by install?

I placed all the Neko files into the Neko folder, I thought that was all that had to be done.

Andreas Mokros

unread,
Jan 13, 2013, 7:42:19 AM1/13/13
to haxe...@googlegroups.com
Hi.

On Sun, 13 Jan 2013 04:05:49 -0800 (PST)
Jens Heldt <balfa...@gmail.com> wrote:
> I placed all the Neko files into the Neko folder, I thought that was
> all that had to be done.

Which Neko files into which Neko folder?
You have to make sure that libneko can be loaded.

--
Mockey

clemos

unread,
Jan 13, 2013, 7:51:45 AM1/13/13
to haxe...@googlegroups.com
I think you may need to put libneko.so in /usr/lib/ as well.

Regards,
Clément


Andreas Mokros

unread,
Jan 13, 2013, 8:11:52 AM1/13/13
to haxe...@googlegroups.com
Hi.

On Sun, 13 Jan 2013 12:51:45 +0000
clemos <cl3...@gmail.com> wrote:
> I think you may need to put libneko.so in /usr/lib/ as well.

Or add your folder to LD_LIBRARY_PATH...

--
Mockey

Jens Heldt

unread,
Jan 13, 2013, 9:40:46 AM1/13/13
to haxe...@googlegroups.com
Is LD_LIBRARY_PATH something to set in command prompt? or located in a file?

This site covers the error, but I have little experience with Linux, not enough to understand it: http://blog.presidentbeef.com/neko_tutorial/debug.html

clemos

unread,
Jan 13, 2013, 9:56:27 AM1/13/13
to haxe...@googlegroups.com
If you don't have access to /usr/lib (I didn't read you were on a shared host), you may try loading libneko.so with LoadFile:
LoadFile /home/azonicrider/neko/libneko.so

Regards,
Clément


--

Andreas Mokros

unread,
Jan 13, 2013, 10:23:21 AM1/13/13
to haxe...@googlegroups.com
Hi.

On Sun, 13 Jan 2013 06:40:46 -0800 (PST)
Jens Heldt <balfa...@gmail.com> wrote:
> Is LD_LIBRARY_PATH something to set in command prompt? or located in
> a file?

command prompt, as it says in your link:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/your/neko
Normally you have to run ldconfig after that. But I don't know what you
are allowed to do on your shared host. You have shell access (SSH)?
But you can not sudo, right? Can you restart apache at all then?

--
Mockey

Left Right

unread,
Jan 14, 2013, 4:21:26 PM1/14/13
to haxe...@googlegroups.com
I've learned that no matter what, you can always restart Apache on
shared hosting... hehe... just give it a "proper" .htaccess, and it
will restart itself until you replace it :P

Anyways, Jens, what kind of Linux is running your server? By what kind
I mean the distro and the kernel. To know that, and since you've said
you have command prompt access, try:

$ lsb_release -a

this is not a standard, but most distros have it. This must print the
info about what Linux it is. If that doesn't exist on your system,
then try:

$ uname -a

or

$ cat /proc/version

(that should be allowed for non-sudo, right?)

After that figured, try:

$ command -v neko

If it prints something - that's the location of neko interpreter, and
you indeed have it installed. If you are lucky, it had also installed
the Apache httpd mode.

If that doesn't print anything, then you'd need to install it... and
here it depends on what your hosting allows you to do. Some
distributions provide neko, so, if you are on some flower of Debian,
then you'd do something like:

# aptitude install neko

If it's RHEL-like, then

# yum install nekovm

Gentoo would use emerge in place of aptitude or yum, but I don't think
neko is provided there. It would be

# packman -S neko
(I guess so?) On Arch Linux.

I don't know what other distros are using, but they probably don't
provide neko too, so you would be on your own there.

Regardless of the distro, the important thing you need to consider is
that you need to, obviously, run a 64-bit binary on a 64-bit system.

How to know if the binary is 64-bit, well, actually, how to know what
is the format of the binary:

$ file neko.so

This will print you all the info it could infer from the file "neko.so"

Best.

Oleg

Left Right

unread,
Jan 14, 2013, 4:23:37 PM1/14/13
to haxe...@googlegroups.com
> Regardless of the distro, the important thing you need to consider is
> that you need to, obviously, run a 64-bit binary on a 64-bit system.

Please correct that: you need to load a 64-bit library into a 64-bit executable.

Best.

Oleg

Jens Heldt

unread,
Jan 15, 2013, 10:09:58 AM1/15/13
to haxe...@googlegroups.com
I'm pretty sure I got command line access: http://wiki.alwaysdata.com/wiki/Deploying_a_Rails_3_application

But I can't do queries like that, or anything that needs to return a value.

Linux Debian 64-bit servers. I uploaded Neko 64-bit binaries.

But on shared hosting, remember I'm trying to make history here.

clemos

unread,
Jan 15, 2013, 10:13:57 AM1/15/13
to haxe...@googlegroups.com
Did you try LoadFile, like I suggested in my previous post ?

Clément


--

Jens Heldt

unread,
Jan 15, 2013, 10:15:44 AM1/15/13
to haxe...@googlegroups.com
Or one of you guys could take a shot at trying to get Neko going, they have a free plan that I'm currently using: https://www.alwaysdata.com/plans/shared/


On Sunday, January 13, 2013 12:38:31 AM UTC-8, Jens Heldt wrote:

Jens Heldt

unread,
Jan 15, 2013, 10:28:04 AM1/15/13
to haxe...@googlegroups.com
Yes, it returned errorless. But if I placed the "LoadModule neko" line in there aswell, it would still give errors.

clemos

unread,
Jan 15, 2013, 10:46:13 AM1/15/13
to haxe...@googlegroups.com
Maybe it would be easier to try the CGI or FastCGI approach : 
It's much easier to hack with library path and everything with this approach.

Regards,
Clément

Andreas Mokros

unread,
Jan 15, 2013, 11:48:03 AM1/15/13
to haxe...@googlegroups.com
Hi.

On Tue, 15 Jan 2013 07:09:58 -0800 (PST)
Jens Heldt <balfa...@gmail.com> wrote:
> I'm pretty sure I got command line access:
> http://wiki.alwaysdata.com/wiki/Deploying_a_Rails_3_application

In this wiki I don't see anything about installing different apache
modules. Are you sure this is possible at all? There's Python, Ruby,
PHP, but this is all preinstalled, isn't it?
Maybe CGI is possible, but this is something else.
Where did you put your LoadModule command?

> But I can't do queries like that, or anything that needs to return a
> value.

Form where are you running your "queries"? Are you in a terminal
connected with SSH?

--
Mockey

Jens Heldt

unread,
Jan 16, 2013, 12:15:25 PM1/16/13
to haxe...@googlegroups.com
You can add lines to the apache config file through admin. For SSH, you create a bash_profile file, for terminal assignments.

Anyways, I'm giving up. I've spent hours trying different methods to get it working.

If anyone else wants to try getting Neko working on their servers, remember they have a free plan: www.alwaysdata.com

I just hope for one day I could target Neko instead of PHP.

Left Right

unread,
Jan 17, 2013, 7:00:24 PM1/17/13
to haxe...@googlegroups.com
I've honestly tried to create an account there... and it doesn't help
much that the info is mostly in French... :) But with some help from
Google translator I got as far as having SSH access, and... whoops. My
user can't do anything. I mean I "sort of" have the access, but I
don't even have a directory to myself, the entire system is owned by
root, and I can't get root. I'm only given ownership of the tty and
the processes relevant to tty and that's it :/

Probably, I don't understand something about server's policies and
regulations, but I couldn't even get as far as uploading files to it,
simply because my user isn't allowed to do so. (For example, I can't
do the steps from the manual for Ruby you linked before because I'm
not even allowed to execute a mkdir :/)
Obviously, I've tried the free account.

Will try to investigate tomorrow, but so far it just seems like I'm
misunderstanding how to use it :/

Best.

Oleg

Andreas Mokros

unread,
Jan 18, 2013, 3:30:31 AM1/18/13
to haxe...@googlegroups.com, olegs...@gmail.com
Hi.

On Fri, 18 Jan 2013 02:00:24 +0200
Left Right <olegs...@gmail.com> wrote:
> My user can't do anything. I mean I "sort of" have the access, but I
> don't even have a directory to myself, the entire system is owned by
> root, and I can't get root.

Well of course you're limited on a shared host and of course you can't
be root but you should have your home-dir like /home/username where you
have full rights. At least I have...
Anyway, I couldn't get mod_neko to run there. Maybe I'll give tora a
try. FWIW: I think you're much better off with a real virtual server of
your own...

--
Mockey

Jens Heldt

unread,
Jan 18, 2013, 11:06:41 AM1/18/13
to haxe...@googlegroups.com, olegs...@gmail.com
Everything has to be done through FTP.

Otherwise, in the admin panel, select "sites", then you can select "personalized apache" for LoadModules.

I'm going to try gaining experience with dedicated hosting, that is probably an easier solution to this.

Left Right

unread,
Jan 18, 2013, 4:00:39 PM1/18/13
to haxe...@googlegroups.com
> Well of course you're limited on a shared host and of course you can't
> be root but you should have your home-dir like /home/username where you
> have full rights. At least I have...

That's the thing, I have nothing like that, I just ran

$ find -user my-user

and it printed the tty and a bunch of /proc/whatever dedicated to the
tty I am connected to. Nothing on file-system. The /home directory has
no subdirectories. But I blame it on poor understanding / translation
of the manual, I'd imagine I'd have to have a place on the file-system
to put my stuff. Otherwise it is kind of useless...

Best.

Oleg

Andreas Mokros

unread,
Jan 18, 2013, 4:47:05 PM1/18/13
to haxe...@googlegroups.com
Hi.

On Fri, 18 Jan 2013 23:00:39 +0200
Left Right <olegs...@gmail.com> wrote:
> The /home directory has no subdirectories.

You can login with ssh and you land in /home? That looks wrong indeed.

--
Mockey

Left Right

unread,
Jan 19, 2013, 5:34:23 AM1/19/13
to haxe...@googlegroups.com
> You can login with ssh and you land in /home? That looks wrong indeed.

Nope, I lend in the root (i.e. /). I can cd to /home or anything else,
but apart of few directories pertaining to alwaysdata, it's just a
bare-bones Debian squeeze + www directory, again, owned by root with a
single index.html or something like that, again, owned by root.

Best.

Oleg

Victor / tokiop

unread,
Jan 19, 2013, 6:25:44 AM1/19/13
to haxe...@googlegroups.com
Yes, Clemos, it's works :
http://tkp.alwaysdata.net/hi/fellow/haxers

The "easy way" (second part) is sufficient, thanks Hugh ! Maybe did a
few changes (add ". ~/.bashrc" in .bash_profile), would need to restart
from scratch to verify..

Cheers !

Le 15/01/13 16:46, clemos a �crit :
> Maybe it would be easier to try the CGI or FastCGI approach :
> http://haxe.org/forum/thread/3395#nabble-td6490363
> http://gamehaxe.com/2009/12/03/neko-on-shared-hosting/
> It's much easier to hack with library path and everything with this
> approach.
>
> Regards,
> Cl�ment

david quertelet

unread,
Jan 19, 2013, 1:10:24 PM1/19/13
to haxe...@googlegroups.com
nice one Victor ! 
could you provide a tutorial ?!
it would be very nice !

thx

Le samedi 19 janvier 2013 à 12:25, Victor / tokiop a écrit :

Yes, Clemos, it's works :

The "easy way" (second part) is sufficient, thanks Hugh ! Maybe did a
few changes (add ". ~/.bashrc" in .bash_profile), would need to restart
from scratch to verify..

Cheers !

Le 15/01/13 16:46, clemos a écrit :
Maybe it would be easier to try the CGI or FastCGI approach :
It's much easier to hack with library path and everything with this
approach.

Regards,
Clément

Cyril B.

unread,
Jan 19, 2013, 2:25:11 PM1/19/13
to haxe...@googlegroups.com
Hello,

As an alwaysdata admin, let me know if I can help. I'm not familiar with Neko, but I managed to load mod_neko on a test account. Unfortunately, when trying to load a test source, it loads forever (no specific error in Apache logs). How can I debug that?

tokiop: it works, but you're using CGI, which is not great for performance. There must be a way to use mod_neko instead.

Victor / tokiop

unread,
Jan 19, 2013, 2:26:25 PM1/19/13
to haxe...@googlegroups.com
Hi David :)

Hugh explains it well in his post ("the easy way" section). The first
part explains how to build haxe/neko if you want updated versions.
http://gamehaxe.com/2009/12/03/neko-on-shared-hosting/


For alwaysdata, the steps should be :

- subscribe free pack
- login in web admin https://admin.alwaysdata.com/
- activate ssh : left column, "Remote access" > SSH


1) Setup haxe and neko
======================

$ ssh your_...@ssh.alwaysdata.com

# get haxe(2.0.4) and neko(1.8.1) from Hugh
$ wget http://gamehaxe.com/wp-content/uploads/haxeneko-1.0.tgz
$ tar xvzf haxeneko-1.0.tgz

$ nano .bashrc

----- file content ----
export HAXENEKO=~/haxeneko
export LD\_LIBRARY\_PATH=$HAXENEKO
export PATH=$PATH:$HAXENEKO
export NEKOPATH=$PATH:$HAXENEKO
export HAXE\_LIBRARY\_PATH=$HAXENEKO/std
----- exit/save -------

$ nano ~/.bash_profile

----- file content ----
. ~/.bashrc
----- exit/save -------

# Reload profile (or login/out)
$ source .bash_profile

# Neko and haxe should be available
$ neko
$ haxe


2) Setup your test neko website :
=================================

# Make dir for your neko files and move in
$ mkdir site
$ cd site

$ nano Site.hx

----- file content ----
class Site
{
public function out(inString:String)
{
neko.Lib.print(inString);
}
public function new()
{
out("Content-type: text/plain\n\n");
out("Hello World!\n");
out("Page : " + neko.Sys.getEnv("REQUEST_URI") + "\n" );
}

static public function main() { return new Site(); }
}
----- exit/save -------


# Compile and test
$ haxe -main Site -neko Site.n
$ neko Site.n
# Hello World \n Page : null


3) Call your neko website from cgi
==================================

$ cd ~/cgi-bin
$ nano Site.cgi

----- file content ----
#!/bin/sh

export HAXENEKO=~/haxeneko
export LD\_LIBRARY\_PATH=$HAXENEKO
export PATH=$PATH:$HAXENEKO
export NEKOPATH=$HAXENEKO
neko ~/site/Site.n
----- exit/save -------

# Make it executable
chmod a+x Site.cgi

# Your neko file should be called here :
# http://your_login.alwaysdata.net/cgi-bin/Site.cgi


4) Rewrite from www
===================

$ cd ~/www
$ nano .htaccess

----- file content ----
RewriteEngine on
RewriteRule \.(css|jpe?g|gif|png)$ - [L]
RewriteRule ^(.*)?$ cgi-bin/Site.cgi [L]
----- exit/save -------

# Your neko file should be called here :
# http://your_login.alwaysdata.net/


Have fun ! :)


Le 19/01/13 19:10, david quertelet a �crit :

david quertelet

unread,
Jan 21, 2013, 3:50:09 AM1/21/13
to haxe...@googlegroups.com
merci Victor!

i will try that ! 
but i definitly hope that we could use native mod_neko in alwaysdata.
Cyril is telling that fast cgi is not as good as native in performence.
Cyril looks interested and it could be really awsome if alwaysdata (which i use regularly) could support mod_neko.
It's a pity i don't have the knowledge to help him debugging the error he is facing with apache.
but if someone with more experience in neko ( server side) could help him.
he shall have all the answers about the ssh privilege stuff this topic is talking about.
This could be a step in deploying neko as a popular server programming solution like Ruby is.

thanks again
Le 19/01/13 19:10, david quertelet a écrit :
nice one Victor !
could you provide a tutorial ?!
it would be very nice !

thx

Jens Heldt

unread,
Jan 21, 2013, 7:35:17 AM1/21/13
to haxe...@googlegroups.com, da...@postite.com
I took a look at fastcgi, but theres so much more steps, and the performance wont be as good anyways.

"but if someone with more experience in neko ( server side) could help him."  could someone get Nicholas in here? haha

Axel Huizinga

unread,
Jan 21, 2013, 7:51:58 AM1/21/13
to haxe...@googlegroups.com

Am 21.01.2013 13:35, schrieb Jens Heldt:
I took a look at fastcgi, but theres so much more steps, and the performance wont be as good anyways.
As a side note - some time ago I made some tests with hxfcgi based on c++ and the performance was better than with mod_neko.

E-Mail ist virenfrei.
Von AVG überprüft - www.avg.de
Version: 2013.0.2890 / Virendatenbank: 2638/6026 - Ausgabedatum: 11.01.2013
Die Virendatenbank sind veraltet.


Victor / tokiop

unread,
Jan 21, 2013, 8:16:19 AM1/21/13
to haxe...@googlegroups.com, alwaysd...@gmail.com
Sure, it would be great to have a clean, easy and efficient way to
deploy neko apps ! Meanwhile maybe it can help for demo/testing or small
websites..

Tested neko / mod_neko on Debian a while back, this path was quick and
successful : http://haxe.org/doc/build/neko_linux

Cyril, does the test file executes from neko ($ neko test.n) ?


Le 21/01/13 09:50, david quertelet a �crit :
Reply all
Reply to author
Forward
0 new messages