Apr 212014

Several issues found after upgrade various version of Ubuntu to latest 14.04 LTS, luckily things are not that hard to fix.

ejabberd does not work, turned to be ejabberd was trying to get rid of asn1, and there were some problem caused by that. Though ejabberd fixed the problem right away, it seems Ubuntu took the wrong version. What you should do is upgrade ejabberd from 2.1.11 to 2.1.12 (later version may work as well, but I didn’t try), Continue reading »

Mar 052014

I just could not make it work although it seems pretty easy and straightforward.

I have a machine with 4 IPs (216.x.x.203~206), and start Apache listening on 1203~1206 for each IP, then for each VirtualHost (such as 216.x.x.203:1203) I turn on ProxyRequests, and set ProxySourceAddress to that IP address, thus client connecting to 203 will have their request go out through 203 as well. Continue reading »

Oct 102013

After several days stuck in various problems, it seems I’m making progress now.

First good news came from financial side … I found this site which is good for on-demand Mac “rental”, and obviously it saved me at least $200 (if I was to go with a refurbished Mac Mini). Now I just leave $30 in my account, and occasionally log on to build my Apps. It was said that you have to log in at least every 60 days, or your money will be gone, this makes sense to me and does not bother me at all. Continue reading »

Mar 262013

Well, one and half month passed and I never post even a single word … yes I was busy but main reason is … I was lazy.

Alright, some updates – I successfully migrate the bcookie module from Apache HTTPd to nginx, things were really tough at the very beginning whenever all you understand is Apache. However, at this stage I would like to say nginx is kind of neat and elegant, expanding it is not that hard though you have to build everything┬á in one shot (i.e. no dso allowed), I’d like to dig in why they have design like this as this is really uncommon in modern era.

And I’m moving to .Net now, again I have no idea so far, but I believe I need to write a filter in C# (YAY!), but before that I need get IIS up and running, and determine if there is any compatibility issues between different version of IIS (and .Net Framework).

Stay tuned, I will post whenever I make any progress and most likely that will be the time I move to Java container part – Jetty or Tomcat, not sure so far.

Jan 252013

I was asked to find a solution to write customized Apache log entry (in Apache access log, not error log), other requirements include easy to use, which implicitly means “PHP friendly”, and flexible, which means “free format” and “may or may not have the value”.

Seriously, the first thing jumped into my mind was an Apache module (let’s hack mod_log!) or a PHP extension, but later on I found that … I don’t want to maintain another orphan project especially it will be orphan since nobody want to touch it after it’s up and running (I have one already, which does some cookie stuffs). So I move on to Google …

Then I found apache_note(), plus mod_log_config (search for %{Foobar}n), all that I need to do is tell PHP guys to call this function, and tell ops guys to setup Apache log properly, we are all set.

It’s good to see apache_note can change the note as many times as you want, whenever the request is finished on server side, the final data will be written to log.

Nov 172011

I got 700K lines of apache log files from a friend’s web server and imported them to the testing Hadoop instance running on my MacBoox, following the instructions listed here I successfully run some analysis.

Note, the last section in the article talking about the Apache Weblog Data doesn’t seem to be correct – it lacks of some space (” “) after ^ and it gave me quite some headache since I’m not familiar with Java regular expressions. Luckily Hive issue 662 mentioned in the article gave me the correct regex to get things done.

It seems I can only learn to play with Hive/Hadoop cos Hadoop running on MacBook is still a single node installation which is … SLOW, but so far I’m fine with it as I don’t have high volume of data to be processed. As a reference, getting top accessed IPs (which I used to figure out potential abusers) took 83 seconds. The HSQL is simple, something like “select host, count(*) cc from apachelog group by host order by cc desc limit 10;”.

Hadoop is a richmen’s game, seems it only improve the performance whenever you have lots of nodes as it can well distributed tasks.

BTW, Hadoop: The Definitive Guide is a good book ­čÖé .

Jun 242009

I have about 2,600 photos uploaded to one of my web sites, and I compose couple of quick PHP scripts to help me browse them. There is a img.php to resize the photo for different purpose (such as thumb view for listing page, medium size for view online, and full size for downloading), but whenever I try to download the photo, I found it’s tough as it always prompt to save as “img.php.jpeg”.

So, instead of doing any PHP stuff, I changed .htaccess under the folder, let apache do rewrite for me, in couple of minutes everything works like a chime.

These are really simple tasks, I guess it can be done with anything else (lighttpd, python, blar blar), but obviously I’m still familiar with PHP and Apache httpd, guess I should stick on that till something else can be this easy to me, just as years back I switched from qmail to postfix …