How to setup Secure Webserver HTTPS (SSL) on Apache in Ubuntu

Secure HTTP (SSL/TLS) has become a must if you are planning to setup a website which includes user authentication (ie. login box) or sensitive data. HTTPS prevents the sensitive data from being transfered across the network in clear text where it is susceptible to being sniffed or altered. Here is the tutorial on how to setup a secure HTTP on Apache web server in Ubuntu 10.04 (Lucid Lynx).

What do you need?

  • apache2 (Web Server)
  • openssl
  • A bit patient, because it will take some time to learn

Step 1: Create a self-signed certificate
You need to create a self-signed certificate with openssl. To do that you will need to generate the server key.


openssl genrsa -des3 -out server-sec.key 4096

…and certificate signing request (CSR)


openssl req -new -key server-sec.key -out server.csr

After that, generate the server certificate by signing it with the server key.

openssl x509 -req -days 365 -in server.csr -signkey server-sec.key -out server.crt

Keep the server-sec.key in a secure location, with read/write permission assigned only to root. Then generate a password-less copy of the key for Apache use.

openssl rsa -in server-sec.key -out server.key

By this time, you should have :

  • server.key (passwordless key for Apache)
  • server.csr (certificate signing request)
  • server.crt (certificate)
  • server-sec.key (server key)

Continue reading “How to setup Secure Webserver HTTPS (SSL) on Apache in Ubuntu”

Broadcom has released open source Linux Wifi 802.11n drivers

In a welcoming step, Broadcom finally released the the source code of its wifi (802.11n) Linux drivers under open source license. The source code can be found on the Linux staging-next tree at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-next-2.6.git in the in the drivers/staging/brcm80211 directory. The open source drivers will support current chips (BCM4313,BCM43224, BCM43225) and it also acts as a framework to support future chips by Broadcom.

This can be considered as a significant move made by the company, as Broadcom chips are widely in use on laptops and netbooks in the market. Its competitor, Atheros, has already open sourced its drivers back in 2008, which in turn, made Atheros drivers much better supported on various operating system platform compared to Broadcom.

Previously, Linux users with Broadcom chip, have to rely on NDISwrapper utilities to enable the wifi functionality on their laptops.

[source][via]

DateDiff – A simple JavaME mobile app to calculate the day differences between two dates

There are times where I am required to calculate the day/month/year differences between two dates, which I found a little bit troublesome to do repeatedly even if it is just a simple estimate. So in turn, I created this mobile app to do the job, which greatly increase my productivity! Here i’m releasing the source code to DateDiff, which is coded and compatible with all JavaME phone:

DateDiff mypapit

DateDiff.jar – binary (MIDP 2.0)
datediff_src.zip (source code)

DateDiff is copyrighted by me, and is licensed under a BSD-like license, you can read the terms of use from the ‘About’ menu or from the source code.

How to use GNU Privacy Guard (GPG) – Encrypt, Decrypt, Sign and Verifying identities

GPG or the GNU Privacy Guard is a free and open source software that implements OpenPGP public-key cryptography message format (RFC4880). You can use GPG to encrypt, decrypt, sign and verify files or emails. To use GPG, you need to generate the public-key/private-key pairs in your computer by running this command, and choose the default option


gpg --gen-key

The application will ask you to enter your ID and passphrase, make sure you choose a strong passphrase to guarantee the safety and security of your keys.

Encrypting and Decrypting Files
You can use GPG to encrypt files, it can be only decrypted by those who have your public-key. The command that can be used to encrypt file is :

gpg --out encrypted_file.txt --encrypt original_file.txt

Run this command to decrypt. Files encrypted with private key can only be decrypted with public key and vice-versa.

gpg --out decrypted.txt --decrypt encrypted_file.txt

Signing Email or body of texts
Alternatively, you can chose to sign emails/texts instead of encrypting them. Signing files is a way to ensure that the message/texts/emails are from the right sender and its content has not been tempered with. You can run this command to sign email or texts :

gpg --clearsign original_text.txt

This will produce a signature file which content the original text with PGP signature embedded at the bottom of the message.

To verify it (assuming you have the public key), you need to run this command:

gpg --verify original_text.txt.asc

Continue reading “How to use GNU Privacy Guard (GPG) – Encrypt, Decrypt, Sign and Verifying identities”

Ubuntu 10.04 fix for USB Drive not mounting on pc with Floppy Drive

Here’s a quick fix for an Ubuntu 10.04 bug that prevents USB Drive from mounting on a PC with Floppy drive (wow, these things still exist?)

The solution is to remove the floppy drive module from linux kernel and you will be able to mount usb drive.
sudo modprobe -r floppy

Should you ever need the module again, you can issue
sudo modprobe floppy
to load the module back (alongside with the annoying bug).

Hope this will help!

p/s: To be fair, my office Dell Optiplex machine (with Pentium 4 HT 2.80GHz, 2005 issue) still has those floppy drives, although I haven’t use them ever since they assigned it to me (back in 2008).