Tutorial to install Sharetribe on Ubuntu (But EC2 not working)

Hi guys,

I wrote a tutorial to install sharetribe on Ubuntu 16.04:
https://freedif.org/how-to-install-sharetribe-for-ubuntu-16-04/

I tested it on various VPS and dedicated servers and it works well.
Except on Amazon EC2… Not sure if any of you succeeded to install sharetribe on Amazon?

1 Like

We are running on Amazon…no problems…CDN can be a bit of a pain in the arse with HTTPS but otherwise works great.

@karibu probably a bit late to answer but I have gotten it running with no problems. Only thing I can think of is problems with the swap file size on the ec2 instance

Thanks alot for this @karibu I finally got it working after some issues and thought I’d share my thoughts about them in case anyone else run into the same “problems” as I did. Everything works, I’m just trying to clarify some parts that not everyone, myself included, might understand from the tutorial.


The most important one that took me a while:

  • When you add lines to config.yml pay attention to indentation. Always add 2 spaces in front of every config line or they will be ignored … I struggled with this for quite some time and had to add the “rake secret” to config/secret.yml etc before I understood what the problem was.

  • When you start your install and check out git, do this as a user preferably in your home folder and not as root in /opt or whatever, or you will run into problems later.

  • npm install: To be able to use “source ~/.profile” you need to type “bash” or log out / log in again becuase of the added lines in .bashrc.

  • bundle install has to be run in your sharetribe folder

  • npm install should be run in the sharetribe/client folder (or in the sharetribe base folder, the script will cd into client but I had some issues with that for some reason).

  • gem install mailcatcher will take a long time and it might look like its hanging… just leave it be for a couple of minutes more :slight_smile:

Hi again, feel free to add the section/sections below to the tutorial if you feel like it. I thought I should add how to update the mysql-db to use your own domain without the need for phpmyadmin and how to fix the google api for map-usage.

Make your databse use your own domain without using phpmyadmin:

  • mysql -u root -p
  • use sharetribe_production;
  • UPDATE communities SET domain = ‘your.fqdn.here’;
  • UPDATE communities SET use_domain = ‘1’;

Make sure it worked. First one should say your domain and next one should say 1.

  • select domain from communities;
  • select use_domain from communities;

Exit mysql

  • exit

Fix google-maps integration

Browse and register your web: https://developers.google.com/maps/documentation/javascript/get-api-key

copy the api-key and paste it in config.yml, dont forget about the leadin double space or the line will be ignored:

  • vi config/config.yml
  • google_maps_key: ‘AIzaSgdfgdgdfgdfgdf…etc…’

Hi there,

I’ve been following your tutorial and it works well for me. (Thanks for this)

I’ve got some struggles trying to enable sharetribe as service.
I’ve followed the related part in your tutorial but with no success.

this is the error i GET :

Unit football.service is not loaded properly: Invalid argument.
See system logs and ‘systemctl status football.service’ for details.

When i do “systemctl status football.service” i get :

[/etc/systemd/system/sharetribe.service:1] Unknown section ‘SERVICE’. Ignoring.
systemd[1]: sharetribe.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

I’ve added ExecStop setting with no exec to do but still not working.
I’ve also change the path directory.

This is the content from /etc/systemd/system/sharetribe.service:

[SERVICE]
WorkingDirectory=/home/monvestiaire/football
ExecStart=/bin/bash -lc 'source /home/monvestiaire/.profile && source /home/monvestiaire/.rvm/scripts/rvm && bundle e$
ExecStop=
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sharetri
User=ubuntu
Group=ubuntu
Environment=RAILS_ENV=production

[Install]
WantedBy=multi-user.target

Any ideas ?
Thanks,
Regards

Hi,
Can you confirm the line in your script:
ExecStart=/bin/bash -lc 'source /home/monvestiaire/.profile && source /home/monvestiaire/.rvm/scripts/rvm && bundle e$
This will not work obviously. (Can you paste the full part otherwise)

Thanks

Hi Karibu

Thanks for you response but I’ve found the solution.
I had some configuration issues like User & Group.

Now it works like a charm :tada:

Hi Karibu, works great

hi . Thanks a lot to Karibu and Vistor. Their tutorial and tips helped me succeed installing after like 6 hours of trying