Pusheo Documentation

Step by step instructions for easy installation and configuration of Pusheo.

Server Setup

  • Java Runtime Environment 7 or above
  • Apache Tomcat 7.0.52
  • Redis Server version 2.8.6

  • MySQL 5.6.11 or above

  • Install the Java Runtime Environment
  • You will need to set the JAVA_HOME and PATH environment variable
  • Type ‘javac’ in your terminal to check your Java installation
  • Install Redis Server
    • Download the Redis package using: (This will download Redis server to your current directory)
      $ wget http://download.redis.io/releases/redis-2.8.6.tar.gz
    • Extract the package using:
      $ tar xzf redis-2.8.6.tar.gz
    • Compile the Redis using:
       $ cd redis-2.8.6
       $ sudo make
    • To start the server (Make sure you are inside your Redis installation directory)
      $ src/redis-server
  • Install Tomcat Server
    • Download Tomcat 7.0.52 using the following command: (This will download Tomcat server to your current directory)
      $ wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.52/bin/apache-tomcat-7.0.52.tar.gz
    • Unpack the archive using:
      $ tar xzf apache-tomcat-7.0.52.tar.gz
    • Set the CATALINA_HOME environment variable (In this case the path is simply ‘apache-tomcat-7.0.52′)
      $ export CATALINA_HOME={Path to your tomcat folder}
    • Turn off the SSLEngine. Find the line
      <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> 
    • and change the SSLEngine attribute to ‘off’.

  • Install MySQL (Optional)
    • Run the following command in your terminal
      $ sudo apt-get install mysql-server
    • Modifiy the following line in ‘my.cnf’ file present at ‘/etc/mysql/’
      bind-address = "0.0.0.0"
    • To install and permanently run MySQL as a service:
      $ sudo service mysql start
    • Create a database for Pusheo
    • You may create a separate user for Pusheo
    • ‘pusheo_db’ will be your database. These credentials will be included in your ‘config.properties’
  • Setting Configuration properties
    • Copy the ‘config.properties’ file directly into the ‘webapps’ directory of your Tomcat installation folder. This file is essential for running the Pusheo server and is required to be placed at this location only.
    • You can define the following properties:
      • USE_MYSQL = Set to 1 if you are using MySQL to store statistics and messages, set to 0 otherwise
      • MYSQL_IP = Specify your MySQL server IP address
      • MYSQL_PORT = Specify your MySQL server port number
      • MYSQL_USERNAME = Specify MySQL username for database ‘pusheo_db’
      • MYSQL_PASSWORD = Specify MySQL password for database ‘pusheo_db’
      • MYSQL_DB_NAME = Provide the name of the database that you have created (Example: ‘pusheo_db’)
      • ACCOUNTS_TABLE = Specify name of the table that will store account details
      • ACCOUNT_DETAILS_TABLE = Specify name of the table that will store account statistics
      • CHANNELS_TABLE = Specify name of the table that will store channels details
      • ACCOUNT_MESSAGES_TABLE = Specify name of the table that will store all account messages
      • FLAG_TABLE = Specify name of the table that will manage crons
      • SAVE_MESSAGES_TO_MYSQL = Set to 1 if you want to store messages in MySQL, set to 0 otherwise
      • USE_REDIS = Set to 1 if you are using Redis server, set to 0 otherwise
      • CLEAR_MESSAGE_HISTORY = Set to 1 in order to clean data from Redis and Context, set to 0 otherwise
      • STATS_CLEAN_INTERVAL = Specify time interval in minutes after which statistic will be moved from Redis to MySQL
      • MESSAGE_RETENTION_PERIOD = Specify the maximum time period in minutes to retain messages in Redis and Context
      • REDIS_IP = Specify your Redis server IP address
      • REDIS_PORT = Specify your Redis server port number
      • REDIS_PASSWORD = Specify your Redis server password that you have mentioned in redis.conf file
      • REDIS_PROTOCOL = Set your Redis server protocol (http or https)
      • EXECUTE_THREADS = Set to 1 if you want to run the crons
      • CLEAR_MESSAGE_HISTORY = Set to 1 in order to clean data from Redis and Context, set to 0 otherwise
      • STATS_CLEAN_INTERVAL = Specify time interval in minutes after which statistic will be moved from Redis to MySQL
      • MESSAGE_RETENTION_PERIOD = Specify the maximum time period in minutes to retain messages in Redis and Context
      • REDIS_IP = Specify your Redis server IP address
      • REDIS_PORT = Specify your Redis server port number
      • REDIS_PASSWORD = Specify your Redis server password that you have mentioned in redis.conf file
      • REDIS_PROTOCOL = Set your Redis server protocol (http or https)
      • EXECUTE_THREADS = Set to 1 if you want to run the crons
  • Deploy pusheo.war
    • Only after configuring the properties file, copy the ‘pusheo.war’ file into the ‘webapps’ directory of your Tomcat installation folder.
    • Start tomcat.

  • Publish and Subscribe keys are defined in the ‘admin.properties’ file present at the location ‘apache-tomcat-7.0.52webappspusheoWEB-INFclasses’
  • By default, these keys are defined as ‘demo’ and ‘demo’. They can be changed by editing the file and then restarting your Tomcat server. But, by doing this you will lose all the data related to the previous keys.