2015年9月17日 星期四

enable nginx HTTPS

無法查看此摘要。請 按這裡查看文章。

[Windows] 自己打造免安裝版的WNMP - Nginx+PHP5+MariaDB

安裝前須知
VC9 與 VC11(原文請請參考http://windows.php.net/download/)
使用 VC9 版本時,需安裝 Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64
使用 VC11 版本時,需安裝 Visual C++ Redistributable for Visual Studio 2012 x86 or x64
註:x86 表示 32位元版本,x64 表示 64位元版本。
因為 Windows XP 與 Windows 2003請使用PHP5.4.X以前版本,因為我的作業系統為win10 所以使用PHP5.5.X以後版本這裡是用PHP5.6.9

下載 WNMP-Lite-Win32-VC9-portable.7z 解壓縮至 E:\ (也可解壓縮至 C:\)。解壓縮後大約42M,因為PHP、MariaDB經過瘦身,有完整版需求者請自行至相關官網下載,覆蓋檔案即可。這裡是用PHP5.6.9取代,MariaDB5.5.36取代。

此版本已設定使用者目錄(UserDir),欲安裝 WordPress 參考 http://web.dhjh.tc.edu.tw/~gzqbyr/fluxbb/forums/viewtopic.php?id=382
執行 E:\WNMP\start.bat 即可啟動網頁伺服器,而執行 E:\WNMP\stop.bat 可停止伺服器。

adminer.php
可以在https://www.adminer.org/取得最新版本,這裡是用Adminer 4.2.2。
瀏覽 127.0.0.1/adminer.php,帳號 輸入 root ⇨ 登入。













開始製作可擕式 WNMP
建立 E:\WNMP 資料夾。
Nginx 安裝:
http://nginx.org/en/download.html 下載 nginx-1.8.x(x 表示版本號),解壓縮至 E:\WNMP。將 E:\WNMP\nginx-1.8.0 重新命名為 E:\WNMP\nginx。
編輯 nginx\conf\nginx.conf
尋找
       location / {
            root   html;
            index  index.html index.htm;
        }
取代為
       location / {
            root   html;
            index  index.php index.html index.htm;
        }

  location ~ .*\.php(\/.*)*$ {
   root html;
   fastcgi_pass   127.0.0.1:9000;
   fastcgi_index  index.php;
   fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
   include fastcgi_params;
  }

PHP 安裝:
建立資料夾 E:\WNMP\php。
http://windows.php.net/downloads/releases/archives/  下載 php-5.5.x-Win32-VC9-x86.zip(x 表示版本號),解壓縮至 E:\WNMP\php。(僅php5.2才能使用SQLite2)
重新命名 E:\WNMP\php\php.ini-development 為 php.ini
編輯 E:\WNMP\php\php.ini(不同的PHP版本的 extension 設定也稍微不一樣)
尋找
extension_dir = "ext"
取代為
extension_dir = "./ext/"
尋找
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_sqlite.dll
;extension=php_sqlite3.dll

取消註解 ;。

MariaDB 安裝:(以MariaDB取代MySQL)
MariaDB 官網 - https://mariadb.org/
以 MariaDB-5.5.36 為例。
https://downloads.mariadb.org/mariadb/5.5.36/ 下載 mariadb-5.5.36-win32.zip,解壓縮至 E:\WNMP。
至 E:\WNMP 將 資料夾 mariadb-5.5.36-win32 更名為 mariadb
下載 NirCmd,解壓縮後將 nircmd.exe 複製至 D:\WNMP。
將 restart.bat、start.bat、stop.bat 存至 D:\WNMP。


然後在DOS模式下(系統管理員)啟動 restart.bat









2014年5月8日 星期四

Office 365 使用PowerShell注意事項

由於當初使用PowerShell年代久遠忘了需要注意什麼.直到OFFICE 由2010升級至2013時將登入小幫手移除才發現無法使用.再次紀錄一下做為參考.


安裝 Office 365 Cmdlet

您必須先安裝 Office 365 Cmdlet,才能開始使用。安裝 Office 365 Cmdlet 的需求如下:

    您可以在 Windows 7 或 Windows Server 2008 R2 電腦上安裝 Cmdlet。
    您必須已啟用 Windows PowerShell 和 .NET Framework 3.5.1。
    您必須安裝 Microsoft Online Services 登入小幫手。從 Microsoft 下載中心,下載並安裝下列其中一項:
        Microsoft Online Services 登入小幫手 (IDCRL7) - 32 位元版 http://go.microsoft.com/fwlink/p/?linkid=236299&clcid=0xC04
        Microsoft Online Services 登入小幫手 (IDCRL7) - 64 位元版 http://go.microsoft.com/fwlink/p/?linkid=236300&clcid=0xC04

若要安裝 Cmdlet,請執行下列步驟:

    從 Microsoft 下載中心,下載以下其中一項:
        適用於 Windows PowerShell 的 Microsoft Online Services 模組 (32 位元版本) http://go.microsoft.com/fwlink/p/?linkid=236298&clcid=0xC04
        適用於 Windows PowerShell 的 Microsoft Online Services 模組 (64 位元版本) http://go.microsoft.com/fwlink/p/?linkid=236297&clcid=0xC04

    若要安裝 Cmdlet,請按兩下 AdministrationConfig.msi 檔案。

    安裝程式會將程式新增至 [開始] 功能表,並將捷徑新增至您的桌面。

連接 Windows PowerShell 至服務

按一下 Microsoft Online Services Module捷徑,開啟含 Cmdlet 的 Windows PowerShell 工作區。或者,您也可以在 Windows PowerShell 命令提示字元下輸入 import-module MSOnline,手動載入 Office 365 Cmdlet。

如需有關 Cmdlet 的詳細資訊,可以執行下列動作:

    若要取得 Cmdlet 清單,請在命令提示字元下輸入get-command -module MSOnline
    若要檢視 Cmdlet 的說明檔,請在命令提示字元下輸入:get-help <cmdlet-name> -detailed

2013年11月27日 星期三

防止被瀏覽器block彈出的視窗

目前幾乎所有瀏覽器都會預設封鎖彈出視窗.為避免被封鎖可以使用JQuery的onclick event



 
 
<html>
<script src="/js/jquery.min.js"></script> 
<script>
$(document).on("click", ".btn-danger", function () { console.log("inside"); }); </script>
<body> 
<a href="#" class="btn btn-danger" >彈出視窗</a> 
</body>
</html> 

2013年11月19日 星期二

不要將任何事情都在jQuery.ready()初始化

一般會用「datapicker」這個jQuery UI widget來選擇日期
大部分的人會預設ready就載入

$( document ).ready( function() {

    $( "input.date" ).datepicker({
        minDate: moment().subtract( "months", 1 ).toDate(),
        maxDate: moment().add( "months", 1 ).toDate(),
        dateFormat: "d M, y",
        constrainInput: true,
        beforeShowDay: $.datepicker.noWeekends
    });

});
 
 
當USer input時才載入.效能會比較好 
 
$( document ).on( "focus", "input.date:not(.hasDatepicker)", function() {
    toastr.info( "Initializing " + this.id );

    $( this ).datepicker({
        minDate: moment().subtract( "months", 1 ).toDate(),
        maxDate: moment().add( "months", 1 ).toDate(),
        dateFormat: "d M, y",
        constrainInput: true,
        beforeShowDay: $.datepicker.noWeekends
    });
}); 

2013年11月7日 星期四

IE Debug不求人

其實測試IE不用裝任何其他軟體.Windows 7 ,IE 10在瀏覽器工具=>F12開發人員工具就會跳出底下的Debug mode.可以選擇IE 7/8/9/10
 強迫使用IE最高版本模式顯示

<meta http-equiv="x-ua-compatible" content="IE=edge" >

 

2013年11月5日 星期二

發送email,圖檔撐開產生一條空白的解決方法

EDM發給hotmail/gmail/yahoo....卻有一條空白.Outlook收到是正常的

只要在圖檔的地方加入style='vertical-align: bottom;' 即可




 ex:
 <img src='http://tw.yahoo.com/EDM/images/03.png' border='0' style='vertical-align: bottom;'>


push mail測試 http://putsmail.com