<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>semioticpixels &#187; plone</title> <atom:link href="http://www.semioticpixels.com/category/plone/feed/" rel="self" type="application/rss+xml" /><link>http://www.semioticpixels.com</link> <description></description> <lastBuildDate>Thu, 12 Jan 2012 08:43:04 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Plone 2 -&gt; Plone 3 Migration: Setting up</title><link>http://www.semioticpixels.com/linux-server-administration/plone-2-plone-3-migration-setting-up/</link> <comments>http://www.semioticpixels.com/linux-server-administration/plone-2-plone-3-migration-setting-up/#comments</comments> <pubDate>Thu, 04 Mar 2010 01:22:21 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[plone]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=270</guid> <description><![CDATA[I have 2 Plone 2.0 websites running on a single Zope instance that I need to: migrate from it&#8217;s ancient server to a more modern server upgrade to Plone 4 I&#8217;m migrating away from a 32 bit Red Hat 7(!) &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/plone-2-plone-3-migration-setting-up/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p> I have 2 Plone 2.0 websites running on a single Zope instance that I need to:</p><ol><li>migrate from it&#8217;s ancient server to a more modern server</li><li>upgrade to Plone 4</li></ol><p><span id="more-270"></span><br /> I&#8217;m migrating away from a 32 bit Red Hat 7(!) server to a 64 bit Ubuntu Lucid.  The reasons should be obvious from that statement alone, but in short:  Red Hat 7 reached its end-of-life years ago.  It&#8217;s stable (so far) but &#8230; for how long?</p><p>The server environment I&#8217;m migrating away from is:<br /> - Server: Zope/(Zope 2.7.3-0, python 2.3.3)<br /> - ZServer/1.1<br /> - Plone/2.0.3</p><p>I&#8217;ll also be upgrading from Apache 1.3 to Apache 2 and considering a switch from Squid to Varnish for caching</p><h3>Getting started: Migrating from Red Hat 7.3 to Ubuntu 10</h3><p>Zope is an &#8220;in-place&#8221; installation, which means it runs from the directory that you put it in.  This is nice and simple, makes it easier to run different versions of Zope on the same server with associated different versions of Python and Plone and, theoretically it should be easy to move to another system altogether.</p><p>My first pass, I rsynced the Zope directory (which contained sources for Zope, Plone, and Python) over from the old server to the new one and tried to compile Python and Zope to see what would happen.  Unfortunately, when I compiled Python, I got a bunch of errors that indicated my version of  Python was optimized for a 32 bit system and &#8230; the new server is 64 bit.  This error looks like this:</p><pre class="brush: bash; title: ; notranslate"> ' Parser/tokenizer_pgen.o' is incompatible with i386:x86-64 output</pre><p>Python  2.3.7 was the oldest version that I could get running on the new VM that didn&#8217;t throw 32 bit errors.  I briefly considered re-compiling Python 2.3.3 with -m32 option to GCC and I could have spent some time getting 2.3.3 running  but 2.3.7 was a bugfix release and the most stable of the 2.3 releases and should work fine so I chose to save time by going with it.  We&#8217;ll see if I regret that later.  I was also reminded in the course of this process to clean up my mess with</p><p><code>$ sudo make clean</code></p><p>When I compiled Python, the following error occurred: <code> Can't locate Tcl/Tk libs and/or headers</code>, so I had to install the tcl/tk libraries (added to setup below)</p><p>Plone/2.0.3 was hard to find, although I was able to locate a copy of Plone/2.0.5.  I don&#8217;t have a development server to upgrade the website to 2.0.5 so if I have to use it, I  may have to keep my fingers crossed. Since Plone is installed as a Zope Product and doesn&#8217;t require compilation, I will first try to copy over the Products directory of the website and see if it&#8217;ll just work.</p><p>I will also need to install PIL and PyXML</p><p>When I compiled Zope the first time, I got error messages that zlib was missing. It turns out that Ubuntu ships with zlib, but not zlib-dev installed.  Also, when researching that error, I came across a comment that I would need to install system support (libjpeg62) for PIL so those 2 lines have been added to the setup below.</p><h3>Initial Server Setup</h3><h4>update and install basics</h4><pre><code>sudo apt-get install update
sudo apt-get upgrade
make sure gcc is up to date
sudo apt-get install build-essential
sudo apt-get install zlib1g zlib1g-dev libjpeg62 libjpeg62-dev tcl tcl-dev tk tk-dev vim-nox lynx</code>

#note on Ubuntu 10.10 vim-full has been replaced by vim-nox. I also installed libfreetype6-dev (libfreetype6 was already installed, but install it if it isn't)
</pre><p>update the locate db so you can find stuff</p><p><code>$sudo updatedb</code></p><p>change root password<br /> <code>$sudo passwd</code></p><p>create a user with sudo privileges:<br /> <code>$ useradd -m -c "real name" -s /bin/bash chris</code></p><p>The flags create a home directory with skel profile defaults and this account is linked to the defaults for bash shell, which is important if you like syntax coloring and tab completion.<br /> If you haven&#8217;t created an admin group with sudo privileges, you can add sudo privileges to the individual user</p><pre><code>$passwd chris
$sudo visudo</code></pre><p>Find the line that says #User Privilege specification and add</p><pre><code>
chris ALL=(ALL) ALL
shift ZZ to save and exit</code></pre><p>or just add the new user to the admin group<br /> <code>sudo usermod -G admin chris</code></p><p>create zope user<br /> $useradd -m -c &#8220;zope&#8221; -s /bin/bash zope<br /> $passwd zope</p><p>Do not add zope user to the sudoers list.</p><p>Disable root login<br /> <code>$sudo vi /etc/ssh/sshd_config</code></p><p>Change &#8220;PermitRootLogin yes&#8221; to &#8220;PermitRootLogin no&#8221;<br /> Reload ssh<br /> <code>$sudo /etc/init.d/ssh reload</code></p><h3>Create Directory Structure</h3><p>The Library directory in the below structure may look a little over-organized at first pass. However, my next project after completing this migration will be to upgrade from Plone 2.0.3 to Plone 3 which will require several interim upgrades.  This version of the website is running on Zope 2.7.3. Each interim upgrade will be installed to it&#8217;s respective directory within Library/Software keeping everything well organized and easy to roll back to if necessary.</p><p>in /usr/local</p><p>/usr/local/Zope<br /> &#8230;./Downloads: where downloads will be stored<br /> &#8230;./src: where software will be unarchived<br /> &#8230;./Library: where compiled software will be compiled to<br /> &#8230;&#8230;&#8230;./Software<br /> &#8230;&#8230;&#8230;&#8230;&#8230;/Zope273<br /> &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;../Python<br /> &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;./Zope<br /> &#8230;/Sites: where each website to be hosted lives<br /> &#8230;&#8230;&#8230;/instancename1<br /> &#8230;&#8230;../instancename2</p><pre><code>
# cd /usr/local/Zope/Downloads
# wget http://www.python.org/ftp/python/2.3.7/Python-2.3.7.tgz
# wget http://www.zope.org/Products/Zope/2.7.0/Zope-2.7.0.tgz
# wget http://dist.plone.org:5021/archive/Plone-2.0.5.tar.gz
# wget http://sourceforge.net/projects/pyxml/files/pyxml/0.8.4/PyXML-0.8.4.tar.gz
# wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
#cp * /usr/local/Zope/src/</code></pre><h3>Install Python 2.3.7</h3><p>Build Python 2.3 from source with the following steps:</p><pre><code>cd /usr/local/Zope/src/
tar -xvzf Python-2.3.7.tgz
cd Python-2.3.7
</code>
<pre><code>./configure BASECFLAGS=-U_FORTIFY_SOURCE --prefix=/usr/local/Zope/Library/Software/Zope273/Python</code></pre><p># Note: on Ubuntu 10.10 I had to add BASECFLAGS. The configure script for older versions of Ubuntu was:</p><pre><code>./configure --prefix=/usr/local/Zope/Library/Software/Zope273/Python</code></pre><p>make<br /> make install</pre><h3>Install PIL</h3><p><a href=" http://www.pythonware.com/products/pil/">More info</a></p><p>At the time of this writing, PIL 1.1.6 is compatible with Python 1.5.2 and up and fixes some 64 bit compatibility errors in Python 2.5 (which we&#8217;re not using yet for this Zope installation)</p><p>On Ubuntu, you have to edit setup.py before installing PIL<br /> <code>#sudo vi /usr/local/Zope/src/Imaging-1.1.6/setup.py</code></p><p>find the line<br /> <code>#TCL_ROOT = None</code></p><p>and replace it with<br /> <code>TCL_ROOT = "/usr/include/tk"</code></p><pre><code>#/usr/local/Zope/Library/Software/Zope273/Python/bin/python2.3 setup.py build
#/usr/local/Zope/Library/Software/Zope273/Python/bin/python2.3 setup.py install</code></pre><h3>Install PyXML</h3><pre><code>cd /usr/local/Zope/src/PyXML-0.8.4/</code>

#/usr/local/Zope/Library/Software/Zope273/Python/bin/python2.3 setup.py build
#/usr/local/Zope/Library/Software/Zope273/Python/bin/python2.3 setup.py install
</pre><h4>Other recommended packages</h4><p>elementree has been recommended, but it&#8217;s not installed on the old system so I&#8217;m not going to worry about it atm.</p><p>Also, the http://plone.org/documentation/kb/setup-from-source plone article recommends installing DocFinder as an invaluable development tool, but again, I don&#8217;t need this to get the website running so I&#8217;m going to come back to it.</p><h3>install zope 2.7.3</h3><p>Build Zope 2.7 from source with the following steps:</p><pre><code>cd /usr/local/Zope/src
tar -xvzf Zope-2.7.3.tgz
cd Zope-2.7.3
./configure --with-python=/usr/local/Zope/Library/Software/Zope273/Python
bin/python2.3 --prefix=/usr/local/Zope/Library/Software/Zope273/Zope
make
make install
</code></pre><h4>create zope instance(s)</h4><p>The zope user must have write access to create the directory. After the instance is created, edit #&#8221;effective-user zope&#8221; into the etc/zope.conf file, so if you start it as root later it should #su itself to the non-root user. Again: make install should be run as root, #mkzopeinstance.py should not.</p><p>Initially, when I tried to create an instance, it failed with the error:<br /> <code># /usr/local/Zope/Library/Software/Zope273/Zope/bin/mkzopeinstance.py: /usr/local/Zope/bin/python: bad interpreter: No such file or directory</code></p><p>I think this was a result of not cleaning up a bad compilation. To fix this edit the first line in  mkzopeinstance.py from<br /> <code>#!/usr/local/Zope/bin/python</code><br /> To<br /> <code>#!/usr/local/Zope/LIbrary/Software/Zope273/Zope/bin/python</code></p><p>When Zope is compiled, one of the last things it does is create a symbolic link from where you told Zope the python interpreter you wanted it to use lives to Zope/bin/python. mkzopeinstance.py is looking for that symbolic link, and not looking for python itself.  This provides further separation so that we could theoretically upgrade python without touching Zope and then that symbolic link would only need to be changed.</p><p>The instance needs to be created with the zope user, NOT root</p><pre><code>
# su zope
# /usr/local/Zope/Library/Software/Zope273/Zope/bin/mkzopeinstance.py
# when prompted for the path to your instance, use:
# /usr/local/Zope/Sites/instance1  .... and so forth for each site.
</code></pre><h4>test Zope</h4><p>For the first instance, you can test by running /usr/local/Zope/Sites/instance1/bin/runzope. OR running /usr/local/Zope/Sites/instance1/bin/zopectl start</p><p>Once loaded, this will make Zope accessible on http://localhost:8080 (unless you changed the port), with the Zope Management Interface available on http://localhost:8080/manage (obviously if you&#8217;re accessing a remote server, then localhost might not work and you need to use the IP address)</p><p>shut down zone by either hitting ctrl+c if runzope was used or by running /usr/local/Zope/Sites/instance1/bin/zopectl stop if zopectl was used to start zone.</p><h3>Install the website</h3><pre><code>
cp originalSite/Products/* /usr/local/Zope/Sites/instance1/Products/
cp originalSite/var/Data.fs /usr/local/Zope/Sites/instance1/var/</code>

/usr/local/Zope/Sites/instance1/bin/zopectl start
</pre><p>navigate to the ZMI localhost:8080/manage<br /> (Note that the admin login credentials will match the credentials of the site migrated, not the credentials you compiled Zope with)<br /> The website I migrated over, even though I physically placed the files in the instance1 directory within /usr/local/Zope/Sites/instance1 are in the ZMI under &#8220;Plone&#8221;</p><p>click the Root Folder of the ZMI<br /> check the box beside &#8220;Plone&#8221;<br /> click the &#8220;rename&#8221; button and rename it to your instance1 site<br /> (at this point I discovered a dependency on lynx which I&#8217;ve added to the apt-get list above)</p><p>navigate to localhost:8080/instance1 to view the website</p><p>On first pass, everything worked!</p><h4>Users</h4><p>make sure that all the Zope files belong to the zope user<br /> cd /usr/local<br /> chown zope -R Zope<br /> chgrp zope -R Zope<br /> //////</p><h4>start Zope</h4><p>Start Zope with the following command:<br /> su zope<br /> /usr/local/Zope/Sites/dev/bin/zopectl start</p><h3>check it out</h3><p>Go to the http://mydomain.com:8080/manage, log in, create a new Plone site object.</p><h3>resources/references</h3><ul><li><a href="http://plone.org/documentation/kb/setup-from-source">setup from source</a></li><li><a href="http://plone.org/documentation/kb/robust-installation">plone installation</a></li><p><a href="http://www.python-forum.org/pythonforum/viewtopic.php?f=1&amp;t=10977">resolving tcl/tk error when installing PIL on Ubuntu Hardy</a></ul><p>Next up:</p><ul><li>VirtualHostMonster and Apache with mod_rewrite &amp; mod_proxy</li><li>caching: Cachefu, Pound, Squid, Varnish</li></ul> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/plone-2-plone-3-migration-setting-up/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>managing plone logs</title><link>http://www.semioticpixels.com/linux-server-administration/managing-plone-logs/</link> <comments>http://www.semioticpixels.com/linux-server-administration/managing-plone-logs/#comments</comments> <pubDate>Tue, 29 Sep 2009 01:32:48 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[plone]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=47</guid> <description><![CDATA[1. Add rotation script to logrotate sudo vi /etc/logrotate.conf add # system-specific logs may be also be configured here. /usr/local/Zope/Sites/SiteName/log/Z2.log { rotate 5 weekly compress size=100k sharedscripts postrotate #close and re-open all Zope log files (z2.log, event.log) The common idiom &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/managing-plone-logs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h3>1. Add rotation script to logrotate</h3><p>sudo vi /etc/logrotate.conf</p><p>add<br /> <span id="more-47"></span><br /> # system-specific logs may be also be configured here.<br /> /usr/local/Zope/Sites/SiteName/log/Z2.log {<br /> rotate 5<br /> weekly<br /> compress<br /> size=100k<br /> sharedscripts<br /> postrotate<br /> #close and re-open all Zope log files (z2.log, event.log) The common idiom after rotating Zope log files<br /> /bin/kill -s SIGUSR2 `cat /usr/local/Zope/Sites/SiteName/var/Z2.pid`<br /> endscript<br /> }</p><p>/usr/local/Zope/Sites/SiteName/log/event.log {<br /> rotate 5<br /> weekly<br /> compress<br /> size=100k</p><p>}</p><h3>2. Test log rotation</h3><p>Do a test run of the rotation without actually rotating anything:</p><p><code>/usr/sbin/logrotate -d /etc/logrotate.conf</code></p><p>if the test run completes without any erros, force a rotation:<br /> <code>/usr/sbin/logrotate -f /etc/logrotate.conf</code></p><h3>3. Automate with crontab</h3><p>On RedHat, crontab may be set up with runparts e.g.</p><pre><code># run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly</code></pre><p>In this case, place a script in the directory where it should run regularly.  I&#8217;m going to rotate weekly for now, so I&#8217;m placing a script in /etc/cron.weekly and naming it zope.cron (you can name it whatever you want. Any script in this directory will run weekely</p><pre><code>sudo vi /etc/cron.weekly/zope.cron

#rotate Z2.log and event.log in SiteName

0 01 * * * root /usr/sbin/logrotate /etc/logrotate.conf > /dev/null2>&#038;1</code></pre>]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/managing-plone-logs/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>installing plone on ubuntu/slicehost</title><link>http://www.semioticpixels.com/linux-server-administration/installing-plone-on-slicehost/</link> <comments>http://www.semioticpixels.com/linux-server-administration/installing-plone-on-slicehost/#comments</comments> <pubDate>Wed, 02 Sep 2009 02:00:19 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[plone]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[ubuntu]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=36</guid> <description><![CDATA[Setting up the Slicehost Account Update everything sudo apt-get update sudo apt-get upgrade install vim full so you can edit files apt-get install vim-full update the &#8220;locate&#8221; db sudo updatedb Change the root password sudo passwd Set up Users useradd &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/installing-plone-on-slicehost/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h3>Setting up the Slicehost Account</h3><p><strong>Update everything</strong><br /> <code>sudo apt-get update</code><br /> <code>sudo apt-get upgrade</code><span id="more-36"></span></p><p><strong>install vim full so you can edit files</strong><br /> <code>apt-get install vim-full</code></p><p><strong>update the &#8220;locate&#8221; db</strong><br /> <code>sudo updatedb</code></p><p><strong>Change the root password</strong><br /> <code>sudo passwd</code></p><p><strong>Set up Users</strong><br /> <code>useradd zope</code> (I like useradd because there&#8217;s no reason to have a home directory. If you want your user to have a home directory then use <code>adduser</code> or <code>useradd -D zope</code> to create ~/home/zope)<br /> <code>passwd zope</code><br /> <code>useradd -m  -c "real name" -s /bin/bash auserwithsudoers</code> The flags create a home directory with skel profile defaults and this account is linked to the defaults for bash shell, which is important if you like syntax coloring and tab completion.<br /> <code>passwd auserwithsudoers</code><br /> <code>sudo visudo </code><br /> Find the line that says #User Privilege specification and add<br /> <code>auserwithsudoers ALL=(ALL) ALL</code><br /> <code>shift ZZ </code> to save and exit</p><p>Now log out as root and login as your new admin user and test sudo<br /> <code>su auserwithsudoers</code><br /> <code>sudo bash</code></p><p><strong> Disable root login</strong><br /> <code>su root</code><br /> <code>sudo vim /etc/ssh/sshd_config</code><br /> Change &#8220;PermitRootLogin yes&#8221; to &#8220;PermitRootLogin no&#8221;</p><p><strong>Reload the ssh config</strong><br /> <code>sudo /etc/init.d/ssh reload</code></p><h3>Ok! Now we&#8217;re ready to think about plone</h3><ol><li>Follow the plone install instructions <a href="http://www.semioticpixels.com/2007/12/install-plone-3-on-ubuntu-7-10/">here</a></li><li>install some products (<a href="http://plone.org/documentation/tutorial/third-party-products/installing">see plone documentation </a>on using buildout).  Here&#8217;s what I did to install a Press Release product<ol><li>download the product. If there&#8217;s a choice of files, choose the one with the naming convention Products.package.tar.gz.  This is a python egg.</li><li><code>su zope<br /> vi /usr/local/Plone/zeocluster/buildout.cfg</code><br /> add the following:</p><pre><code>[buildout]
...
eggs =
Products.PressRelease</code></pre><p>and save (<code>ctrl + ZZ</code>)</li><li><code>sudo /usr/local/Plone/zeocluster/bin/buildout</code></li><li><code>sudo /usr/local/Plone/zeocluster/bin/plonectl restart</code></li><li>In each Plone site where you want to install the Product, go Site Setup&gt;Add/Remove Products and install the Product.</li></ol></li></ol> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/installing-plone-on-slicehost/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 13/18 queries in 0.009 seconds using disk: basic
Object Caching 431/431 objects using disk: basic

Served from: www.semioticpixels.com @ 2012-02-04 23:18:56 -->
