Skip to content
Ajinkya Wavare edited this page May 31, 2016 · 48 revisions

sTeam can be installed and used in a development environment in two ways.
1.Using a Docker image
2.Manual Installation
Manual Installation would include installing Pike and it's dependencies followed by sTeam installation.

This tutorial on installation of sTeam is divided into the following sections:

  1. sTeam installation using Docker image
  2. Manual Installation: Installing Pike and Pike dependencies
  3. Manual Installation: Installing sTeam
  4. Debugging and Error Resolution
  5. Troubleshooting
  6. Distro Specific Instruction

================================================================================================================= #Installation Steps

Section 1:

sTeam installation using Docker image

Docker image generated in GSOC 2015.

docker pull dolftax/steam:v1
docker run -d dolftax/steam /usr/local/lib/steam

This is the old docker image for the project.

Docker image generated in GSOC 2016.

This docker image contains all the necessary dependencies to start the sTeam server.
It also includes the sTeam UI and the Rest API along with it's dependencies. These have already been installed and developer can start collaborating to it. The docker image can be found on Docker Hub.

docker pull ajinkya007/societyserver 
docker run -i -t ajinkya007/societyserver /bin/bash

[ For long term purpose, do the manual installation ]

Section 2:

Manual Installation: Installing Pike

Pike - Installation

  • Install required dependencies
mysql-server
mysql-devel
bzip2-devel
libjpeg-devel
libpng-devel
zlib-devel
pcre-devel
freetype-devel
gmp-devel
make
nettle-devel
gcc
tar
wget

Example:

###CentOS/Fedora

yum install mysql-server mysql-devel bzip2-devel libjpeg-devel  libpng-devel zlib-devel pcre-devel freetype-devel gmp-devel make nettle-devel gcc gcc-c++ tar wget

Note: In Centos 7 install mariadb-server instead. MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL.

###Ubuntu 12.0+

sudo apt-get install mysql-server libmysqld-dev bzip2 libjpeg-dev libpng-dev zlib1g-dev libpcre3-dev libfreetype6-dev libgmp-dev make nettle-dev

Pike Installation methods

  • Pike can be installed in two ways.
    1.Compiling the source code and installing it.
    2.Installing from the pike debian package.

The following Pike packages are required by sTeam:

pike7.8  
pike7.8-bzip2  
pike7.8-core  
pike7.8-dev  
pike7.8-image  
pike7.8-mysql  
pike7.8-pcre  
pike7.8-svg

###1.Pike Installation from source

Get the Pike v7.8.866 source from ubuntu launnchpad

  • Unpack the source
tar -xzvf pike7.8_7.8.866.orig.tar.gz 
cd Pike-v7.8.866
  • And then run,
make
sudo make install

###2.Install Pike from the debian package

Open a terminal window and run the following command.

sudo apt-get install pike7.8 pike7.8-bzip2 pike7.8-svg  

The pike7.8 debian package would install the following extra packages:pike7.8-core pike7.8-dev pike7.8-gdbm pike7.8-image pike7.8-mysql pike7.8-pcre pike7.8-pg some of which are needed by sTeam.

  • Installing pike from debian package should be the preferred way. The package version would vary depending upon your distribution. Pike version 7.8 is the preferred version for sTeam.
  • Changes in sTeam to work with pike version 8.0 are in progress.

Section 3

Manual Installation: Installing sTeam

##Install the sTeam dependencies

  • For CentOS
yum install libxml2-devel libxslt-devel automake flex
  • For Ubuntu
sudo apt-get install libxml2-dev libxslt1-dev automake flex

sTeam - Installation

  • Get steam 2.9 from git repo
git clone https://github.com/societyserver/sTeam.git
  • Git checkout societyserver-source
cd sTeam
git checkout societyserver-source
  • Start mysql daemon (mysqld)

For CentOS

/etc/init.d/mysqld start

Note: Centos 7: systemctl enable mariadb && systemctl start mariadb

For Ubuntu

sudo /etc/init.d/mysql start

And then run,

./build
sudo ./install

If the build script gave dereferencing pointer to incomplete type'. Error on three lines in xslt.c. 411, 412 and 417. This is because of the mismatch between the versions of libxml2 installed in the machine and expected by the build script. Its expecting version 2.8.x and what I had was 2.9.1. Its possible to install an older version of libxml2, but quick (and dirty) solution would be patching the the lines 411, 412, 417 by changing, xmlBuf->conv->content to xmlBufContent(xmlBuf->conv).

  • Start the server
cd /usr/local/lib/steam/
  • patch line 101 in server/libraries/Test.pmod
  • line should be "object first_test = TestCard( obj, obj->test, 0, 0);"
sudo ./start

.. at this point you should have a running server

  • Login at https://localhost/ (username "root", password "steam")

Get the web interface

wget -c https://raw.githubusercontent.com/societyserver/sTeam/steam-packages/web-2_2_17.spm
  • Install the webinterface with the spm tool

Open a new terminal window in the folder where you downloaded the web-2_2_17.spm file. Then run the following command:-

sudo /usr/local/lib/steam/bin/spm -i web-2_2_17.spm
  • Login at https://localhost/ (username "root", password "steam")

###Or you can follow this after starting the server.

1.Make sure the server actually is running.(and hasn't exited already)

2.Go to http://localhost and make sure you are getting a “Welcome to sTeam” message on your browser.

3.Go to https://localhost (Notice the s)you will get a prompt message asking for user and password. Login at https://localhost/ (username "root", password "steam")

4.Enter user: “root” , password: “steam”. You will get a security exception message, for eg. in firefox :

5.Add exception, and you will be directed to https://localhost/platform

6.Simply upload the spm file and install. This should result in successful installation. On refresh, you should get

  • Optional: Set up your system to start sTeam automatically
chkconfig --add steam
chkconfig steam on

.. at this point you should have a running server.

Note: For other linux distributions you may need to adapt the package names, and you may also run into versioning issues with regards to libxml and libxslt. In future versions I intend to remove the libxml/libxslt support. Pike itself already has xml support for your development needs. libxml is only needed for libxslt, and I want to remove the latter.

  • Closing the server

Note: Don't close the server directly with Ctrl+C.

Follow the steps below.

sudo killall -r steam

Or

sudo ./stop

Section 4

Debugging and Error Resolution

##Important: /var/log/steam has log files that can be used to troubleshoot.

  • If you use libxml2-2.9.x, you might come across the error of ' error: ‘struct svalue’ has no member named ‘type'. Uninstall the libxml2 version and install the one mentioned above.

  • If the build script gave dereferencing pointer to incomplete type'. Error on three lines in xslt.c. 411, 412 and 417. This is because of the mismatch between the versions of libxml2 installed in the machine and expected by the build script. Its expecting version 2.8.x and what I had was 2.9.1. Its possible to install an older version of libxml2, but quick (and dirty) solution would be patching the the lines 411, 412, 417 by changing, xmlBuf->conv->content to xmlBufContent(xmlBuf->conv).

  • If you have mysql installed and mysqld is running, and port 80 is not being used sTeam will start and you can see it running at http://localhost/

Section 5

Troubleshooting

Here is a list of few common errors most of us in the mailing list faced when trying to get the sTeam Server up and running:

Ref: http://groups.google.com/forum/#!msg/fossasia/3PkhAThE1lI/_depnAIYA5YJ

Ref: https://docs.google.com/document/d/1S8CXouW34GRd4pPGzlg3KS5kJJ6eQ9bceretg6wYU3w/edit

Common General Errors

Missing Lexer: You get this error when you try building sTeam.

Solution: Do apt-get install flex or yum install flex (Depending on your distro)

Server Errors

Exited with 10 while starting the server:

This error indicates that there is a problem with the database. While this could be due to many reasons, the most common reason is plainly due to not completing the sTeam installation properly.

Connect to mysql :

mysql -u root -p
mysql>show databases;

If steam is present, then try dropping steam and try installation again in source.

Failed to connect to Database ( while installation):

` Failed to connect to database:

  1. Make sure mysql is running.
  2. Is a root pw for mysql set? Use --rootpw=pw to login.
    ` This error is usually one of the general errors.
    Not many notice this, cause it is followed by “Installation finished successfully...”.
    There are two reasons for it:
    1)MySQL is not running.
    2)sTeam cannot access MySQL because it doesn't have the authorization to do so.

Solution for error resolution: 1)MySQL not running.
The main reason for this is because the mysql daemon hasn't been started properly. Mysql is started in different ways in different operating systems. In Ubuntu, the file to start the daemon is called mysql not mysqld. So do,

/etc/init.d/mysql start

In CentOS6, it is mysqld itself. In CentOS7, you have to make use of systemctl to start. Mysqld has been shifted from init.d folder. Read /etc/init.d/README for syntax.

You must get an OK back, or else there is something wrong with the mysql installation. (Just in case, do a stop before a start)

2)sTeam cannot access MySQL.
It happens if the user has set a password for the MySQL. This password needs to be added to the sTeam install script so that the application can access it and make the database during installation.
Find the install file in the sTeam directory.
Go to line no 41.
./setup
Replace this line with
./setup --rootpw="your_root_pwd"
(your_root_pwd being your actual mysql password)

Connection to sTeam server failed (Error while installing web Interface) :

  • Make sure the server actually is running.(and hasn't exited already)
  • Go to http://localhost and make sure you are getting a “Welcome to sTeam” message on your browser.
  • Go to https://localhost (Notice the s) and irrespective of browser(I tried on 5 browsers), you will get a prompt message asking for user and password.
  • Add exception, and you will be directed to https://localhost/platform
  • Simply upload the spm file and install. This should result in successful installation. On refresh, you should get

Server Returned status -1 and exited.

  • Make sure you have installed all the dependencies accurately. Remove all the dependencies and try reinstalling them and follow the procedure again. _1 return stands for the error caused due to a signal sent by the application. Can check the loader.pike file for more detail information on it.

Security error in modern browsers

  • Secure Connection Failed
  • An error occurred during a connection to localhost. The server certificate included a public key that was too weak. (Error code: ssl_error_weak_server_cert_key) .
  • Firefox v34+ doesn't allow the use of a weak public key. Can try the following to make it work in Firefox 34+.
Go to the about:config of firefox.
Add to the security.tls.insecure_fallback_hosts value to the https://localhost
  • Preferably use Firefox v34 and below.

Or

  • Use Chromium

Failed to load the localhost data after starting the server

  • This can happen after running the server again after closing the earlier instance of the server abruptly. The ports are not allocated which results in the data not being loaded in the webpage.
  • Check the error.log and search for ports associated with the different protocols like FTP, COAL, HTTP, SMPT etc. Quick fix is to close the server using
killall -r steam
  • Start the server again.

Errors while ./build:

Failed to find libxslt library:

This is a common error, if you have followed the installation steps exactly. This is happening because the ./configure file is not able to find the libxslt.so files. The files in most probability will be present in /usr/lib/i386-linux-gnu or /usr/lib/x86_64-linux-gnu.

Solution: Find the file and go to line 4916 in ./configure file , and append the location to the file.

Eg: If file was found in /usr/lib/i386-linux-gnu, do

for a in /opt/local/lib64 /opt/local/lib /sw/lib64 /sw/lib /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/lib64 /opt/lib /lib64 /lib /opt/sfw/lib64 /opt/sfw/lib /usr/sfw/lib64 /usr/sfw/lib /usr/lib/i386-linux-gnu ; do

Note: Both these Solutions require root.

##Miscellaneous If errors still persist make sure you have correct versions of libxml2, libxslt and Pike

1.) libxml2 version 2.8.0 (not latest) Source Link

2.) libxslt version 1.1.28 (latest, 16/03/2015) Source Link

3.) Pike v7.8 release 866 Source Link

Ask on the IRC channel #steam-devel (freenode) if you need more help.

Section 6

Distro Specific Instructions

UBUNTU 12.04 – 16.04 :

The installation instructions given on Society Server are for CentOS6. Hence make appropriate changes for Ubuntu.

  • Replace every step which has “yum” with “apt-get”
  • Replace every centOS package with its respective Ubuntu version As a thumb rule, when you cannot find a package you need, do
apt-cache search <package-name>

(This will return a list of similar packages with description)

CentOS 6.6:

You don't need to make changes from

xmlBuf->conv->content to xmlBufContent(xmlBuf->conv)

since centOS6 hasn't yet come up with the latest version of libxml2.

CentOS 7:

Icon Module Error in error.log file: Although, this could happen in any OS, noticed mostly in Centos7.

Solution: These type of errors only occur when the DB hasn’t been restarted every time you get an error while starting the server. Hence, it would be better to restart before every trial. See the common error instructions above for that.

Clone this wiki locally