Aug 14, 2014

1. Check your Wifi card
Check whether your wifi card support AccessPoint (AP) infrastructure mode
iw list
Your wifi card is good to go if the output shows something like
Supported interface modes:
   * --
   * --
   * AP
   * AP/VLAN
   * --
AP means AccessPoint (AP) infrastructure mode.

2. Install "hostapd"
The latest version was buggy when I'm writing this blog. So install the just before version and hold it's updation. 
64 Bit
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_2.1-0ubuntu1.2_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd
32 Bit
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_2.1-0ubuntu1.2_i386.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

3. Install dnsmasq

apt-get install dnsmasq

4. Install ap-hotspot
Install  ap-hotspot, it's a set of scripts that helps you to easily configure the hotspot settings.
Download the .deb file from the below links and double click to install.
Ubuntu 12.04 - Click to download
Ubuntu 12.10 - Click to download
Ubuntu 13.04 - Click to download
Ubuntu 13.10 - Click to download
Ubuntu 14.04 - Click to download

5. Configure WiFi hotspot
sudo ap-hotspot configure

6. Start/Stop/Restart WiFi hotspot
sudo ap-hotspot start
sudo ap-hotspot stop
sudo ap-hotspot restart

7. Common Issues/Errors
Another process already running error
When you try to start the ap-hotspot it says 'Another process already running'
sudo ap-hotspot start
Another process is already running
To fix this issue remove hotspot.pid from /tmp
sudo rm /tmp/hotspot.pid
sudo ap-hotspot start

Hope this helps and saved your time...