From 530caf3d804abe540eb4d0280b3b822c67300760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=BB=BFghost-from-the-past?= Date: Wed, 14 Apr 2021 15:54:42 +0200 Subject: [PATCH] Updated Install Tracks on Ubuntu 20.10 (markdown) --- Install-Tracks-on-Ubuntu-20.10.md | 57 +++++++++---------------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/Install-Tracks-on-Ubuntu-20.10.md b/Install-Tracks-on-Ubuntu-20.10.md index a2f4797..fa6fe24 100644 --- a/Install-Tracks-on-Ubuntu-20.10.md +++ b/Install-Tracks-on-Ubuntu-20.10.md @@ -164,7 +164,7 @@ admin_email : my.email@domain.com

For the time zone setting you can use the command

>rake --rakefile=/var/www/tracks/Rakefile time:zones:local
->bundle exec rake time:zones:local +>bundle exec rake time:zones:local

to see all available timezones on your machine

Adjust owner and owner group for the downloaded files

@@ -210,7 +210,7 @@ mysql> quit

>systemctl restart mysql.service

-

you can use the following that MySQL is running ok

+

you can use the following to check that MySQL is running ok

>systemctl status mysql.service

@@ -236,34 +236,21 @@ mysql> quit >bundle update

Populate database

-

This will set up your database with the required structure to hold Tracks’ data.

-

go to the directory where you installed Tracks and run

+

This will set up your database with the required structure to hold Tracks data.

+

going to the directory where Tracks is installed run

-

>cd /var/www/tracks

-

->rake --rakefile=/var/www/tracks/Rakefile db:migrate RAILS_ENV=production -

-

>bundle exec rake db:migrate RAILS_ENV=production

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

------------

Precompile assets

Static assets (images, stylesheets, and javascript) need to be compiled in order for them to work correctly with the new asset pipeline feature in Rails.

-

go to the directory where you installed Tracks and run

+

going to the directory where Tracks is installed run

-

>cd /var/www/tracks

-

->rake --rakefile=/var/www/tracks/Rakefile assets:precompile RAILS_ENV=production -

-

>bundle exec rake assets:precompile RAILS_ENV=production

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

------------

-

ToDo: test this

-

-
-

-

Optional; if you don't have SSL certificate

generate certificates, e.g. in /home/ubuntu/certificates

>openssl req -newkey rsa:2048 -nodes -keyout key.pem -out req.pem
>openssl x509 -req -days 365 -in req.pem -signkey key.pem -out cert.pem

Run tracks with thin + ssl

-

(in tracks-2.3.0 folder)

>bundle exec thin start -e production --ssl --ssl-verify --ssl-key-file /home/ubuntu/certificates/key.pem --ssl-cert-file /home/ubuntu/certificates/cert.pem

-

------------

Run Apache

Enable module rewrite

>a2enmod rewrite
@@ -271,24 +258,12 @@ mysql> quit
>systemctl restart apache2

you can check the status, to see that up to here everything is ok, with

-

>systemctl status apache2.service

-

>journalctl -xe

-
-

if apache was installed correctly and is running go with your browser to http://localhost you should see the Apache webserver page

-

------------

-

To enable or disable the automatic start of Apache2 service when you boot your machine use

-
-

>systemctl enable apache2.service

-

>systemctl disable apache2.service

-
-

-
-

-

To start or stop manually the Apache2 service use

-
-

>systemctl start apache2.service

-

>systemctl stop apache2.service

+>systemctl status apache2.service
+>journalctl -xe
+

if apache was installed correctly and is running go with your browser to http://localhost you should see the Apache webserver page

+

For more information see [[Apache tips]]

+

------------

Setup Apache to run your website

at /etc/apache2/sites-available/ create the file tracks.conf