Updated Install Tracks on Ubuntu 20.10 (markdown)

ghost-from-the-past 2021-04-14 15:08:51 +02:00
parent feda5f39df
commit 4a7844a931

@ -1,6 +1,6 @@
<p>This is based on the previous installation guides (from where I shamelessly copy and paste several parts)</p>
<p>
Don't forget in case you need some help to consutl/write in the users group :<br/>
Don't forget in case you need some help to consult/write in the users group :<br/>
<a href="https://groups.google.com/g/tracksapp">https://groups.google.com/g/tracksapp</a>
</p>
<p>
@ -30,6 +30,8 @@
&gt;systemctl enable mysql<br/>
&gt;systemctl start mysql.service</blockquote>
<p>The last three lines set to automatically start Apache web server and MySQL database server when you boot and starts the MySQL (Apache is still off). For more information see [[Apache tips]] and [[MySQL tips]]</p>
<h3>MySQL - change the default of default_authentication_plugin</h3>
<p>Follow the instruction at [[MySQL tips#mysql---change-the-default-of-default_authentication_plugin]] to change the default authentication used by MySQL</p>
<h3>Install Ruby</h3>
<p>Tracks requires Ruby 2.5 or greater. Most of the testing is done with 2.6.</p>
<p>Install the following packages</p>
@ -131,121 +133,74 @@
<p>&gt;cp ./config/database.yml.tmpl ./config/database.yml</p>
<p>&gt;cp ./config/site.yml.tmpl ./config/site.yml</p>
</blockquote>
<p>
<br/>
</p>
<h4>edit the content of database.yml</h4>
<p>you can use the nano text editor</p>
<blockquote>
<p>&gt;nano database.yml</p>
&gt;nano database.yml
</blockquote>
<p>Normally you edit only the "production" section</p>
<p>the words in red are the names you need to choose for the database, the user and password. This must match what you later use when manually creates the database.</p>
<p>the words in marked are the names you need to choose for the database, the user and password. This must match what you later use when manually creates the database.</p>
<blockquote>
<p>production:</p>
<p> adapter: mysql2</p>
<p> database: <span style="color: rgb(255,0,0);">tempe</span>
</p>
<p> encoding : utf8</p>
<p> host: localhost</p>
<p> username: <span style="color: rgb(255,0,0);">daniel</span>
</p>
<p> password: <span style="color: rgb(255,0,0);">DANIEL</span>
</p>
production:<br/>
adapter: mysql2<br/>
database: `tempe`<br/>
encoding : utf8<br/>
host: localhost<br/>
username: `daniel`<br/>
password: `DANIEL`<br/>
</blockquote>
<p>if you use sqlite</p>
<blockquote>
<p>production:</p>
<p> adapter: sqlite3</p>
<p> database: db/tracks-20-blank.sqlite3.db</p>
<p> pool: 5</p>
<p> timeout: 5000</p>
production:<br/>
adapter: sqlite3<br/>
database: db/tracks-20-blank.sqlite3.db<br/>
pool: 5<br/>
timeout: 5000<br/>
</blockquote>
<h4>edit the content of site.yml</h4>
<p>you can use the nano text editor</p>
<blockquote>
<p>&gt;nano site.yml</p>
&gt;nano site.yml
</blockquote>
<p>Choose a new secret token and set the correct time zone</p>
<blockquote>
<p>secret_token: ''<span style="color: rgb(255,0,0);">change-me</span>''</p>
<p>time_zone: ''<span style="color: rgb(255,0,0);">UTC</span>''</p>
<p>admin_email : <span style="color: rgb(255,0,0);">my.email@domain.com</span>
</p>
secret_token: '`change-me`'<br/>
time_zone: '`UTC`'<br/>
admin_email : `my.email@domain.com`<br/>
</blockquote>
<p>
<br/>
</p>
<p>For the time zone setting you can use the command</p>
<blockquote>
<p>
<s>&gt;rake --rakefile=/var/www/tracks/Rakefile time:zones:local</s>
</p>
<p>&gt;bundle <span class="pl-c1">exec</span> rake time:zones:local</p>
<s>&gt;rake --rakefile=/var/www/tracks/Rakefile time:zones:local</s><br/>
&gt;bundle <span class="pl-c1">exec</span> rake time:zones:local
</blockquote>
<p>to see all available timezones on your machine</p>
<p>
<br/>
</p>
<p>If you intend to use Tracks behind a web server or reverse proxy with https enabled, ensure to set force_ssl option to true.</p>
<p>------------</p>
<p>If you are using Windows, you may need to check the shebang lines (#!/usr/bin/env ruby) of the /public/dispatch.* files and all the files in the /script directory.</p>
<p>They are set to #!/usr/bin/env ruby by default.</p>
<p>This should work for all Unix based setups (Linux or Mac OS X), but Windows users will probably have to change it to something like #c:/ruby/bin/ruby to point to the Ruby binary on your system.</p>
<p>------------</p>
<h3>Adjust owner and owner group for the downloaded files</h3>
<p>set the owner and the owner group of all the files to www-data</p>
<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>
<p>&gt;chown -R www-data:www-data <strong>tracks</strong>
</p>
&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>
<p>then you need to set the access rights, the simplest way is at /var/www execute</p>
<blockquote>
<p>&gt;chmod -R 777 tracks</p>
&gt;chmod -R 777 tracks
</blockquote>
<p>later once you have all running you can correctly set</p>
<blockquote>
<p>
<br/>&gt; find /var/www/tracks -type d -exec chmod 700 '{}' \;</p>
<p>&gt; find /var/www/tracks -type f -exec chmod 600 '{}' \;</p>
<p>&gt; find /var/www/tracks/script -type f -exec chmod 700 '{}' \;</p>
&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>
<p>All the files will be owned by the user ''www-data'' which is the user that runs Apache</p>
<p>------------</p>
<h3>MySQL - change the default of default_authentication_plugin</h3>
<p>
<br/>
</p>
<p>since Mysql version 8.0 the default values has been changed from mysql_native_password to caching_sha2_password</p>
<p>this needs to be reverted in the cnf file</p>
<p>
<br/>
</p>
<p>for my installation /etc/mysql/my.cnf is a symbolic link to /etc/alternatives/my.cnf which is a symbolic link to /etc/mysql/mysql.cnf</p>
<p>so we need to edit the file /etc/mysql/mysql.cnf</p>
<p>add the following at the end of the file</p>
<blockquote>
<p>[mysqld]</p>
<p>default_authentication_plugin=mysql_native_password</p>
</blockquote>
<p>the group [mysqld] is for the server, for the client the group is [mysql]</p>
<p>(info <span class="nolink">http://dev.mysql.com/doc/mysql/en/server-system-variables.html</span>
</p>
<p>
<a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html">https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html</a> )</p>
<p>
<br/>
</p>
<p>possible places of the cnf file</p>
<ul>
<li>/etc/my.cnf</li>
<li>/etc/mysql/my.cnf</li>
<li>$MYSQL_HOME/my.cnf</li>
<li>[datadir]/my.cnf</li>
<li>~/.my.cnf</li>
</ul>
<p>------------</p>
<h3>Manually create the database</h3>
<p>Tracks is tested on MySQL and SQLite, but PostgreSQL can also be used.</p>