Project

General

Profile

MS DHCP » History » Revision 9

Revision 8 (Corey Osman, 10/31/2011 02:37 PM) → Revision 9/13 (Corey Osman, 10/31/2011 02:38 PM)

h1. MS DHCP 

 The Microsoft smart-proxy installation procedure is very basic compared to the RPM or APT based solution.  

 It is required that this procedure is executed as an administrator. 

 # Go to the smart-proxy repository at https://github.com/ohadlevy/smart-proxy 
 # Select download and choose the latest revision 
 # Extract this to a directory that does not have any spaces in its name. 
 # Go to the rubyinstaller webpage at http://rubyinstaller.org/downloads/ 
 # Download and install the latest ruby [ruby 1.8.7 release 334:http://rubyforge.org/frs/download.php/74293/rubyinstaller-1.8.7-p334.exe release](http://rubyforge.org/frs/download.php/74293/rubyinstaller-1.8.7-p334.exe). (Allow the ruby associations to be installed.) 
 # Open a CMD window and, using *gem install --version X.X.X --platform ?????*, add these gems 
 <pre> 
  columnize (0.3.2) 
  highline (1.6.1) 
  json (1.4.6 x86-mswin32) 
  linecache (0.43 mswin32) 
  mime-types (1.16) 
  mocha (0.9.11) 
  net-ping (1.3.7) 
  rack (1.2.0) 
  rake (0.8.7) 
  rest-client (1.6.1) 
  sinatra (1.1.0) 
  tilt (1.1) 
  win32-api (1.4.6 x86-mswin32-60) 
  win32-open3 (0.3.2 x86-mswin32-60) 
  win32-service (0.7.1 x86-mswin32-60) 
  windows-api (0.4.0) 
  windows-pr (1.1.2) 
 </pre> 

 Command to download them all: 
 <pre> 
 wget http://rubygems.org/downloads/columnize-0.3.2.gem \ 
      http://rubygems.org/downloads/haml-3.0.24.gem \ 
      http://rubygems.org/downloads/highline-1.6.1.gem \ 
      http://rubygems.org/downloads/json-1.4.6-x86-mswin32.gem \ 
      http://rubygems.org/downloads/linecache-0.43-mswin32.gem \ 
      http://rubygems.org/downloads/mime-types-1.16.gem \ 
      http://rubygems.org/downloads/mocha-0.9.11.gem \ 
      http://rubygems.org/downloads/net-ping-1.3.7.gem \ 
      http://rubygems.org/downloads/rack-1.2.0.gem \ 
      http://rubygems.org/downloads/rake-0.8.7.gem \ 
      http://rubygems.org/downloads/rest-client-1.6.1.gem \ 
      http://rubygems.org/downloads/sinatra-1.1.0.gem \ 
      http://rubygems.org/downloads/tilt-1.1.gem \ 
      http://rubygems.org/downloads/win32-api-1.4.6-x86-mswin32-60.gem \ 
      http://rubygems.org/downloads/win32-open3-0.3.2-x86-mswin32-60.gem \ 
      http://rubygems.org/downloads/win32-service-0.7.1-x86-mswin32-60.gem \ 
      http://rubygems.org/downloads/windows-api-0.4.0.gem \ 
      http://rubygems.org/downloads/windows-pr-1.1.2.gem 
 </pre> 

 To get it to work on Windows 2008 R2 some of the packages has to change 
 <pre> 
  columnize (0.3.2) 
  highline (1.6.1) 
  json (1.4.6 x86-mingw32) 
  linecache (0.43 mswin32) 
  mime-types (1.16) 
  mocha (0.9.11) 
  net-ping (1.3.7) 
  rack (1.2.0) 
  rake (0.8.7) 
  rest-client (1.6.1) 
  sinatra (1.1.0) 
  tilt (1.1) 
  win32-api (1.4.6 x86-mingw32) 
  win32-open3 (0.3.2 x86-mingw32) 
  win32-service (0.7.1 x86-mswin32-60) 
  windows-api (0.4.0) 
  windows-pr (1.1.2) 
 </pre> 
 Easy copy and paste method (platform may be different for you.    Please check gem environment to find out. 
 <pre> 
 gem install --version 0.3.2 --platform x86-mingw32 columnize 
 gem install --version 1.6.1 --platform x86-mingw32 highline 
 gem install --version 1.4.6 --platform x86-mingw32 json 
 gem install --version 0.43 --platform x86-mingw32 linecache 
 gem install --version 1.16 --platform x86-mingw32 mime-types 
 gem install --version 0.9.11 --platform x86-mingw32 mocha 
 gem install --version 1.3.7 --platform x86-mingw32 net-ping 
 gem install --version 1.2.0 --platform x86-mingw32 rack 
 gem install --version 0.8.7 --platform x86-mingw32 rake 
 gem install --version 1.6.1 --platform x86-mingw32 rest-client 
 gem install --version 1.1.0 --platform x86-mingw32 sinatra 
 gem install --version 1.1 --platform x86-mingw32 tilt 
 gem install --version 1.4.6 --platform x86-mingw32 win32-api 
 gem install --version 0.3.2 --platform x86-mingw32 win32-open3 
 gem install --version 0.7.1 --platform x86-mingw32-60 win32-service 
 gem install --version 0.4.0 --platform x86-mingw32 windows-api 
 gem install --version 1.1.2 --platform x86-mingw32 windows-pr 
 </pre> 
 Command to download them all: 
 <pre> 
 wget http://rubygems.org/downloads/columnize-0.3.2.gem \ 
      http://rubygems.org/downloads/haml-3.0.24.gem \ 
      http://rubygems.org/downloads/highline-1.6.1.gem \ 
      http://rubygems.org/downloads/json-1.4.6-x86-mingw32.gem \ 
      http://rubygems.org/downloads/linecache-0.43-mswin32.gem \ 
      http://rubygems.org/downloads/mime-types-1.16.gem \ 
      http://rubygems.org/downloads/mocha-0.9.11.gem \ 
      http://rubygems.org/downloads/net-ping-1.3.7.gem \ 
      http://rubygems.org/downloads/rack-1.2.0.gem \ 
      http://rubygems.org/downloads/rake-0.8.7.gem \ 
      http://rubygems.org/downloads/rest-client-1.6.1.gem \ 
      http://rubygems.org/downloads/sinatra-1.1.0.gem \ 
      http://rubygems.org/downloads/tilt-1.1.gem \ 
      http://rubygems.org/downloads/win32-api-1.4.6-x86-mingw32.gem \ 
      http://rubygems.org/downloads/win32-open3-0.3.2-x86-mingw32.gem \ 
      http://rubygems.org/downloads/win32-service-0.7.1-x86-mswin32-60.gem \ 
      http://rubygems.org/downloads/windows-api-0.4.0.gem \ 
      http://rubygems.org/downloads/windows-pr-1.1.2.gem 
 </pre> 

 8) CD to the root of the smart-proxy install directory 
 9) Edit config/settings.yml so that it looks a bit like this 

 _Sample config/settings.yml file_ 
 <pre> 
  --- 
  # HTTPS settings 
  :ssl_certificate: c:\documents\smart-proxy\config\signed.pem 
  :ssl_private_key: c:\documents\smart-proxy\config\private.pem 
  :ssl_ca_file:       c:\documents\smart-proxy\config\ca.pem 

  :trusted_hosts: [ foreman.someware.com] 

  :daemon: false 


  # Enable DHCP management 
  :dhcp: true 
  # The vendor can be either isc or native_ms 
  :dhcp_vendor: native_ms 
  # The dhcp_server is only used by the native_ms implementation 
  :dhcp_server: 172.29.90.240 

  # Where our proxy log files are stored 
  # filename or STDOUT 
  # Unix setting 
  #:log_file: log/proxy.log 
  # Windows setting 
  :log_file: c:\tmp\proxy.log 
  # valid options are 
  # Logger::WARN, Logger::DEBUG, Logger::Error, Logger::Fatal, Logger:INFO, LOGGER::UNKNOWN 
  #:log_level: Logger::DEBUG 
 </pre> 

 10) Create the SSL key 
 10.1) Login to your puppetmaster 
 10.2) puppetca --generate _Smart-proxy FQDN_. (Do not use an alias here.) 
 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. 
 11) Test the installation by running ruby bin\smart-proxy.rb 
 12) Install the program as a service 
 12.1) ruby extra\register-service.rb 
 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. 
 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.)