Note: This document has been totally superceded by the installer which is available from the downloads page. The installer automates the entire process.
The aim of this document is to provide brief notes so that an experienced system administrator can install ZendTo on a pre-existing Ubuntu server. These are notes and not a full HOWTO document.
apt-get install debhelper bison chrpath freetds-dev libcurl4-openssl-dev libedit-dev libgd2-xpm-dev libgmp3-dev libmhash-dev libpam0g-dev libpspell-dev librecode-dev libsasl2-dev libsnmp-dev libsqlite0-dev libt1-dev libtidy-dev re2c unixodbc-dev apt-get -y install apache2-prefork-dev autoconf automake flex hardening-wrapper libapr1-dev libbz2-dev libdb-dev libenchant-dev libgcrypt11-dev libglib2.0-dev libicu-dev libmysqlclient-dev libpcre3-dev libpq-dev libsqlite3-dev libxmltok1-dev libxml2-dev libxslt1-dev quilt apt-get -y install clamav clamav-daemon apt-get -y install php5 php5-cli php5-sqlite php5-ldap php5-imap php-apc apt-get -y install rrdtool
rpm -e --allmatches gtk2 trousers ecryptfs-utils yum -y install sendmail sendmail-cf yum -y install httpd mod_ssl yum -y install mysql mysql-server chkconfig mysqld on chkconfig iptables off chkconfig ip6tables off chkconfig httpd on yum -y install elinks rpm-build yum -y install vixie-cron crontabs logrotate yum-cron elinks http://packages.sw.be/ Download from "clamav" dir: clamav clamav-db clamd Download from "lua" dir: lua lua-devel Download from "rrdtool" dir: lua-rrdtool perl-rrdtool rrdtool yum -y install libdbi lua-devel gettext lua ruby xorg-x11-fonts-Type1 rpm -Uvh *rpm freshclam rm *rpm rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-8.ius.el5.noarch.rpm rpm --nodeps -e php php-cli php-common php-imap php-pdo php-ldap php-mysql yum install php52-pear php52 php52-cli php52-common php52-devel php52-gd php52-mbstring php52-mcrypt php52-mysql php52-pdo php52-soap php52-xml php52-xmlrpc php52-bcmath php52-pecl-apc php52-pecl-memcache php52-ldap
cd /opt tar xzf /root/zendto.tgz ln -s Zend* zendto
rpm -Uvh zendto*.noarch.rpm
This only applies to x86_64 (or x64 64-bit) systems, don't do this step on 32-bit x86 systems as you will achieve nothing. PHP as shipped has a limit of 2 Gbytes on the size of any upload, and we need to work round that.
This is already documented here.
This is already documented here.
cd /etc/apache2/sites-enabled rm 000-default cat <<EOF > 000-zendto <VirtualHost *:80> ServerAdmin webmaster@localhost HostnameLookups On DocumentRoot /opt/zendto/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /opt/zendto/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> LogLevel notice ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined </VirtualHost> EOF
Setup the secure SSL website if you need it. This is already documented here. Make sure the files ssl.conf, ssl.load and rewrite.load are linked from /etc/apache2/mods-available to /etc/apache2/mods-enabled.
Edit /etc/httpd/conf/httpd.conf and set the following lines appropriately for your site:
usermod -a -G www-data clamav cd /var mkdir zendto zendto/dropoffs zendto/incoming zendto/rrd touch zendto/zendto.log chown www-data zendto/* chgrp www-data zendto zendto/* chmod g+w zendto cd /opt/zendto chmod -R a+rX . chmod -R a+rx bin chown -R www-data templates_c myzendto.templates_c cache chgrp -R www-data templates_c myzendto.templates_c cache chmod -R g+w templates_c myzendto.templates_c cache
usermod -a -G apache clamav
Edit /etc/apparmor.d/local/usr.sbin.clamd and add this line (including the comma at the end:
/var/zendto/** r,
You need to do one of
export EDITOR=vi crontab -eAdd these 3 lines at the end:
5 0 * * * /usr/bin/php /opt/zendto/sbin/cleanup.php /opt/zendto/config/preferences.php 2 10 * * * /usr/bin/php /opt/zendto/sbin/rrdInit.php /opt/zendto/config/preferences.php 2 12 * * * /usr/bin/php /opt/zendto/sbin/rrdUpdate.php /opt/zendto/config/preferences.php
You need to put your own settings into /etc/postfix/main.cf. The ones you need to change are:
And put only your internet domain name into /etc/mailname. This file must only be 1 line.
You need to put your own settings into /etc/mail/sendmail.mc. The only change required is to remove and "dnl" from the start of the line that defines "SMART_HOST" and set the value to the fully qualified name of your SMTP server or "smarthost". This must be configured to accept and deliver any mail from your ZendTo server, even if its "From" address is not in your domain.
Then run the command
cd /etc/mail ; make service sendmail restartIf that make command fails, install the sendmail-cf package with the command
yum -y install sendmail-cf
ZendTo requires a small back-end database to store all its information. On Ubuntu I strongly recommend you use SQLite as it is a lot simpler to use and requires no configuration at all. On CentOS you have to use MySQL as SQLite is not available for PHP on CentOS or RedHat.
Setting up the MySQL database can be done by creating an empty database, importing the table layout and granting the proper permissions to the zendto user. Here is an example of that procedure:
# mysql mysql> CREATE DATABASE zendto; mysql> GRANT ALL PRIVILEGES ON zendto.* TO zendto@localhost IDENTIFIED by 'password'; mysql> quit # mysql --user=zendto --password='password' zendto < /opt/zendto/sql/zendto.MySQL
And then try starting a web browser and going to http://your.site.here/about.php. That will trigger the creation of all the necessary database tables. Then try the website's home page at http://your.site.here.
If it doesn't work, check your Apache logs in /var/log/apache2 (Ubuntu) or /var/log/httpd (CentOS).
cd /opt/zendto/sbin php rrdInit.php /opt/zendto/config/preferences.php
Ignore any "PHP Notice" output from that.
If you have got this far, well done!
Use the scripts in /opt/zendto/bin to add a new local user and list the users. All the scripts in there will show you their command-line syntax if you run them with no command-line parameters. It is worth setting ZENDTOPREFS as suggested.
If you can now log in, you need to go and configure /opt/zendto/config/preferences.php and then /opt/zendto/config/zendto.conf. Those 2 files are pretty well commented.