2010年5月12日星期三

realVNC Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list! 處理

 

參考:http://cha.homeip.net/blog/2005/08/137.html

vnc-4_1_3-x86_linux.tar.gz

 

安裝realvnc for linux 後發現啟動不了

查看~/.vnc/xxx.log發現

Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'

Xvnc Free Edition 4.1.3 - built Oct 15 2008 12:55:42
Copyright (C) 2002-2008 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40201000, The XFree86 Project, Inc

Wed May 12 22:18:05 2010
vncext:      VNC extension running!
vncext:      Listening for VNC connections on port 5901
vncext:      Listening for HTTP connections on port 5801
vncext:      created VNC server for screen 0
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!

Fatal server error:
could not open default font 'fixed'
xsetroot:  unable to open display 'pennyho.test.com:1'
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s

(gnome-session:22056): Gtk-WARNING **: cannot open display:
vncconfig: unable to open display "pennyho.crp.com:1"

發現/usr/X11R6/lib/X11/ 沒有內容

google了一下發現http://www.linuxquestions.org/questions/linux-desktop-74/vnc-problems-could-not-open-default-font-fixed-481175/

 

cp –rf /usr/share/X11 /usr/X11R6/lib/X11

再次啟動,vncserver 查看一下端口

# netstat -untlp |grep Xvnc
tcp        0      0 0.0.0.0:5801                0.0.0.0:*                   LISTEN      3463/Xvnc
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      3463/Xvnc
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      3463/Xvnc

出來了

remote 瀏覽器訪問5801端口 ok!

記錄一下備忘

記錄一下我的過程:

tar xvfz vnc-4_1_3-x86_linux.tar.gz
cd vnc-4_1_3-x86_linux

  ./vncinstall /usr/local/bin

mkdir -p /usr/X11R6/lib/modules/extensions/

  cd vnc-4_1_3-x86_linux

cp vnc.so /usr/X11R6/lib/modules/extensions/
mkdir -p /usr/local/vnc/classes
  cp java/* /usr/local/vnc/classes
cp -rf /usr/share/X11 /usr/X11R6/lib/X11

# which vncserver
/usr/local/bin/vncserver

 

# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:771                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:904                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:25300               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

]# vncserver

You will require a password to access your desktops.

Password:
Verify:

New 'CRRACTEST.localdomain:1 (root)' desktop is CRRACTEST.localdomain:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/CRRACTEST.localdomain:1.log

# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:771                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:904                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5801                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:25300               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

從remote IE or firefox :

:5801">http://vncserver<ip>:5801

就可以訪問到了

當然如果希望gnome or kde env,修改 ~/.vnc/xstartup文件

GNOME:

xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &

KDE:

xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startkde &

補充完畢

2010年5月4日星期二

vmware安裝在Centos5.3上的報錯vmware gcc: error trying to exec 'cc1': execvp: No such file or directory

 

運行

vmware-config.pl ,報錯

vmware gcc: error trying to exec 'cc1': execvp: No such file or directory

糾結了半天原來認為是kernel 的問題,後來發現

gcc-c++ 沒有安裝

yum install gcc-c++

再次運行 過去了

記錄一下備忘

2010年5月3日星期一

keepalived failover實驗

實驗keepalived 對2個lvs server進行failover的切換

要求:

1.可以切換過去

2.發送mail

安裝keepalived-1.1.19.tar.gz 目前最新的

./configure

make

make install 三部曲

#cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

#cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/

#mkdir /etc/keepalived

#cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/

#cp /usr/local/sbin/keepalived /usr/sbin/

然後便捷.conf文件

! Configuration File for keepalived
global_defs {
   notification_email {
                yourname@yourdomain //要收到mail的address
   }
   notification_email_from lvs-machine@lvsdomain  發送
   smtp_server 127.0.0.1 
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}
# VIP1
vrrp_instance VI_1 {
    state MASTER            

    smtp_alert    #這個是關鍵,如果沒有這個不會發mail!
    interface eth0
    virtual_router_id 51
    priority 150        advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        172.16.1.240
    }
}

virtual_server 172.16.1.240 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 60
    protocol TCP

    real_server 172.16.1.233 80 {
        weight 3
        TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
        }
     }
}
[root@lvserver keepalived]#

backup

! Configuration File for keepalived
global_defs {
   notification_email {
                yourname@yourdomain
   }
   notification_email_from  lvs-backup@lvs-domain
   smtp_server 127.0.0.1   #default 啟動sendmail 25端口
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}

# VIP1
vrrp_instance VI_1 {
    state BACKUP             #.......MASTER..BACKUP
        smtp_alert
    interface eth0
    virtual_router_id 51
    priority 99    # ......100..99
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        172.16.1.240
    }
}

virtual_server 172.16.1.240 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 60
    protocol TCP

    real_server 172.16.1.233 80 {
        weight 3
        TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
        }
     }
}

在default情況下,master 掉了會切換到slave(backup) lvs server, 但是當master 回來的時候會取代slave,還是master.

這個要跟實際應用策略有關係。

要注意就是:

smtp_alert的設置,否則不會收到mail

測試發現他發出來的mail不是太明顯,沒有辦法編輯格式,後來想了一下,可以使用其他的手段做一個mail script.發送。

網上很多資料。不再列舉了

記錄一下,備忘!

 

參考:

http://www.linuxtone.org/thread-1077-1-1.html

2010年5月2日星期日

sendmail “cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory” 問題處理

在生成sendmail configure file的時候報錯了

m4 sendmail.mc >sendmail.cf

cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory

網上查一下少

sendmail-cf


這個包



因為我這裡使用的是OEL 5.4 從iso上面找到



[root@lvserver Server]# rpm -Uvh sendmail-cf-8.13.8-2.el5.x86_64.rpm

warning: sendmail-cf-8.13.8-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159


Preparing...                ########################################### [100%]


   1:sendmail-cf            ########################################### [100%]


[root@lvserver Server]#



 



再次運行m4 sendmail.mc >sendmail.cf     ok



[root@lvserver ~]# netstat -tln

Active Internet connections (only servers)


Proto Recv-Q Send-Q Local Address               Foreign Address             State


tcp        0      0 127.0.0.1:199               0.0.0.0:*                   LISTEN


tcp        0      0 0.0.0.0:904                 0.0.0.0:*                   LISTEN


tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN


tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN


tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN   <-here


tcp        0      0 0.0.0.0:860                 0.0.0.0:*                   LISTEN


tcp        0      0 :::22                       :::*                        LISTEN



 



發一個mail測試一下:



[root@lvserver ~]# mail -s "lvs222 test"    youname@example.com.hk </dev/null


Null message body; hope that's ok


[root@lvserver ~]#



收到,測試成功記錄一下,



sendmail的配置文件的地址:



[root@lvserver mail]# pwd

/etc/mail



啟動關閉


[root@lvserver init.d]# pwd


/etc/init.d

[root@lvserver init.d]# ./sendmail

Usage: ./sendmail {start|stop|restart|condrestart|status}




記錄一下備忘!