[ZendTo] My updates to Zendto site Centos install

John Cooper johnpcooper at yahoo.com
Tue Apr 19 09:34:20 BST 2011


Installing ZendTo on CentOS 5.6

The aim of this document is to provide brief notes so that an 
experienced system administrator can install ZendTo on an existing 
CentOS server.
This assumes a brand new server only to be used for zendto

yum -y install sendmail sendmail-cf httpd mod_ssl mysql mysql-server 
rpm-build vixie-cron crontabs logrotate yum-cron

chkconfig mysqld on
chkconfig httpd on
chkconfig iptables off
chkconfig ip6tables off

service mysqld start

mysql_secure_installation

Set root password? [Y/n] y
New password:
Re-enter new password:

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

rpm -Uvh 
http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm 
http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.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-6.ius.el5.noarch.rpm

Ensure php 5.1 is removed

  yum remove php php-cli php-common php-imap php-pdo php-ldap php-mysql

Install PHP 5.2 (5.3 is available but will give errors about timezone 
which are not fixed by adding timezone in php.ini)

  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
  yum -y install libdbi lua-devel gettext lua ruby xorg-x11-fonts-Type1 
perl-rrdtool rrdtool clamav clamav-db clamd
  service clamd start
  chkconfig clamd on
  freshclam

Install zendto repo and packages

  rpm -Uvh http://zend.to/files/zendto-repo.rpm
  yum install zendto

Build PHP

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. http://zend.to/phpfix.php

php.ini

This is already documented here. http://zend.to/phpini.php

Apache

Edit /etc/httpd/conf/httpd.conf and set the following lines 
appropriately for your site:


The name of your ZendTo website with ":80" added on the end

ServerName

DocumentRoot /var/www/html
to
DocumentRoot /opt/zendto/www

Around line 307, should contain /opt/zendto/www between the quotes

<Directory "/var/www/html">
to
<Directory "/opt/zendto/www">

HostnameLookups on

Set Permissions

  usermod -a -G apache clam

Configure SELinux

You need to do one of (I will disable it)

     * Configure SELinux to allow clamd access to everything in and 
under /var/zendto, or
     * Disable SELinux altogether.
       Edit /etc/sysconfig/selinux and change the setting to
       SELINUX=disabled

Setup Mail

If you have direct internet access, you may not need to alter any 
settings and will just work for sending enails.
Update /etc/mail/sendmail.mc as required. 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.
If you make changes, "cd /etc/mail && make" then "service sendmail restart"

If you still cannot get mail to be delivered correctly, I have written a 
minimal sendmail.mc file which will work perfectly well for most people. 
Just read the file to see what to change for your organisation.

Setup Database

ZendTo requires a small back-end database to store all its information. 
On CentOS you have to use MySQL as SQLite is not available for PHP on 
CentOS or RedHat.
MySQL

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 -uroot -p
  mysql> CREATE DATABASE zendto;
  mysql> GRANT ALL PRIVILEGES ON zendto.* TO zendto at localhost
     IDENTIFIED by 'zendpassword';
  mysql> quit

where zendpassword is your own password

  # mysql --user=zendto --password='zendpassword' zendto < 
/opt/zendto/sql/zendto.MySQL

Update /opt/zendto/config/preferences.php

  define('SqlBackend', 'MySQL');
  //define('SqlBackend', 'SQLite');

  // Next 4 lines needed for MySQL operation
  'MySQLhost'            => 'localhost',
  'MySQLuser'            => 'zendto',
  'MySQLpassword'        => 'zendpassword<',
  'MySQLdb'              => 'zendto',

If you are upgrading from a previous version of ZendTo and the database 
has changed, just do the last "mysql" command given above. It will not 
delete anything, don't worry; it will just add any new tables necessary.

Reboot to ensure all services are started/stopped as necessary.

Logon back on

  # sestatus
  SELinux status:                 disabled
  # service iptables status
  Firewall is stopped.

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/httpd.

Setup Logging

cd /opt/zendto/sbin
php rrdInit.php /opt/zendto/config/preferences.php

Ignore any "PHP Notice" output from that.

Add a User

cd /opt/zendto/bin
php adduser.php mcooper zendtopass2011 mcooper at uni.ac.uk 'M Cooper' 'My Uni'

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.

Beaware of these settings as they will need changing :-
  'localIPSubnets'       => array('139.166.','152.78'),
  'recaptchaPublicKey'   => '1111111111111111111111111111111111111111',
  'recaptchaPrivateKey'  => '1111111111111111111111111111111111111111',
  'authIMAPServer' => 'mail.soton.ac.uk',
  'authIMAPDomain' => 'soton.ac.uk',
  'defaultEmailDomain' => 'soton.ac.uk',
  'emailDomainRegexp' => '/^([a-zA-Z\.\-]+\.)?soton\.ac\.uk$/i',
  'cookieSecret'      => '11111111111111111111111111111111',


More information about the ZendTo mailing list