From 851787ca9c84a3d2004032e1beef2ea20ea2dbca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=BB=BFghost-from-the-past?= Date: Mon, 14 Jun 2021 10:11:08 +0200 Subject: [PATCH] Created Update already installed Tracks on Ubuntu 21.04 (markdown) --- ...lready-installed-Tracks-on-Ubuntu-21.04.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Update-already-installed-Tracks-on-Ubuntu-21.04.md diff --git a/Update-already-installed-Tracks-on-Ubuntu-21.04.md b/Update-already-installed-Tracks-on-Ubuntu-21.04.md new file mode 100644 index 0000000..7f681ae --- /dev/null +++ b/Update-already-installed-Tracks-on-Ubuntu-21.04.md @@ -0,0 +1,83 @@ +

This is a complement of the installation guide [[Install Tracks 2.5 on Ubuntu 20.10]]

+

+
+

+

it is not the best practice... but normally I do

+
+

>sudo -i

+
+

at the beginning to avoid all the sudos during the update

+

Stop Apache and MySQL service

+
+

>systemctl stop mysql.service

+

>systemctl stop apache2

+
+

Move Gemfile

+

Move the files Gemfile and Gemfile.lock out of the /var/wwww/tracks directory

+

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.

+

Update the files from the repository

+
+

>cd /var/www

+

>git pull

+
+

Check the parameter files

+

compare the configuration file database.yml.tmpl with yours database.yml

+

compare the configuration file site.yml.tmpl with yours site.yml

+ +

Update the Ruby libraries known as ‘gems’

+
+>cd /var/www/tracks
+>bundle update +
+

you can also use

+
+>bundle install +
+ +

Adjust owner and owner group for the downloaded files

+

All the files should be owned by the user ''www-data'' which is the user that runs Apache.

+

To set the owner and the owner group of all the files to www-data, at /var/www execute

+
+>chown -R www-data:www-data tracks +
+

then you need to set the access rights, the simplest way is at /var/www execute

+
+>chmod -R 777 tracks +
+

later once you have all running you can correctly set

+
+> find /var/www/tracks -type d -exec chmod 700 '{}' \;
+> find /var/www/tracks -type f -exec chmod 600 '{}' \;
+> find /var/www/tracks/script -type f -exec chmod 700 '{}' \; +
+

The ''find'' and ''chmod'' commands will set permissions as ''700'' for all directories and files inside the ''script'' directory.

+

All other files will have permissions set to ''600''.

+ +

Start MySQL service

+
+

>systemctl start mysql.service

+
+ +

Update database

+
+>cd /var/www/tracks
+>rake --rakefile=/var/www/tracks/Rakefile db:migrate RAILS_ENV=production
+>bundle exec rake db:migrate RAILS_ENV=production +
+

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.

+

When we installed "libapache2-mod-passenger" it suggested to install "nodejs"; so just install (or re-install) it."

+
+>apt install nodejs +
+ +

Precompile assets

+
+>cd /var/www/tracks
+>rake --rakefile=/var/www/tracks/Rakefile assets:precompile RAILS_ENV=production
+>bundle exec rake assets:precompile RAILS_ENV=production +
+ +

Start Apache service

+
+

>systemctl start apache2

+