2013-05-26 38 views
4

我設法使用this Etherpad installation instruction啓動並運行Etherpad。將Etherpad安裝到子目錄

它在我的服務器上運行於http://localhost:9000/,並通過反向代理服務器和SSL在Apache上交付至https://www.example.com/

這一切都運行良好,但由於Etherpad不是我唯一的應用程序,我希望它被稱爲通過https://www.example.com/etherpad/。我怎樣才能管理這個?

我試圖ProxyPass命令更改爲

ProxyPass /etherpad/ http://localhost:9000/ 
ProxyPassReverse /etherpad/ http://localhost:9000/ 

這使得它可以在/etherpad/目錄,但其中的所有ressources仍然從/(根目錄)交付。在/etc/etherpad/etherpad.local.properties配置文件中,我沒有找到任何相關的設置。

如何告訴Etherpad在子目錄中生存?我不能使用其他子域名,因爲我在那裏沒有SSL。

回答

4

我切換到Etherpad-Lite解決的問題。不完全相同的功能,但足夠我。 Etherpad-Lite使用像../scripts/script.js這樣的相對目錄而不是絕對目錄(Etherpad:/scripts/script.js)。

1

See the Etherpad reverse proxy documentation

<VirtualHost *:80> 
     ServerAdmin [email protected] 
     ServerName etherpad.example.org 
     ServerSignature Off 
     CustomLog /var/log/apache2/etherpad_access.log combined 
     ErrorLog /var/log/apache2/etherpad_error.log 
     ErrorLog syslog:local2 

     <IfModule mod_proxy.c> 
      # the following allows "nice" urls such as https://etherpad.example.org/padname 
      # But, some users reported issues with this 
     RewriteEngine On 
     RewriteRule /p/*$ https://etherpad.example.org/ [NC,L] 
     RewriteCond %{REQUEST_URI} !^/locales/ 
     RewriteCond %{REQUEST_URI} !^/locales.json 
     RewriteCond %{REQUEST_URI} !^/admin 
     RewriteCond %{REQUEST_URI} !^/p/ 
     RewriteCond %{REQUEST_URI} !^/static/ 
     RewriteCond %{REQUEST_URI} !^/pluginfw/ 
     RewriteCond %{REQUEST_URI} !^/javascripts/ 
     RewriteCond %{REQUEST_URI} !^/socket.io/ 
     RewriteCond %{REQUEST_URI} !^/ep/ 
     RewriteCond %{REQUEST_URI} !^/minified/ 
     RewriteCond %{REQUEST_URI} !^/api/ 
     RewriteCond %{REQUEST_URI} !^/ro/ 
     RewriteCond %{REQUEST_URI} !^/error/ 
     RewriteCond %{REQUEST_URI} !^/jserror 
      RewriteCond %{REQUEST_URI} !/favicon.ico 
     RewriteCond %{REQUEST_URI} !/robots.txt 
     RewriteRule ^/+(.+)$ https://etherpad.example.org/p/$1 [L] 

      ProxyVia On 
      ProxyRequests Off 
      ProxyPass/http://etherpad.internal.example.org:9001/ 
      ProxyPassReverse/http://etherpad.internal.example.org:9001/ 
      ProxyPreserveHost on 
      <Proxy *> 
       Options FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
      </Proxy> 
     </IfModule> 
    </VirtualHost> 
+0

我沒有設法讓它工作,也沒有真正將所有數據移動到子目錄中。我切換到使用相對路徑的Etherpad-Lite。 – arnep