Difference between revisions of "Draft:Discourse Implementation and Exploitation"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m
Tag: 2017 source edit
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'''
 
 
 
For Windows based machines, you can use https://hostsfileeditor.com/ for that purpose.
 
 
 
 
 
== Clickable addresses ==
 
 
 
* http://dolibarr-test-fr.traulle.net
 
* http://dolibarr-test-fr.traulle.net/forum
 
* http://dolibarr-test-org.traulle.net
 
* http://dolibarr-test-org.traulle.net/forum
 
* http://dolibarr-test-de.traulle.net
 
* http://dolibarr-test-de.traulle.net/forum
 
 
 
== Replicated minimal VM for tests ==
 
 
 
For the implementation to go smooth, the <code>vmprod1</code> environment has been replicated on a dedicated test VM.
 
 
 
* 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>.
+
Les forums sont accessibles depuis les url https://www.dolibarr.org/forum
 
 
 
 
=== 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]]).
 
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]]).
Line 43: Line 12:
  
 
<syntaxhighlight lang="apache">
 
<syntaxhighlight lang="apache">
 +
  # 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">
 
<Location "/forum">
     ProxyPass "http://dolibarr-test-fr.traulle.net:8800/forum"
+
#    Deny from all
 +
#    Allow from 37.170.87.101
 +
#    RequestHeader set X-Forwarded-Port "443"
 +
#    RequestHeader set X-Forwarded-Proto "https"
 +
    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>
 
</Location>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== Firewall ==
 +
Les regles du firewall sont définies et activé par lescript
 +
/home/dolibarr/tools/firewallvmprod1
 +
 +
TODO Utilisé ufw
 +
  
 
=== Files ===
 
=== Files ===

Revision as of 12:37, 4 September 2024


Apache2 config

Les forums sont accessibles depuis les url https://www.dolibarr.org/forum

Apache2 virtual hosts config dolibarr.fr.conf and dolibarr.org.conf has been copied from vmprod1 (Servername apache directive has just been modified to match names specified in #Addresses).

Enabling proxy and proxy_http modules.

Adding

   # 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">
#    Deny from all
#    Allow from 37.170.87.101
#    RequestHeader set X-Forwarded-Port "443"
#    RequestHeader set X-Forwarded-Proto "https"
    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>

Firewall

Les regles du firewall sont définies et activé par lescript

/home/dolibarr/tools/firewallvmprod1

TODO Utilisé ufw


Files

Files from /home/dolibarr/dolibarr.fr and /home/dolibarr/dolibarr.org has been copied to the same location on the test VM (however /home/dolibarr/dolibarr.org/httpdocs/files/stable has not been replicated on the test VM due to the weight/size of all packages).


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
sudo ./launcher rebuild data
sudo ./launcher rebuild data
sudo ./launcher rebuild web_only

Useful resources