Need help?

I'm available for remote short term contracting or consultancy work. Please check out my LinkedIn profile for more details on my experience.

Please feel free to use the form below to contact me.




How to install the APE Server on Linux (and Mac OS)

If you've found this article, you probably know what APE is; but for a quick recap, it means AJAX Push Engine. It's great if you want less overhead when transferring a lot of data back and forth - most likely for games, chat or any other interactive applications.

For more information, please check out http://www.ape-project.org/docs/.

In this article, I'm going to assume that you have a web server installed and working (Apache). If you don't, you can check out the article below or do a quick search in Google for 'install lamp on linux'.

http://www.linux.com/learn/tutorials/288158-easy-lamp-server-installation/

Alright, lets get started - first thing you'll need to do is download the Linux generic binary (32 or 64 bit, depending on your needs), and the APE Javascript Framework. You can grab them both here.

Next, we're going to create the directory /etc/ape, and move both of those files in there. Lets decompress them both; so your ape directory should look like this:


APE_JSF/  
APE_JSF-1.1.0.tar.gz  
APE_Server/  
APE_Server-1.1.1.i386.bin.tar.gz  (if you have the 64bit version, yours will look different)

We're almost ready to start the server; but first, lets navigate to /etc/ape/APE_Server/bin and edit the ape.conf file. Look for daemon=no and change it to daemon=yes. All that does is makes it run in the background, so it gives you the command prompt back after starting the server. We also need to make sure your server settings are good - make sure they look like this:


Server {
    port = 6969 # we won't be using 80, because that's already used by apache
    daemon = yes
    ip_listen = 127.0.0.1 # add the IP that you want the APE Server to bind to
    domain = localhost # add the domain that is going to point to the bound IP
    rlimit_nofile = 10000
    pid_file = /var/run/aped.pid
}

As you noticed, I used 127.0.0.1/localhost for the IP and domain. I will be using those for all my examples, just so it's clear. This at least gives you the option of setting it up locally first, and making sure it works.

Okay, lets test out the server now - navigate to /etc/ape/APE_Server/bin and type the following:


./aped

This should start your server. Now lets check if it's actually running.


ps faux | grep aped

This will show the grep aped command process and the one for the APE daemon. If it's not running, it'll only show the grep aped process information.

Assuming that it's all working fine, lets move on to the next step - setting up your APE Javascript Framework. Remember at the beginning when I said I'm assuming you have a web server running? Well, we're at that step. Navigate to your web server document root - this may be /var/www/ or where ever else you may have configured it.

Lets copy /etc/ape/APE_JSF to your web server document root. Assuming it's in the default location I mentioned, you can do it like this:


cp -r /etc/ape/APE_JSF /var/www/

Now that that's all done, we can configure the APE_JSF - navigate to /var/www/APE_JSF/Demos/ and edit config.js.

The following should be changed to look like this:


APE.Config.baseUrl = 'http://localhost/APE_JSF'; //APE JSF 
APE.Config.domain = 'localhost'; //Your domain, must be same as domain in aped.conf
APE.Config.server = 'localhost:6969'; //APE server URL

If you're not using localhost, make sure you substitute it for your own domain, or alternate local domain.

That should be it - try navigating to http://localhost/ape-jsf/Tools/Check/ - if you can get there and it validates, you're all set. If there are things you feel are missing, or not too sure about something,. please feel free to leave a comment. You can also check out the more advanced configuration settings at http://www.ape-project.org/wiki/index.php/Advanced_APE_configuration#Run_your_APE_Server


jon | August 08, 2012 | Comments (0)

Comments


Name (required)
Email (will not be published) (required)
Website

captcha