Cryptpad: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) |
F (Diskussion | Beiträge) |
||
Zeile 4: | Zeile 4: | ||
− | == Apache Proxy == | + | == Installation == |
+ | === Apache Proxy === | ||
* bash | * bash | ||
<source lang=bash> | <source lang=bash> | ||
Zeile 66: | Zeile 67: | ||
</VirtualHost> | </VirtualHost> | ||
+ | </source> | ||
+ | |||
+ | === node.js und cryptpad === | ||
+ | |||
+ | <source lang=bash> | ||
+ | npm install -g bower | ||
+ | bower install | ||
+ | bower install --allow-root | ||
+ | cd /var/www/cryptpad.domain.tld/ | ||
+ | cd config/ | ||
+ | cp config.example.js config.js | ||
+ | cd /var/www/cryptpad.domain.tld/ | ||
+ | systemctl restart apache2.service && node server | ||
</source> | </source> |
Version vom 21. November 2020, 10:39 Uhr
Installation
Apache Proxy
- bash
a2enmod ssl
a2enmod rewrite
a2enmod auth_basic
a2enmod proxy proxy_wstunnel proxy_http
a2enmod proxy*
- /etc/apache2/sites-enabled/cryptpad.domain.tld.conf
<VirtualHost *:80>
ServerName cryptpad.domain.tld
Redirect permanent / https://cryptpad.domain.tld
</VirtualHost>
<VirtualHost *:443>
ServerName cryptpad.domain.tld
ServerAdmin admin@domain.com
# Turn SSL on
SSLEngine on
SSLProxyEngine On
# ProxyPreserveHost On to prevent SSL handshake fail for valid domainn.
# Note: requires valid SSL Certificate obviously
ProxyPreserveHost On
# Do not enable proxying with ProxyRequests until you have secured your server.
# Open proxy servers are dangerous both to your network and to the Internet at large.
ProxyRequests Off
# Certificate chain. Note: also add these in Cryptpad config.js as privKeyAndCertFiles value
# SSLCertificateFile /etc/letsencrypt/live/cryptpad.domain.com/fullchain.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/cryptpad.domain.com/privkey.pem
SSLCertificateKeyFile /etc/ssl/private/live/domain.tld/privkey.pem
SSLCertificateFile /etc/ssl/private/live/domain.tld/cert.pem
SSLCertificateChainFile /etc/ssl/private/live/domain.tld/chain.pem
# Include /etc/letsencrypt/options-ssl-apache.conf
# This is the "httpSafePort" from the Cryptpad config.js.
# Not sure if this should be here. Note: in my setup changing this to port 3000 results in a 502 proxy error
#ProxyPass / http://localhost:3001/
ProxyPass / http://195.17.149.245:3001/
ProxyPassReverse / http://195.17.149.245:3001/
#ProxyPassReverse / http://localhost:3001/
# Activate the Apache RewriteEngine
RewriteEngine On
# Catch websocket requests. Change this to value of your websocketPath in Cryptpad config.js
RewriteCond %{REQUEST_URI} ^/cryptpad_websocket [NC]
# Rewrite to websocket. Port number should be value of httpPort in Cryptpad config.js
#RewriteRule /(.*) ws://localhost:3000/$1 [P]
RewriteRule /(.*) ws://195.17.149.245:3000/$1 [P]
ErrorLog ${APACHE_LOG_DIR}/error.cryptpad.domain.tld.log
CustomLog ${APACHE_LOG_DIR}/access.cryptpad.domain.tld.log combined
</VirtualHost>
node.js und cryptpad
npm install -g bower
bower install
bower install --allow-root
cd /var/www/cryptpad.domain.tld/
cd config/
cp config.example.js config.js
cd /var/www/cryptpad.domain.tld/
systemctl restart apache2.service && node server