Thursday, February 10, 2011

Piwik : An Open Source Web Analytics alternative to Google Analytics

Hello Friends,

Since Google Analytics can not be used on intranet website, we needed to find something similar in open source. And we have Piwik which provides similar functionalities. Piwik is open source, under GPL license Piwik also provides development options for developers.

To know more have a look here at the http://piwik.org/

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Setting Up Mail Server on Linux [Postfix + Dovecot]

Hello Friends,

Here are the steps to configure a basic mail server using Postfix and Dovecot.
For the basics of Mail server you can refer Wikipedia. We need to download Postfix and dovecot. Generally with any Linux these packages are distributed by default but if not available can be downloaded and installed.

This document assumes that all commands are run using super user or root.

For Redhat/Fedora/Mandriva/Suse etc Linux flavours  
  • rpm -ivh postfix-Xx.XX.rpm
  • rpm -ivh dovecot-xx.xx.rpm

For Ubuntu/Debian
  • apt-get install postfix
  • apt-get install dovecot 

Configure your domain name.
  • If you are running on any system which is directly visible to Internet i.e. you have your domain name then use your domain.
  • My system is running on intranet/LAN so I have to configure a domain name in hosts file
    • Add this line to /etc/hosts
      • 127.0.0.1    rkg.test
    • You can choose the domain name according to you. I use .test because that is not gonna conflict with any website I open. 

Configure SMTP which runs on port 25 by default
  • Using your favorite editor edit /etc/postfix/main.cf file 
    • vi  /etc/postfix/main.cf
  • Add these lines at the end
    • myhostname = rkg.test
    • mydomain = rkg.test
    • inet_interfaces = all
    • mynetworks = 172.0.0.0/8 
  • These are the basic configurations. If you want to get into details just read main.cf file accordingly.
  • mynetworks should be configured accordingly. For basics like > My system is in intranet with private LAN with IPs starting from 172.0.0.0 so I put it like that. Choose according to your network.

Configure Dovecot for mail receiving protocols- imap imaps pop3 pop3s
  • Edit the /etc/dovecot.conf or sometimes at /etc/dovecot/dovecot.conf
    • vi /etc/dovecot.conf
  • add this line
    • protocols = imap imaps pop3 pop3s 
  • For advanced configurations modify dovecot.conf file.

Now we need to configure accounts. 

Add some system accounts like a, b, c etc.
  • useradd a
  • passwd a 
  • useradd b
  • passwd b
For these accounts emails will be a@rkg.test, b@rkg.test etc.

Now we need to start the servers -
  • service dovecot start 
  • service postfix start

To automatically start the servers at startup
  • chkconfig dovecot on
  • chkconfig postfix on
 
Now the mail server is up. You can now use it for your integration purposes. In next post we will see how Evolution can be used as mail client to verify what we just did. :)

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Saturday, February 5, 2011

[Ubuntu] Broadcom Wireless STA Driver Activated But Not Currently In Use

Hello Friends,

I am using Ubuntu 10.04 LTS - the Lucid Lynx. I was using Wireless daily with no problem but one week back something happened and my wireless stopped working suddenly. I figured with System > Administration > Hardware Drivers.. that my wireless driver was not in use. I thought of removing it, reinstalling and then re-activate it.. it worked.. but whenever I rebooted my system I had to do the same process everytime.. :(

Tried google and found this blog.. thanks a lot to the writer..

I will just rewrite the steps here for my reference.. :D

All this we are going to do on a terminal.. just press Alt+F2 and type gnome-terminal and press enter..

1. Optionally u can try these commands first.. just to check the connection
lspci -nn
lshw -C Network
lsusb
ifconfig
iwconfig
sudo iwlist scan

Now run the following commands..
sudo modprobe -r b43 ssb wl
sudo modprobe wl
sudo ifconfig eth1 up
sudo iwlist scan
 
2. Blacklist ssb. Run the following command 
echo blacklist ssb | sudo tee -a /etc/modprobe.d/blacklist.conf
 
3. Edit rc.local and add the following code at the end.
sudo vi /etc/rc.local
and add this just before "exit 0"
modprobe wl



Now just reboot... the problem should be gone :)

P.S. I am running ubuntu on Dell 1440.

Cheers!!!

Ravi Kumar Gupta -aka D'Maverick

Sunday, January 9, 2011

How to configure start up programs / services in Ubuntu

Hello Friends,

I was recently installing a lot of softwares and most of which were started when computer starts. I needed to configure start up programs/services. After looking at some websites I found one tool.. install it using

sudo apt-get install sysv-rc-conf

then run sysv-rc-conf using sudo and configure.

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Saturday, January 1, 2011

configure: error: BDB/HDB: BerkeleyDB not available

Hello Friends,

Today morning while installing OpenLDAP I was getting error like :
configure: error: BDB/HDB: BerkeleyDB not available

I checked, googled and found-

from read me:
BDB and HDB backends require Oracle Berkeley DB 4.4, 4.5,
4.6, 4.7, or 4.8. It is highly recommended to apply the
patches from Oracle for a given release.

And then I installed Berkeley DB and set these environment variables..
CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include"
LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib"
LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"

export CPPFLAGS LD_LIBRARY_PATH LDFLAGS

Then everything worked fine...

just ran
./configure
make depend
make
sudo make install

Cheers!!!

Ravi Kumar Gupta aka D'Maverick

Saturday, December 11, 2010

Internal Server Error - Apache Web Server

Hello Friends,

Recently I got this error on my web server,

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@******.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I checked the logs and found..

[Sat Dec 11 21:33:29 2010] [alert] [client 127.0.1.1] /var/www/volant/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

This was raised by .htaccess because mod_rewrite was not enabled.

Solve this by enabling the module.. for ubuntu i wrote
a2enmod rewrite
in mods-available directory as sudo

directory exists in /etc/apache2/mods-available

Enjoy..
Ravi Kumar Gupta aka D'Maverick