openvpn vnc java firefox on centos5

作者: 2hei 发表于2011年6月10日 14:29
版权声明: 可以转载, 转载时务必以超链形式标明文章原始出处和作者信息及版权声明
http://www.2hei.net/mt/2011/06/openvpn-vnc-java-firefox-on-centos.html

1. yum install openvpn
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install epel-release-5-4.noarch.rpm
yum intall openvpn

vnp configs: 2hei.net.ovpn
add:
--script-security 2
up "/etc/openvpn/update-resolv-conf up"
down "/etc/openvpn/update-resolv-conf down"

script: update-resolv-conf
#!/bin/bash
case "$1" in
    up)
        mv /etc/resolv.conf /etc/resolv.conf.openvpn
        echo "# Generated by OpenVPN Client UP Script" > /etc/resolv.conf
        echo "search 2hei.net" > /etc/resolv.conf
        for opt in ${!foreign_option_*};
        do
            #echo ${!opt} | sed -e 's/dhcp-option DOMAIN/domain/g' -e 's/dhcp-option DNS/nameserver/g' >> /etc/resolv.conf
            echo ${!opt} | sed -e 's/dhcp-option DNS/nameserver/g' >> /etc/resolv.conf
        done
        #add orig nameserver
        grep nameserver /etc/resolv.conf.openvpn >> /etc/resolv.conf
        ;;
    down)
        mv /etc/resolv.conf.openvpn /etc/resolv.conf
        ;;
    *)
        echo "Pass either UP or DOWN"
        ;;
esac

cat start_client_dc1.sh
#!/bin/sh
/usr/sbin/openvpn /etc/openvpn/2hei.net.ovpn


2. update firefox on centos
down load new version of firfox
ln -s /usr/local/firefox/firefox /usr/bin


3. use java web start on firefox
download new version of jre
sh ./jre-6u25-linux-x64-rpm.bin
alternatives --install /usr/bin/java java /usr/java/jre1.6.0_25/bin/java 2
alternatives --config java     # pick 1 or 2 or 3
java -version
cd /usr/lib/mozilla/plugins
ln -s /usr/java/jre1.6.0_25/lib/amd64/libnpjp2.so

4. vnc
[2hei.net# .vnc]$ cat xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &

start vncserver
vncserver
| | Comments (0) | TrackBacks (0)

发表一个评论

关于这篇文章

这篇文章由2hei2011年6月10日 14:29发布.

上一篇:bonding in linux

下一篇:linux 环境变量中配置参数 use function but not use alias

回到首页 或者查看归档文章

  • Powered by FeedBurner
  • Add to Google Reader or Homepage
  • Add to My AOL
  • Subscribe in NewsGator Online
  • del.icio.us/2heidel.icio.us/2hei
  • Subscribe to feed feeds