{"id":89,"date":"2017-09-23T10:05:35","date_gmt":"2017-09-23T09:05:35","guid":{"rendered":"http:\/\/blog.brunocsmartin.fr\/?p=89"},"modified":"2017-09-28T14:39:18","modified_gmt":"2017-09-28T13:39:18","slug":"openproject","status":"publish","type":"post","link":"https:\/\/blog.brunocsmartin.fr\/index.php\/2017\/09\/23\/openproject\/","title":{"rendered":"OpenProject"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Bel outils de gestion de projet en ruby avec du node !<\/p>\n<p>\u00e0 partir de <a href=\"https:\/\/github.com\/opf\/openproject\/blob\/stable\/7\/docs\/installation\/manual\/README.md\" target=\"_blank\" rel=\"noopener\">cette page<\/a>.<\/p>\n<p>Cr\u00e9er l&rsquo;utilisateur openproject :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo groupadd openproject\r\nsudo useradd --create-home --gid openproject openproject\r\nsudo passwd openproject #(enter desired password)\r\nchsh -s \/bin\/bash openproject\r\nusermod -G sudo -a openproject\r\n<\/pre>\n<p>Installer les composants n\u00e9cessaires :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get update -y\r\nsudo apt-get install -y zlib1g-dev build-essential                  \\\r\n                    libssl-dev libreadline-dev                      \\\r\n                    libyaml-dev libgdbm-dev                         \\\r\n                    libncurses5-dev automake                        \\\r\n                    imagemagick libmagickcore-dev libmagickwand-dev \\\r\n                    libtool bison libffi-dev git curl               \\\r\n                    libxml2 libxml2-dev libxslt1-dev                \\\r\n                    libssl1.0-dev mysql-server memcached            \\\r\n                    default-libmysqlclient-dev mysql-server\r\n<\/pre>\n<p>Cr\u00e9er la base de donn\u00e9es pour openproject<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">mysql -uroot -p\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">mysql&gt; CREATE DATABASE openproject CHARACTER SET utf8;\r\nmysql&gt; CREATE USER 'openproject'@'localhost' IDENTIFIED BY 'my_password';\r\nmysql&gt; GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost';\r\nmysql&gt; FLUSH PRIVILEGES;\r\nmysql&gt; QUIT\r\n<\/pre>\n<p>R\u00e9cup\u00e9rer ruby et node pour le compte openproject.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">su openproject --login\r\ngit clone https:\/\/github.com\/sstephenson\/rbenv.git ~\/.rbenv\r\necho 'export PATH=\"$HOME\/.rbenv\/bin:$PATH\"' &gt;&gt; ~\/.profile\r\necho 'eval \"$(rbenv init -)\"' &gt;&gt; ~\/.profile\r\nsource ~\/.profile\r\ngit clone https:\/\/github.com\/sstephenson\/ruby-build.git ~\/.rbenv\/plugins\/ruby-build\r\n\r\nrbenv install 2.4.1\r\nrbenv rehash\r\nrbenv global 2.4.1\r\n\r\ngit clone https:\/\/github.com\/OiNutter\/nodenv.git ~\/.nodenv\r\necho 'export PATH=\"$HOME\/.nodenv\/bin:$PATH\"' &gt;&gt; ~\/.profile\r\necho 'eval \"$(nodenv init -)\"' &gt;&gt; ~\/.profile\r\nsource ~\/.profile\r\ngit clone git:\/\/github.com\/OiNutter\/node-build.git ~\/.nodenv\/plugins\/node-build\r\n\r\nnodenv install 6.11.3\r\nnodenv rehash\r\nnodenv global 6.11.3\r\n<\/pre>\n<p>R\u00e9cup\u00e9rer OpenProject<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd ~\r\ngit clone https:\/\/github.com\/opf\/openproject-ce.git --branch stable\/7 --depth 1\r\ncd openproject-ce\r\ngem install bundler\r\nbundle install --deployment --without postgres sqlite development test therubyracer docker\r\n\r\nnpm install\r\n\r\n# for raspberry pi or other if phantomjs does not install\r\ngit clone https:\/\/github.com\/piksel\/phantomjs-raspberrypi.git\r\nchmod +x phantomjs-raspberrypi\/bin\/phantomjs\r\ncp phantomjs-raspberrypi\/bin\/phantomjs \/home\/openproject\/.nodenv\/shims\/\r\nnpm install phantomjs\r\nnpm install\r\n# for raspberry pi\r\n<\/pre>\n<p>Copier<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp config\/database.yml.example config\/database.yml\r\n<\/pre>\n<p>puis renseigner les informations pour la connexion \u00e0 la base de donn\u00e9e dans le ficher \/home\/openproject\/openproject-ce\/config\/database.yml<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">production:\r\n  adapter: mysql2\r\n  database: openproject\r\n  host: localhost\r\n  username: openproject\r\n  password: my_password\r\n  encoding: utf8\r\n\r\ndevelopment:\r\n  adapter: mysql2\r\n  database: openproject\r\n  host: localhost\r\n  username: openproject\r\n  password: my_password\r\n  encoding: utf8\r\n<\/pre>\n<p>Copier<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp config\/configuration.yml.example config\/configuration.yml\r\n<\/pre>\n<p>puis renseigner les informations pour la configuration dans le fichier\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/home\/openproject\/openproject-ce\/config\/configuration.yml<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp config\/configuration.yml.example config\/configuration.yml\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">production:                          #main level\r\n  email_delivery_method: :smtp       #settings for the production environment\r\n  smtp_address: smtp.gmail.com\r\n  smtp_port: 587\r\n  smtp_domain: smtp.gmail.com\r\n  smtp_user_name: ***@gmail.com\r\n  smtp_password: ****\r\n  smtp_enable_starttls_auto: true\r\n  smtp_authentication: plain\r\n[...]\r\nrails_cache_store: :memcache\r\n<\/pre>\n<p>Lancer le site en production<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd ~\/openproject-ce\r\nRAILS_ENV=\"production\" .\/bin\/rake db:create\r\nRAILS_ENV=\"production\" .\/bin\/rake db:migrate\r\nRAILS_ENV=\"production\" .\/bin\/rake db:seed\r\nRAILS_ENV=\"production\" .\/bin\/rake assets:precompile\r\n<\/pre>\n<p>Le tester.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">RAILS_ENV=\"production\" npm run webpack-watch &amp;\r\nRAILS_ENV=\"production\" .\/bin\/rails server<\/pre>\n<p>Remplir la cl\u00e9.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">echo \"export SECRET_KEY_BASE=$(.\/bin\/rake secret)\" &gt;&gt; ~\/.profile\r\nsource ~\/.profile\r\n<\/pre>\n<p>Faire le lien avec apache2<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get install -y apache2 libcurl4-gnutls-dev      \\\r\n                               apache2-dev libapr1-dev \\\r\n                               libaprutil1-dev\r\nchmod o+x \"\/home\/openproject\"\r\n\r\nsu openproject --login\r\ncd ~\/openproject-ce\r\ngem install passenger\r\npassenger-install-apache2-module\r\n<\/pre>\n<p>Editer le fichier <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/etc\/apache2\/mods-available\/passenger.load<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">LoadModule passenger_module \/home\/openproject\/.rbenv\/versions\/2.3.0\/lib\/ruby\/gems\/2.3.0\/gems\/passenger-5.1.8\/buildout\/apache2\/mod_passenger.so\r\n<\/pre>\n<p>Editer le fichier\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/etc\/apache2\/mods-available\/passenger.conf<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">&lt;IfModule mod_passenger.c&gt;\r\n     PassengerRoot \/home\/openproject\/.rbenv\/versions\/2.3.0\/lib\/ruby\/gems\/2.3.0\/gems\/passenger-5.1.8\r\n  PassengerDefaultRuby \/home\/openproject\/.rbenv\/versions\/2.3.0\/bin\/ruby\r\n&lt;\/IfModule&gt;\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@openproject] a2enmod passenger\r\n<\/pre>\n<p>Editer le fichier\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/etc\/apache2\/sites-available\/openproject.conf<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">SetEnv EXECJS_RUNTIME Disabled\r\n\r\n&lt;VirtualHost *:80&gt;\r\n   ServerName yourdomain.com\r\n   # !!! Be sure to point DocumentRoot to 'public'!\r\n   DocumentRoot \/home\/openproject\/openproject-ce\/public\r\n   &lt;Directory \/home\/openproject\/openproject-ce\/public&gt;\r\n      # This relaxes Apache security settings.\r\n      AllowOverride all\r\n      # MultiViews must be turned off.\r\n      Options -MultiViews\r\n      # Uncomment this if you're on Apache &gt;= 2.4:\r\n      Require all granted\r\n   &lt;\/Directory&gt;\r\n\r\n   # Request browser to cache assets\r\n   &lt;Location \/assets\/&gt;\r\n#     ExpiresActive On ExpiresDefault \"access plus 1 year\"\r\n   &lt;\/Location&gt;\r\n\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>D\u00e9sactiver le site par d\u00e9faut et activer openproject :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@host] a2dissite 000-default\r\n[root@host] a2ensite openproject\r\n<\/pre>\n<p>Installer le cron<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">su --login openproject\r\ncrontab -e<\/pre>\n<p>et ajouter la ligne<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">*\/10 * * * * cd \/home\/openproject\/openproject-ce; \/home\/openproject\/.rbenv\/versions\/2.4.1\/bin\/rake jobs:workoff<\/pre>\n<p>pour qu&rsquo;il se lance toute les 10 minutes<\/p>\n<p>Et pour l&rsquo;avoir sur localhost\/openproject<\/p>\n<ul>\n<li>editer le fichier <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/etc\/apache2\/sites-available\/openproject.conf<\/code>:<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">SetEnv EXECJS_RUNTIME Disabled\r\n\r\n&lt;VirtualHost *:80&gt;\r\n   ServerName yourdomain.com\r\n   # !!! Be sure to point DocumentRoot to 'public'!\r\n   &lt;Directory \/home\/openproject\/openproject-ce\/public&gt;\r\n      # This relaxes Apache security settings.\r\n      AllowOverride all\r\n      # MultiViews must be turned off.\r\n      Options -MultiViews\r\n      # Uncomment this if you're on Apache &gt;= 2.4:\r\n      Require all granted\r\n   &lt;\/Directory&gt;\r\n\r\n   # Request browser to cache assets\r\n   &lt;Location \/assets\/&gt;\r\n#     ExpiresActive On ExpiresDefault \"access plus 1 year\"\r\n   &lt;\/Location&gt;\r\n\r\n# These have been added:\r\n    Alias \/openproject \/home\/openproject\/openproject-ce\/public\r\n    &lt;Location \/openproject&gt;\r\n        PassengerBaseURI \/openproject\r\n        PassengerAppRoot \/home\/openproject\/openproject-ce\r\n\r\n    &lt;\/Location&gt;\r\n    &lt;Directory \/home\/openproject\/openproject-ce\/public&gt;\r\n        Allow from all\r\n        Options -MultiViews\r\n        # Uncomment this if you're on Apache &gt;= 2.4:\r\n        #Require all granted\r\n    &lt;\/Directory&gt;\r\n\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<ul>\n<li>editer le fichier <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/home\/openproject\/openproject-ce\/config\/configuration.yml<\/code>:<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">[...]\r\n  rails_relative_url_root: \"\/openproject\"\r\n[...]<\/pre>\n<ul>\n<li>relancer la pr\u00e9compilation des assets avec le nouvel url\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">RAILS_ENV=\"production\" .\/bin\/rake assets:precompile<\/pre>\n<p>&nbsp;<\/li>\n<li>relancer le serveur apache\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo systemctl reload apache2<\/pre>\n<p>Pour l&rsquo;installer en tant que service sous windows, utiliser &lsquo;thin&rsquo;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">gem install thin\r\ngem install thin_service<\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Bel outils de gestion de projet en ruby avec du node ! \u00e0 partir de cette page. Cr\u00e9er l&rsquo;utilisateur openproject : sudo groupadd openproject sudo useradd &#8211;create-home &#8211;gid openproject openproject sudo passwd openproject #(enter desired password) chsh -s \/bin\/bash openproject usermod -G sudo -a openproject Installer les composants n\u00e9cessaires : sudo apt-get update -y &hellip; <a href=\"https:\/\/blog.brunocsmartin.fr\/index.php\/2017\/09\/23\/openproject\/\" class=\"more-link\">Continuer la lecture de <span class=\"screen-reader-text\">OpenProject<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/89"}],"collection":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":37,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":128,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/89\/revisions\/128"}],"wp:attachment":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}