2011年6月16日 星期四

CentOS 5.x 安裝 VMware Server 2.x 的問題

CentOS 5.x 安裝 VMware Server 2.x 版本,在使用 http://IP:8222 連線後,會發現網頁出不來,但連到 http://IP 很正常,不是 apache 的問題。測試不同的環境,在 Windows 裡使用 IE ,可以顯示登入、登入後的畫面。
後來在 Server 的 /var/log/vmware 裡的 log 檔案看到 SSL Handshake on client connection failed: SSL Exception 的錯誤訊息。有了方向,就表示快找到解決的方式了。
果然,Google 一下就找到 http://planetvm.net/blog/?p=1087 這篇。作者也測試了各種不同的可能性,原來應該是 ssl 連線的問題,另一位網友提供了解決的方式,如下:

Dayworker replied to the forum post and made a remark about how-to fix the issue on firefox 3.6. It turns out that SSL2 is disabled in Firefox 3.6, this turned out to be my problem on the default firefox 3.0.x setup as well… He referred to a post in a german VMware forum where shecki found out about this little tid bit.

So if you encounter this then try changing the following in about:config

security.enable.ssl2 from false into true 

For me it solved my firefox problem completely. Thanks guys for sharing this.


簡單來說,就是在 firefox 裡連到 about:config ,尋找 security.enable_ssl2 將這裡的值改為 true ,再連到 http://IP:8222 就可以使用囉!

2011年6月7日 星期二

vmware server

目前在 vmware player 環境裡的 centos ,這也是在一個 vm 環境,如果要安裝 vmware server 的系統做測試,在安裝時,有幾個問題要注意:
  1. 安裝 centos 時,不能安裝虛擬環境,例如 xen 就不能安裝。若安裝 xen 的話,在 vmware server 安裝的動作就會失敗。
  2. 當 centos 安裝完成後,不要安裝 vmware tools。若安裝 vmware tools 的話,在安裝 vmware server 完成後,還需要執行 vmware-config.pl 的這個動作,會顯示系統己安裝 xxx 模組的訊息,而造成 vmware-config.pl 的設定動作無法繼續執行。
  3. 連結時,使用 http://localhost:902 是 remote connect ,使用 http://localhost:8222 是 standard http connection 或 http://localhost:8333 是使用 secure http connection 方式連結管理。
  4. 由於 port 不同,所以,記得要在 system-config-security 增加上述的幾個 tcp port ,才能從其它台遠端連線管理。

以下是參考資料:
http://www.vmware.com/support/pubs/server_pubs.html
http://blog.pmail.idv.tw/index.php?load=read&id=511
http://blog.lyhdev.com/2009/09/vmware-server-201-linux.html

2011年6月6日 星期一

eclipse連到android手機

參考這篇
http://developer.android.com/guide/developing/device.html

以及, 將手機的 usb除錯功能 開啟,就可以將 eclipse 撰寫的內容直接送到 手機裡執行囉!

android的VideoView

哈~~ 可以播放影片了~~ 原來,在 layout 這裡,若是使用 VideoView 的話,大部份都依原本的規劃來處理即可,但是卻不能加入 background ,加入這個設定的話,就會看到 background ,但沒有內容。

2011年3月3日 星期四

javac cannot find symbol

在 dos 指令模式下編譯 java 時, 可能會出現 javac cannot find symbol 這個錯誤訊息.
舉例來說, 有個 dog.java 和 dogTestDrive.java, 前者是 純class, 後者是 main 程式進入點, 這裡會使用 dog 的類別. 當我們在執行
javac dog.java
時沒有問題, 而在執行
javac dogTestDrive.java
時, 系統回應 javac cannot find symbol 的訊息. 這個時候, 是因為系統找不到我們所建立的 dog.class 這個類別, 是的, 雖然在同一個目錄裡, 但就是找不到, 解決的方式是, 編譯時
javac dogTestDrive.java -classpath ./
使用 -classpath 跟 javac 編譯器說明類別的目錄在 ./ (現在的目錄) 這裡, 這樣就可以編譯成功. 然後執行
java dogTestDrive
就可以囉~~ 另外, 使用 java 時, 不要加上副檔案名稱 .class 哦~~

以上的例子, 我是以 Head First Java 裡的例子來說明的.

2011年2月17日 星期四

mysql utf8 中文亂碼解決

參考資料來源:
http://www.sonys.tw/2008/07/php-mysql-phpmyadmin-utf-8.html
http://33tsai.blogspot.com/2008/06/mysql-big5utf8.html

以下資料由第一個參考來源複製備份的~
=====================

PHP, MySQL, phpmyadmin, utf-8 使用中文出現亂碼?

  遇到這個問題的程式設計者,想要利用google大神找尋答案的時候,不外乎就是使用如同標題一般的搜尋字串,希望找到那麼一點機會,讓亂碼的問題可以全面消失!這邊不講原理,原理網路上很多可以慢慢爬,這邊只提供一個可能適用於你的惱人狀況的解法.試試看吧!

在mysql_select_db的區塊之前,安插程式片段如下:
mb_internal_encoding('utf8');
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET NAMES 'utf8'");
mysql_select_db($DB_NAME);

  當然,除了這一段資料庫的編碼設定之外,將網頁存成utf-8格式也是必要的!建議使用Notepad++來做這一個另存新檔的動作.如此一來不但網頁上可以順利呈現utf-8編碼,資料庫在讀寫上也能順利進行,不會有"亂碼"或是"????"的字樣出現~

  這段程式碼是在征戰國內外主機之後,對於utf-8編碼的精華心得,希望對你/妳有幫助!注意,有時候utf8與utf-8這兩個不同寫法,會產生不同結果喔!

2011年2月16日 星期三

apache時區不正確

如果網頁上顯示的時間(時區)不正確,請開啟 php.ini 檔案,找到以下內容:
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
將最底下這一行改為
date.timezone = Asia/Taipei
再重新啟動 apache 就 OK 囉!