From d57700af515ead65062e8859a57e18d71f201ae3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 28 Nov 2016 18:28:15 +0000 Subject: [PATCH 1/2] Adding missing dependency for bundle install --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd17812..71b3e3c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ git clone https://github.com/YunoHost/dynette Web subscribe server deployment ------------------------------- ``` -apt-get install postgresql ruby thin libpq-dev bundler apache2 +apt-get install postgresql postgresql-server-dev-9.4 ruby thin libpq-dev bundler apache2 ``` In dynette repository: From 2fcbca1cf748b5ce326de372c38ed490e13fbd91 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 28 Nov 2016 19:05:06 +0000 Subject: [PATCH 2/2] More update of the documentation --- README.md | 76 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 71b3e3c..c72ac89 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,54 @@ git clone https://github.com/YunoHost/dynette Web subscribe server deployment ------------------------------- + +Install required stuff ``` -apt-get install postgresql postgresql-server-dev-9.4 ruby thin libpq-dev bundler apache2 +$ apt-get install postgresql postgresql-server-dev-9.4 ruby thin libpq-dev bundler apache2 bind9 python ``` -In dynette repository: +Prepare user dynette ``` -bundle install +$ useradd dynette +$ passwd dynette +$ mkdir /home/dynette +$ chown -R dynette:dynette /home/dynette ``` -Thin configuration: +Prepare PostgreSQL database ``` -thin config -C /etc/thin1.9.1/dynette.yml -c /path/to/dynette/ --servers 3 -p 5000 -e production +$ su - postgres +$ psql template1 +template1=# CREATE USER dynette WITH PASSWORD 'verySecurePassword'; +template1=# CREATE DATABASE dynette; +template1=# GRANT ALL PRIVILEGES ON DATABASE dynette to dynette; +template1=# \q ``` -Apache configuration: +Install dynette +``` +$ cd /home/dynette +$ git clone https://github.com/YunoHost/dynette +$ cd dynette +$ bundle install +``` + +Edit dynette.rb, change PostgreSQL password and domains handled, line 11-12: +``` +DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://dynette:myPassword@localhost/dynette") +DOMAINS = ["nohost.me", "noho.st"] +``` + +Configure and launch thin +``` +thin config -C /etc/thin2.1/dynette.yml -c /home/dynette/dynette/ --servers 3 -p 5000 -e production +service thin restart +``` + + +Apache configuration +-------------------- + ``` vim /etc/apache2/sites-available/dynette ``` @@ -63,43 +96,21 @@ Paste & change server name in below configuration: ``` -PostgreSQL configuration: -``` -# adduser dynette -# passwd dynette -# su - postgres -$ psql template1 -template1=# CREATE USER dynette WITH PASSWORD 'myPassword'; -template1=# CREATE DATABASE dynette; -template1=# GRANT ALL PRIVILEGES ON DATABASE dynette to dynette; -template1=# \q -``` - -Edit dynette.rb, change PostgreSQL password and domains handled, line 11-12: -``` -DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://dynette:myPassword@localhost/dynette") -DOMAINS = ["nohost.me", "noho.st"] -``` - Enable apache2 sites & modules: ``` a2enmod proxy a2enmod rewrite a2ensite dynette -service thin start service apache2 restart ``` -DNS configuration ------------------ - -``` -apt-get install bind9 python -``` +Cron job configuration +---------------------- Edit dynette.cron.py and change settings: ``` +# If you want to simply do test in local, use "http://127.0.0.1:5000/" subs_urls = ['https://dyndns.yunohost.org'] ns0 = 'ns0.yunohost.org' ns1 = 'ns1.yunohost.org' @@ -119,7 +130,10 @@ Enable cronjob for dynette (crontab -e) ``` * * * * * /path/to/dynette/dynette.cron.py >> /var/log/dynette.log 2>&1 ``` +Test it's working +----------------- +`wget -q -O - http://127.0.0.1:5000/test/someDomain.nohost.me` Troobleshooting ---------------