Changes

Line 1: Line 1: −
== Domains names ==
     −
* dolibarr-test-fr.traulle.net
  −
* dolibarr-test-org.traulle.net
     −
These DN has been choosen to test the distinct vhosts but are not actually binded to public DNS.
+
=== Apache2 config ===
   −
You <u>MUST</u> edit your <code>/etc/hosts</code> local file (or similar) to point these addresses to IP '''37.59.159.184'''
+
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.
   −
For Windows based machines, you can use https://hostsfileeditor.com/ for that purpose.
+
Enable '''proxy '''and '''proxy_http '''modules.
    +
Add
   −
== Clickable addresses ==
+
<syntaxhighlight lang="apache">
 +
  # To allow the rewrite on rss that is not a redirect from browser
 +
  SSLProxyEngine on
 +
  SSLProxyVerify none
 +
  SSLProxyCheckPeerCN off
 +
  SSLProxyCheckPeerExpire off
   −
* http://dolibarr-test-fr.traulle.net
+
  # Redirection pour compatibilite avec ancien forum kunena
* http://dolibarr-test-fr.traulle.net/forum
+
  RewriteRule ^/forum/user/(\d+)-(.*) /forum/u/$2/summary [L,R=permanent]
* http://dolibarr-test-org.traulle.net
+
  RewriteRule ^/forumold/.*/(\d+)-(.*)$ /forum/t/$2 [L,R=permanent]
* http://dolibarr-test-org.traulle.net/forum
     −
== Replicated minimal VM for tests ==
+
  # 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>
   −
For the implementation to go smooth, the <code>vmprod1</code> environment has been replicated on a dedicated test VM.
+
</syntaxhighlight>
 
  −
* Linux distro : Ubuntu 16.4.7
  −
* Webserver : Apache2
  −
* RDBMS : Mariadb
  −
* PHP : 5.6
  −
 
  −
=== PHP version ===
  −
 
  −
PHP version is installed from <code>ppa:ondrej/php</code>.
  −
 
  −
 
  −
=== Apache2 config ===
     −
Apache2 virtual hosts config <code>dolibarr.fr.conf</code> and <code>dolibarr.org.conf</code> has been copied from <code>vmprod1</code> (Servername apache directive has just been modified to match names specified in [[#Addresses]]).
+
The apache proxy redirect HTTP including /forum/ in URL to the port the docker nginx server run.
   −
Enabling '''proxy '''and '''proxy_http '''modules.
+
The Logs of the proxy are available into /home/dolibarr/logs/dolibarr_ssl_access_log file and are used by fail2ban rules.
   −
Adding
+
== Firewall ==
 +
Les regles du firewall sont définies et activé par le script /home/dolibarr/tools/firewallvmprod1
   −
<source lang="apache">
+
TODO Utiliser ufw
<Location "/forum">
  −
    ProxyPass "http://dolibarr-test-fr.traulle.net:8800/forum"
  −
</Location>
  −
</source>
     −
=== Files ===
     −
Files from <code>/home/dolibarr/dolibarr.fr</code> and <code>/home/dolibarr/dolibarr.org</code> has been copied to the same location on the test VM (however <code>/home/dolibarr/dolibarr.org/httpdocs/files/stable</code> has not been replicated on the test VM due to the weight/size of all packages).
+
=== Backup ===
    +
Backup of discourse instance is done into directories /mnt/sdb1/backup/discourses
    
=== MySQL/MariaDB Databases ===
 
=== MySQL/MariaDB Databases ===
Line 61: Line 56:  
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 ==
 +
 +
* 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 ==
 
== Upgrade the web container ==
 +
 +
From : https://meta.discourse.org/t/faster-rebuilds/40341/13
    
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
./launcher bootstrap web_only
+
cd /var/discourse
./launcher destroy web_only
+
sudo git pull
./launcher start web_only
+
sudo ./launcher bootstrap web_only
 +
sudo ./launcher destroy web_only
 +
sudo ./launcher start web_only
 
</syntaxhighlight>
 
</syntaxhighlight>
    +
== Upgrade the data container ==
 +
 +
See https://meta.discourse.org/t/postgresql-12-update/151236#data-container-install
 +
 +
<syntaxhighlight lang="bash">
 +
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
 +
</syntaxhighlight>
    
== Useful resources ==
 
== Useful resources ==