Created Update already installed Tracks on Ubuntu 21.04 (markdown)

ghost-from-the-past 2021-06-14 10:11:08 +02:00
parent 7532da945d
commit 851787ca9c

@ -0,0 +1,83 @@
<p>This is a complement of the installation guide [[Install Tracks 2.5 on Ubuntu 20.10]]</p>
<p>
<br/>
</p>
<p>it is not the best practice... but normally I do</p>
<blockquote>
<p>&gt;sudo -i</p>
</blockquote>
<p>at the beginning to avoid all the sudos during the update</p>
<h3>Stop Apache and MySQL service</h3>
<blockquote>
<p>&gt;systemctl stop mysql.service</p>
<p>&gt;systemctl stop apache2</p>
</blockquote>
<h3>Move Gemfile </h3>
<p>Move the files Gemfile and Gemfile.lock out of the /var/wwww/tracks directory</p>
<p>Normally they are modified after the last "pull" (retrieval) of git so when you pull again git will inform a conflict due to the late modifications.</p>
<h3>Update the files from the repository</h3>
<blockquote>
<p>&gt;cd /var/www</p>
<p>&gt;git pull</p>
</blockquote>
<h3>Check the parameter files</h3>
<p>compare the configuration file database.yml.tmpl with yours database.yml</p>
<p>compare the configuration file site.yml.tmpl with yours site.yml</p>
<h3>Update the Ruby libraries known as gems</h3>
<blockquote>
&gt;cd /var/www/tracks<br/>
&gt;bundle update
</blockquote>
<p>you can also use</p>
<blockquote>
&gt;bundle install
</blockquote>
<h3>Adjust owner and owner group for the downloaded files</h3>
<p>All the files should be owned by the user ''www-data'' which is the user that runs Apache.</p>
<p>To set the owner and the owner group of all the files to www-data, at /var/www execute</p>
<blockquote>
&gt;chown -R www-data:www-data <strong>tracks</strong>
</blockquote>
<p>then you need to set the access rights, the simplest way is at /var/www execute</p>
<blockquote>
&gt;chmod -R 777 <strong>tracks</strong>
</blockquote>
<p>later once you have all running you can correctly set</p>
<blockquote>
&gt; find /var/www/tracks -type d -exec chmod 700 '{}' \;<br/>
&gt; find /var/www/tracks -type f -exec chmod 600 '{}' \;<br/>
&gt; find /var/www/tracks/script -type f -exec chmod 700 '{}' \;
</blockquote>
<p>The ''find'' and ''chmod'' commands will set permissions as ''700'' for all directories and files inside the ''script'' directory.</p>
<p>All other files will have permissions set to ''600''.</p>
<h3>Start MySQL service</h3>
<blockquote>
<p>&gt;systemctl start mysql.service</p>
</blockquote>
<h3>Update database</h3>
<blockquote>
&gt;cd /var/www/tracks<br/>
<s>&gt;rake --rakefile=/var/www/tracks/Rakefile db:migrate RAILS_ENV=production</s><br/>
&gt;bundle exec rake db:migrate RAILS_ENV=production
</blockquote>
<p>If you get the error : "ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime", that means that yourJavaScript runtime has lost its magic or you don't have a JavaScript runtime installed.</p>
<p>When we installed "libapache2-mod-passenger" it suggested to install "nodejs"; so just install (or re-install) it."</p>
<blockquote>
>apt install nodejs
</blockquote>
<h3>Precompile assets</h3>
<blockquote>
&gt;cd /var/www/tracks<br/>
<s>&gt;rake --rakefile=/var/www/tracks/Rakefile assets:precompile RAILS_ENV=production</s><br/>
&gt;bundle exec rake assets:precompile RAILS_ENV=production
</blockquote>
<h3>Start Apache service</h3>
<blockquote>
<p>&gt;systemctl start apache2</p>
</blockquote>