2011年10月20日 星期四

xampp+postgresql+phppgadmin

  1. Version:
    • xampp : xampp-win32-1.7.4-VC6.zip
      • PHP Version 5.3.5
      • Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8l
    • PostgreSQL : postgresql-9.0.4-1-windows.exe
      (對於windows的portable安裝,設置步驟比較多,故暫不考慮)
    • phpPgAdmin : phpPgAdmin-5.0.2.zip
  2. 下載並解壓縮xampp zip檔至root下。
    跟installer檔差別在於如果不放置在根目錄底下(C:\ , D:\),則要手動執行xampp_start.exe完成環境配置。
  3. 安裝PostgreSQL於"\xampp\pgsql"目錄底下(位置同MySQL的"\xampp\mysql"),安裝時會自動設置一windows user:postgres,並於安裝期間可指定其password。
  4. 下載phpPgAdmin的壓縮檔,decompress to "\xampp\phpPgAdmin"目錄底下(位置同phpMyAdmin的"\xampp\phpMyAdmin")。
    修改"\xampp\apache\conf\httpd.conf"設定檔, 加入以下此行讓apache載入postgresql的library(似乎是PHP的BUG!)。
    Loadfile "%Your PostgreSQL installation directory%/bin/libpg.dll"
    
    修改"\xampp\php\php.ini"的設定檔, 開啟支援(unmark掉)
    # default setting
    # extension=php_pdo_pgsql.dll
    # extension=php_pgsql.dll
    
    extension=php_pdo_pgsql.dll
    extension=php_pgsql.dll
    
  5. 修改"\xampp\phpPgAdmin\conf\config.inc.php"的php設定檔。
    為了方便開發把以下登入的安全設定改為false來可以使用DB預設Admin登入。
    //$conf['extra_login_security']=true;
    $conf['extra_login_security']=false;
    
  6. 修改"\xampp\apache\conf\extra\httpd-xampp.conf"的apache用於xampp整合的specific settings。
    可參考phpMyAdmin的配置來進行修改。
    
     Alias /phpmyadmin "xampp/phpMyAdmin/"
     
      AllowOvreride AuthConfig
     
     
     Alias /phppgadmin "xampp/phpPgAdmin/"
     
      AllowOvreride AuthConfig
      # 以下應該可不加,不過實際情況還是參考apache的configuration比較妥當。
      # 可參考最底下httpd.conf裡找到的片段說明。
      Order allow,deny
      Allow frrom all
     
    
    
    加入安全訪問設定於LocationMatch中,在最後的server-info後面加入"|phppgadmin"。
    #
    # New XAMPP security concept
    #
    
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/8 
        ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
    
    
  7. 開啟apache service開始使用xampp+postgresql+phppgadmin的windows的開發環境。

在httpd.conf裡找到Directory存取的描述
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/xampp/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all


#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#

    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all



syntaxhighlight test

Hello SyntaxHighlighter

function helloSyntaxHighlighter()
{
 return "hi!";
}

2010年7月26日 星期一

Cycling around Taiwan, Day 10

2010-07-25
彰化埔心~台南關廟[Home]

出發照#Day 10

加水站#29

程俐涵在斗南~
感謝路上有妳加油XD
聊了一下後準備趕往嘉義午餐吃火雞肉飯。

來拍一張吧:P

這附近有家噴水火雞肉飯,
問了當地的車友他們說:那間是給外地觀光客吃的。
原來有名的地方小吃也要分在地人吃的跟外地觀光客吃的= =

看到岳飛像了,
火雞肉飯我來了~

盧家揚推薦!

禮拜日人很多,
我弟跟价良兩個人等到睡著zzz...

等好久終於上菜了~
不錯吃!

殘念的北緯23.5度,
在花蓮瑞穗舞鶴摸黑下滑路段錯過了一次 orz
嘉義水上照回來。

加水站#30
感謝警察幫忙拍照,
這裡過去就回台南了。

台南到了~

這間很熟吧~
全國最大間的小7。

小7的吹泡泡機。

回程下雨,
很幸運的是,
在我們回到家後的隔天,
就是一連下了好幾天的豪大雨,
提前回家果然是對的!
這一路遇到很多環島車友,
有些是剛出發而已,
想想他們應該很悶吧。。。
不過還是希望他們以安全為重。

雨停了。

到家1191km...
差一點就到1200km了。


Bikemap

單車路徑 689388 - powered by Bikemap 

Slide Show