Enable Apache mod_rewrite module on OpenSuSE

OpenSuSE has mod_rewrite installed, but it is not loaded by default. Check if mod_rewrite is actually loaded by default or not:

# grep "^APACHE_MODULES" /etc/sysconfig/apache2
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5"

As you can see that “rewrite” is not present in the loaded modules. Add “rewrite” as below:


# vi /etc/sysconfig/apache2
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5 rewrite"
# /sbin/service apache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done

Posted in FLOSS, Tips/Code Snippets | Tagged | Leave a comment

UW IMAP on OpenSolaris 2009.06

It is quite surprising that the opensolaris distribution does not come with an imap server in the standard repositories. I needed one and the simplest one to use is the one from UW IMAP.

I downloaded the source package from:

ftp://ftp.cac.washington.edu/imap/imap.tar.gz

The UW IMAP documentation is at http://www.washington.edu/imap/documentation/

I have GCC installed in my opensolaris 2009.6

$ which cc
/usr/gnu/bin/cc

I followed the usual compile procedure:

$ tar -xvzf imap.tar.gz
$ cd imap-2007e

I tried building it, but it failed although GCC is installed. So I thought of compiling it with Sun Studio. I installed the Sun Studio as follows:

$ pfexec pkg install developer/sunstudio12u1

Next I did some modifications to the src/osdep/unix/Makefile in the UW IMAPD. Following are the lines that need to be changed from the default ones.

CC=/usr/bin/cc
SSLCERTS=/etc/openssl/certs
SSLINCLUDE=/usr/include/openssl
SSLLIB=/usr/lib

Now run the make command. With UW IMAP you need to tell the system type for which you are building the imap, I tried ‘sol’ but it did not work for some reason. Next I tried ‘gso’ which is actually for GNU C in solaris, and it worked. Not sure why as I was using the Sun Studio compiler….

$ make gso

Next I needed to manually copy the imapd (I only wanted imapd and not pop as of now).

$ pfexec cp imap/imapd /usr/sbin/

Now add the inetd service entry

imap    stream  tcp     nowait  root    /usr/sbin/imapd     imapd
imaps   stream  tcp     nowait  root    /usr/sbin/imapd     imapd

and add it to the SMF framework

$ pfexec inetconv

I received an error for the imaps entry:

inetconv: Error /etc/inet/inetd.conf line 42 invalid or inconsistent fields: service-name protocol

Upon checking I found that /etc/services file was missing the entry for the imaps protocol, so I added a line:

imaps        993/tcp

and imported the services to the SMF again. This was a success this time. Finally we need to enable the daemons, which can be done as follows:

$ pfexec svcadm enable svc:/network/imaps/tcp:default
$ pfexec svcadm enable svc:/network/imap/tcp:default
Posted in Solaris/AIX/HP-UX | Tagged , , , , | Leave a comment

Is statistics always right, how do you measure the development?

Sometimes by looking at various statistics being published at various places about India becoming a (so called?) developed country, I am compelled to think that are these statistics reflecting the true Indian progress…..

For example, according to some reports recently published some time back, India has around 50 crores of telephones which means one phone per two people. But is it true? Quite a lot of people keep more than one phones, some even has 6-7 phones. According to TRAI (Telecom Regulatory Authority of India) there are 47.1 crores mobile subscribers in the country and 3.7 crore landlines. Does the number of increasing mobiles have anything to do with progress of the country?

The number of people below the line of poverty is still increasing. Villages are getting destroyed to give way to ever expanding towns and cities. In the name of SEZ (Special Economic Zone) furtile agriculture land is being destroyed. If all agricultural land will be turned in to industrial lands, where will we grow food which we all eat.

This is not development, but destruction. Its high time that we educated Indians start raising these issues and concerns and educate the general public about this.

Posted in Views | Tagged | Leave a comment

On Sabayon 5 now

Last night installed Sabayon 5 amd64 on my laptop. All went fine except when I tried to do an update. I did the following as suggested in the Sabayon wiki:

$ sudo equo update
$ sudo equo update --force
$ sudo equo upgrade --ask

I was shown a long list of around 700+ packages which I started updating. After I was done, I executed the following and rebooted afterwards.

$ sudo equo conf update

Upon logging in to the newly updated system, I was surprised with ‘wicd’ asking me for a root password and then stating that its having a DBus error. So I connected the ethernet cable and a bit of search on the net (using Yahoo search engine) pointed me that I need to add wicd to startup at boot, which I achieved using the following:

$ sudo rc-update add wicd boot

I next rebooted, but still no joy. I was this time getting a message “BAD PASSWORD”. I was pretty sure that my password was correct. Again I spent some time on searching the internet using ethernet cable and finally found that a new version of knetworkmanager was in the entropy, so I decided to switch to it and remove the wicd.

$ sudo equo remove wicd
$ sudo equo install knetworkmanager

This was smooth and all started working well.

This does not mean that there is a problem with wicd. There are lots of people who had problem with knetworkmanager and have switched to wicd. This is the prime reason that sabayon guys have perhaps included wicd into the distribution. But the point which I am not able to understand is that why they changed my functional knetworkmanager during update to wicd?

Anyways, all izz well that ends well. I am writing this post from wire.

Oh!! and I have not rebooted yet. Ok let me reboot after this post and see if all remains well or not. Obviously you will see something either here or on twitter if all is not well. ;-)

Posted in FLOSS | Leave a comment

Setting Filesystem Quota in linux

I recently activated quota on my slicehost slice and it was quite simple and fast to do. The only disadvantage is that I needed to set quota on the only filesystem I had, which is /. If there is a choice then it is advisable to set quota on non-root filesystem such as /home, /var etc. The primary reason for this is that while performing the quota check the filesystem needs to be mounted read-only temporarily by the quotacheck utility. Since the root filesystem can not be mounted read-only while the system is running we need to do a force quota check on the system which might result in in-accurate figures and can cause corruption to the quota files.

Here are the commands which I executed in quick succession to enable the quota:

$ sudo modprobe quota_v2
$ sudo lsmod|grep quota
quota_v2               11392  0
$ sudo mount -o remount,noatime,usrquota,grpquota /

The following command will create the quota files and the -m option is to force the execution as the filesystem can not be mounted read-only.

$ sudo quotacheck -cugm /

Now to calculate the current usage,

$ sudo quotacheck -avugm
quotacheck: Scanning /dev/sda1 [/] done
quotacheck: Checked 8990 directories and 87482 files

Now to set the quota for user testuser we can use setquota. Following command set the quota to 1GB.

$ sudo setquota -u testuser 1000000 1048576 0 0 -a
Posted in FLOSS | Leave a comment