wiki:jazz/08-04-25

Version 2 (modified by jazz, 17 years ago) (diff)

--

  • 讓 Pootle 中文翻譯網站可以同時支援 80 跟 8080 port
    • [源起] 由於 pootle 是使用 Python 撰寫的 PO 翻譯網頁介面,雖然可以直接用 --port=80 的方式強制執行, 但如果加在 /etc/default/pootle 的 POOTLE_OPTIONS 中, 卻會遇到權限的問題.
    • [參考]
    • 安裝 libapache2-mod-proxy-html
      # apt-get install libapache2-mod-proxy-html
      
    • 鏈結 proxy.conf , proxy.load, proxy_http.load
      # cd /etc/apache2/mods-enabled/
      /etc/apache2/mods-enabled# ln -s ../mods-available/proxy.conf
      /etc/apache2/mods-enabled# ln -s ../mods-available/proxy.load
      /etc/apache2/mods-enabled# ln -s ../mods-available/proxy_http.load
      
    • 修改 /etc/apache2/mods-enabled/proxy.conf
      • proxy.conf

        old new  
        44
        55        ProxyRequests Off
        66
        7         <Proxy *>
        8                 AddDefaultCharset off
        9                 Order deny,allow
        10                 Deny from all
        11                 #Allow from .example.com
        12         </Proxy>
         7        #<Proxy *>
         8        #        AddDefaultCharset off
         9        #        Order deny,allow
         10        #        Deny from all
         11        #        #Allow from .example.com
         12        #</Proxy>
         13
         14       # 2008-04-21: Jazz add this for pootle website
         15       <Proxy localhost:8080>
         16               Order Allow,Deny
         17               Allow from localhost
         18       </Proxy>
        1319
        1420        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        1521        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    • 編輯 /etc/apache2/sites-enabled/pootle.conf
      <VirtualHost *:*>
       ServerName pootle.nchc.org.tw
       ProxyPass /images !
       ProxyPass /js !
       ProxyPass /pootle.css !
       ProxyPass /favicon.ico !
       ProxyPass / http://localhost:8080/
       ProxyPassReverse / http://localhost:8080/
       <Directory proxy:http://localhost:8080/*>
           Order deny,allow
           Allow from all
       </Directory>
       ErrorLog /var/log/pootle-error_log
       CustomLog /var/log/pootle-access_log common
       # Fallback for static html content
       DocumentRoot "/usr/share/pootle/html"
       <Directory "/usr/share/pootle/html">
         Order deny,allow
         Allow from all
       </Directory>
      </VirtualHost>