Installing APE Streaming Server – Tutorial
The Ajax Push Engine, or APE, is one of the best internet inventions so far. I want to give a big KOODOS! to the developers, great job guys!
APE has actually been around for a while and the developers, in my opinion, are beginning to lose interest in the project. Not surprising, managing open source projects for free is a huge commitment with absolutely no reward. So I’ll do my part to help. Currently the year is 2012, and the month is June. This tutorial is relevant as of today.
The server that I’ll be working with is CentOS 6, with PHP5 and I believe MySQL 5.11, but I’m not going to bother to check lol.
Step One:
The latest Master branch on the APE repository is not stable yet, so let’s download the last stable release, that tag is v1.1.0, it was launched in 2011.
Navigate to your tmp directory, download and unzip the APE files.
$ cd /tmp $ wget https://github.com/APE-Project/APE_Server/zipball/v1.1.0 $ unzip v1.1.0
You can find the link to the APE download here:
Download APE Server Version 1.1.0
Step Two:
We’ll need to move the APE files to the proper location now. It’s best to place the APE server files into your etc directory. Here’s the command to do that:
mv /tmp/APE-Project-APE_Server-070b57a /etc/ape
Step Three:
If you’re expecting to use APE on a LAMP stack, then you’ll need to download the dependencies for APE. Here’s the list, simply run yum install to install these.
libstdc++-devel gcc-c++ zip keyutils-libs-devel libsepol-devel libselinux-devel libcom_err-devel krb5-devel openssl-devel mysql-devel yum install -y libstdc++-devel gcc-c++ zip keyutils-libs-devel libsepol-devel libselinux-devel libcom_err-devel krb5-devel openssl-devel mysql-devel
Step Four:
We’re getting closer! kinda.. Ok, so now let’s go ahead and update one of the APE files so that it will work with our CentOS. I’m not sure if you need to do this on Ubuntu of Debian, but if you run into an error during the build about “lmysqlclient_r” not existing, then you’ll need to make this adjustment as well.
Open your /etc/ape/modules/Makefile:
$ vi /etc/ape/modules/Makefile
Then replace line seven (7) in the Makefile with this new line. This update tells APE Server where to find your MySQL Client on CentOS 6.
MYSQL_FLAGS = -L./deps/mysac/ -L/usr/lib64/mysql -I./deps/mysac/ -lmysac -lmysqlclient_r
Now we’re ready to build APE for the first time. We’ll navigate to the APE folder and run the build command.
$ cd /etc/ape $ ./build.sh
This process should go pretty smooth. It is designed to handle everything for you, but in the even that you run into an error, be sure to contact Jonathon Byrd so that I can look into a fix for you.
Step Six:
Let’s create the Daemon file so that we can have APE Server start when the server starts up. Create a new file located in the “/etc/init.d” folder and call it “aped”. The contents of that file are found in this gist:
Now run the following command to add the APE Daemon to your boot sequence:
$ chkconfig --add aped
Whenever you want to start, stop or restart the ape server, simply run one of these following commands.
$ service aped stop $ service aped start
I find that calling “service aped restart” is ineffective and you’ll need to call “stop” then “start” separately.
Step Seven:
Now we’ll need to configure the APE server prior to starting it. Anytime you make changes to the APE Server you’ll need to restart it for the changes to take affect.
Let’s open the APE configurations file and make a few changes.
$ vi /etc/ape/bin/ape.conf
# You'll see this section
Server {
port = 6969
daemon = no
ip_listen = 0.0.0.0
domain = example.com
rlimit_nofile = 10000
pid_file = /var/run/aped.pid
}
# You'll want to update it to look like this
Server {
port = 6969
daemon = yes
ip_listen = 0.0.0.0
domain = your_domain_here.com
rlimit_nofile = 10000
pid_file = /var/run/aped.pid
}
Step Eight: Making sure the APE Daemon is running
No start the APE Server using the commands in step six. You can use the following command to make sure that the APE Server is running:
$ ps -aux|grep ape
Now we need to validate that your APE port is open and that APE can be accessed by outside connections. In order to do this, you’ll enter your server’s IP address into your browser, followed by the port number that you’ve installed APE under.
http://127.0.0.1:6969/
If you see the following screen, then APE is officially installed and correctly configured on your server. Now you’ll need to see the next tutorial to learn how to begin connecting to APE from your website.

- Category



