<?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>Phil Bayfield &#187; Servers</title>
	<atom:link href="http://www.philbayfield.com/category/servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philbayfield.com</link>
	<description>A little about me, my photos and some general geeky stuff!</description>
	<lastBuildDate>Wed, 02 Nov 2011 01:59:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Migrating to MySQL 5.5 on Ubuntu</title>
		<link>http://www.philbayfield.com/2011/01/26/migrating-to-mysql-5-5-on-ubuntu/</link>
		<comments>http://www.philbayfield.com/2011/01/26/migrating-to-mysql-5-5-on-ubuntu/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 02:36:31 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=560</guid>
		<description><![CDATA[MySQL 5.5 has been GA since December 2010, however there are currently no deb packages available. Ubuntu takes all (or most of) it&#8217;s packages from the unstable Debian branch, hence the natural order of things is for Debian maintainers to do the leg work (e.g. creating the build scripts) and then Ubuntu can use this [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL 5.5 has been GA since December 2010, however there are currently no deb packages available. Ubuntu takes all (or most of) it&#8217;s packages from the unstable Debian branch, hence the natural order of things is for Debian maintainers to do the leg work (e.g. creating the build scripts) and then Ubuntu can use this to build similar or newer minor versions for the Ubuntu OS. I suspect that as 5.5 is a major release and there are a considerable number of changes that the build scripts take a considerable amount of time to write and possibly some of the Debian modifications/patches need updates to ensure compatibility too, hence the long delay.</p>
<p>However, we can install MySQL 5.5 from the generic tarball and make a few &#8220;tweaks&#8221; to maintain the default Ubuntu structures and settings. </p>
<p>There are more straight forward ways to install MySQL, however the intention of this guide is to allow us to easily upgrade via multiple future available routes with minimal effort (e.g. via deb packages, or in their absence newer generic tar distributions).</p>
<p>1. Create user/group</p>
<p>Note: I manually chose system group ids looking at the latest system group id in /etc/passwd and /etc/group</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd -r -g 108 mysql<br />
useradd -r -g mysql -u 106 mysql</div></div>
<p>2. Create folders</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir /var/lib/mysql<br />
mkdir /var/log/mysql<br />
mkdir /usr/lib/mysql<br />
mkdir /usr/share/mysql<br />
mkdir -p /etc/mysql/conf.d<br />
mkdir /var/run/mysqld</div></div>
<p>3. Set a few folder permissions</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">chown mysql:adm /var/log/mysql<br />
chmod 750 /var/log/mysql/<br />
chmod g+s /var/log/mysql/<br />
chown mysql:mysql /var/run/mysqld</div></div>
<p>4. Download the source and copy/move it to the default install folder in /usr/local. (This is not standard Ubuntu, however due to some of the compilation options on the tar package it avoids a few issues but maintains Ubuntu paths.)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://www.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.8-linux2.6-x86_64.tar.gz/from/ftp://ftp.mirrorservice.org/sites/ftp.mysql.com/<br />
tar xzf mysql-5.5.8-linux2.6-x86_64.tar.gz<br />
mv mysql-5.5.8-linux2.6-x86_64 mysql<br />
mv mysql /usr/local/</div></div>
<p>5. Move files to the Ubuntu locations and create simlinks &#8220;just in case&#8221; MySQL has something hard coded into the build that cannot be changed via the config.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd /usr/local/mysql/<br />
mv bin/* /usr/bin/<br />
rmdir bin/<br />
ln -s /usr/bin/<br />
cp lib/libmysqlclient* /usr/lib<br />
cp -r lib/plugin /usr/lib/mysql/<br />
cp support-files/* /usr/share/mysql<br />
cp -r share/* /usr/share/mysql<br />
rm -r share<br />
ln -s /usr/share/mysql share</div></div>
<p>6. Create the default data files and move them to /var/lib/mysql</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">scripts/mysql_install_db<br />
cp -r data/* /var/lib/mysql<br />
chown -R mysql:mysql /var/lib/mysql<br />
chmod -R 700 /var/lib/mysql<br />
rm -r data<br />
ln -s /var/lib/mysql data</div></div>
<p>7. Copy the init script over to /etc/init.d and modify to suit our needs</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cp support-files/mysql.server /etc/init.d/mysql</div></div>
<p>Edit with your favorite text editor and ensure the following are set:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">basedir=/usr/local/mysql<br />
datadir=/var/lib/mysql</div></div>
<p>8. Add my.cnf, the default 5.1 file will do, with 1 or 2 modifications. Specifically, check the basedir and datadir are set correctly, ensure Innodb is the default storage engine (as per 5.5) and note the new syntax for slow query logging (disabled by default). It would be advisable to set common Innodb options, e.g. pool size.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#<br />
# The MySQL database server configuration file.<br />
#<br />
# You can copy this to one of:<br />
# - &quot;/etc/mysql/my.cnf&quot; to set global options,<br />
# - &quot;~/.my.cnf&quot; to set user-specific options.<br />
#<br />
# One can use all long options that the program supports.<br />
# Run program with --help to get a list of available options and with<br />
# --print-defaults to see which it would actually understand and use.<br />
#<br />
# For explanations see<br />
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html<br />
<br />
# This will be passed to all mysql clients<br />
# It has been reported that passwords should be enclosed with ticks/quotes<br />
# escpecially if they contain &quot;#&quot; chars...<br />
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.<br />
[client]<br />
port &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 3306<br />
socket &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /var/run/mysqld/mysqld.sock<br />
<br />
# Here is entries for some specific programs<br />
# The following values assume you have at least 32M ram<br />
<br />
# This was formally known as [safe_mysqld]. Both versions are currently parsed.<br />
[mysqld_safe]<br />
socket &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /var/run/mysqld/mysqld.sock<br />
nice &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0<br />
<br />
[mysqld]<br />
#<br />
# * Basic Settings<br />
#<br />
<br />
#<br />
# * IMPORTANT<br />
# &nbsp; If you make changes to these settings and your system uses apparmor, you may<br />
# &nbsp; also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.<br />
#<br />
<br />
user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= mysql<br />
socket &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /var/run/mysqld/mysqld.sock<br />
port &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 3306<br />
basedir &nbsp; &nbsp; &nbsp; &nbsp; = /usr/local/mysql<br />
datadir &nbsp; &nbsp; &nbsp; &nbsp; = /var/lib/mysql<br />
tmpdir &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /tmp<br />
skip-external-locking<br />
#<br />
# Instead of skip-networking the default is now to listen only on<br />
# localhost which is more compatible and is not less secure.<br />
bind-address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 127.0.0.1<br />
#<br />
# * Fine Tuning<br />
#<br />
key_buffer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 16M<br />
max_allowed_packet &nbsp; &nbsp; &nbsp;= 16M<br />
thread_stack &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 192K<br />
thread_cache_size &nbsp; &nbsp; &nbsp; = 8<br />
# This replaces the startup script and checks MyISAM tables if needed<br />
# the first time they are touched<br />
myisam-recover &nbsp; &nbsp; &nbsp; &nbsp; = BACKUP<br />
#max_connections &nbsp; &nbsp; &nbsp; &nbsp;= 100<br />
#table_cache &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 64<br />
#thread_concurrency &nbsp; &nbsp; = 10<br />
#<br />
# * Query Cache Configuration<br />
#<br />
query_cache_limit &nbsp; &nbsp; &nbsp; = 1M<br />
query_cache_size &nbsp; &nbsp; &nbsp; &nbsp;= 16M<br />
#<br />
# * Logging and Replication<br />
#<br />
# Both location gets rotated by the cronjob.<br />
# Be aware that this log type is a performance killer.<br />
# As of 5.1 you can enable the log at runtime!<br />
#general_log_file &nbsp; &nbsp; &nbsp; &nbsp;= /var/log/mysql/mysql.log<br />
#general_log &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1<br />
<br />
log_error &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /var/log/mysql/error.log<br />
<br />
# Here you can see queries with especially long duration<br />
#slow-query-log<br />
#slow-query-log-file &nbsp; &nbsp; = /var/log/mysql/mysql-slow.log<br />
#long_query_time &nbsp; &nbsp; &nbsp; &nbsp; = 2<br />
#log-queries-not-using-indexes<br />
#<br />
# The following can be used as easy to replay backup logs or for replication.<br />
# note: if you are setting up a replication slave, see README.Debian about<br />
# &nbsp; &nbsp; &nbsp; other settings you may need to change.<br />
#server-id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br />
#log_bin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /var/log/mysql/mysql-bin.log<br />
expire_logs_days &nbsp; &nbsp; &nbsp; &nbsp;= 10<br />
max_binlog_size &nbsp; &nbsp; &nbsp; &nbsp; = 100M<br />
#binlog_do_db &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = include_database_name<br />
#binlog_ignore_db &nbsp; &nbsp; &nbsp; = include_database_name<br />
<br />
#<br />
# * InnoDB<br />
#<br />
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.<br />
# Read the manual for more InnoDB related options. There are many!<br />
default_storage_engine &nbsp;= InnoDB<br />
<br />
#<br />
# * Security Features<br />
#<br />
# Read the manual, too, if you want chroot!<br />
# chroot = /var/lib/mysql/<br />
#<br />
# For generating SSL certificates I recommend the OpenSSL GUI &quot;tinyca&quot;.<br />
#<br />
# ssl-ca=/etc/mysql/cacert.pem<br />
# ssl-cert=/etc/mysql/server-cert.pem<br />
# ssl-key=/etc/mysql/server-key.pem<br />
<br />
<br />
<br />
[mysqldump]<br />
quick<br />
quote-names<br />
max_allowed_packet &nbsp; &nbsp; &nbsp;= 16M<br />
<br />
[mysql]<br />
#no-auto-rehash # faster start of mysql but no tab completition<br />
<br />
[isamchk]<br />
key_buffer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 16M<br />
<br />
#<br />
# * IMPORTANT: Additional settings that can override those from this file!<br />
# &nbsp; The files must end with '.cnf', otherwise they'll be ignored.<br />
#<br />
!includedir /etc/mysql/conf.d/</div></div>
<p>9. Start the server!</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/etc/init.d/mysql start</div></div>
<p>If the server fails to start, check /var/log/mysql/error.log for clues.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2011%2F01%2F26%2Fmigrating-to-mysql-5-5-on-ubuntu%2F&amp;title=Migrating%20to%20MySQL%205.5%20on%20Ubuntu" id="wpa2a_2"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2011/01/26/migrating-to-mysql-5-5-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web server benchmark PHP &#8211; Apache vs Nginx vs Lighttpd</title>
		<link>http://www.philbayfield.com/2010/10/02/web-server-benchmark-php-apache-vs-nginx-vs-lighttpd/</link>
		<comments>http://www.philbayfield.com/2010/10/02/web-server-benchmark-php-apache-vs-nginx-vs-lighttpd/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 15:52:01 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=519</guid>
		<description><![CDATA[This is a quick benchmark of the 3 major *nix web servers, to see which gives the best performance. Test system: Hardware: vps247 cloud VPS node, 512Mb ram. Software: Ubuntu 10.10 RC (kernel 2.6.35-22), Apache 2.2.16 (mod_php), Nginx 0.7.67 (php-fpm), Lighttpd 1.4.26 (php-cgi), PHP 5.3.3 with Xcache. Site: LiteMVC 0.1 Hello World. Test process: Using [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick benchmark of the 3 major *nix web servers, to see which gives the best performance.</p>
<p><strong>Test system:</strong></p>
<p>Hardware: vps247 cloud VPS node, 512Mb ram.<br />
Software: Ubuntu 10.10 RC (kernel 2.6.35-22), Apache 2.2.16 (mod_php), Nginx 0.7.67 (php-fpm), Lighttpd 1.4.26 (php-cgi), PHP 5.3.3 with Xcache.<br />
Site: LiteMVC 0.1 Hello World.</p>
<p><strong>Test process:</strong></p>
<p>Using ab with 10,000 requests, 10 concurrent requests.<br />
Monitoring load/memory usage with htop.<br />
All web servers with default configuration, 1 site enabled.<br />
All tests were repeated 3 times.</p>
<p><strong>Apache 2.2.16:</strong></p>
<table>
<tr>
<th>Test 1</th>
<th>Test 2</th>
<th>Test 3</th>
</tr>
<tr>
<td>Load at start: 0.03<br />
Memory usage at start: 130 Mb<br />
Load average max: 15.88<br />
Memory usage max: 290 Mb<br />
Requests per second: 400.04<br />
Time per request: 2.5 ms<br />
Longest request: 806 ms</td>
<td>Load at start: 0.07<br />
Memory usage at start: 130 Mb<br />
Load average max: 21.73<br />
Memory usage max: 332 Mb<br />
Requests per second: 395.49<br />
Time per request: 2.529 ms<br />
Longest request: 728 ms</td>
<td>Load at start: 0.06<br />
Memory usage at start: 121 Mb<br />
Load average max: 20.95<br />
Memory usage max: 253 Mb<br />
Requests per second: 385.82<br />
Time per request: 2.592 ms<br />
Longest request: 937 ms</td>
</tr>
</table>
<p><strong>Nginx 0.7.67:</strong></p>
<table>
<tr>
<th>Test 1</th>
<th>Test 2</th>
<th>Test 3</th>
</tr>
<tr>
<td>Load at start: 0.05<br />
Memory usage at start: 129 Mb<br />
Load average max: 0.77<br />
Memory usage max: 157 Mb<br />
Requests per second: 413.40<br />
Time per request: 2.419 ms<br />
Longest request: 239 ms</td>
<td>Load at start: 0.05<br />
Memory usage at start: 152 Mb<br />
Load average max: 0.93<br />
Memory usage max: 169 Mb<br />
Requests per second: 409.15<br />
Time per request: 2.444 ms<br />
Longest request: 232 ms</td>
<td>Load at start: 0.00<br />
Memory usage at start: 163 Mb<br />
Load average max: 0.61<br />
Memory usage max: 169 Mb<br />
Requests per second: 415.28<br />
Time per request: 2.408 ms<br />
Longest request: 250 ms</td>
</tr>
</table>
<p><strong>Lighttpd 1.4.26:</strong></p>
<table>
<tr>
<th>Test 1</th>
<th>Test 2</th>
<th>Test 3</th>
</tr>
<tr>
<td>Load at start: 0.00<br />
Memory usage at start: 115 Mb<br />
Load average max: 0.81<br />
Memory usage max: 139 Mb<br />
Requests per second: 427.92<br />
Time per request: 2.337 ms<br />
Longest request: 120 ms</td>
<td>Load at start: 0.09<br />
Memory usage at start: 136 Mb<br />
Load average max: 0.73<br />
Memory usage max: 143 Mb<br />
Requests per second: 447.10<br />
Time per request: 2.237 ms<br />
Longest request: 111 ms</td>
<td>Load at start: 0.03<br />
Memory usage at start: 140 Mb<br />
Load average max: 0.69<br />
Memory usage max: 159 Mb<br />
Requests per second: 454.13<br />
Time per request: 2.202 ms<br />
Longest request: 178 ms</td>
</tr>
</table>
<p><strong>Conclusions:</strong></p>
<p>Lighttpd was the fastest overall in this test, however what probably stands out the most is the inefficiency of Apache with both server load and memory usage increasing considerably during the test. The reason for this may be down to Apache spawning additional processes when it is receiving a large volume of requests, which results in the higher memory usage. The memory usage with Nginx and Lighttpd increases by a much smaller amount because each of them runs a fixed number of PHP CGI processes (20 in this case).</p>
<p>Apache is definitely the winner in terms of module support and ease of configuration, but I may have a somewhat biased view as I&#8217;ve worked with Apache for years. Nginx is probably the hardest to setup and configure, however after switching from PHP-CGI to PHP-FPM this made things easier and it does seam there are more configuration examples floating around on the net than for Lighttpd. Lighttpd is notorious for memory leaks, I&#8217;m not sure if this is still an issue with current versions.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F10%2F02%2Fweb-server-benchmark-php-apache-vs-nginx-vs-lighttpd%2F&amp;title=Web%20server%20benchmark%20PHP%20%26%238211%3B%20Apache%20vs%20Nginx%20vs%20Lighttpd" id="wpa2a_4"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/10/02/web-server-benchmark-php-apache-vs-nginx-vs-lighttpd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Today is a confusing day for 32 bit PHP</title>
		<link>http://www.philbayfield.com/2010/09/23/today-is-a-confusing-day-for-32-bit-php/</link>
		<comments>http://www.philbayfield.com/2010/09/23/today-is-a-confusing-day-for-32-bit-php/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 10:13:49 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=495</guid>
		<description><![CDATA[As many people probable know, there are some glaring inconsistencies between 32 bit and 64 bit PHP, especially when it comes to large numbers and floats. For some reason, best known to the PHP developers, 32 bit PHP is limited to the maximum signed 32 bit integer size of 2147483647, while 64 bit PHP uses [...]]]></description>
			<content:encoded><![CDATA[<p>As many people probable know, there are some glaring inconsistencies between 32 bit and 64 bit PHP, especially when it comes to large numbers and floats.</p>
<p>For some reason, best known to the PHP developers, 32 bit PHP is limited to the maximum signed 32 bit integer size of 2147483647, while 64 bit PHP uses the 64 bit equivalent of 9223372036854775807. Many languages overcome the 32 bit / 64 bit differences by storing 64 bit ints as 2 32 bit ints to allow the usage of 64 bit integers on 32 bit systems, hence providing complete consistency between the two platforms.</p>
<p>These inconsistencies similarly apply to floating point precession, presumably a float in 32 bit PHP is equivalent to a 32 bit float in C, whereas it appears that in 64 bit PHP it&#8217;s actually a double.</p>
<p>Here is a nice example of the inconsistency, today&#8217;s unix timestamp in float form:</p>
<p>32 bit:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php &gt; echo (float) 1285200000;<br />
1.2852E+9</div></div>
<p>64 bit:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php &gt; echo (float) 1285200000;<br />
1285200000</div></div>
<p>This is an important thing to remember with PHP, despite the fact it is a loosely typed language, they behaviour is equivalent to the C behaviour for the particular architecture of your server.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F09%2F23%2Ftoday-is-a-confusing-day-for-32-bit-php%2F&amp;title=Today%20is%20a%20confusing%20day%20for%2032%20bit%20PHP" id="wpa2a_6"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/09/23/today-is-a-confusing-day-for-32-bit-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neat trick to beat the sendmail FQDN check</title>
		<link>http://www.philbayfield.com/2010/09/17/neat-trick-to-beat-the-sendmail-fqdn-check/</link>
		<comments>http://www.philbayfield.com/2010/09/17/neat-trick-to-beat-the-sendmail-fqdn-check/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 09:29:05 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=492</guid>
		<description><![CDATA[When you install sendmail on a local machine and want to test some mail sending feature of your project, sendmail has a tendency to hang for a couple of minutes each time you try and send mail. Looking in the /var/log/mail.log will reveal it is trying to determine the fully qualified domain name: Sep 16 [...]]]></description>
			<content:encoded><![CDATA[<p>When you install sendmail on a local machine and want to test some mail sending feature of your project, sendmail has a tendency to hang for a couple of minutes each time you try and send mail.</p>
<p>Looking in the /var/log/mail.log will reveal it is trying to determine the fully qualified domain name:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Sep 16 09:20:01 MyHostName sm-msp-queue[14171]: My unqualified host name (MyHostName) unknown; sleeping for retry<br />
Sep 16 09:21:01 MyHostName sm-msp-queue[14171]: unable to qualify my own domain name (MyHostName) -- using short name</div></div>
<p>Here is a quick fix which resolves the problem:</p>
<p>1. Edit /etc/hosts<br />
2. Change the record for 127.0.0.1 so that it looks something like this</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">127.0.0.1 localhost.localdomain localhost MyHostName</div></div>
<p>3. Restart sendmail</p>
<p>This now makes sendmail think it&#8217;s FQDN is localhost.localdomain, and mail now sends instantly!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F09%2F17%2Fneat-trick-to-beat-the-sendmail-fqdn-check%2F&amp;title=Neat%20trick%20to%20beat%20the%20sendmail%20FQDN%20check" id="wpa2a_8"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/09/17/neat-trick-to-beat-the-sendmail-fqdn-check/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up MySQL replication with SSL</title>
		<link>http://www.philbayfield.com/2010/08/27/setting-up-mysql-replication-with-ssl/</link>
		<comments>http://www.philbayfield.com/2010/08/27/setting-up-mysql-replication-with-ssl/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 07:14:53 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=464</guid>
		<description><![CDATA[There are many posts out there on how to setup both MySQL replication and self signed SSL certificates but not really any that combine the 2 very well. This post is partly for my own reference and partly for anyone else who is interested in the subject. To enable SSL replication both the client and [...]]]></description>
			<content:encoded><![CDATA[<p>There are many posts out there on how to setup both MySQL replication and self signed SSL certificates but not really any that combine the 2 very well. This post is partly for my own reference and partly for anyone else who is interested in the subject.</p>
<p>To enable SSL replication both the client and server require signed certificates, these could be a purchased certificate from a common CA but really as they are only going to be used for private communication there is no need and a self signed certificate will do the job.</p>
<p><strong>Please note, that for the section of this post which discusses the MySQL replication, I am assuming that you already know how to setup replication, including ensuring data is consistent on master/slave. The focus of his article is to document the additional configuration required to setup replication with SSL.</strong></p>
<p>For the purpose of this example I will be configuring the following hosts:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">master.example.com - The MySQL replication master<br />
slave.example.com - The MySQL replication slave</div></div>
<p><strong>Creating the certificates:</strong></p>
<p>The first thing to do is to create a certificate authority in order to sign the certificates, this is based on the <a href="https://help.ubuntu.com/community/OpenSSL">Ubuntu Documentation</a> with a few changes.</p>
<p>First, create some directories to organise things and change into the new CA directory:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir -p CA/private<br />
mkdir -p CA/certs<br />
cd CA</div></div>
<p>Create a certificate database:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">echo '01' &gt; serial &nbsp;&amp;&amp; touch index.txt</div></div>
<p>Create a configuration for the CA:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nano ca.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Example CA config file<br />
#<br />
# Default configuration to use when one is not provided on the command line.<br />
#<br />
[ ca ]<br />
default_ca &nbsp; &nbsp; &nbsp;= local_ca<br />
#<br />
#<br />
# Default location of directories and files needed to generate certificates.<br />
#<br />
[ local_ca ]<br />
dir &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = /home/&lt;strong style=&quot;color:red&quot;&gt;user&lt;/strong&gt;/CA<br />
certificate &nbsp; &nbsp; = $dir/ca.pem<br />
database &nbsp; &nbsp; &nbsp; &nbsp;= $dir/index.txt<br />
new_certs_dir &nbsp; = $dir/certs<br />
private_key &nbsp; &nbsp; = $dir/private/cakey.pem<br />
serial &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $dir/serial<br />
# &nbsp; &nbsp; &nbsp; <br />
#<br />
# Default expiration and encryption policies for certificates.<br />
#<br />
default_crl_days &nbsp; &nbsp; &nbsp; &nbsp;= 365<br />
default_days &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1825<br />
default_md &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= md5<br />
# &nbsp; &nbsp; &nbsp; <br />
policy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= local_ca_policy<br />
x509_extensions = local_ca_extensions<br />
# &nbsp; &nbsp; &nbsp; <br />
#<br />
# Default policy to use when generating server certificates. &nbsp;The following<br />
# fields must be defined in the server certificate.<br />
#<br />
[ local_ca_policy ]<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= supplied<br />
stateOrProvinceName &nbsp; &nbsp; = supplied<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = supplied<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= supplied<br />
organizationName &nbsp; &nbsp; &nbsp; &nbsp;= supplied<br />
organizationalUnitName &nbsp;= supplied<br />
# &nbsp; &nbsp; &nbsp; <br />
#<br />
# x509 extensions to use when generating server certificates.<br />
#<br />
[ local_ca_extensions ]<br />
subjectAltName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= DNS:example.com<br />
basicConstraints &nbsp; &nbsp; &nbsp; &nbsp;= CA:false<br />
nsCertType &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= server<br />
# &nbsp; &nbsp; &nbsp; <br />
#<br />
# The default root certificate generation policy.<br />
#<br />
[ req ]<br />
default_bits &nbsp; &nbsp;= 2048<br />
default_keyfile = /home/&lt;strong style=&quot;color:red&quot;&gt;user&lt;/strong&gt;/CA/private/cakey.pem<br />
default_md &nbsp; &nbsp; &nbsp;= md5<br />
# &nbsp; &nbsp; &nbsp; <br />
prompt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= no<br />
distinguished_name &nbsp; &nbsp; &nbsp;= root_ca_distinguished_name<br />
x509_extensions &nbsp; &nbsp; &nbsp; &nbsp; = root_ca_extensions<br />
#<br />
#<br />
# Root Certificate Authority distinguished name. &nbsp;Change these fields to match<br />
# your local environment!<br />
#<br />
[ root_ca_distinguished_name ]<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;My &nbsp;Certificate Authority&lt;/strong&gt;<br />
stateOrProvinceName &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;London&lt;/strong&gt;<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;GB&lt;/strong&gt;<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;ca@example.com&lt;/strong&gt;<br />
organizationName &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;My Company Name&lt;/strong&gt;<br />
organizationalUnitName &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;IT Department&lt;/strong&gt;<br />
# &nbsp; &nbsp; &nbsp; <br />
[ root_ca_extensions ]<br />
basicConstraints &nbsp; &nbsp; &nbsp; &nbsp;= CA:true</div></div>
<p>You will need to change the user in red with your Linux username and the CA info in green.</p>
<p>Now generate the CA certificate with the following:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req -x509 -newkey rsa:2048 -out ca.pem -outform PEM -days 1825 -config ca.conf</div></div>
<p>You will be prompted for a passphrase:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Generating a 2048 bit RSA private key<br />
...............................................+++<br />
...................................................................................+++<br />
writing new private key to '/home/phil/CA/private/cakey.pem'<br />
Enter PEM pass phrase:<br />
Verifying - Enter PEM pass phrase:<br />
-----</div></div>
<p>We now have a certificate and key which we can use to sign the certificates. The next stage is to create certificates for each of our 2 hosts (or more, if more than 2 hosts are being configured in the replication setup).</p>
<p>Create a config file for each host:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nano master.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#<br />
# Config file for master.example.com<br />
#<br />
<br />
[ req ]<br />
prompt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= no<br />
distinguished_name &nbsp; &nbsp; &nbsp;= server_distinguished_name<br />
<br />
[ server_distinguished_name ]<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;master.example.com&lt;/strong&gt;<br />
stateOrProvinceName &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;London&lt;/strong&gt;<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;GB&lt;/strong&gt;<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;ca@example.com&lt;/strong&gt;<br />
organizationName &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;My Company Name&lt;/strong&gt;<br />
organizationalUnitName &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;IT Department&lt;/strong&gt;</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nano slave.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#<br />
# Config file for slave.example.com<br />
#<br />
<br />
[ req ]<br />
prompt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= no<br />
distinguished_name &nbsp; &nbsp; &nbsp;= server_distinguished_name<br />
<br />
[ server_distinguished_name ]<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;slave.example.com&lt;/strong&gt;<br />
stateOrProvinceName &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;London&lt;/strong&gt;<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &lt;strong style=&quot;color:green&quot;&gt;GB&lt;/strong&gt;<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;ca@example.com&lt;/strong&gt;<br />
organizationName &nbsp; &nbsp; &nbsp; &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;My Company Name&lt;/strong&gt;<br />
organizationalUnitName &nbsp;= &lt;strong style=&quot;color:green&quot;&gt;IT Department&lt;/strong&gt;</div></div>
<p>Change the bits in green to your company name, the commonName must be the host name of the machine, this is important or the certificate will be invalid.</p>
<p>The next step is to create a certificate signing request (CSR) and private key for each of our hosts:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req -newkey rsa:1024 -keyout master.key.pem -keyform PEM -out master.csr.pem -outform PEM -config master.conf</div></div>
<p>You will be prompted for a passphrase again:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Generating a 1024 bit RSA private key<br />
..++++++<br />
.++++++<br />
writing new private key to 'master.key.pem'<br />
Enter PEM pass phrase:<br />
Verifying - Enter PEM pass phrase:<br />
-----</div></div>
<p>Repeat for slave (and additional hosts):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req -newkey rsa:1024 -keyout slave.key.pem -keyform PEM -out slave.csr.pem -outform PEM -config slave.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Generating a 1024 bit RSA private key<br />
....................++++++<br />
....++++++<br />
writing new private key to 'slave.key.pem'<br />
Enter PEM pass phrase:<br />
Verifying - Enter PEM pass phrase:<br />
-----</div></div>
<p>Now in their current form the keys we have just generated will require the passphrase every time we start the server, this is far from ideal as MySQL will have to be manually started every time the server is rebooted (intentionally or not).</p>
<p>We can create an unencrypted version of the keys so that the passphrase is not required for server starts:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl rsa &lt; master.key.pem &gt; master.dckey.pem</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Enter pass phrase:<br />
writing RSA key</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl rsa &lt; slave.key.pem &gt; slave.dckey.pem</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Enter pass phrase:<br />
writing RSA key</div></div>
<p>Finally, we can sign the certificate requests for each host with our CA:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl ca -in master.csr.pem -out master.crt.pem -config ca.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Using configuration from ca.conf<br />
Enter pass phrase for /home/phil/CA/private/cakey.pem:<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject's Distinguished Name is as follows<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:'master.example.com'<br />
stateOrProvinceName &nbsp; :PRINTABLE:'London'<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :PRINTABLE:'GB'<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:IA5STRING:'ca@example.com'<br />
organizationName &nbsp; &nbsp; &nbsp;:PRINTABLE:'My Company Name'<br />
organizationalUnitName:PRINTABLE:'IT Department'<br />
Certificate is to be certified until Aug 26 08:56:20 2015 GMT (1825 days)<br />
Sign the certificate? [y/n]:y<br />
<br />
1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl ca -in slave.csr.pem -out slave.crt.pem -config ca.conf</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Using configuration from ca.conf<br />
Enter pass phrase for /home/phil/CA/private/cakey.pem:<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject's Distinguished Name is as follows<br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:'slave.example.com'<br />
stateOrProvinceName &nbsp; :PRINTABLE:'London'<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :PRINTABLE:'GB'<br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:IA5STRING:'ca@example.com'<br />
organizationName &nbsp; &nbsp; &nbsp;:PRINTABLE:'My Company Name'<br />
organizationalUnitName:PRINTABLE:'IT Department'<br />
Certificate is to be certified until Aug 26 08:57:52 2015 GMT (1825 days)<br />
Sign the certificate? [y/n]:y<br />
<br />
1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated</div></div>
<p><strong>Configuring the servers:</strong></p>
<p>We will need to copy 3 files to each machine:</p>
<p>ca.pem  &#8211; The CA certificate</p>
<p>On the master:</p>
<p>master.crt.pem &#8211; The master certificate<br />
master.key.pem or master.dckey.pem &#8211; Either the encrypted or decrypted version of the master private key</p>
<p>On the slave:</p>
<p>slave.crt.pem &#8211; The slave certificate<br />
slave.key.pem or slave.dckey.pem &#8211; Either the encrypted or decrypted version of the slave private key</p>
<p>These files should be copied into /etc/mysql on the respective hosts.</p>
<p>On the master, create a user for replication:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CREATE USER slave@slave.example.com IDENTIFIED BY 'password';<br />
GRANT REPLICATION SLAVE ON *.* TO slave@slave.example.com REQURE SSL;</div></div>
<p>Note that the addition of the &#8216;REQUIRE SSL&#8217; at the end of the grant statement, this means insecure connections from the slave will not be possible.</p>
<p>Create the configuration on the master for replication:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server-id = 1<br />
report_host = master<br />
# These should be used for multiple masters<br />
#auto_increment_increment = 2<br />
#auto_increment_offset &nbsp; = 1<br />
log_bin = /var/log/mysql/binlog<br />
log_bin_index = /var/log/mysql/binlog.index<br />
sync_binlog = 1<br />
expire_logs_days = 10<br />
max_binlog_size = 100M<br />
binlog_do_db = mydb<br />
#binlog_do_db = myotherdb<br />
binlog_ignore_db = mysql</div></div>
<p>Also we need to add the SSL configuration:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssl-ca = /etc/mysql/ca.pem<br />
ssl-cert = /etc/mysql/master.crt.pem<br />
ssl-key = /etc/mysql/master.dckey.pem</div></div>
<p>Restart MySQL to apply the configuration:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo /etc/init.d/mysql restart</div></div>
<p>or (in newer versions with upstart):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">restart mysql</div></div>
<p>Then configure the slave for replication:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server-id = 2<br />
report_host = slave<br />
relay_log = /var/log/mysql/relay-bin<br />
relay_log_index = /var/log/mysql/relay-bin.index<br />
relay_log_info_file = /var/log/mysql/relay-bin.info<br />
master_host = master.example.com<br />
master_user = slave<br />
master_password = password<br />
master_port = 3306<br />
master_ssl = 1<br />
master_ssl_ca = /etc/mysql/ca.pem<br />
master_ssl_cert = /etc/mysql/slave.crt.pem<br />
master_ssl_key = /etc/mysql/slave.dckey.pem<br />
replicate_do_db = mydb<br />
#replicate_do_db = myotherdb<br />
replicate_ignore_db = mysql<br />
read_only</div></div>
<p>Restart MySQL, and everything should be up and running.</p>
<p>From the master we should see something like this:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">show master status\G<br />
*************************** 1. row ***************************<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File: binlog.000001<br />
&nbsp; &nbsp; &nbsp; &nbsp; Position: 106<br />
&nbsp; &nbsp; Binlog_Do_DB: mydb<br />
Binlog_Ignore_DB: mysql<br />
1 row in set (0.00 sec)</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">show slave hosts\G<br />
*************************** 1. row ***************************<br />
&nbsp; &nbsp; &nbsp; &nbsp; Server_id: 2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Host: slave<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Port: 3306<br />
Rpl_recovery_rank: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; Master_id: 1<br />
1 row in set (0.00 sec)</div></div>
<p>And on the slave:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">show slave status\G<br />
*************************** 1. row ***************************<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Slave_IO_State: Waiting for master to send event<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_Host: master.example.com<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_User: slave<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_Port: 3306<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connect_Retry: 60<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_Log_File: binlog.000001<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Read_Master_Log_Pos: 106<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Relay_Log_File: relay-bin.000001<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Relay_Log_Pos: 253<br />
&nbsp; &nbsp; &nbsp; &nbsp; Relay_Master_Log_File: binlog.000001<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Slave_IO_Running: Yes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Slave_SQL_Running: Yes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Replicate_Do_DB: mydb<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Replicate_Ignore_DB: mysql<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Replicate_Do_Table:<br />
&nbsp; &nbsp; &nbsp; &nbsp;Replicate_Ignore_Table:<br />
&nbsp; &nbsp; &nbsp; Replicate_Wild_Do_Table:<br />
&nbsp; Replicate_Wild_Ignore_Table:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Last_Errno: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Last_Error:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Skip_Counter: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exec_Master_Log_Pos: 106<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Relay_Log_Space: 549<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Until_Condition: None<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Until_Log_File:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Until_Log_Pos: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Master_SSL_Allowed: Yes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Master_SSL_CA_File: /etc/mysql/ca.pem<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Master_SSL_CA_Path:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_SSL_Cert: /etc/mysql/slave.crt.pem<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master_SSL_Cipher:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Master_SSL_Key: /etc/mysql/slave.dckey.pem<br />
&nbsp; &nbsp; &nbsp; &nbsp; Seconds_Behind_Master: 0<br />
Master_SSL_Verify_Server_Cert: No<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Last_IO_Errno: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Last_IO_Error:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Last_SQL_Errno: 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Last_SQL_Error:<br />
1 row in set (0.02 sec)</div></div>
<p>Note: The status info above I copy/pasted from a live replication setup and replaced with values that you can expect to see, values will likely differ (especially log file positions).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F08%2F27%2Fsetting-up-mysql-replication-with-ssl%2F&amp;title=Setting%20up%20MySQL%20replication%20with%20SSL" id="wpa2a_10"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/08/27/setting-up-mysql-replication-with-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching MySQL for MariaDB on Ubuntu.</title>
		<link>http://www.philbayfield.com/2010/07/11/switching-mysql-for-mariadb-on-ubuntu/</link>
		<comments>http://www.philbayfield.com/2010/07/11/switching-mysql-for-mariadb-on-ubuntu/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 11:36:35 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=449</guid>
		<description><![CDATA[MariaDB offers quite a few improvements over MySQL, mainly in the storage engines it provides. Firstly, the Maria engine is a crash safe version of MyISAM which in the future will also support transactions. Secondly, the XtraDB engine is an enhanced version of Innodb which can give considerable speed improvements over the standard Innodb engine. [...]]]></description>
			<content:encoded><![CDATA[<p>MariaDB offers quite a few improvements over MySQL, mainly in the storage engines it provides. Firstly, the Maria engine is a crash safe version of MyISAM which in the future will also support transactions. Secondly, the XtraDB engine is an enhanced version of Innodb which can give considerable speed improvements over the standard Innodb engine. There are many other features and improvements over the standard MySQL distribution, move info on the differences can be found here: <a href="http://askmonty.org/wiki/MariaDB_versus_MySQL">http://askmonty.org/wiki/MariaDB_versus_MySQL</a></p>
<p>The easiest way to install MariaDB is to add one of the repositories, I&#8217;ve used OurDelta:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -O- http://ourdelta.org/deb/ourdelta.gpg | sudo apt-key add -<br />
sudo wget http://ourdelta.org/deb/sources/lucid-mariadb-ourdelta.list -O /etc/apt/sources.list.d/ourdelta.list</div></div>
<p>Then install MariaDB:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install mariadb-server-5.1</div></div>
<p>This should install MariaDB without any problems, it should also replace MySQL if you already installed it:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># apt-get install mariadb-server-5.1<br />
Reading package lists... Done<br />
Building dependency tree<br />
Reading state information... Done<br />
The following extra packages will be installed:<br />
&nbsp; libmariadbclient16 libmysqlclient16 mariadb-client-5.1<br />
&nbsp; mariadb-client-core-5.1 mariadb-server-core-5.1 mysql-common<br />
Suggested packages:<br />
&nbsp; tinyca mailx mariadb-test<br />
The following packages will be REMOVED<br />
&nbsp; libmysqlclient-dev libmysqlclient16-dev mysql-client mysql-client-5.1<br />
&nbsp; mysql-client-core-5.1 mysql-server-5.1 mysql-server-core-5.1<br />
The following NEW packages will be installed<br />
&nbsp; libmariadbclient16 mariadb-client-5.1 mariadb-client-core-5.1<br />
&nbsp; mariadb-server-5.1 mariadb-server-core-5.1<br />
The following packages will be upgraded:<br />
&nbsp; libmysqlclient16 mysql-common<br />
2 upgraded, 5 newly installed, 7 to remove and 8 not upgraded.</div></div>
<p>If you are upgrading from MySQL, you will probably be prompted to overwrite the my.cnf and for a new root password. I generally choose Y to overwrite and enter my existing root password to avoid issue.</p>
<p>You can also follow my previous post to upgrade the client library used by PHP, rather than installing the MySQL dev package, the Maria equivalent should be used:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install libmariadbclient16-dev</div></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F07%2F11%2Fswitching-mysql-for-mariadb-on-ubuntu%2F&amp;title=Switching%20MySQL%20for%20MariaDB%20on%20Ubuntu." id="wpa2a_12"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/07/11/switching-mysql-for-mariadb-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Update Zend Server MySQL extensions</title>
		<link>http://www.philbayfield.com/2010/05/06/update-zend-server-mysql-extensions/</link>
		<comments>http://www.philbayfield.com/2010/05/06/update-zend-server-mysql-extensions/#comments</comments>
		<pubDate>Thu, 06 May 2010 08:39:09 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=430</guid>
		<description><![CDATA[As the MySQL extensions with Zend Server are out of date, I decided to update them as it&#8217;s pretty simple to do. Install the source package: sudo apt-get install php-5.2-source-zend-server or sudo apt-get install php-5.3-source-zend-server Install the MySQL client dev package: sudo apt-get install libmysqlclient16-dev Install autoconf: sudo apt-get install autoconf From this point onwards [...]]]></description>
			<content:encoded><![CDATA[<p>As the MySQL extensions with Zend Server are out of date, I decided to update them as it&#8217;s pretty simple to do.</p>
<p>Install the source package:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install php-5.2-source-zend-server</div></div>
<p>or</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install php-5.3-source-zend-server</div></div>
<p>Install the MySQL client dev package:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install libmysqlclient16-dev</div></div>
<p>Install autoconf:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install autoconf</div></div>
<p>From this point onwards I ran as root as saves time having to sudo everything, I have also created symlinks for the binaries in /usr/local/zend/bin to /usr/local (php, phpize, php-config, pear, pecl etc)</p>
<p>Change to the extensions directory of the source you just installed:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd /usr/local/zend/share/php-source/php-5.3.2/</div></div>
<p>There are 3 extensions that need to be recompiled mysql, mysqli and pdo_mysql, the following procedure is the same for all 3:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd mysql<br />
./configure<br />
make<br />
cp modules/mysql.so /usr/local/zend/lib/php_extensions/</div></div>
<p>Finally restart Zend Server and all the MySQL extensions will be using the latest libraries.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F05%2F06%2Fupdate-zend-server-mysql-extensions%2F&amp;title=Update%20Zend%20Server%20MySQL%20extensions" id="wpa2a_14"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/05/06/update-zend-server-mysql-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Server on Ubuntu Lucid has dependency problems</title>
		<link>http://www.philbayfield.com/2010/05/06/zend-server-on-lucid-has-dependency-problems/</link>
		<comments>http://www.philbayfield.com/2010/05/06/zend-server-on-lucid-has-dependency-problems/#comments</comments>
		<pubDate>Thu, 06 May 2010 08:20:25 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=427</guid>
		<description><![CDATA[When trying to install Zend Server on Lucid you will be met with the following dependency problems: The following packages have unmet dependencies: &#160; php-5.2-mysql-zend-server: Depends: libmysqlclient15off (&#62;= 5.0.27-1) which is a virtual package. &#160; php-5.2-pdo-mysql-zend-server: Depends: libmysqlclient15off (&#62;= 5.0.27-1) which is a virtual package. &#160; php-5.2-mysqli-zend-server: Depends: libmysqlclient15off (&#62;= 5.0.27-1) which is a virtual [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to install Zend Server on Lucid you will be met with the following dependency problems:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">The following packages have unmet dependencies:<br />
&nbsp; php-5.2-mysql-zend-server: Depends: libmysqlclient15off (&gt;= 5.0.27-1) which is a virtual package.<br />
&nbsp; php-5.2-pdo-mysql-zend-server: Depends: libmysqlclient15off (&gt;= 5.0.27-1) which is a virtual package.<br />
&nbsp; php-5.2-mysqli-zend-server: Depends: libmysqlclient15off (&gt;= 5.0.27-1) which is a virtual package.</div></div>
<p>Along with the rather unsatisfactory resolution:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">The following actions will resolve these dependencies:<br />
Keep the following packages at their current version:<br />
help-zend-server-ce [Not Installed]<br />
php-5.2-common-extensions-zend-server-ce [Not Installed]<br />
php-5.2-mysql-zend-server [Not Installed]<br />
php-5.2-mysqli-zend-server [Not Installed]<br />
php-5.2-pdo-mysql-zend-server [Not Installed]<br />
zend-server-ce-php-5.2 [Not Installed]</div></div>
<p>The reason for this error is that the Zend MySQL packages are built against MySQL 5.0 (despite the fact 5.1 has been GA for over a year now).</p>
<p>Ubuntu have removed MySQL 5.0 in Lucid, but the package from Karmic is usable and available here: <a href="http://ns2.canonical.com/pt/karmic/libmysqlclient15off">http://ns2.canonical.com/pt/karmic/libmysqlclient15off</a></p>
<p>Simply install this and Zend Server will install nicely.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F05%2F06%2Fzend-server-on-lucid-has-dependency-problems%2F&amp;title=Zend%20Server%20on%20Ubuntu%20Lucid%20has%20dependency%20problems" id="wpa2a_16"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/05/06/zend-server-on-lucid-has-dependency-problems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.04 Server, so far so good!</title>
		<link>http://www.philbayfield.com/2010/04/28/ubuntu-10-04-server-so-far-so-good/</link>
		<comments>http://www.philbayfield.com/2010/04/28/ubuntu-10-04-server-so-far-so-good/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 21:49:20 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=349</guid>
		<description><![CDATA[I upgraded one of my Karmic servers to Ubuntu 10.04 RC the other day. The last upgrade from Jaunty to Karmic was a rather traumatic process, but thankfully this time round all went smoothly. Not really any overly noticeable changes this time round other than a few more things have moved into upstart (MySQL for [...]]]></description>
			<content:encoded><![CDATA[<p>I upgraded one of my Karmic servers to Ubuntu 10.04 RC the other day.</p>
<p>The last upgrade from Jaunty to Karmic was a rather traumatic process, but thankfully this time round all went smoothly. Not really any overly noticeable changes this time round other than a few more things have moved into upstart (MySQL for example) and when I boot via KVM the new Plymouth boot screen is present, although not sure why this is even included in a server release.</p>
<p>It&#8217;s about as updated a LAMP setup as is possible including Apache 2.2.14, MySQL 5.1.41 and especially pleased they put in PHP 5.3.2 after the code freeze. On this server I&#8217;m actually running Zend Server CE (which already had PHP 5.3.2) as Zend are quicker to push out the updates, but on others I will stick with the default Ubuntu release.</p>
<p>What else can be said about a server OS? Well, it just works <img src='http://www.philbayfield.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F04%2F28%2Fubuntu-10-04-server-so-far-so-good%2F&amp;title=Ubuntu%2010.04%20Server%2C%20so%20far%20so%20good%21" id="wpa2a_18"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/04/28/ubuntu-10-04-server-so-far-so-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.04 &#8211; Looks like it will ship with PHP 5.3</title>
		<link>http://www.philbayfield.com/2010/03/04/ubuntu-10-04-looks-like-it-will-ship-with-php-5-3/</link>
		<comments>http://www.philbayfield.com/2010/03/04/ubuntu-10-04-looks-like-it-will-ship-with-php-5-3/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 07:13:18 +0000</pubDate>
		<dc:creator>Phil</dc:creator>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.philbayfield.com/?p=334</guid>
		<description><![CDATA[I took a look on Launchpad today to see if there was any indication as to which version of PHP Ubuntu had decided to ship with the next release. As it&#8217;s an LTS release there is always the possibility that they may go for the slightly more stable options than the slightly more experimental options [...]]]></description>
			<content:encoded><![CDATA[<p>I took a look on Launchpad today to see if there was any indication as to which version of PHP Ubuntu had decided to ship with the next release. As it&#8217;s an LTS release there is always the possibility that they may go for the slightly more stable options than the slightly more experimental options as they will have to support this edition for the next 3 years.</p>
<p>It appears from a package search that 2 days ago PHP 5.3.1 packages were added to Lucid. It&#8217;s quite a big step, and will be interesting if they also include a 5.2.x release along side it as so many applications are not ready for 5.3 yet.</p>
<p>More information can be found on Launchpad: <div style="float: left; text-align: center">
			    <a href="https://launchpad.net/ubuntu/+source/php5" target="_blank"><img src="http://simple.thumbshots.com/image.aspx?cid=1508&v=1&w=200&h=150&url=https://launchpad.net/ubuntu/+source/php5" /></a><br /><a href="https://launchpad.net/ubuntu/+source/php5" target="_blank">https://launchpad.net/ubuntu/+source/...</a></div><br style="clear: both" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.philbayfield.com%2F2010%2F03%2F04%2Fubuntu-10-04-looks-like-it-will-ship-with-php-5-3%2F&amp;title=Ubuntu%2010.04%20%26%238211%3B%20Looks%20like%20it%20will%20ship%20with%20PHP%205.3" id="wpa2a_20"><img src="http://www.philbayfield.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.philbayfield.com/2010/03/04/ubuntu-10-04-looks-like-it-will-ship-with-php-5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

