The usual way to configure a server is to fill in your details in the file /etc/network/interfaces. First, confirm you have a working wireless interface:
iwconfig
Do you have an interface, ideally wlan0? Next confirm it is working as expected:
sudo iwlist wlan0 scan
Do you see your network, among others? If so, edit the file with the editor vim:
sudo vim /etc/network/interfaces
Add your details so it looks something like:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static <--you want to be able to reach your server by ssh and ftp
address 192.168.1.100 <--an address outside the DHCP range in the router
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8
wpa-ssid <your_network>
wpa-psk <your_key>
Save your changes and close vim with :wq. Now get the interface to see and use the new settings:
sudo ifdown wlan0 && sudo ifup wlan0
Confirm you got the new address:
ifconfig
And that you can reach the internet:
ping -c3 www.google.com
Of course, substitute your details above.
Best Answer
Are you using network manager? If so, try using wicd. (I literally just had this problem 2 days ago, and this is how I solved it.)
I think network manager struggles with WPA for some reason.