对于Calibre-Web这种较为简单的服务,重新安装比迁移更为节省时间,直接复制会因为python版本不同面临二进制不兼容问题,因此迁移建议直接重走安装流程即可。
对于在Apache2上实现反向代理和HTTPS加密,作者给出建议如下↗:
<VirtualHost *:443>
SSLEngine on
SSLProxyEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "C:\Apache24\conf\ssl\test.crt"
SSLCertificateKeyFile "C:\Apache24\conf\ssl\test.key"
<Location /calibre-web >
RequestHeader set X-SCRIPT-NAME /calibre-web
RequestHeader set X-SCHEME https
ProxyPass http://localhost:8083/
ProxyPassReverse http://localhost:8083/
ProxyPassReverseCookiePath / /calibre-web/
</Location>
</VirtualHost>
这个写法Nginx风格十分明显,标志就是手动处理SSL协议和HTTP请求头,我个人认为这些对于Apache2来说没有必要。
Apache2处理反向代理有默认配置可用,经过验证可以正常使用,我个人使用的配置如下:
<VirtualHost *:443>
ServerName xxx.xxx
SSLEngine on
SSLCertificateFile /etc/ssl/xxx.xxx.crt
SSLCertificateKeyFile /etc/ssl/xxx.xxx.key
SSLCertificateChainFile /etc/ssl/xxx.xxx.crt
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
<Proxy *>
Require all granted
</Proxy>
</VirtualHost>