Apache WebServer 設定技巧

1 開啟與關閉顯示目錄檔案清單

通常基於資訊安全因素會關閉顯示目錄檔案清單, 所以在 httpd.conf 內會設定所有目錄都不顯示 (也就是移除掉 MultiViews 的設定)

:
# Note that "MultiViews" must be named *explicitly* --- "Options All"
:
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.

如果要顯示目錄檔案清單,可以針對特定目錄設定 Options 有 MultiViews 功能, Exp. /Stuff 以下可以針對特定 IP 來源存取並出現檔案目錄清單

<Location /Stuff>
  Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.11.0/24
</Location>

2 ProxyPass directive 抓遠端主機頁面

我是用在將 VMWare 在內部運作的網頁能夠簡易的呈現到 Internet 的 WebServer 上.

proxypass

Browser 連上 webServer(http://mail.ichiayi.com/webmail), 出現的畫面是由 vm-mail(http://192.168.11.238/webmail) 所提供頁面

2.1 webServer 設定方式

  • apache 要有安裝 mod_proxy (預設已經安裝)
  • 只要在 httpd.conf 內定義 :
ProxyPass /webmail http://192.168.11.238/webmail

這樣 http://mail.ichiayi.com/webmail/ 就可以正確轉讀至 http://192.168.11.238/webmail 網頁功能

2.2 vm-mail 設定方式

只要依據一般正常的 web server 設定即可

參考資料

 
回到頁頂
tech/apache.txt · 上一次變更: 2008/06/13 10:40 來自 jonathan
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0