Project

General

Profile

MS DHCP » History » Version 10

Corey Osman, 10/31/2011 02:38 PM

1 1 Paul Kelly
h1. MS DHCP
2
3
The Microsoft smart-proxy installation procedure is very basic compared to the RPM or APT based solution. 
4
5
It is required that this procedure is executed as an administrator.
6
7 4 Ohad Levy
# Go to the smart-proxy repository at https://github.com/ohadlevy/smart-proxy
8
# Select download and choose the latest revision
9
# Extract this to a directory that does not have any spaces in its name.
10
# Go to the rubyinstaller webpage at http://rubyinstaller.org/downloads/
11 10 Corey Osman
# Download and install the latest "ruby 1.8.7 release 334":http://rubyforge.org/frs/download.php/74293/rubyinstaller-1.8.7-p334.exe (Allow the ruby associations to be installed.)
12 4 Ohad Levy
# Open a CMD window and, using *gem install --version X.X.X --platform ?????*, add these gems
13 5 Ohad Levy
<pre>
14 1 Paul Kelly
 columnize (0.3.2)
15
 highline (1.6.1)
16
 json (1.4.6 x86-mswin32)
17
 linecache (0.43 mswin32)
18
 mime-types (1.16)
19
 mocha (0.9.11)
20
 net-ping (1.3.7)
21
 rack (1.2.0)
22
 rake (0.8.7)
23
 rest-client (1.6.1)
24
 sinatra (1.1.0)
25
 tilt (1.1)
26
 win32-api (1.4.6 x86-mswin32-60)
27
 win32-open3 (0.3.2 x86-mswin32-60)
28
 win32-service (0.7.1 x86-mswin32-60)
29
 windows-api (0.4.0)
30
 windows-pr (1.1.2)
31 5 Ohad Levy
</pre>
32 1 Paul Kelly
33 2 Kai Stian Olstad
Command to download them all:
34
<pre>
35
wget http://rubygems.org/downloads/columnize-0.3.2.gem \
36
     http://rubygems.org/downloads/haml-3.0.24.gem \
37
     http://rubygems.org/downloads/highline-1.6.1.gem \
38
     http://rubygems.org/downloads/json-1.4.6-x86-mswin32.gem \
39
     http://rubygems.org/downloads/linecache-0.43-mswin32.gem \
40
     http://rubygems.org/downloads/mime-types-1.16.gem \
41
     http://rubygems.org/downloads/mocha-0.9.11.gem \
42
     http://rubygems.org/downloads/net-ping-1.3.7.gem \
43
     http://rubygems.org/downloads/rack-1.2.0.gem \
44
     http://rubygems.org/downloads/rake-0.8.7.gem \
45
     http://rubygems.org/downloads/rest-client-1.6.1.gem \
46
     http://rubygems.org/downloads/sinatra-1.1.0.gem \
47
     http://rubygems.org/downloads/tilt-1.1.gem \
48
     http://rubygems.org/downloads/win32-api-1.4.6-x86-mswin32-60.gem \
49
     http://rubygems.org/downloads/win32-open3-0.3.2-x86-mswin32-60.gem \
50
     http://rubygems.org/downloads/win32-service-0.7.1-x86-mswin32-60.gem \
51
     http://rubygems.org/downloads/windows-api-0.4.0.gem \
52
     http://rubygems.org/downloads/windows-pr-1.1.2.gem
53
</pre>
54 3 Kai Stian Olstad
55
To get it to work on Windows 2008 R2 some of the packages has to change
56
<pre>
57
 columnize (0.3.2)
58
 highline (1.6.1)
59
 json (1.4.6 x86-mingw32)
60
 linecache (0.43 mswin32)
61
 mime-types (1.16)
62
 mocha (0.9.11)
63
 net-ping (1.3.7)
64
 rack (1.2.0)
65
 rake (0.8.7)
66
 rest-client (1.6.1)
67
 sinatra (1.1.0)
68
 tilt (1.1)
69
 win32-api (1.4.6 x86-mingw32)
70
 win32-open3 (0.3.2 x86-mingw32)
71
 win32-service (0.7.1 x86-mswin32-60)
72
 windows-api (0.4.0)
73
 windows-pr (1.1.2)
74
</pre>
75 6 Corey Osman
Easy copy and paste method (platform may be different for you.  Please check gem environment to find out.
76
<pre>
77
gem install --version 0.3.2 --platform x86-mingw32 columnize
78
gem install --version 1.6.1 --platform x86-mingw32 highline
79
gem install --version 1.4.6 --platform x86-mingw32 json
80
gem install --version 0.43 --platform x86-mingw32 linecache
81
gem install --version 1.16 --platform x86-mingw32 mime-types
82
gem install --version 0.9.11 --platform x86-mingw32 mocha
83
gem install --version 1.3.7 --platform x86-mingw32 net-ping
84
gem install --version 1.2.0 --platform x86-mingw32 rack
85
gem install --version 0.8.7 --platform x86-mingw32 rake
86
gem install --version 1.6.1 --platform x86-mingw32 rest-client
87
gem install --version 1.1.0 --platform x86-mingw32 sinatra
88
gem install --version 1.1 --platform x86-mingw32 tilt
89
gem install --version 1.4.6 --platform x86-mingw32 win32-api
90
gem install --version 0.3.2 --platform x86-mingw32 win32-open3
91
gem install --version 0.7.1 --platform x86-mingw32-60 win32-service
92
gem install --version 0.4.0 --platform x86-mingw32 windows-api
93
gem install --version 1.1.2 --platform x86-mingw32 windows-pr
94
</pre>
95 3 Kai Stian Olstad
Command to download them all:
96
<pre>
97
wget http://rubygems.org/downloads/columnize-0.3.2.gem \
98
     http://rubygems.org/downloads/haml-3.0.24.gem \
99
     http://rubygems.org/downloads/highline-1.6.1.gem \
100
     http://rubygems.org/downloads/json-1.4.6-x86-mingw32.gem \
101
     http://rubygems.org/downloads/linecache-0.43-mswin32.gem \
102
     http://rubygems.org/downloads/mime-types-1.16.gem \
103
     http://rubygems.org/downloads/mocha-0.9.11.gem \
104
     http://rubygems.org/downloads/net-ping-1.3.7.gem \
105
     http://rubygems.org/downloads/rack-1.2.0.gem \
106
     http://rubygems.org/downloads/rake-0.8.7.gem \
107
     http://rubygems.org/downloads/rest-client-1.6.1.gem \
108
     http://rubygems.org/downloads/sinatra-1.1.0.gem \
109
     http://rubygems.org/downloads/tilt-1.1.gem \
110
     http://rubygems.org/downloads/win32-api-1.4.6-x86-mingw32.gem \
111
     http://rubygems.org/downloads/win32-open3-0.3.2-x86-mingw32.gem \
112
     http://rubygems.org/downloads/win32-service-0.7.1-x86-mswin32-60.gem \
113
     http://rubygems.org/downloads/windows-api-0.4.0.gem \
114
     http://rubygems.org/downloads/windows-pr-1.1.2.gem
115
</pre>
116
117 1 Paul Kelly
8) CD to the root of the smart-proxy install directory
118
9) Edit config/settings.yml so that it looks a bit like this
119
120
_Sample config/settings.yml file_
121
<pre>
122
 ---
123
 # HTTPS settings
124
 :ssl_certificate: c:\documents\smart-proxy\config\signed.pem
125
 :ssl_private_key: c:\documents\smart-proxy\config\private.pem
126
 :ssl_ca_file:     c:\documents\smart-proxy\config\ca.pem
127
128
 :trusted_hosts: [ foreman.someware.com]
129
130
 :daemon: false
131
132
133
 # Enable DHCP management
134
 :dhcp: true
135
 # The vendor can be either isc or native_ms
136
 :dhcp_vendor: native_ms
137
 # The dhcp_server is only used by the native_ms implementation
138
 :dhcp_server: 172.29.90.240
139
140
 # Where our proxy log files are stored
141
 # filename or STDOUT
142
 # Unix setting
143
 #:log_file: log/proxy.log
144
 # Windows setting
145
 :log_file: c:\tmp\proxy.log
146
 # valid options are
147
 # Logger::WARN, Logger::DEBUG, Logger::Error, Logger::Fatal, Logger:INFO, LOGGER::UNKNOWN
148
 #:log_level: Logger::DEBUG
149
</pre>
150
151
10) Create the SSL key
152
10.1) Login to your puppetmaster
153
10.2) puppetca --generate _Smart-proxy FQDN_. (Do not use an alias here.)
154
10.3) Copy the private key, the public certificate and the ca.pem from /var/lib/puppet/ssl over to the locations that you specified in the setting file.
155
11) Test the installation by running ruby bin\smart-proxy.rb
156
12) Install the program as a service
157
12.1) ruby extra\register-service.rb
158
12.2) This may install the service but not run it. If so then try to start the service from the Ordinary Microsoft services snapin utility.
159
13) You may test connectivity by running the *extra\query.rb* utility from your foreman host. (Note that this file comes from the _extra_ directory in the smart-proxy release.)