I've had to play with this every time I reinstall Ubuntu and want to setup a VNC web client which is really handy when I'm work and need to access my PC at home for whatever reason.
First, make sure you have remote desktop enabled by going to Menu -> System -> Preferences -> Remote Desktop. Click "Allow other users to view your desktop" and "Allow other users to control your desktop." For my use, since I VNC into my desktop from remote locations and thus will not be at my desk to accept my own connection, I uncheck "You must confirm each access to this machine" and check "Require the user to enter this password." Make sure you use a strong password. Of course, you may need to configure your router to forward incoming communication for ports 5800 and 5900 to your desktop you're wanting to connect into.
Second, if you do not already have apache installed, install it:
sudo apt-get install apache2
Third, download the tightvnc-java package. I use the latest version at Tightvnc's website rather than the one in Ubuntu's repositories. Download and extract the java Binary *.class and JAR files in Zip archive (or Tar+Gzip) and extract the contents wherever you want.
Finally, open Nautilus as root by hitting Ctrl-F2 and typing gksu nautilus (or if you're a Linux pro, you can use a terminal to copy the contents to /var/www/vnc). Browse to /var/www and create a folder named vnc. Copy the contents of the java vnc viewer to /var/www/vnc. Open index.html and replace all the contents with this:
<HTML>
<TITLE>
TightVNC desktop
</TITLE>
<APPLET CODE="VncViewer.class" CODEBASE=classes/ ARCHIVE="VncViewer.jar"
WIDTH="800" HEIGHT="632">
<PARAM NAME="PORT" VALUE="5900">
<param name="Open New Window" value="yes">
</APPLET>
<BR>
<A href="http://www.tightvnc.com/">TightVNC site</A>
</HTML>
And that should do it. You can now access it via http://ip.address/vnc or use a dynamic DNS service such s DnsExit to create a domain name that points to your home IP.


