Difference between revisions of "Draft:Discourse Implementation and Exploitation"
m (→Apache2 config) Tag: 2017 source edit |
Tag: 2017 source edit |
||
(6 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
but behind, it is discourse. | but behind, it is discourse. | ||
− | + | Enable '''proxy '''and '''proxy_http '''modules. | |
− | |||
− | |||
+ | Add | ||
<syntaxhighlight lang="apache"> | <syntaxhighlight lang="apache"> | ||
Line 32: | Line 31: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | The apache proxy redirect HTTP including /forum/ in URL to the port the docker nginx server run. | ||
+ | |||
+ | The Logs of the proxy are available into /home/dolibarr/logs/dolibarr_ssl_access_log file and are used by fail2ban rules. | ||
== Firewall == | == Firewall == | ||
− | Les regles du firewall sont définies et activé par | + | Les regles du firewall sont définies et activé par le script /home/dolibarr/tools/firewallvmprod1 |
− | |||
− | TODO | + | TODO Utiliser ufw |
− | === | + | === Backup === |
− | |||
− | |||
+ | Backup of discourse instance is done into directories /mnt/sdb1/backup/discourses | ||
=== MySQL/MariaDB Databases === | === MySQL/MariaDB Databases === | ||
Line 54: | Line 55: | ||
Installed following the Docker docs : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-engine---community-1 | Installed following the Docker docs : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-engine---community-1 | ||
− | |||
== Tests for dolibarr.de migration == | == Tests for dolibarr.de migration == | ||
Line 83: | Line 83: | ||
sudo ./launcher stop web_only | sudo ./launcher stop web_only | ||
sudo ./launcher stop data | sudo ./launcher stop data | ||
+ | # twice is not a typo but on purpose | ||
sudo ./launcher rebuild data | sudo ./launcher rebuild data | ||
sudo ./launcher rebuild data | sudo ./launcher rebuild data |
Latest revision as of 12:47, 24 January 2025
Apache2 config
Forums are available on entry URL: https://www.dolibarr.org/forum, https://www.dolibarr.fr/forum, https://www.dolibarr.de/forum but behind, it is discourse.
Enable proxy and proxy_http modules.
Add
# To allow the rewrite on rss that is not a redirect from browser
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off
# Redirection pour compatibilite avec ancien forum kunena
RewriteRule ^/forum/user/(\d+)-(.*) /forum/u/$2/summary [L,R=permanent]
RewriteRule ^/forumold/.*/(\d+)-(.*)$ /forum/t/$2 [L,R=permanent]
# Redirection pour transfert apache - discourse
<Location "/forum">
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}
ProxyPreserveHost On
ProxyPass "http://127.0.0.1:8800/forum" connectiontimeout=60 timeout=60
ProxyPassReverse "http://127.0.0.1:8800/forum"
</Location>
The apache proxy redirect HTTP including /forum/ in URL to the port the docker nginx server run.
The Logs of the proxy are available into /home/dolibarr/logs/dolibarr_ssl_access_log file and are used by fail2ban rules.
Firewall
Les regles du firewall sont définies et activé par le script /home/dolibarr/tools/firewallvmprod1
TODO Utiliser ufw
Backup
Backup of discourse instance is done into directories /mnt/sdb1/backup/discourses
MySQL/MariaDB Databases
Database names and users has been preserved (same users, same database names and same credentials has been created on test VM).
Databases for French and International websites has been dumped and restored on test VM.
Docker
Installed following the Docker docs : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-engine---community-1
Tests for dolibarr.de migration
- Retrieve test VM backup
- Update packages (apt)
- Upgrade db to postgres12 (data container)
- rebuild web_only container tu upgrade to same discourse version as prod
Upgrade the web container
From : https://meta.discourse.org/t/faster-rebuilds/40341/13
cd /var/discourse
sudo git pull
sudo ./launcher bootstrap web_only
sudo ./launcher destroy web_only
sudo ./launcher start web_only
Upgrade the data container
See https://meta.discourse.org/t/postgresql-12-update/151236#data-container-install
cd /var/discourse
sudo ./launcher stop web_only
sudo ./launcher stop data
# twice is not a typo but on purpose
sudo ./launcher rebuild data
sudo ./launcher rebuild data
sudo ./launcher rebuild web_only