将Etherpad安装到子目录中

时间:2013-05-26 11:33:07

标签: apache ssl reverse-proxy etherpad

我设法使用this Etherpad installation instruction启动并运行Etherpad。

它在我的服务器上的http://localhost:9000/运行,并通过反向代理和SSL传递到https://www.example.com/

这一切都运行良好,但由于Etherpad不是我唯一的应用程序,我希望通过https://www.example.com/etherpad/调用它。我该如何管理?

我尝试将ProxyPass命令更改为

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

使其在/etherpad/目录中可用,但其中的所有资源仍然从/(根目录)传递。在/etc/etherpad/etherpad.local.properties配置文件中,我没有找到任何相关设置。

如何告诉Etherpad存在于子目录中?我不能使用另一个子域,因为我没有SSL。

2 个答案:

答案 0 :(得分:4)

我通过切换到Etherpad-Lite解决了这个问题。功能不完全相同,但对我来说足够了。

Etherpad-Lite使用../scripts/script.js之类的相对目录而不是绝对目录(Etherpad:/scripts/script.js)。

答案 1 :(得分:1)

See the Etherpad reverse proxy documentation

    <VirtualHost *:80>
        ServerAdmin support@example.org
        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>