How To Install Apache Wave on a CentOS 6.4 x64 VPS
This article covers a version of CentOS that is no longer supported. If you are currently operating a server running CentOS 6, we highly recommend upgrading or migrating to a supported version of CentOS.
Reason: CentOS 6 reached end of life (EOL) on November 30th, 2020 and no longer receives security patches or updates. For this reason, this guide is no longer maintained.
This guide might still be useful as a reference, but may not work on other CentOS releases. If available, we strongly recommend using a guide written for the version of CentOS you are using.
About Apache Wave
Apache Wave is an open sourced, real-time communication platform based on the work done by Google for Google Wave. Initially envisioned as a replacement for email built for the modern day, it combines typical messaging with real-time communication, rich content, and advanced sharing capabilities – sort of a mashup of email, chat, wikis, and a real-time document editor.
Google announced in 2010 they were no longer developing Wave, and handed the project to the Apache Software Foundation to continue its development. Despite Google’s exit, the ASF and open-source contributors continue to evolve the platform.
We will use a CentOS 6.4 VPS with 4 GB of RAM for this tutorial.
Step 1: Prerequisites
Before getting started, make sure you have a regular user account with sudo access. Most steps will be run as your regular user account.
This tutorial will run you through creating a user account and granting it sudo power.
Logged in as your user account, install the prerequisite packages to compile and run Wave.
sudo yum install git java-1.6.0-openjdk java-1.6.0-openjdk-devel mongodb ant
Create a Wave User
Create a user account explicitly for running the Wave server. This user should not have superuser permissions. You can name this user anything; this tutorial will assume the username
wave for the Wave user account.
This tutorial will run you through creating a user account, but do not grant this user root privileges.
Check Your RAM
Building and executing Wave takes a lot of memory. Depending on your VPS size, you’ll need to add swap space in order to successfully compile Wave. If you haven’t yet added swap to your VPS, this tutorial has instructions on enabling swap for CentOS 6.
Have at least 2.5 GB of RAM including swap (i.e., if you have a 512MB VPS running, add 2 GB of swap space).
Step 2: Compile Wave
Grab the Wave source code
Become the wave user you created earlier:
sudo su - wave
Then pull down the latest Wave source using git. This will create a subfolder called wave containing the files needed to run Wave:
cd ~ git clone git://git.apache.org/wave.git wave
Tweak Build Configuration
Still as the wave user, go into the newly cloned source tree:
If you’re running on a VPS with less than 2 GB of real RAM, it’ll speed up compilation to reduce the number of threads used to compile at one time. The default setting of 4 will cause a lot of wasted time swapping data in and out of the limited RAM available.
To reduce the number of threads used, edit the
Find a line that reads
<arg line="-localWorkers 4"/> and change the 4 to a 1. The line will now look like this:
<arg line="-localWorkers 1"/>
Using ant, grab any needed third-party dependencies and compile the Wave source:
ant get-third-party ant compile-gwt dist-server
Depending on your VPS’ specs, it can take up to an hour to compile the code.
Step 3: Configure Your Wave
You’ll need to create a configuration file before starting the Wave server. While there are many options to configure, there are a couple that need to be specified in order for the cloud server to start accepting remote connections. At minimum you will specify the Wave server’s hostname and the IP of your cloud server that it should bind and serve on.
To create this configuration file, execute this command filling <domain> in with your server’s hostname, and <IP> with your cloud server’s IP address:
ant -f server-config.xml -Dwave_server_domain=<domain> -Dhttp_frontend_public_address=<ip>:8282
This will create a configuration file to serve on your VPS’ IP on port 8282. You can update the port to be anything, though port numbers below 1024 (such as the standard HTTP port, 80) will not be available for the wave user to bind to.
Step 4: Run and Use Wave
Your Wave instance is now configured and ready to run. To launch the Wave front and backend servers, run the
As the wave user:
cd ~/wave/ ./run-server.sh
This will bring up the server using the configuration you specified in Step 3. You can now navigate to the IP and port you specified, and start using Wave!