Linux


I just noticed that re-bundling in EC2 instance is not working. Google told me that it is due to the incompatibility between latest rsync and relatively old kernel used by EC2 (2.6.16).

In the thread about this issue, 5 possible workarounds are presented. However, none of them are easy under gentoo without messing up with ebuild/emerge. I found another way, and you don’t need to regenerate the configure file for rsync at all, all you need is to comment the following line in the config.h file (which is generated after you run the configure script):

#define HAVE_LUTIMES 1

then make and make install, all should be fine now.

If you are using a dns service provider with dynamic dns support, and using a gentoo based EC2 AMI, then you may find this script to be useful. It can update the IP address for a specified domain name whenver the gentoo AMI is booted.

To use this script, just extract the file, and place ec2.conf under /etc/conf.d and rename it as ec2, then move file ec2 to /etc/init.d

Before you can use it, you have to set some parameters in file /etc/conf.d/ec2, please consult the comments in that file.

In order to register IP address whenever the AMI is getting booted, a final step is needed:

rc-update add ec2 default

Just before generating the manifest file, ec2-bundle-vol under gentoo, throws this error at me:

Googling around, it turns out that, it’s due to my “too recent” version of ruby (I only use stable packages in gentoo, but we all know gentoo is always cutting edge, even its stable branch, isn’t it?), which has a backward incompability. The fix is trivial:

— rexml/text.rb.orig 2007-10-22 08:00:04.000000000 +0100
+++ rexml/text.rb 2007-10-22 08:00:33.000000000 +0100
@@ -286,7 +286,7 @@
EREFERENCE = /&(?!#{Entity::NAME};)/
# Escapes all possible entities
def Text::normalize( input, doctype=nil, entity_filter=nil )
- copy = input
+ copy = input.to_s
# Doing it like this rather than in a loop improves the speed
#copy = copy.gsub( EREFERENCE, ‘&’ )
copy = copy.gsub( “&”, “&” )

— rexml/document.rb.orig 2007-10-22 08:02:36.000000000 +0100
+++ rexml/document.rb 2007-10-22 08:03:01.000000000 +0100
@@ -183,7 +183,7 @@
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1
- if transitive
+ if trans
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )

Amazon EC2 AIM tools are necessary if you want to create your own images (by either doing it from scratch or modifying others AIM) to use on Amazon EC2 service. That tool is only supporting linux, so they provide a RPM (maybe primarily targeted for FC?).

If you are a gentooer, then you have to do it manually. The following is what I have done to make it work

rpm2targz ec2-ami-tools.noarch.rpm #if you don't have rpm2targz, run emerge rpm2targz first
tar xvfz ec2-ami-tools.noarch.tar.gz
mv usr/local/* /usr/local/
mv usr/lib/site_ruby/ /usr/lib/
mv etc/aes/ /etc/
ln -s /usr/lib/site_ruby/aes /usr/lib/ruby/site_ruby/1.8/i686-linux/aes

After that, you should be able to run ec2-bundle-vol and others just fine.

Another tip: I have this in my ~/.bash_profile (~/.bashrc will do too):

#for Amazon EC2 AMI bundle
EC2_BUNDLE="-k /path/to/your/pk/pem -c /path/to/your/cert/.pem -u <user_id>"
alias ec2-bundle-vol="ec2-bundle-vol $EC2_BUNDLE"
alias ec2-bundle-image="ec2-bundle-image $EC2_BUNDLE"

So that you don’t need to specify all those mandatory options every time you invoke these commands.

After re-installing php 5, I got a wired error when starting apache 2:

Cannot load /.../libphp5.so into server: /.../libphp5.so: undefined symbol: _efree

Google suggested that, lots of people have the exact error, but not a single page contains what caused this error or how to solve it. In addition, this error also happens with php 4 and apache 1.

After some hard time Trial and error, I found the issue: due to some reasons, the make install to install php 5 does not actually copy over the libphp5.la files to the right place. After manually copying the la file, apache 2 can be started happily with php 5 enabled.

When setuping trac on a server, I encountered a strange issue: the python binding of subversion can not be loaded by python, I got something like this:

libsvn_ra_dav-1.so.0: undefined symbol: gss_delete_sec_context

After googling around, I found out that, someone suggested to disable neon when compiling subversion 1.4. That did do the trick, and binding works. However, with neon disabled, svn can not work with http/https repositories, which is not acceptable. So I have to find another workaround.

Google told me that gss_delete_sec_context is part of libgssapi.so, and "ldd libsvn_ra_dav-1.so.0" reveals that it does not link to any libgssapi.so at all. The obvious workaround is to explicitly specify that in the Makefile.

Edit the top Makefile in subversion 1.4.0, append "-lgssapi" to this line:

SVN_APR_LIBS = ...

(… is the actual content you will see) after installing it, everything works fine now.

It may be argued that this is not a subversion issue, rather than a neon one (it should link to gssapi). As subversion uses a bundled neon, so maybe it is more faire to call it a subversion bug.

After fixing a SJSD svn trunk regression bug reported in the bug tracking system, I tried to make eZ installed in a subdir work with rewrite rules in apache 1.3 (not virtual host setup), as I already achieved it in lighttpd, it must be feasible in apache as well: the mod_rewrite can achieve almost anything as long as you can come up with. (PHP-CGI is used in the apache)

(more…)

Since setup of lighttpd in my test server, it seems working pretty fine. However, without the index.php specified in the url, it does not work. Lighttpd definitely supports rewrite rules, as I see an module named mod_rewrite in lighttpd config file.

After a bit of searching around and failure and trial, I finally got it working.

(more…)

Yesterday, I upgraded the eZ publish setup in SCIM project website from 3.5 to latest stable version 3.8. For your references, here I will present the details about how to achieve this.

Before anything else, first make your eZ offline in case users want to access it. You can achieve this easily by just replace the eZ index.php with a file stating that “the site is undergoing an upgrade and will back online soon” or similar.

(more…)

Since several days ago, whenever I connect to this server via ssh, it freezes very easily. To my impression, it seems that the idle timeout is set to a very short period. However, after checking the sshd_config file, it has not been changed for several months. Confused…

Today, I was working on upgrading the eZ publish in SCIM project from version 3.5.x to 3.8.x. It was really annoying that the ssh froze every now and then: I kept reconnecting/rediring to the working path/re-opening vim to edit the files.

Finally, I decided to face the issue and solve it!

(more…)

Next Page »