Thursday, February 10, 2011

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

Tuesday, March 23, 2010

30 Habits that Will Change your Life

 
 

Sent to you by ravi via Google Reader:

 
 

via Freestyle Mind by Oscar on 3/22/10

Developing good habits is the basic of personal development and growth. Everything we do is the result of a habit that was previously taught to us. Unfortunately, not all the habits that we have are good, that's why we are constantly trying to improve.

The following is a list of 30 practical habits that can make a huge difference in your life.

You should treat this list as a reference, and implement just one habit per month. This way you will have the time to fully absorb each of them, while still seeing significant improvements each month.

Health habits

  1. Exercise 30 minutes every day. Especially if you don't do much movement while working, it's essential that you get some daily exercise. 30 minutes every day are the minimum recommended for optimal health.
  2. Eat breakfast every day. Breakfast is the more important meal of the day, yet so many people skip it. Personally, I like to eat a couple of toasts in the morning along with a fruit beverage.
  3. Sleep 8 hours. Sleep deprivation is never a good idea. You may think that you are gaining time by sleeping less, when in reality you are only gaining stress and tiredness. 8 hours are a good number of hours for most people, along with an optional 20 minutes nap after lunch.
  4. Avoid snacking between meals. Snacking between meals is the best way to gain weight. If you are hungry, eat something concrete. Otherwise don't. Update: for clarification, I mean don't eat junk food between meals, but eating real food it's ok.
  5. Eat five portions of fruits and vegetables every day. Our body and brain loves getting vegetables and fruit, so I highly recommend eating as much of them as possible. Five portions is the dose that's usually recommended by many health associations.
  6. Eat fish. Fish is rich of omega 3 and other healthy elements. At least one meal per week of fish should be enough for getting all these nutrients.
  7. Drink one glass of water when you wake up. When you wake up, your body is dehydrated and needs liquid. Make the habit of drinking one glass of water after you wake up in the morning. Also, drink more during the day.
  8. Avoid soda. Soda is often one of the most unhealthy beverage you can find. Limit your consumption of soda as much as possible and you're body will be grateful for that.
  9. Keep your body clean. I don't advise spending your day in front of the mirror, but a minimum of personal care does never hurt.
  10. If you smoke, stop it. There's no reason to smoke anymore, and quitting is easy.
  11. If you drink, stop it. Same as above. Don't think that alcohol will solve your problems. It never does. The only exception is one glass of wine per day during meals.
  12. Take the stairs. This is just a hack that forces you to do a minimum of exercise. Instead of taking the elevator, take the stairs.

Productivity habits

  1. Use an inbox system. Make the habit of keeping track of all the ideas and things that comes to mind. You can use a notebook to do this, and then sync everything on your computer.
  2. Prioritize. If you have a list of things to do, where do you start? One way is to prioritize your list. If you are in doubt, ask yourself: "If I could only accomplish one thing today, what would it be?"
  3. Plan, but not too much. Planning is important, and you should decide in advance what you are going to do today or this week. However, planning for more than a few weeks is usually inefficient, so I would not worry too much about that.
  4. Wake up early. Waking up early in the morning is a great way to gain extra time. I personally like to wake up at 5 am, so that by 9 am I have already accomplished what otherwise would have taken me many days..
  5. Check your email only twice per day. Email can easily become an addiction, but it's usually unnecessary to check it every 10 minutes. Make an effort and check your email only once or twice per day, see if the world will still rotate as before after you try this.
  6. Eliminate unimportant tasks. Being busy all day does not mean you are doing important stuff. Eliminate every activity that's not important, and focus on what really matters.
  7. Clean off your desk and room. Having a clear room and desk is important to maintain focus and creativity.
  8. Automate. There are a lot of tasks that you need to perform every day or every week. Try to automate them as much as possible.
  9. Set strict deadlines. When you do something, decide in advance when you're going to stop. There's a rule that states that you will fulfill all the time you have available for completing a task, so make an habit of setting strict deadlines for maximizing your productivity.
  10. Take one day off per week. Instead of working every day, take one day off per week (for example sunday) where you are not going to turn on your computer. Use that time for doing recreational activities like going for a walk.

Personal Development habits

  1. Read 1 book per week. Reading is a good way to keep your brain active. With just 30 minutes per day you should be able to read one book per week, or more than 50 books per year.
  2. Solve puzzles. Quizzes, word games, etc. are all good ways to exercise your brain.
  3. Think positively. You are what you think, all the time.
  4. Make fast decisions. Instead of thinking for one hour wherever you are going to do something, make your decisions as fast as possible (usually less than 1 minute).
  5. Wait before buying. Waiting 48 hours before buying anything is a tremendous money saver, try it.
  6. Meditate 30 minutes per day. A great way to gain clearness and peace is through meditation. 30 minutes are not a lot, but enough to get you started with meditation.

Career habits

  1. Start a blog. Blogging is one of the best way to put your word out. It doesn't have to be around a specific topic, even a personal blog will do.
  2. Build a portfolio. If your job is creating stuff, building a portfolio is a great way to show what you are capable of. You can also contribute stuff for free if that applies to your work.

What do you think? What are the habits that changed your life?

Image credits (homepage)


 
 

Things you can do from here: