Getting Started
This chapter describes what you need to know to get ZipTie installed and running to manage your network device inventory.
Prerequisites
Before installing either of the server or client components for ZipTie, certain prerequisites must be met. While these prerequisites will be discussed here, there is also documentation for them on the ZipTie website, located here: http://ziptie.org/requirements
Supported Operating Systems
The following operating systems are officially supported for the ZipTie server and client components:
- Windows XP (x86 only) Service Pack 2 or higher
- Ubuntu Linux
- Mac OS X (x86 and PowerPC)
Any operating system listed here is not supported and ZipTie functionality is purely experimental.
- Other Linux (x86 only)
- Solaris
Server Dependencies
The following prerequisites are needed for running the ZipTie server:
- Sun Java Development Kit (JDK) version 1.5 (aka version 5) or higher
- JDK 6 for Windows and Linux can be found here: http://java.sun.com/javase/downloads/index.jsp
- JDK 5 for Windows and Linux can be found http://java.sun.com/products/archive/j2se/5.0_11/index.html
- On Mac OS X, the version of Sun Java included should be the correct version if updates with Apple are up to date. Please run Apple's Software Update to ensure this is so.
- Perl version 5.8.8 or higher
- On Windows, ActiveState's version of Perl is recommended for use. This can be downloaded from here: http://www.activestate.com/store/activeperl/download/
- On Linux and Mac OS X, the Perl included with the operating system should suffice.
- NMAP version 4 or higher
- On Windows, NMAP can be downloaded from here: http://download.insecure.org/nmap/dist
- On Linux, many distributions already have NMAP version 4 installed. If it is not, use your distributions package manager to install it.
- On Mac OS X, the proper version is already installed.
- Subversion (SVN) Libraries and Java Bindings
- On Windows, the SVN libraries and java bindings are already provided for use in the ZipTie server.
- On Linux, the
libsvnSVN library package andjavahlSVN Java bindings package must both be installed.- On Ubuntu, the
libsvnSVN library package is namedlibsvn1; thejavahlSVN Java bindings package is namedlibsvn-javahl. Use Ubuntu's package manager to install these packages. - On Mandriva, the
libsvnSVN library package is namedlibsvn; thejavahlSVN Java bindings package is namedsvn-javahl. Use Mandriva's package manager to install these packages.
- On Mac OS X, the SVN libraries and Java bindings can be found here: http://downloads.open.collab.net/binaries.html.
Perl Module Dependencies
Besides having version 5.8.8 of higher installed of Perl, there are a number of Perl modules that must be properly installed in order for the ZipTie server to function properly.
''perlcheck.pl'' Perl Script
There is a Perl script named perlcheck.pl located in the base directory of the ZipTie server install that can be executed to check if all of the Perl dependencies have been met. While the perlcheck.pl script will check for missing modules on all operating systems, it does behave slightly differently depending on if Windows is being used or not:
- On Windows, if it has been determined that any number of Perl modules have been missing, then PPM will automatically be used to download all of the missing modules. The ZipTie server installer for Windows automatically executes the
perlcheck.plPerl script at the end of installation to automate the install of missing modules. - On Linux and Mac OS X, the
perlcheck.plPerl script will simply print out all of the Perl CPAN commands necessary to retrieve the missing Perl modules. This method was chosen since many distributions of Linux can have their package managers install Perl modules instead of using the CPAN method of install Perl modules. It is up to the user to decide how they want to install the missing Perl modules.
Once the perlcheck.pl Perl script has been executed and all of the Perl module dependencies have been successfully met, you should see a message stating:
All the Perl modules required by ZipTie are already installed! Yatta!
Client Dependencies
The following prerequisites are needed for running the ZipTie client:
- Sun Java Runtime Environment (JRE) version 1.5 (aka version 5) or higher
- JRE 6 for Windows and Linux can be found here: http://www.java.com/en/download/manual.jsp
- JRE 5 for Windows and Linux can be found here: http://java.sun.com/products/archive/j2se/5.0_11/index.html
- On Mac OS X, the version of Sun Java included should be the correct version if updates with Apple are up to date. Please run Apple's Software Update to ensure this is so.
Downloading and Installing ZipTie
ZipTie is split up into two components: server and client. Both components need to be download and installed in order to fully utilize what ZipTie offers. All of the installers and binary distributions for ZipTie can be found here: http://www.ziptie.org/stable_build
Server Installation
The following sections outline steps for properly installing the ZipTie server component on various operating systems. Certain operating systems may have various ways of having the ZipTie server installed, so please find the section that corresponds the chosen installation method. Before attempting installation of the ZipTie server, please ensure that all the prerequisites are met; this is outlined in the Prerequisites section of the User Guide.
Windows Installer
To install the ZipTie server on Windows, double-click the downloaded file and follow the installation wizard. The installation wizard will perform the following actions:
- Ensure that a valid version of both Perl and and the Sun JDK are installed before continuing. This should not be an issue if all of the prerequisites have been properly met.
- Prompts the user for the desired installation location. The default location is:
C:\Program Files\ZipTie Server - Prompts the user as to whether or not they would like to install the ZipTie server as a service and/or start the server once the installation has finished. For more information regarding running the ZipTie server, particularly as a service, please refer to The Server section.
- Installs all of the ZipTie server files into the specified location.
- Once the installation has finished, the
perlcheck.plscript will be ran to resolve any possible missing Perl modules. For more information regarding theperlcheck.plscript, please refer to the Perl Module Dependencies section.
Ubuntu (.deb Package Method)
To install the ZipTie server on Ubuntu, the preferred method is to use the Ubuntu-specific .deb package. Please note that this .deb package is designed specifically for Ubuntu. This means that it will not work for Debian or any Debian-based Linux distributions. This is because the list of dependencies that the .deb package try to resolve are specific only to Ubuntu. In order to install the ZipTie server on a different Linux distribution, please refer to the Other Linux Distributions and Mac OS X (.tgz Method) section.
The Ubuntu-specific .deb package will perform the following actions:
- Installs all of the ZipTie server files into the
/usr/share/ziptie-serverdirectory. - Creates a
ziptieuser. This is the user that will be used to run the ZipTie server if being executed through as an init.d service. Please refer to the various ways to run the ZipTie server in the The Server section. - Changes the ownership of all of the files and directories in the
/usr/share/ziptie-serverdirectory to belong to theziptieuser. This is to ensure that the server can only be ran by the authorizedziptieuser and to make sure that it can't be executed with an super-user privileges. - Executes the
perlcheck.plPerl script to determine if there are any missing Perl modules that are required by the ZipTie server. The check is performed because when using the Ubuntu-specific.debpackage, nearly all dependencies will be installed; It is possible, however, that not all of Perl module dependencies could automatically be installed. The reasons for this is that some of the required Perl modules can not be installed using Ubuntu's package manager or they do not have package maintainer for Ubuntu. Please use the commands output by theperlcheck.plPerl script to install these missing modules. For more information regarding theperlcheck.plscript, please refer to the Perl Module Dependencies section. - Installs the ZipTie server to run as an init.d service and be properly handled at system startup and shutdown. Once the service is installed, the ZipTie server will be started. For detailed regarding setting up and running the ZipTie server using a service, please refer to the The Server section.
Other Linux Distributions (RPM Method)
The ZipTie RPM file that is provided is created for the Mandriva distribution of Linux. However, the RPM installer can still be used on other RPM-based distributions, provided that prerequisites are installed separately. On a non-Mandriva distribution, use the 'nodeps' option during installation. The prerequisites are Sun JDK 1.5 or 1.6 (server), or Sun JRE 1.5 or 1.6 (client). The version of Java that is in your path must be the Sun version of Java, otherwise ZipTie will not run.
You will notice at the end of installation a list of Perl dependencies that could not be satisfied during installation. These modules (typically two) will need to be installed from the CPAN (www.cpan.org) archive.
Other Linux Distributions and Mac OS X (.tgz Method)
To install the ZipTie server on any other distribution of Linux or Mac OS X, simply download the ZipTie Server tarball (.tgz) archive and extract the contents into a desired location. This process will only install the ZipTie server files onto the system and does not perform any other task. In order to to run the server, refer to the The Server section.
Client Installation
The following sections outline steps for properly installing the ZipTie client component on various operating systems. Certain operating systems may have various ways to having the ZipTie client installed, so please find the section that corresponds the chosen installation method. Before attempting installation of the ZipTie client, please ensure that all the prerequisites are met; this is outlined in the Prerequisites section of this User Guide.
Windows Installer
To install the ZipTie client, click on Windows, double-click the downloaded file and follow the installation wizard. The installation wizard will perform the following actions:
- Ensure that a valid version of the Sun JRE is installed before continuing. This should not be an issue if all of the prerequisites have been properly met.
- Prompts the user for the desired installation location. The default location is:
C:\Program Files\ZipTie Client - Prompts the user whether or not they would like an application shortcut to the ZipTie client placed our their desktop, quick launch taskbar, and Start menu.
- Installs all of the ZipTie client files into the specified location.
Ubuntu (.deb Package Method)
To install the ZipTie client on Ubuntu, the preferred method is to use the Ubuntu-specific .deb package. Please note that this .deb package is designed specifically for Ubuntu. This means that it will not work for Debian or any Debian-based Linux distributions. This is because the list of dependencies that the .deb package try to resolve are specific only to Ubuntu. In order to install the ZipTie client on a different Linux distribution, please refer to the Other Linux Distributions (.tgz Method) section.
The Ubuntu-specific .deb package will perform the following actions:
- Installs all of the ZipTie client files into the
/usr/share/ziptie-clientdirectory. - Changes the permissions on the
ziptiebinary to be executed for group, user, and others. - Places an application shortcut to the ZipTie client within the Applications→Internet menu.
Mac OS X (.dmg Method)
To install the ZipTie client on Mac OS X, the preferred method is to use the OS X specific.dmg disk image. The .dmg disk image represents a virtual drive that contains the ZipTie client application. The ZipTie client can either be ran directly from the disk image, or it can be copied into the Applications folder within Mac OS X to be installed.
Other Linux Distributions (.tgz Method)
To install the ZipTie client on any other distribution of Linux, simply download the ZipTie client tarball (.tgz) archive and extract the contents into a desired location. This process will only install the ZipTie client files onto the system and does not perform any other task.
Alternate Database Setup
The default installation of the ZipTie server includes an embedded version of the Apache Derby database. However, ZipTie can be configured to use MySQL 5.1+ or PostgreSQL 8.2.5+. Included with the ZipTie server is a utility that can be used to initialize (or re-initialize) the ZipTie database. This utility is a Perl script that resides in the root of the server installation directory and is called dbutil.pl.
Here is an example of running the utility to initialize a MySQL database instance:
./dbutil.pl --db=mysql reset
And here is an example of running the utility to initialize a PostgreSQL database instance:
./dbutil.pl --db=pgsql reset
Both of these example assume defaults for the given database. For MySQL the user 'root' with no password is assumed, and for PostgreSQL the user 'postgres' is assumed. By default, a 'localhost' installation of either database is assumed. These defaults can be overridden by command line parameters supplied to the dbutil.pl utility. Running dbutil.pl with no parameters provides usage information for the utility, like so:
Usage: dbutil [options] <action> Options: --db database (one of: derby, mysql, pgsql) --user the user to connect to the database as (optional) --pass the password to connect to the database with (optional) --host the hostname of the database server (optional) --port the port number of the database server (optional) --dir the ZipTie installation directory (optional) Actions: reset reset ZipTie to it's original state
If you are running your database server on a different machine, there are further edits to ZipTie configuration files that must be made in order for the ZipTie server to be able to connect to the database during startup.
For MySQL the file osgi-config/bitronix-jta/btm-config.mysql.properties must be edited and the following lines changed to suit your environment:
resource.ds.driverProperties.url=jdbc:mysql://localhost/ziptie resource.ds.driverProperties.user=root resource.ds.driverProperties.password=
Additionally, the file osgi-config/quartz/quartz.mysql.properties must be edited and the following lines changed to suit your environment:
org.quartz.dataSource.ziptie.URL=jdbc:mysql://localhost/ziptie org.quartz.dataSource.ziptie.user=root org.quartz.dataSource.ziptie.password=
In the case of PostgreSQL, the two files are osgi-config/bitronix-jta/btm-config.pgsql.properties and osgi-config/quartz/quartz.pqsql.properties and the lines that must be edited are the same.
In the files above, for a remote installation of a server, 'localhost' should be replaced by the hostname or IP address of the server along with the port if it is not the default port (eg. jdbc:mysql:/ /mysqlhost:8029/ziptie). Once these edits are made, the server can be started. You should check the ziptieServer.log file to ensure there were no errors during startup. If you received no errors, your installation is correctly configured.
Running ZipTie
The Server
The following sections outline steps for running the ZipTie server component on various operating systems. Certain operating systems may have various ways of running the ZipTie server installed, so please find the section that corresponds to the desired method of execution.
Windows
On Windows, there are two methods for running the ZipTie server: using the system service that was setup when the ZipTie server was installed, or directly starting up using the server.bat batch script.
Run as a service
The ZipTie server is capable of being installed as a Windows Service, which will allow it to begin at system startup and will terminate at system shutdown. The installation of this service is usually achieved by choosing to install it during the ZipTie server installation. Assuming that the ZipTie server install ran successfully with the option to install as a service, then there should be a ZipTie Server service available on your system.
If the ZipTie server was not installed as a Windows Service during the installation process, it can be done manually after the fact following these steps:
- In a terminal, navigate to the ZipTie server installation directory, such as
C:\Program Files\ZipTie Server - From the base ZipTie server directory, navigate to the
ztwrapper\windowsdirectory - Execute the following command:
''ztwrapper.exe --install ztwrapper.conf''
Once the ZipTie server is installed as a Windows service, the following message will be displayed:
STATUS | wrapper | 2008/01/15 12:54:21 | ZipTie Server installed.
In order to manually control the ZipTie Server service from the command line, refer to the following commands:
- To start the service:
net start "ZipTie Server"
- To stop the service:
net stop "ZipTie Server"
- To see what other functionality can be performed against the service:
net help
Run using the server.bat script
Although the ZipTie Server service may have been properly installed, there may be a time when a user wishes to manually run the ZipTie server. This can be achieved by executing the server.bat batch script that is located within the installation directory of the ZipTie server. Please note that the server can only be invoked this way if the ZipTie Server service is not currently running; otherwise, there will be conflicts.
Ubuntu
Run as an init.d service
In order to provide support for automatically starting and stopping the ZipTie server on Ubuntu, an init.d service script by the name of ztserver is included. The ztserver script allows the ZipTie server life cycle to be controlled within the init.d service framework. Here are the actions that the ztserver init.d script supports:
- start
- Redirects certain low ports for TFTP, FTP, HTTPS and SNMP to higher ports for use by ZipTie Server using the
iptablescommand. This is needed because the TFTP and FTP servers provided by the ZipTie server can not bind to 69/21 due to restricted access. The ZipTie TFTP and FTP servers by default bind to port 11069 and 11021 respectively. - Uses the
sucommand to switch to theziptieuser. - Invokes the
ztwrapperbinary as theziptieuser to start the ZipTie server.
- stop
- Tears down any port redirection that was set up using the
iptablescommand. - Uses the
sucommand to switch to theziptieuser. - Invokes the
ztwrapperbinary as theziptieuser to stop the server.
- restart
- Calls the stop action
- Calls the start action
- status
- Checks the pid of the Java Service Process used to run the ZipTie server to determine if it is running or not. A status message along with the pid will be displayed if the server is running; otherwise, a message saying the server is not running will be displayed.
As mentioned in the Server Installation section, this init.d service functionality will be installed automatically when using the Ubuntu .deb package.
In order to manually control the ZipTie server init.d service on Ubuntu, reference the following commands:
- To start the server:
sudo invoke-rc.d ziptie-server start
- To stop the server:
sudo invoke-rc.d ziptie-server stop
- To restart the server:
sudo invoke-rc.d ziptie-server restart
- To check the status of the server:
sudo invoke-rc.d ziptie-server status
For more information on how to manually set up the init.d service for the ZipTie server, read the following section.
Other Linux Distributions & Mac OS X
Run using the server.sh script
On systems that don't support init.d style services, or if you wish to manually run the server, there is a Bash shell script provided to invoke the ZipTie server called server.sh. The server.sh is a Bash script that invokes the ZipTie server for startup. The server.sh script can be found with in the base ZipTie server directory location.
In contrast to the functionality of the ztserver init.d script, the server.sh script only brings up the ZipTie server. This means that any port redirection that may be necessary for certain low ports for TFTP, FTP, HTTPS and SNMP to higher ports for use by ZipTie Server will need to be manually done by the user. This has to be done because the TFTP and FTP servers provided by the ZipTie server can not bind to 69/21 due to restricted access. The ZipTie TFTP and FTP servers by default bind to port 11069 and 11021 respectively.
On most Linux distributions, the iptables command is available to perform this functionality. Please refer to the zt_iptables function within the ztserver script to see one way of redirecting ports using the iptables command.
Using the ztserver script to run the ZipTie server as an init.d service (Linux only)
On Linux systems that support the init.d services framework, a user can leverage the ztserver script to control the ZipTie server life cycle. Here are the actions that the ztserver init.d script supports:
- start
- Redirects certain low ports for TFTP, FTP, HTTPS and SNMP to higher ports for use by ZipTie Server using the
iptablescommand. This is needed because the TFTP and FTP servers provided by the ZipTie server can not bind to 69/21 due to restricted access. The ZipTie TFTP and FTP servers by default bind to port 11069 and 11021 respectively. - Uses the
sucommand to switch to theziptieuser. - Invokes the
ztwrapperbinary as theziptieuser to start the ZipTie server.
- stop
- Tears down any port redirection that was set up using the
iptablescommand. - Uses the
sucommand to switch to theziptieuser. - Invokes the
ztwrapperbinary as theziptieuser to stop the server.
- restart
- Calls the stop action
- Calls the start action
- status
- Checks the pid of the Java Service Process used to run the ZipTie server to determine if it is running or not. A status message along with the pid will be displayed if the server is running; otherwise, a message saying the server is not running will be displayed.
In order to properly use the ztserver script to control the ZipTie server, two pre-requisites must be fulfilled:
- Create a
ziptieuser with non-administrative privileges. This is required in order to ensure that the ZipTie server is not run as a user with administrative privileges. Within theztserverscript, it is expected thatziptieis a valid user and will be used via thesucommand when starting/stopping/restarting the server. If you wish to use a different name thanziptie, be sure to update theRUN_AS_USERvariable located within theztserverscript; theRUN_AS_USERvariable is what is referenced when changing users using thesucommand. - Change the ownership for the ZipTie server installation directory and its entire contents to belong to the newly created
ziptieuser. This is to ensure that the ZipTie server can only be executed by theziptieuser or a super-user.
Once the ziptie user has been successfully created and the ownership of the ZipTie server has been successfully changed, the following steps can be enacted to allow the ztserver script to be used to control the ZipTie server as an init.d service:
- Create a symbolic link to the
ztserverscript within your distribution's init.d directory:ln -s <ziptie_server_dir>/ztserver /etc/init.d/ziptie-server
A symbolic link must be used rather than copying the
ztserverscript because there are relative paths contained within the script that assume the script is based out of the ZipTie server directory. - Create a symbolic link to the
ztserverscript within your distribution's desired init.d run-level directories. For most distributions based on System V architecture, the following commands should work:ln -s /etc/init.d/ziptie-server /etc/rc3.d/S99ztserver ln -s /etc/init.d/ziptie-server /etc/rc3.d/K01ztserver ln -s /etc/init.d/ziptie-server /etc/rc5.d/S99ztserver ln -s /etc/init.d/ziptie-server /etc/rc5.d/K01ztserver
These commands will ensure that the ZipTie server is invoked at system startup and terminated at system shutdown.
In order to manually control the ZipTie server init.d service, reference the following commands:
- To start the server:
sudo /etc/init.d/ziptie-server start
- To stop the server:
sudo /etc/init.d/ziptie-server stop
- To restart the server:
sudo /etc/init.d/ziptie-server restart
- To check the status of the server:
sudo /etc/init.d/ziptie-server status
Configuring for Email
ZipTie has the ability to mail things like scheduled reports. To do this, ZipTie must know of a good SMTP server to send mail through. By default it tries to send mail to the hostname mail. If that hostname doesn't resolve on your ZipTie server then you must configure it further.
To do so, edit the file ~/ZipTie Server/osgi-config/mail/mail.properties. Set the mail.host property to the hostname of your SMTP server. There are additional commented out fields in the file to allow you to authenticate to your SMTP server if necessary. Below is an example of this file's contents.
mail.host=mail.company.com mail.from=ziptie@ziptie.org mail.from.name=ZipTie mail.smtp.starttls.enable=true # mail.auth.user=someuser # mail.auth.password=somepassword mail.smtp.auth=false
After editing the file you must restart your ZipTie server for the changes to take effect.
























