From f08b268bcce00d4b385db0df92876f23ea634129 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Fri, 2 Jan 2015 11:55:34 +0200 Subject: [PATCH 1/3] readme cleanup and added apache config examples --- README.md | 113 +++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index ff86be465..8c404d96a 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,16 @@ Installation ### Registry app -Usual Rails 4 app installation, rvm and bundler are your friends. +Usual Rails 4 app installation (rbenv install is under Debian build doc) git clone git@github.com:internetee/registry.git cd registry - rvm install ruby-2.1.2 + rbenv local 2.1.2 bundle - rake db:setup mv config/secrets-example.yml config/secrets.yml # generate your own keys -If you desire other database locale, you have to create database manually first and -skip rake db:setup. Example: +Create database manually, example: create database registry owner registry encoding 'UTF-8' LC_COLLATE 'et_EE.utf8' LC_CTYPE 'et_EE.utf8' template template0; rake db:schema:load @@ -64,11 +62,57 @@ Enable ssl: sudo a2enmod ssl sudo nano /etc/apache2/sites-enabled/epp_ssl.conf -For development configuration, add: +For Apache, registry admin goes to port 443 in production, /etc/apache2/sites-enabled/registry.conf short example: +``` + + ServerName your-domain + ServerAdmin your@example.com + + PassengerEnabled on + PassengerMinInstances 10 + PassengerMaxPoolSize 10 + PassengerPoolIdleTime 0 + PassengerMaxRequests 1000 + + RailsEnv production + DocumentRoot /home/registry/registry/current/public + + # Possible values include: debug, info, notice, warn, error, crit, + LogLevel info ssl:warn + ErrorLog /var/log/apache2/registry.error.log + CustomLog /var/log/apache2/registry.access.log combined + + + Require all granted + Options -MultiViews + + + SSLEngine On + SSLCertificateFile /etc/ssl/certs/your.crt + SSLCertificateKeyFile /etc/ssl/private/your.key + SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem + SSLCACertificateFile /etc/ssl/certs/ca.pem + + SSLProtocol TLSv1 + SSLHonorCipherOrder On + SSLCipherSuite RC4-SHA:HIGH:!ADH + + + Options FollowSymLinks -Indexes + AllowOverride None + + + Options -MultiViews -Indexes + AllowOverride all + + +``` + +For Apache, epp goes to port 700, /etc/apache2/sites-enabled/epp.conf short example: ```apache - Listen 701 - + Listen 700 + SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /etc/apache2/ssl/apache.crt @@ -81,7 +125,7 @@ For development configuration, add: EPPSessionRoot /proxy/session EPPErrorRoot /proxy/error - ProxyPass /proxy/ http://localhost:8989/epp/ + ProxyPass /proxy/ http://localhost:443/epp/ EPPAuthURI implicit EPPReturncodeHeader X-EPP-Returncode @@ -89,61 +133,18 @@ For development configuration, add: ``` -Configuration on plain TCP EPP is as follows: -```apache - - - Options ExecCGI - SetHandler cgi-script - - - Listen 1701 - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - ProxyPass /proxy/ http://localhost:8080/epp/ - - EPPErrorRoot /cgi-bin/epp/error - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - -``` - -Note: Its best to go with two virtual hosts, one for autotest and one for dev, -then you don't have to worry about quitting -the dev appserver for running autotests (because of colliding ports). +Enable epp_ssl and restart apache sudo a2ensite epp_ssl sudo service apache2 restart -Try it out: +Now you should see registry admin at https://your-domain -Fire up your appserver on port 8989 - - cd $mod_epp - ./epptelnet.pl localhost 701 -s - -You should receive the greeting from the registry server. -Wait for the greeting message on the STD, then send EPP/TCP frame: - -```xml - - - registrar1 - test1 - - sample1trid - -``` - -All demo data locates at: +All registry demo data can be found at: db/seeds.rb -There are two type of users: admin users and EPP users. +Initially you can use two type of users: admin users and EPP users. ### EPP web client From 98b620d5c23d7494b8757f2233da861170a2076f Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Fri, 2 Jan 2015 12:02:24 +0200 Subject: [PATCH 2/3] added rbenv install --- doc/debian_build_doc.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/debian_build_doc.md b/doc/debian_build_doc.md index 02c9aea58..fe191ea5e 100644 --- a/doc/debian_build_doc.md +++ b/doc/debian_build_doc.md @@ -43,3 +43,11 @@ Use Phusion Passenger [official debian packages](https://www.phusionpassenger.co We also recommend to investigate [Passenger Optimization Guide](https://www.phusionpassenger.com/documentation/ServerOptimizationGuide.html) for proper configuration. + + +### RBENV install + + cd /home/registry + git clone https://github.com/sstephenson/rbenv.git /home/registry/.rbenv + git clone https://github.com/sstephenson/ruby-build.git /home/registry/.rbenv/plugins/ruby-build + From 2e5915f3d593daf3eaa82ca896243b9930c98d60 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Fri, 2 Jan 2015 13:09:21 +0200 Subject: [PATCH 3/3] added production deploy readme --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c404d96a..27a208306 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,34 @@ Installation Usual Rails 4 app installation (rbenv install is under Debian build doc) - git clone git@github.com:internetee/registry.git +Manual demo install and database setup: - cd registry + cd /home/registry + git clone git@github.com:internetee/registry.git demo-registry + cd demo-registry rbenv local 2.1.2 bundle - mv config/secrets-example.yml config/secrets.yml # generate your own keys + mv config/database-example.yml config/database.yml # and update it + mv config/secrets-example.yml config/secrets.yml # and generate your own key with 'rake secret' + rake assets:precompile + +Production install (requires database is already setuped) + + # at your local machine + git clone https://github.com/internetee/EPP-web-client.git eppweb + cd eppweb + rbenv local 2.1.2 + gem install mina + mina pr setup # one time, only creates missing directories + ssh registry + # at your server + vi registry/shared/config/database.yml # add production database conf + vi registry/shared/config/secrets.yml # add secret file (example: secrets-example.yml) + vi /etc/apache2/sites-enabled/registry.conf # add conf and all needed serts + vi /etc/apache2/sites-enabled/epp.conf # add epp conf, restart apache + exit + # at your local machine + mina pr deploy # this is command you use in every application code update Create database manually, example: