<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    This is why I distribute it as a VM, so you don't have to do all
    this stuff by hand (it's quite a long list of instructions). But
    from my notes on building the VMs, here are what I have to say on
    the subject. For starters, do this on a 64-bit build of Ubuntu, not
    32-bit, or you will be limited to 2 Gbyte uploads due to limitations
    in PHP. You still have to rebuild the Apache PHP library with some
    code edits to get past the 2 Gbyte upload limit, but at least in
    64-bit it can be done. I will leave out all the stuff to do with
    https, as you can add that later yourself (and it's on the website
    Documentation page).<br>
    <br>
    Here we go.....<br>
    <br>
    Install Ubuntu 10 server 64-bit<br>
    Partition manually.<br>
    Part 1 = primary 2.0 GB swap at beginning of disk<br>
    Part 2 = primary max / ext4 bootable<br>
    Install security updates automatically.<br>
    Software selection: Basic, LAMP, OpenSSH.<br>
    Install GRUB in master boot record.<br>
    <br>
    Remove CD/DVD and reboot.<br>
    <br>
    SSH in remotely, stop using console.<br>
    <br>
    sudo su -<br>
    <br>
    This chunk rebuilds the Apache PHP5 library so that uploads can be
    more than 2 Gbytes.<br>
    <br>
    mkdir php-source<br>
    cd php-source<br>
    apt-get -y 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<br>
    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<br>
    apt-get -y install clamav clamav-daemon<br>
    apt-get -y install php5 php5-cli php5-sqlite php5-ldap php5-apc<br>
    apt-get -y install rrdtool<br>
    apt-get -y source php5-cgi<br>
    cd php5*<br>
    perl -i -pe 's/int zend_atoi/long zend_atoi/'
    Zend/zend_operators.[ch];<br>
    perl -i -pe 's/\n/@@@@@@/g' Zend/zend_operators.c;perl -i -pe
    's/(long zend_atoi.*?)int retval/$1long retval/m'
    Zend/zend_operators.c;<br>
    perl -i -pe 's/@@@@@@/\n/g' Zend/zend_operators.c;perl -i -pe
    's/atoi\(content_length\)/atol(content_length)/' `find sapi -name
    '*.c'`perl -i -pe 's/\(uint\)( SG\(request_info\))/$1/' `find sapi
    -name '*.c'`;<br>
    perl -i -pe 's/uint post_data_length, raw/uint
    IGNORE_post_data_length, IGNORE_raw/' main/SAPI.h;perl -i -pe 's/}
    sapi_request_info/\tlong post_data_length, raw_post_data_length;\n}
    sapi_request_info/' main/SAPI.h;<br>
    perl -i -pe 's/int read_post_bytes/long read_post_bytes/'&nbsp;&nbsp;&nbsp;
    main/SAPI.h;<br>
    perl -i -pe 's/int boundary_len=0, total_bytes=0/long total_bytes=0;
    int boundary_len=0/' main/rfc1867.c;<br>
    # Omit this for the 32-bit build<br>
    dpkg-buildpackage -rfakeroot -uc -b -j2<br>
    cd debian/libapache2-mod-php5/usr/lib/apache2/modules<br>
    mv /usr/lib/apache2/modules/libphp5.so
    /usr/lib/apache2/modules/libphp5.so-UBUNTU<br>
    cp libphp5.so /usr/lib/apache2/modules/<br>
    # End Omit this for the 32-bit build<br>
    <br>
    Bit of cleaning up.<br>
    cd<br>
    apt-get remove mysql-server<br>
    rm -rf ~/php-source<br>
    <br>
    Setup PHP for ZendTo<br>
    cd /etc/php5/apache2<br>
    Edit php.ini<br>
    allow_call_time_pass_reference = On<br>
    max_execution_time = 7200<br>
    max_input_time = 7200<br>
    memory_limit = 300M<br>
    error_reporting = E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED<br>
    display_errors = On<br>
    post_max_size = 50000M<br>
    upload_tmp_dir = /var/zendto/incoming<br>
    upload_max_filesize = 50G<br>
    max_file_uploads = 200<br>
    <br>
    Edit conf.d/apc.ini<br>
    apc.rfc1867 = on<br>
    apc.max_file_size = 50G<br>
    <br>
    Setup the ZendTo website.<br>
    cd /etc/apache2/sites-enabled<br>
    rm 000-default<br>
    cat &lt;&lt;EOF &gt; 000-zendto<br>
    &lt;VirtualHost *:80&gt;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerAdmin webmaster@localhost<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HostnameLookups On<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DocumentRoot /opt/zendto/www<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Directory /&gt;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options FollowSymLinks<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride None<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Directory&gt;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Directory /opt/zendto/www/&gt;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options Indexes FollowSymLinks MultiViews<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride None<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Order allow,deny<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow from all<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Directory&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LogLevel notice<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ErrorLog /var/log/apache2/error.log<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CustomLog /var/log/apache2/access.log combined<br>
    &lt;/VirtualHost&gt;<br>
    EOF<br>
    <br>
    Set all the permissions required and make sure that AppArmor doesn't
    get in the way of the virus scanning.<br>
    usermod -a -G www-data clamav<br>
    <br>
    Edit /etc/apparmor.d/usr.sbin.clamd<br>
    - Add "&nbsp; /var/zendto/** r," just before the last line<br>
    <br>
    cd /var<br>
    mkdir zendto zendto/dropoffs zendto/incoming zendto/rrd<br>
    touch zendto/zendto.log<br>
    chown www-data zendto/*<br>
    chgrp www-data zendto zendto/*<br>
    chmod g+w zendto<br>
    <br>
    Housekeeping jobs.<br>
    export EDITOR=vi<br>
    crontab -e<br>
    Add these 3 lines at the end:<br>
    5 0 * * * /usr/bin/php /opt/zendto/sbin/cleanup.php
    /opt/zendto/config/preferences.php<br>
    2 10 * * * /usr/bin/php /opt/zendto/sbin/rrdInit.php
    /opt/zendto/config/preferences.php<br>
    2 12 * * * /usr/bin/php /opt/zendto/sbin/rrdUpdate.php
    /opt/zendto/config/preferences.php<br>
    <br>
    Unpack all the source under /opt/ZendTo-3.63.<br>
    Build all the source code owned by root.root under /opt/zendto,<br>
    making /opt/ZendTo-3.63 the real dir with /opt/zendto a symlink to
    it.<br>
    <br>
    Basically, the web server must be able to write into the directories
    cache and templates_c (ignore the MyZendTo stuff for now, that's a
    slightly different project that ships with ZendTo). And the web
    server must be able to read everything else.<br>
    cd /opt/zendto<br>
    chown -R www-data cache *templates_c<br>
    chgrp -R www-data cache *templates_c<br>
    chmod -R ug+rwX cache *templates_c<br>
    chmod -R o+rX *<br>
    <br>
    service apache2 restart<br>
    <br>
    Load the home page of the new website in a web browser.<br>
    Click on the "About" button.<br>
    That will create the database.<br>
    <br>
    Login and "sudo su -" to get root access.<br>
    <br>
    cd /opt/zendto/sbin<br>
    php rrdInit.php /opt/zendto/config/preferences.php<br>
    Ignore any "PHP Notice" output from that.<br>
    <br>
    Then start setting up the authentication in
    /opt/zendto/config/preferences.php. If you are using AD or LDAP then
    play with "ldapsearch" until you can get it to read users'
    information, and then you will have the right strings to put into
    preferences.php.<br>
    <br>
    If you are going to use the "Local" authentication to start with,
    then look in /opt/zendto/bin for all the commands required to add
    and edit the user table. It *never* stores plain-text passwords,
    don't worry!<br>
    <br>
    Customise the user interface with /opt/zendto/config/zendto.conf. If
    you want to make bigger changes, then it's all templated in
    /opt/zendto/templates.<br>
    <br>
    Hopefully that will get you started.<br>
    Do you see why I distribute it as a pre-built VM now? :-)<br>
    <br>
    Jules.<br>
    <br>
    On 09/02/2011 13:09, Nigel Kendrick wrote:
    <blockquote
      cite="mid:AANLkTim4SOewwBbZFd4jZCEAy5KFxTESwvRabiL8kfJ+@mail.gmail.com"
      type="cite">Hi Jules and everybody else,<br>
      <br>
      I'm looking to install ZendTo on a Ubuntu server so I have to
      start with the tar version. I've unpacked it and now deeply
      missing the comfort of an install.sh a la MailScanner!<br>
      <br>
      I've checked the docs on site and as supplied in the tar file but
      can't see where to dive in. Any pointers appreciated.<br>
      <br>
      Thanks<br>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
ZendTo mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ZendTo@zend.to">ZendTo@zend.to</a>
<a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto">http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">Jules

-- 
Julian Field MEng CITP CEng
<a class="moz-txt-link-abbreviated" href="http://www.Zend.To">www.Zend.To</a>

Follow me at twitter.com/JulesFM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

'All programs have a desire to be useful' - Tron, 1982
</pre>
  </body>
</html>