mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Add basic mod_epp setup to readme
This commit is contained in:
parent
4d92a40a8d
commit
6a0a22bdc0
6 changed files with 141 additions and 0 deletions
4
Gemfile
4
Gemfile
|
@ -28,6 +28,9 @@ gem 'jbuilder', '~> 2.0'
|
|||
# Use ActiveModel has_secure_password
|
||||
# gem 'bcrypt', '~> 3.1.7'
|
||||
|
||||
# Replacement for erb
|
||||
gem 'haml-rails', '~> 0.5.3'
|
||||
|
||||
group :assets do
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
gem 'therubyracer', platforms: :ruby
|
||||
|
@ -54,6 +57,7 @@ group :development, :test do
|
|||
|
||||
# For debugging
|
||||
gem 'pry'
|
||||
gem 'pry-byebug'
|
||||
|
||||
# Testing framework
|
||||
gem 'rspec-rails', '~> 3.0.1'
|
||||
|
|
17
Gemfile.lock
17
Gemfile.lock
|
@ -29,6 +29,9 @@ GEM
|
|||
tzinfo (~> 1.1)
|
||||
arel (5.0.1.20140414130214)
|
||||
builder (3.2.2)
|
||||
byebug (1.1.1)
|
||||
columnize (~> 0.3.6)
|
||||
debugger-linecache (~> 1.2.0)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (4.0.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
|
@ -37,12 +40,21 @@ GEM
|
|||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.7.0)
|
||||
columnize (0.3.6)
|
||||
debugger-linecache (1.2.0)
|
||||
diff-lcs (1.2.5)
|
||||
erubis (2.7.0)
|
||||
execjs (2.2.0)
|
||||
fabrication (2.11.3)
|
||||
faker (1.3.0)
|
||||
i18n (~> 0.5)
|
||||
haml (4.0.5)
|
||||
tilt
|
||||
haml-rails (0.5.3)
|
||||
actionpack (>= 4.0.1)
|
||||
activesupport (>= 4.0.1)
|
||||
haml (>= 3.1, < 5.0)
|
||||
railties (>= 4.0.1)
|
||||
hike (1.2.3)
|
||||
i18n (0.6.9)
|
||||
jbuilder (2.1.0)
|
||||
|
@ -67,6 +79,9 @@ GEM
|
|||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
pry-byebug (1.0.1)
|
||||
byebug (~> 1.1.1)
|
||||
pry (>= 0.9.10)
|
||||
rack (1.5.2)
|
||||
rack-test (0.6.2)
|
||||
rack (>= 1.0)
|
||||
|
@ -156,10 +171,12 @@ DEPENDENCIES
|
|||
coffee-rails (~> 4.0.0)
|
||||
fabrication (~> 2.11.3)
|
||||
faker (~> 1.3.0)
|
||||
haml-rails (~> 0.5.3)
|
||||
jbuilder (~> 2.0)
|
||||
jquery-rails
|
||||
pg
|
||||
pry
|
||||
pry-byebug
|
||||
rails (= 4.1.1)
|
||||
rspec-rails (~> 3.0.1)
|
||||
sass-rails (~> 4.0.3)
|
||||
|
|
94
README.md
94
README.md
|
@ -1,2 +1,96 @@
|
|||
registry
|
||||
========
|
||||
|
||||
###To install and configure mod_epp (on Ubuntu 14.04 LTS)
|
||||
|
||||
* `sudo apt-get install apache2`
|
||||
* `sudo apt-get install apache2-threaded-dev`
|
||||
* `sudo apt-get install apache2-utils`
|
||||
* `sudo apt-get install apache2-dbg` (Actually I don't think this is needed, but while debugging I installed this too)
|
||||
* Download [mod_epp 1.10](http://sourceforge.net/projects/aepps/)
|
||||
* `tar -xzf mod_epp-1.10.tar.gz`
|
||||
* `cd mod_epp-1.10`
|
||||
* `sudo apxs2 -a -c -i mod_epp.c`
|
||||
* `sudo a2enmod cgi`
|
||||
* `sudo a2enmod authn_file`
|
||||
* `sudo a2enmod proxy_http`
|
||||
* `sudo htpasswd -c /etc/apache2/htpasswd test`
|
||||
* Type "test" when prompted
|
||||
|
||||
* `cd /usr/lib/cgi-bin`
|
||||
* `mkdir epp`
|
||||
* Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp (this is just for now)
|
||||
* `cd /etc/apache2/sites-available`
|
||||
* `nano epp.conf`
|
||||
|
||||
Add:
|
||||
```
|
||||
<IfModule mod_epp.c>
|
||||
<Directory "/usr/lib/cgi-bin/epp">
|
||||
Options ExecCGI
|
||||
SetHandler cgi-script
|
||||
</Directory>
|
||||
|
||||
Listen 1701
|
||||
<VirtualHost *: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
|
||||
</VirtualHost>
|
||||
</IfModule>
|
||||
```
|
||||
|
||||
* `sudo service apache2 restart`
|
||||
|
||||
Try it out:
|
||||
|
||||
* `cd $mod_epp`
|
||||
* `./epptelnet.pl localhost 1701`
|
||||
|
||||
You should receive the freeting from the registry server.
|
||||
|
||||
|
||||
Alternative virtual host config is as follows:
|
||||
This needs a static greeting file, so you will have to make /var/www writable.
|
||||
|
||||
```
|
||||
<IfModule mod_epp.c>
|
||||
<Directory "/usr/lib/cgi-bin/epp">
|
||||
Options ExecCGI
|
||||
SetHandler cgi-script
|
||||
</Directory>
|
||||
|
||||
Listen 1700
|
||||
|
||||
<VirtualHost *:1700>
|
||||
EPPEngine On
|
||||
EPPCommandRoot /cgi-bin/epp/command
|
||||
EPPSessionRoot /cgi-bin/epp/session
|
||||
EPPErrorRoot /cgi-bin/epp/error
|
||||
# we can redirect to static pages.
|
||||
Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello
|
||||
|
||||
|
||||
# or to specialized scripts
|
||||
Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login
|
||||
Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout
|
||||
Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema
|
||||
Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create
|
||||
Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info
|
||||
|
||||
EPPAuthURI /epp/auth/login
|
||||
<Location /epp/auth>
|
||||
AuthType Basic
|
||||
AuthName "EPP"
|
||||
AuthUserFile /etc/apache2/htpasswd
|
||||
require valid-user
|
||||
</Location>
|
||||
</VirtualHost>
|
||||
</IfModule>
|
||||
```
|
||||
|
|
5
app/controllers/epp/sessions_controller.rb
Normal file
5
app/controllers/epp/sessions_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Epp::SessionsController < ApplicationController
|
||||
def index
|
||||
render 'hello'
|
||||
end
|
||||
end
|
17
app/views/epp/sessions/hello.xml
Normal file
17
app/views/epp/sessions/hello.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<!-- This is an example EPP greeting from mod_epp -->
|
||||
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
|
||||
epp-1.0.xsd">
|
||||
<greeting>
|
||||
<svID>Example mod_epp server</svID>
|
||||
<svDate>2002-10-28T22:00:00.0Z</svDate>
|
||||
<svcMenu>
|
||||
<version>1.0</version>
|
||||
<lang>en</lang>
|
||||
</svcMenu>
|
||||
</greeting>
|
||||
</epp>
|
|
@ -1,4 +1,8 @@
|
|||
Rails.application.routes.draw do
|
||||
namespace(:epp) do
|
||||
get 'session/:command', to: 'sessions#index', defaults: { format: :xml }
|
||||
end
|
||||
|
||||
# The priority is based upon order of creation: first created -> highest priority.
|
||||
# See how all your routes lay out with "rake routes".
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue