2013-05-26 115 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