Introduction how to administrate a steam server
0. Contents
1. Basics1.1) The sTeam Server Hardware
1.2) The Servers operating System
1.3) Some useful commands:
1.4) the packages
1.4) important files
2. The sTeam Server
2.1) useful commands
2.2) important files
2.3) programming languages
2.4) Important directories on the server itself
2.5) Ports and Protocols
2.6) Help Pages and Documentation
3) Stylesheets - View of the Data
3.1) Basic description of the data flow
4) HowTo - what to do if...
4.1) Shutdown the server
4.2) Start the Server
5) Conclusion
1. Basics
1.1) The sTeam Server Hardware
the hardware:floppydisk drive
harddisc 1: 36 GB
harddisk2: 146 GB (120 GB mountet under /var to be used as the database)
1 GB RAM
1000 MBit network interface (scales automatically to 100MBit/ 10 MBIt)
SCSI harddisk controller
DVD ROM drive
motherpoard ASUS PSCH-L
2,8 GHz processor
to login into the server use a SSH tool and connect to 211.87.148.252 (or in the future use steam.qust.edu.cn)
1.2) The Servers operating System
As Operating System it is used Debian "sarge" (see www.debian.org for more information) as "testing" (this is needed to provide the fast harddisk controller).In Linux the important pathes are as follows:
general:
/tmp - temporary files
/root - home directory of the root user
/var - there will be stored some valuable data (like mysql uses /var/lib/mysql/steam to store the servers database in)
/etc - contains important configuration data
/etc/init.d - start scripts for the servers services (e.g. steam, mysql and much more..)
related to the steam server:
/usr/local/lib/steam - the installation directory of the steam server
/var/lib/mysql/steam - the steam database used by the mysql daemon
1.3) Some useful commands:
man <command> (e.g. man ls) for a description of a specific commandls - list the directorys content (use ls -l for a long description similar to windows "dir")
cd - change directory
rm <file> - delete file
rm -rf <file or directory> - to delete a file or a directory, be careful this is recursive ! a windows like "trashbin" doesnt exist under linux
cp <file> <destination> - copy a file
cp -r <directory> <destination> - copy a directory
mv <file or directory> <destination> - move a file or a whole directory
ps -eaf - to show all running processes and their process id
ps -eaf | grep <name> - show all processes containing <name> (ps -eaf | grep steam - shows all running steam processes, use this to determine if the server itself is running)
kill <process id> - kills the process with id <process id>
reboot - reboot the whole system
shutdown - h now - shutdown the whole system, all processes will be closed. Wait a minimum of 5 Minutes after performing this action. Than press the "power" button at least 5 seconds to power off.
top - shows all processes and displays the cpu usage
vi - a command line editor (main commands are: "i" - insert (ESC is needed to quit the edit mode), "A" - insert at end of line, "x"- delete one char, "dd"- delete line, ":w" - write changes, ":wq" save changes and quit, "q" - quit, "q!" - force quit without saving changes)
ssh -l <user> <server> - make a secure connection as <user> to <server>
date - display the servers current date and time
ntpdate - contact to the time server (time.edu.cn) to synchronize local time
cat <file> - show whole <file>
tail <file> - show last lines of <file> use tail -f <file> - to follow new input in <file>
df -h - shows how many space is available
du -h - shows the disk usage of the dirs in the actual dir
dpkg - debian linux package manager, use dpkg -l <name> to view the installation status of <name> e.g dpgk -l mysql*
apt-get - the package installer, a powerful tool, please be careful using it:
apt-get install <package> - install <package>
apt-get remove <package> - remove package (be careful !!)
apt-get update - update the package list information
apt-get upgrade - upgrade all packages !!!! DONT USE THIS !!! This will cause several damage to the server !!!!! (By upgrading ALL packages, the newest installation candidates of ALL packages will be downloaded and installed. But the server depends on the features of the actual installed packages and there versions. If upgrading packages this will cause the server not to work properly)
1.4) the packages
the steam server requires some "packages" which have the same meaning as little programs used by the system e.g. by the steam server like some text transformation helper, the mysql database and many more. some packages are needed from mysql and so on.... the most important packages are listed below:pike7.4
pike7.4-core
pike7.4-dev
pike7.4-image
pike7.4-mysql
libxml2
libxml2-dev
libxml2-utils
libxslt1
cvs
ssh
automake
autoconf
autoconf2.13
mysql-client
mysql-server
mysql-common
flex
gcc
make
less
jed
ntpdate
1.4) important files
/etc/init.d/* - scripts to "start" "stop" and "restart" a couple of system serveices like:networking
steam
mysql
/etc/network/interfaces - configuration file of the network interface. ip addres, subnet mask and others are defined here
/etc/resolf.conf - nameservers are specified here
/etc/hostname - the hostname was specified here
/etc/hosts - some local hostname configuration
if changing hostname, nameserver ore interface configuration restart the network with:
/etc/init.d/networking restart
(NOTE: !! if changing the ip address you have to reconnect with your ssh- tool. remind that you have to keep the new ip address in mind in order to be able to connect (and configure e.g. repair) the server after this changes)
2. The sTeam Server
2.1) useful commands
/etc/init.d/steam stop - stop the steam server/etc/init.d/steam start - start the server
the same can be used to stop the database server with:
/etc/init.d/mysql stop - stop the mysql server
/etc/init.d/mysql start - start the server
if you want to stop mysql it is recommended to stop the steam server first !
2.2) important files
/usr/local/steam/logs/server.log - the servers main log file, use tail -f /usr/local/steam/logs/server.log to view all actions in the log file/usr/local/steam/logs/errors.log - the server error log file, use tail -f /usr/local/steam/logs/errors.log to view all actions in the errors log file (the most things can be ignored, we misuse this log file for some debug output too...)
/usr/local/steam/config/config.txt - the servers configuration file
/var/run/steam.pid - the steam servers process id (used by the server to determine if server is already running, NOTE: if there is a power down in the cdtf and the server cant shutdown normal, you have to delete this filewith rm /var/run/steam.pid and start the server by yourself using /etc/init.d/steam start)
/etc/init.d/steam - steam server start script (this is used during the boor process to start the steam server automatically)
2.3) programming languages
the steamserver (see steam.upb.de mostly german, sorry) or steam.upb.de/en ) is programmed in PIKE (see pike.ida.liu.se for more information). The stylesheets are written in XSLT (see www.w3schools.com ) using XML (see www.w3schools.com ) as data source. Some features of the user interface are written in JAVASCRIPT (see selfhtml.teamone.de (german))2.4) Important directories on the server itself
/sources/ - containing all system scripts (instances of these script can be found in /scripts/, so the calls are going to /scripts/<name>.pike)browser.pike - the main script used to process information send to the server using the webinterface (like renaming a file and nearly all other actions which require to send information to the server)
xmltools.pike - a helper with a lot of useful methods allowing to generate easy-to-use xml source code data to be transformed using the xslt-stylesheets
/stylesheets/ - containes all system stylesheets. the most important ones are:
selection.xsl - display the "search" tab, and search results. some special functionality, its used within the group->invite procedure
mailbox.xsl - display the users mailbox
rucksack.xsl - display the users rucksack
groups.xsl - "groups" tab
group.xsl - view of one group
details.xsl - the xslt- stylesheet for the "properties" and "actions" tabs. its also used displaying the properties of a group
(and details.xsl.xml - xml description how to generate the xml source displayed using the corresponding .xsl file)
content.xsl - the file list ("navigation" tab)
annotations.xsl - "comments" tab
annotation.xsl - used by annotations.xsl to display one annotation
access.xsl - "rights" tab
inventory.xsl - included by several stylesheets and used to display the objects in detail
steam_header.xsl - included by all main stylesheets and used to display the header
user_details.xsl - used to show the user details
admin.xsl - the servers- config page
/languages/ - containing the language definition files
/gui_js/ - the javascript sources used by the stylesheets
/register/ - some register pages using simple forms to create new user
/styles/ - some useful stylesheets used to layout pages if viewed using the public port
/chat/ - chat applet
/backtraces/ - contains all backtraces (error messages) produced by any user using the webinterface (very useful for bug-tracking)
/images/ - images used by the webinterface
/tools/ - use this container to put in own developed scripts used to generate useful xml-source code data (if using within the webinterface is necessary for all users)
/xsl_tags/ - xml definition how to generate xml- source code data (used by most of the webinterfaces .xsl.xml files)
/gui_css/ - some .css definitions for the layout of the webinterface (like color definitions and other stuff...)
2.5) Ports and Protocols
http (80) - use any standard browser, javascript must be enabled to allow some interaction and some basic checks on the form datahttps (443)- standard browser, secure http, internal view, only accessible with login
ftp (21)- use any ftp- client (iso8859 -based at the moment, it is possible to fit special needs for chinese language support. will maybe implemented in the future, we will need some help to find out how to adjust the existing ftp interface..)
coal (1900) - our self developed COAL (client object access layer) protocol. e.g. used by our java clients like the whiteboard and the application launcher
coals (1999) - secure coal, can be used by the application launcher
irc (6667) - any IRC (internet relay chat) client
telnet (2004) - any telnet client - doesnt work right now, there must be some bug... but no problem, telnet is insecure anyway...
imap (143) - any imap meilreader (like mozilla) - to read the messages in the users mailbox using an email client (in fact you can view all steam objects using this client, a little bit untested until now...)
smtp (25) - used by our internal mailserver module to receive messages
(Please dont stop some ports (even if they are not needed right now) or change the port numbers, this can result in several problems using the server)
2.6) Help Pages and Documentation
Using the Public Port via http you can use:/steam/ - some user information about sTeam (copy of some docs from www.open-steam.org to allow fast access)
/web-template/ - view a sample pages which describes how to use the cdtf-public stylesheets
If you are logged in additional information can be found at:
/home/developer/ - (you must be member of group developer) - how to administrate a steam server
Group web:
/home/web/ - contains some other official publications like /steam/ or /web-template/
3) Stylesheets - View of the Data
3.1) Basic description of the data flow
To produce views of the data we use XML and XSLT technologie (see www.w3schools.com ):Our "system" stylesheets are located in :
/stylesheets/ - of the steam system (using https)
1) At first we have to create some data we can transform into a html page. The definition of how to produce these xml source- data is stored in the .xsl.xml- files. This will look like :
<?xml version="1.0" encoding="utf-8"?>
<?steam generate="pike"?>
<structure generate="pike">
<class type="Object">
<tag name="name">
<call><f><n>query_attribute</n><p><string>OBJ_NAME</string></p></f></call>
<show><f><n>show</n></f></show>
</tag>
[....]
</structure>
This will produce output like:
[...]
<name>
<![CDATA[ testdata ]]>
</name>
[...]
This is the xml source data which will be converted by the xsl- stylesheet into the final html page which will be displayed.
You can view this xml source data by adding ?source=true (if there is no parameter before) or &source=true (if there are still some parameters) to the Address (URL) of any website produced by the steam system. Just try something like /home/steam/?source=true
2) Now we got the xml source data depending on which object will be displayed. Now there are the xsl- stylesheets to transform these xml source data into a html- page. This will be done by using a template named "Object" as root point. The most of our system stylesheets are using this template as a kind of entry point. Within this template it is possible to mix up normal html code extended by xsl- commands.
For example:
<xsl:template match="Object">
<HEAD>
</HEAD>
<BODY BGCOLOR="#F5F5F5" LINK="#000000" VLINK="#000000" ALINK="#000000">
Hello i am displaying <xsl:value-of select="/Object/name"/>
<br/>
<br/>
My content is<br/>
<br/>
<xsl:for-each select="/Object/inventory/Object">
<a href=""><img src="/scripts/get.pike?object={icon/object/id}"/><xsl:value-of select="name"/></a><br/>
</xsl:for-each>
</BODY>
</xsl:template>
This will display the actual area or container in a simple style and list all the object in this area/container
4) HowTo - what to do if...
4.1) Shutdown the server
Connect to the server via ssh. Login and typeshutdown -h now
The server starts to exit all running processes including ssh, therefore the connection will break down.
Please wait at least 5- 10 Minutes, the server will shutdown all processes but cant switch of himself. So after waiting a couple of minutes please turn off the server by pressing the "Power" Switch (on the front behind the blend on the lower right edge..) at least 5 Secs, then the power supply switch off and the whole server is off now. You can now switch off the power supply itself by pressing the button on the back of the server.
4.2) Start the Server
Just switch on the server, the server will automatically start all important processes.if you switch on the server after loosing power it may happen that the sevrer takes some time to come up because he need to check his filesystem, please wait maybe 10 minutes. If after 10 Minutes the steam server still doesnt run then connect via ssh and delete the steam.pid file with: rm /var/run/steam.pid
and then start the server by hand
/etc/init.d/steam start
this should work. if there are still problems i am sorry but you have to call us to receive some help, mybe there is something wrong on the filesystem or database caused by the power- loss...
Improvements, critics, suggestions and comments are welcome, please email us.
For more information about sTeam please visit: http://www.open-steam.org.