<?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; linux server administration</title> <atom:link href="http://www.semioticpixels.com/category/linux-server-administration/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>nvidia drivers in ubuntu maverick</title><link>http://www.semioticpixels.com/linux-server-administration/nvidia-drivers-in-ubuntu-maverick/</link> <comments>http://www.semioticpixels.com/linux-server-administration/nvidia-drivers-in-ubuntu-maverick/#comments</comments> <pubDate>Wed, 19 Jan 2011 21:45:00 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=428</guid> <description><![CDATA[The other day, I ran an update on my Maverick box that wiped out my video settings. Nvidia released a nice new driver for GeForce 6000+ but I&#8217;m using a GeForce 5 series card so I think the upgrade probably &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/nvidia-drivers-in-ubuntu-maverick/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>The other day, I ran an update on my Maverick box that wiped out my video settings.  Nvidia released a nice new driver for GeForce 6000+ but I&#8217;m using a GeForce 5 series card so I think the upgrade probably replaced my video settings with the nice new ones.</p><p>There are a lot of unresolved forum posts about this &#8230; if you&#8217;re using an older video card, you just need to uninstall the new Nvidia drivers and re-install the legacy drivers:</p><pre class="brush: bash; title: ; notranslate">apt-get remove --purge nvidia-current
apt-get install nvidia-173
</pre>]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/nvidia-drivers-in-ubuntu-maverick/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>setting up Ubuntu Lucid 10.04 for web development Part 1</title><link>http://www.semioticpixels.com/linux-server-administration/setting-up-ubuntu-lucid-10-04-for-web-development-part-1/</link> <comments>http://www.semioticpixels.com/linux-server-administration/setting-up-ubuntu-lucid-10-04-for-web-development-part-1/#comments</comments> <pubDate>Sun, 23 May 2010 20:07:32 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[linux server administration]]></category> <category><![CDATA[lamp stack]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[web server]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=310</guid> <description><![CDATA[Ubuntu Lucid 10.04 is the most recent LTR released about a week ago, so naturally I wanted to take a look. I upgraded my test server which is where I run demo installs of various content management systems and where &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/setting-up-ubuntu-lucid-10-04-for-web-development-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p> Ubuntu Lucid 10.04 is the most recent LTR released about a week ago, so naturally I wanted to take a look.  I upgraded my test server which is where I run demo installs of various content management systems and where I store works-in-progress.  This requires that the server must serve up a number of applications written in php, django, plone, and ruby on rails.<span id="more-310"></span></p><p>Lucid ships with php 5.3, the newest version of php.  Unfortunately a number of popular open source content management systems do not yet run on 5.3.  This was also an issue when I upgraded my mac to Snow Leopard.  In both cases, php 5.3 must be downgraded to 5.2.10 (you could choose to run both versions too, but I&#8217;m not going to address that here).</p><h3>Setting up a Lucid server on SliceHost</h3><p>on Slicehost, if you&#8217;re willing to wipe out everything, you can rebuild a clean slice for Lucid, which is what I chose.</p><ol><li>upgrade your kernel to 2.6.32-16.25</li><li>rebuild slice with Lucid</li></ol><p>As soon as the build is complete, you need to ssh in, and</p><ol><li>change the root password<pre class="brush: bash; light: true; title: ; notranslate">passwd</pre></li><li>create a sudoers group and create and add a user to it<pre class="brush: bash; title: ; notranslate">groupadd sudoers
visudo</pre><p>add</p><pre class="brush: bash; title: ; notranslate">%sudoers ALL=(ALL) ALL</pre><p>create user with sudo privileges</p><pre class="brush: bash; title: ; notranslate">useradd yourUserName
usermod -a -G sudoers yourUserName</pre></li><li>edit ssh configuration to disallow root login<pre class="brush: bash; title: ; notranslate"> vi /etc/ssh/sshd_config </pre><p>find</p><pre class="brush: bash; title: ; notranslate"> PermitRootLogin yes</pre><p> and set it to</p><pre class="brush: bash; title: ; notranslate">PermitRootLogin no</pre><p>add</p><pre class="brush: bash; title: ; notranslate">AllowUsers yourusername</pre></li><li>setup IPtables<br /> I used http://articles.slicehost.com/2010/4/30/ubuntu-lucid-setup-part-1</li><li>reload ssh<pre class="brush: bash; title: ; notranslate">/etc/init.d/ssh reload</pre></li><li>Add additional sources to sources.list. See <a href="http://repogen.simplylinux.ch/">sources list generator</a> for more sources lists.<pre class="brush: bash; title: ; notranslate">vi /etc/apt/sources.list</pre></li><li>Set to use bash<pre class="brush: bash; title: ; notranslate">dpkg-reconfigure dash</pre><p>select &#8220;no&#8221;</li><li>synchronize date<pre class="brush: bash; title: ; notranslate">apt-get install ntp ntpdate</pre></li><li>Install tools for compiling<pre class="brush: bash; title: ; notranslate">apt-get install build-essential</pre></li><li>if you&#8217;re a vi user, install vim-nox (hint: I used to install vim-full, but that&#8217;s now deprecated in Lucid)<pre class="brush: bash; title: ; notranslate">apt-get install vim-nox</pre></li></ol><h3>Set up LAMP server</h3><ol><li>If you don&#8217;t need to compile from source, you can use one of Ubuntu&#8217;s 1-liners for installing a LAMP server.<pre class="brush: bash; title: ; notranslate">tasksel1
or
1apt-get install lamp-server^</pre><p>I used the latter. This will return the following:</p><pre class="brush: bash; title: ; notranslate">apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdbd-mysql-perl libdbi-perl libexpat1 libhtml-template-perl libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 php5-common php5-mysql psmisc
Suggested packages:
www-browser apache2-doc apache2-suexec apache2-suexec-custom ufw php-pear zbishell  libipc-sharedcache-perl tinyca mailx php5-suhosin
The following NEW packages will be installed:
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdbd-mysql-perl libdbi-perl libexpat1 libhtml-template-perl libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 php5-common php5-mysql psmisc</pre></li><li>test apache <br />http://www.domainname.com/<br />should return &#8220;It Works!&#8221;</li><li>test php<pre class="brush: bash; title: ; notranslate">vi /var/www/test.php
&amp;lt;php phpinfo(); ?&amp;gt;</pre></li><li>reload apache<pre class="brush: bash; title: ; notranslate">/etc/init.d/apache2 restart</pre><p>navigate in browser to http://www.domainname.com/test.php</code></code></li><li>check that mysql is bound to localhost<pre class="brush: bash; title: ; notranslate">cat /etc/mysql/my.cnf | grep bind-address</pre><p>should return</p><pre class="brush: bash; title: ; notranslate">bind-address	=127.0.0.1</pre><p>If it doesn't, edit /etc/mysql/my.cnf with correct address</li></ol><p>Ok! everything works as planned. Two small tasks remaining:  We need to downgrade php from 5.3 to 5.2.10 and install more php libraries.</p><h4>Downgrading Lucid from PHP 5.3 to 5.2</h4><p>There are several methods floating around out there, which all use the same idea.</p><ul><li><a href="http://mrkandy.wordpress.com/2010/04/16/install-php-5-2-x-in-ubuntu-10-04-lucid/">MrKandy</a> wrote a good script</li><li><a href="http://www.nickveenhof.be/blog/reverting-or-downgrading-php-53-52-ubuntu-lucid-lynx-1004">Nck Veenhof</a></li><li><a href="http://thejibe.com/blog/10/5/php-5210-debs-ubuntu-104-lucid">the jibe blog</a>.  I used the bash script provided in the comments on this blog post because it was the most succinct.</li></ul><p>For future use, I created <a href="http://www.semioticpixels.com/wp-content/uploads/2010/05/lucidDowngradePHP.txt">this bash script</a></p><p>You can either execute that script as a bash script or execute it within the shell. I initially executed it within the shell, then later decided to save it as an executable script for future use.<br /> To execute as a script</p><ol><li>create a directory somewhere you'd like to store scripts. It could be ~/home/username/scripts.  Copy the bash script above to your scripts directory, name it someName.sh, and make it executable<pre class="brush: bash; title: ; notranslate">chmod ugo+x</pre></li><li>execute the script<pre class="brush: bash; title: ; notranslate">sudo ./someName.sh</pre></li><li><pre class="brush: bash; title: ; notranslate">sudo apt-get update</pre></li><li><pre class="brush: bash; title: ; notranslate">sudo apt-get install $php_packages</pre></li></ol><p>Essentially, the way it works is it finds all the php 5.3 packages and removes them, then uses sed to replace "lucid" with "karmic" in the sources list and saves that in /etc/apt/sources/preferences.d which is iterated over first during update.  It then pins the karmic sources for php packages so that the php version isn't inadvertently updated during update/upgrade.</p><p>Next step for me was to install some more php packages since the initial install was so minimal and I wiped it out anyway.</p><pre class="brush: bash; title: ; notranslate">apt-get install php5-cli php5-curl php5-imagick php-pear php5-sqlite php5-xmlrpc php5-xsl</pre><p>and finally, I like to use phpmyadmin for managing multiple databases:</p><pre class="brush: bash; title: ; notranslate">apt-get install libapache2-mod-auth-mysql phpmyadmin</pre><p>select [*] apache 2 by hitting the space bar<br /> If this is a fresh install, select yes when asked to configure dbconfig-common</p><p>enter the mysql root password created earlier<br /> enter a password for the phpmyadmin admin account</p><p>navigate in a browser to http://www.domainname/phpmyadmin</p><p>Why didn't I just not install 5.3 and build 5.2 in?  Because I think it's actually faster this way.  For me at least.  I install defaults, test that apache and mysql work as expected, downgrade to 5.2, install remaining php packages.  Fairly straight-forward.  If only it had been so easy on  my mac.</p><p>Will I do this on my production servers?  Probably not for php applications.  Ubuntu 8.04 is supported for another year and 9.04 is supported for 2 years.  There's no hurry.   I <em>will</em>, however, probably go ahead and use 10.04 for Rails, Django, and Plone installations.</p><h3>Update: Rolling Back</h3><p>3/17/2011<br /> To roll this back,  do the following:</p><ol><li>list out the php modules installed to compare<pre class="brush: bash; title: ; notranslate">dpkg -l | grep php</pre></li><li>archive outside of sources directory or comment out /etc/apt/sources.list.d/karmic.list</li><li>archive /etc/apt/preferences.d/php outside of the sources directory</li><li><pre class="brush: bash; title: ; notranslate">apt-get update
apt-get upgrade</pre></li><li>I manually reinstalled php5 and modules even though apt-get should update should update them:<pre class="brush: bash; title: ; notranslate">apt-get install libapache2-mod-php5  php5-common php5-mysql php-pear php5-suhosin libapache2-mod-php5 php5-curl php5-imagick php-pear php5-sqlite php5-xmlrpc php5-xsl</pre></li><li>I had to remove the "#" mark from imagick.conf and cli.conf - apparently that's been deprecated as a comment symbol</li><li>if you're running WordPress, don't forget to edit php.ini with the date/time zone.  Initially I got an internal server error after restoring php5.  Fixing the date/time seemed to do the trick.</li></ol><h3>Why?</h3><p>I was installing an application for a friend and needed to install ffmpeg packages. Unfortunately, when I ran apt-get update, I received the below error:</p><pre class="brush: bash; title: ; notranslate">
APT::Cache limit ...
.... Dynamic MMap out of room! ...
Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_dapper_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
</pre><p>The default Apt Cache limit was too low for all the sources (Lucid and Karmic). I stepped through the <a href="https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure">troubleshooting procedure for packages</a>, upping my apt cache to 200000000 which is quite high and the error disappeared.  In the end I decided to just keep it tidy and rollback. All of the php applications I'm running work fine on 5.3.</p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/setting-up-ubuntu-lucid-10-04-for-web-development-part-1/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>WordPress 2.9 Illegal Mix of Collations in Database</title><link>http://www.semioticpixels.com/linux-server-administration/wordpress-2-9-illegal-mix-of-collations-in-database/</link> <comments>http://www.semioticpixels.com/linux-server-administration/wordpress-2-9-illegal-mix-of-collations-in-database/#comments</comments> <pubDate>Thu, 04 Mar 2010 05:20:56 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[database administration]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=244</guid> <description><![CDATA[In the course of investigating a problem with runaway Apache processes, I discovered this collation issue. In the apache error log, the first error to confront me was this: Collation conflict &#8230;. I looked at the database structure, sure enough, &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/wordpress-2-9-illegal-mix-of-collations-in-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>In the course of investigating a problem with runaway Apache processes, I discovered this collation issue.</p><p>In the apache error log, the first error to confront me was this:</p><pre class="brush: bash; title: ; notranslate"> WordPress database error Illegal mix of collations
(latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' for query SELECT comment_ID FROM wp_comments WHERE comment_post_ID = '2933' AND comment_approved != 'trash' AND  .... etc</pre><p><span id="more-244"></span></p><p>Collation conflict &#8230;. I looked at the database structure, sure enough, there&#8217;s a mix of</p><pre class="brush: bash; title: ; notranslate"> utf8_general_ci and latin1_swedish_ci </pre><p>.  Most of the default WordPress database tables are Latin1 and it looks like the newer tables and all of my plugins are UTF 8.</p><p>Looking at WordPress installs that I haven&#8217;t upgraded yet, all of them are set to UTF 8. <strong><em>But</em></strong> these are newer installs. The WordPress installation that has this problem has been in place since version 1.* and WordPress <em>used</em> to default to <code>Latin 1</code> encoding.  The UTF 8 tables are newer.</p><p>So, in other words, if you&#8217;re maintaining a WordPress install that&#8217;s been around for a while, you probably also have this issue in your database.</p><p>Now, to get this particular database fixed up &#8230;<br /> One suggestion I came across was to export the schema and data separately then recreate the database with UTF 8 charset and reimport the data. However, that will likely break the existing content because the content has Latin 1 characters which will cause the newly minted UTF tables to choke a little.</p><blockquote><p><em> &#8230; When converting the character sets, all TEXT (and similar) fields are converted to UTF-8, but that conversion will BREAK existing TEXT because the conversion expects the data to be in latin1, but WordPress may have stored unicode characters in a latin1 database, and as a result, data could end up as garbage after a conversion!</em><br /> <a href="http://codex.wordpress.org/Converting_Database_Character_Sets">ref</a></p></blockquote><p>The better way is to run an ALTER tables query. The steps are:</p><ol><li>backup everything up</li><li>ALTER all TEXT and related fields to their binary counterparts using the SQL statements generated below</li><li>alter the character set</li><li>change the binary data type fields back to TEXT</li><li>Add DB_CHARSET and DB_COLLATE definitions to wp-config.php</li></ol><p>Using MySQL&#8217;s information_schema to generate the actual ALTER tables statements  needed, I wanted to pipe out the statements to a reusable text document so I could do a test run on a copy of the problem database first.  Generating the ALTER tables statements using information_schema will then include whatever extra tables or rows have been added by plugins.</p><p>The following 4 queries are lifted directly from <a href="http://www.haidongji.com/2008/11/11/convert-character-set-to-utf8-in-mysql/">Haidong Ji</a> via the <a href="http://codex.wordpress.org/Converting_Database_Character_Sets">WordPress Codex</a>. I added the pipe out to text file.  Note that the path to mysql executable is on Ubuntu. Your path might be different, for example, another common location might be /usr/local/mysql/bin.</p><p>1. ALTER all TEXT and related string field types to binary field types counterparts using the SQL statements generated below. The list of conversions being made is as follows:</p><p>CHAR -&gt; BINARY</p><p>VARCHAR -&gt; VARBINARY</p><p>TINYTEXT -&gt; TINYBLOB</p><p>TEXT -&gt; BLOB</p><p>MEDIUMTEXT -&gt; MEDIUMBLOB</p><p>LONGTEXT -&gt; LONGBLOB</p><ul><li><pre class="brush: bash; title: ; notranslate">echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', REPLACE(column_type, 'char', 'binary'),';') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%char%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/char2binary.txt</pre></li><li><pre class="brush: bash; title: ; notranslate">echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', REPLACE(column_type, 'text', 'blob'),';') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%text%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/text2blob.txt</pre></li><li><pre class="brush: bash; title: ; notranslate">echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', column_type, 'CHARACTER SET utf8;') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%char%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/char2utf.txt[/code]&lt;/li&gt;
	&lt;li&gt;1echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', column_type, 'CHARACTER SET utf8;') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%text%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/text2utf.txt</pre></li></ul><p>2. Change the default character set of the database from Latin 1 to UTF 8.  This will ensure all <em>new</em> tables created are UTF 8, but doesn't affect existing tables (which is fine since we've already changed those above, right?).<br /> This can be done either using phpmyadmin (select database -&gt; click the Operations tab -&gt; select UTF 8 from dropdown menu at bottom) or in your shell</p><pre class="brush: bash; title: ; notranslate">ALTER DATABASE MyDb CHARACTER SET utf8;</pre><p>3. change the binary data type fields back to TEXT<br /> This can get sticky if your original structure had datatypes that ... were <em>supposed</em> to be binary or blobs. I looked through my database before altering it and did not find any blobs or binaries. But this could vary depending upon plugins used, etc.  Changing the binaries back to TEXT essentially involves running the above sql scripts in reverse.</p><ul><li><pre class="brush: bash; title: ; notranslate">echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', REPLACE(column_type, 'binary', 'char'), ';') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%binary%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/rev-binary2char.txt</pre></li><li><pre class="brush: bash; title: ; notranslate">echo &quot;SELECT CONCAT('ALTER TABLE ', table_name, ' MODIFY ', column_name, ' ', REPLACE(column_type, 'blob', 'text'), ';') FROM columns WHERE table_schema = 'testblog' and data_type LIKE '%blob%';&quot; | /usr/bin/mysql -u&lt;em&gt;user&lt;/em&gt; -p&lt;em&gt;password&lt;/em&gt; information_schema &gt; /home/&lt;em&gt;userdir&lt;/em&gt;/rev-blob2text.txt</pre></li></ul><p>4. Add DB_CHARSET and DB_COLLATE definitions to wp-config.php</p><h3>references</h3><p><a href="http://codex.wordpress.org/Converting_Database_Character_Sets">wordpress article on changing collation</a></p><p><a href="http://alexking.org/blog/2008/03/06/mysql-latin1-utf8-conversion">article by alex king</a></p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/wordpress-2-9-illegal-mix-of-collations-in-database/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <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>bash settings on Mac Snow Leopard</title><link>http://www.semioticpixels.com/linux-server-administration/bash-settings-on-mac-snow-leopard/</link> <comments>http://www.semioticpixels.com/linux-server-administration/bash-settings-on-mac-snow-leopard/#comments</comments> <pubDate>Thu, 21 Jan 2010 09:51:06 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[development environment]]></category> <category><![CDATA[infrastructure]]></category> <category><![CDATA[mac]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=193</guid> <description><![CDATA[I&#8217;ve been slowly migrating from my desktop to my laptop so I&#8217;ve been setting it up piecemeal. Bash (Terminal) File and Directory Colors I do a lot of work within Terminal and not having directory and file coloring drives me &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/bash-settings-on-mac-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been slowly migrating from my desktop to my laptop so I&#8217;ve been setting it up piecemeal.</p><h3>Bash (Terminal) File and Directory Colors</h3><p>I do a lot of work within Terminal and not having directory and file coloring drives me nuts after a while.  To add colors<span id="more-193"></span></p><pre><code>cd ~/
vi .bash_profile</code>
</pre><p>add</p><pre><code>export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad</code></pre><p>reload it by typing (in Terminal)<br /> <code> source ~/.bash_profile</code></p><p>close out Terminal then start a new Terminal session. Do an <code>ls</code> and directories and files should now have color.  A more in-depth explanation is listed below in &#8220;references&#8221;</p><h3>References</h3><p><a href="http://www.geekology.co.za/blog/2009/04/enabling-bash-terminal-directory-file-color-highlighting-mac-os-x/">adding file and directory colors to Terminal</a></p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/bash-settings-on-mac-snow-leopard/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>$PATH settings on Mac Snow Leopard</title><link>http://www.semioticpixels.com/linux-server-administration/path-settings-on-mac-snow-leopard/</link> <comments>http://www.semioticpixels.com/linux-server-administration/path-settings-on-mac-snow-leopard/#comments</comments> <pubDate>Thu, 21 Jan 2010 09:47:56 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[development environment]]></category> <category><![CDATA[infrastructure]]></category> <category><![CDATA[mac]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=205</guid> <description><![CDATA[Managing Paths The problem with setting up an environment piecemeal is when you sit down to do something, you have to figure out what rabbit hole you&#8217;d gone down when you left off. In this case, I remembered installing mysql, &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/path-settings-on-mac-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h3>Managing Paths</h3><p>The problem with setting up an environment piecemeal is when you sit down to do something, you have to figure out what rabbit hole you&#8217;d gone down when you left off.  In this case, I remembered installing mysql, but usually the last thing I do when I install mysql is install phpmyadmin because it&#8217;s such a handy productivity tool.  Well, there was no phpmyadmin on my system, but that could be because Snow Leopard came with PHP 5.3 out of the box which is incompatible with most of the popular PHP web applications out there.<span id="more-205"></span></p><p>Anyhoo &#8230; so I started by checking my $PATH variable and was surprised by the output.</p><p><code>echo $PATH</code> gave me duplicates of /usr/local and /opt/local et. al. and had stuff in it that wasn&#8217;t in my ~/.profile</p><p>my ~/.profile had the following in it:</p><pre><code>export PATH=/usr/local/sbin:/usr/local/mysql/bin:$PATH
##
# Your previous /Users/username/.profile file was backed up as /Users/username/.profile.macports-saved_2009-12-29_at_11:21:58
##
# MacPorts Installer addition on 2009-12-29_at_11:21:58: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.</code></pre><p>and the second entry made by MacPorts was overriding the first entry.</p><p>Pretty funky.</p><h3>TheTao of Path Variables</h3><ol><li>/etc/profile is the default startup script for Bash, which is what I&#8217;m using. (If you&#8217;re using a different shell, then you may have a different startup script).  /etc/profile calls /usr/libexec/path_helper</li><li>path_helper first calls /etc/path and /etc/manpath which contain the initial path environment variables. /etc/path contains system-wide defaults:<pre><code>/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin</code></pre></li><li>path_helper then looks for files in the directories: /etc/paths.d and  /etc/manpaths.d and appends the paths found there. On my system, /etc/paths.d and /etc/manpaths.d contain a file named X11 which simply contains the paths for X11.</li><li>After /etc/profile has called path_helper, it then looks for /etc/.bashrc.  I have a bashrc (no &#8220;.&#8221;), but my bashrc only has stuff in it specifying the bash shell prompt (<code>name-of-my-computer:directory username$</code>)</li><li>Bash next looks for ~/.bash_profile.  This is the file where you&#8217;ll <a href="http://www.semioticpixels.com/2010/01/bash-settings-…c-snow-leopard/">set file and directory colors</a> and could also be where you place your Path environment variables. Obviously, ~/ represents your user directory, so your settings will only be valid for your user.</li><li>Next, bash looks for ~/.bash_login. I don&#8217;t have this on my system so it&#8217;s ignored in my case</li><li>next, bash looks for ~/.profile which I <em>did</em> have on my system and is the file that XCode wrote to.</li></ol><p>Another file that can contain path variables is ~/.MacOSX/environment.plist. This sets environment variables, including paths, for gui applications.  I&#8217;m not using it on my system so don&#8217;t have anything to say about it.</p><h3>Recap</h3><p>So, what that all means is that instead of exporting PATH environment variables to a .profile or .bash_profile in a user account directory, you (or your application) can, instead, make PATHs global by adding text files to the /etc/paths.d and /etc/manpaths.d directories.</p><p>If you need to control the order of a path, then try this:<br /> Add a line PATH=&#8221;" before the call to path_helper like this in /etc/profile:</p><pre><code>if [ -x /usr/libexec/path_helper ]; then
        PATH=""
        eval `/usr/libexec/path_helper -s`
fi</code></pre><p>All that said and done &#8230; I&#8217;ll continue using ~/.bash_profile because it&#8217;s got that warm fuzzy familiarity.  Personal preference, as always.</p><h3>Update</h3><p>I wanted more control over my Rails environment and wanted it to run from /usr/local/bin. I got partway setting up my cucumber tests when I realized that my application was running off of the default mac Rails environment in /usr/bin/.  The solution is to get /usr/local/bin in front of /usr/bin.  To do so, edit your ~/.profile or ~/.bashrc (wherever you decided to put your PATH variables)</p><h3>References</h3><p><a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man8/path_helper.8.html">man page for path_helper</a><br /> <a href="http://littlesquare.com/2008/01/24/upgraded-to-leopard-making-use-of-etcpathsd-and-path_helper/">making use of paths.d</a><br /> <a href="http://www.softec.st/en/OpenSource/DevelopersCorner/MasteringThePathHelper.html">mastering the path_helper</a></p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/path-settings-on-mac-snow-leopard/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>rsync over ssh</title><link>http://www.semioticpixels.com/linux-server-administration/rsync-over-ssh/</link> <comments>http://www.semioticpixels.com/linux-server-administration/rsync-over-ssh/#comments</comments> <pubDate>Tue, 19 Jan 2010 19:29:30 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[crib notes]]></category> <category><![CDATA[data security]]></category> <category><![CDATA[linux server administration]]></category> <category><![CDATA[backups]]></category> <category><![CDATA[infrastructure]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[ssh]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=174</guid> <description><![CDATA[Rysnc from 1 linux box to another and keep the file structure identical Delete files from the target directory that have been deleted in the source directory rsync -avz -e ssh --delete remoteuser@remotehost:/remote/dir/ /this/dir/ Note: the ending {/} is important &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/rsync-over-ssh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h3>Rysnc from 1 linux box to another and keep the file structure identical</h3><p>Delete files from the target directory that have been deleted in the source directory<br /> <code>rsync -avz -e ssh --delete remoteuser@remotehost:/remote/dir/ /this/dir/</code><span id="more-174"></span></p><p><em>Note:</em> the ending {/} is important if you don&#8217;t want to hose a directory.</p><h3>Rsync with a custom ssh port</h3><p>place the ssh command in quotes; for example:<br /> <code>rsync -avz 'ssh -p1234'</p><h3>Backup a website on a linux box to your windows machine</h3><p>rsync reads ":" in a filepath as a remote directory, so if you're trying to rsync to "c://" rsync will be confused. Instead of using windows syntax for filepaths, use the cygwin directory structure.</p><ol><li><a href="http://www.cygwin.com/cygwin-ug-net/setup-net.html">Install cygwin</a> to windows</li><li>test rsync and ssh are installed by typing from within the cygwin terminal:<br /> <code>rsync --version</code><br /> <code>ssh -l username somedomain</code></li><li>create a directory in c://cygwin named backups or whatever you want to call it.</li><li><code>rsync -avz -e ssh --delete remoteuser@remotehost:/remote/dir/ /cygdrive/c/directoryname</code> Change the directory drive to whatever it should be</li></ol><h3>references</h3><p><a href="http://troy.jdmz.net/rsync/index.html">rsync over ssh</a></p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/rsync-over-ssh/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>open ssl upgrade from ssl 2 -&gt; ssl 3</title><link>http://www.semioticpixels.com/linux-server-administration/open-ssl-upgrade-from-ssl-2-ssl-3/</link> <comments>http://www.semioticpixels.com/linux-server-administration/open-ssl-upgrade-from-ssl-2-ssl-3/#comments</comments> <pubDate>Mon, 05 Oct 2009 17:18:32 +0000</pubDate> <dc:creator>chris</dc:creator> <category><![CDATA[linux server administration]]></category> <category><![CDATA[PCI compliance]]></category> <category><![CDATA[infrastructure]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[ssl]]></category><guid isPermaLink="false">http://www.semioticpixels.com/?p=74</guid> <description><![CDATA[I inherited a number of web servers that had been installed and configured by different contractors and am now in the process of evaluating what needs to happen to bring them all up to snuff as well as figuring out &#8230; <a href="http://www.semioticpixels.com/linux-server-administration/open-ssl-upgrade-from-ssl-2-ssl-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I inherited a number of web servers that had been installed and configured by different contractors and am now in the process of evaluating what needs to happen to bring them all up to snuff as well as figuring out ways to streamline regular updates.   Some of those web servers are still on Red 7.3 (!), the last free open source version of Red Hat.  They&#8217;re quite old in server years.  Additionally I have a few other servers I set up a year ago that are more up-to-date running Ubuntu 8 LTS, but the Apache version is 2.2.11 and 2.2.8.  Our security scanning service notifies me regularly that SSL v 2 must be upgraded to SSL v3, which requires an upgrade to Apache 2.2.13<span id="more-74"></span></p><h3>Environment:</h3><p>Apache 1.3.29</p><h3>References:</h3><p><a href="http://apachehacker.com/kabir/security/disabling-weak-ssl-v2-support-in-apache-server.html">How to Disable SSL v 2 support in Apache</a></p><p>On Aug 10, 2009, Apache released an upgrade that addresses a DOS vulnerability.</p><p>server:</p><pre>/usr/local/apache2/bin/httpd -v
# Server version: Apache/2.2.11 (Unix)
# Server built:   Jan 15 2009 13:39:20</pre><p>dev server:</p><pre>/usr/sbin/apache2 -v</pre><h3>Issues</h3><ol><li>caused 401 error for all http requests (worked correctly for https connections) <a href="http://forums.cpanel.net/f5/apache-2-2-13-upgrade-breaks-site-127817.html">source</a></li><li>Seem to be some issues with mac version &#8211; It&#8217;s unclear whether this is an issue with a pre-compiled mac version or a generic self-compiled (which should be identical to the linux version) <a href="http://diymacserver.com/">source</a></li></ol><h3>Dev Server Tests</h3><p>Ran apt-get update and apt-get upgrade on dev server</p><p>ran apt-get upgrade apache2 and message returned says that 2.2.8 is the current version.  Which means my dev and my production servers are out of sync. I was surprised to learn that the last contractor from whom I took over server management had installed from source, removing Apache from package management. Not a big deal really, but it was undocumented.</p><p>In any case, there doesn&#8217;t appear to be a package release for Apache 2.2.13 yet in Ubuntu.  Only one of the 4 bugfixes has a security bulletin attached, so I&#8217;ve decided to wait a few weeks to see if anything new transpires in the security bulletins.  In general, I prefer to wait on updating production servers until a new release has been out long enough for bugfixes to be released.</p> ]]></content:encoded> <wfw:commentRss>http://www.semioticpixels.com/linux-server-administration/open-ssl-upgrade-from-ssl-2-ssl-3/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/56 queries in 0.018 seconds using disk: basic
Object Caching 819/919 objects using disk: basic

Served from: www.semioticpixels.com @ 2012-02-04 23:47:52 -->
