<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 # -*- encoding: utf-8 -*-
 Gem::Specification.new do |s|
   s.name = %q{cpanel-passenger}
-  s.version = '0.0.3'
+  s.version = '0.0.3.1'
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Paul Hepworth&quot;]</diff>
      <filename>cpanel-passenger.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
   $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
 
 module CpanelPassenger
-  VERSION = '0.0.3'
+  VERSION = '0.0.3.1'
 end
\ No newline at end of file</diff>
      <filename>lib/cpanel_passenger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'optparse'
 require 'ftools'
+require 'fileutils'
       
 module CpanelPassenger
   class CLI
@@ -28,9 +29,11 @@ module CpanelPassenger
         opts.on(&quot;-c&quot;, &quot;--show-current-config&quot;,
                 &quot;Show the current config for an account; requires -u and -p&quot;) { |arg| options[:showcurrentconfig] = true }
         opts.on(&quot;-p&quot;, &quot;--path=PATH&quot;, String,
-                &quot;The absolute path to your rails application root (ex: /home/username/blog)&quot;) { |arg| options[:path] = arg }
+                &quot;The absolute path to your rails application root (ex: /home/username/blog/current)&quot;) { |arg| options[:path] = arg }
         opts.on(&quot;-u&quot;, &quot;--username=USERNAME&quot;, String, 
-                &quot;Your cpanel account username (ex: peppyheppy)&quot;) { |arg| options[:username] = arg.strip }
+                &quot;Your cpanel account username (ex: peppyhep)&quot;) { |arg| options[:username] = arg.strip }
+        opts.on(&quot;-d&quot;, &quot;--domain=domain&quot;, String, 
+                &quot;The domain for this username (ex: peppyheppy.com)&quot;) { |arg| options[:domain] = arg.strip }
         opts.on(&quot;-s&quot;, &quot;--max-pool-size=SIZE&quot;, String, 
                 &quot;Value for PassengerMaxPoolSize which is used for setting&quot;, 
                 &quot;the max number of application instances&quot;) { |arg| options[:maxpoolsize] = arg.strip }
@@ -52,13 +55,23 @@ module CpanelPassenger
 
       username = options[:username]
       rails_app_path = options[:path]
+      apache_config_root = '/usr/local/apache/conf'
+      apache_userdata_config_root = &quot;#{apache_config_root}/userdata/std/2&quot;
 
       stdout.puts &quot;* Setting up Rails app in Apache config for user&quot;
       raise &quot;Path is required!&quot; unless File.directory?(rails_app_path) or File.directory?(&quot;#{rails_app_path}/public&quot;)
       raise &quot;Script needed for overriding or appending vhost includes is not found, do you have cpanel installed?&quot; unless File.exists?(&quot;/scripts/ensure_vhost_includes&quot;)
-      
+                       
+      unless File.directory?(&quot;#{apache_userdata_config_root}/#{username}&quot;)
+        raise &quot;Apache is not yet configured for your virtual host configurations... please provide the domain (-d/--domain)&quot; unless options[:domain]
+        stdout.puts &quot;* Making required apache config dirs.&quot;
+        config_path = &quot;#{apache_userdata_config_root}/#{username}/#{options[:domain]}&quot;
+        FileUtils::mkdir_p(config_path)  
+        path_to_config = config_path + &quot;/rails.conf&quot;
+      end      
+
       stdout.puts &quot;* Fetching info from httpd.conf&quot;
-      path_to_config = File.new(&quot;/usr/local/apache/conf/httpd.conf&quot;).readlines.grep(/userdata\/.*\/#{username}/).first.strip[/\/usr\/.*[*]/].chop + &quot;rails.conf&quot;
+      path_to_config ||= File.new(&quot;/usr/local/apache/conf/httpd.conf&quot;).readlines.grep(/userdata\/.*\/#{username}/).first.strip[/\/usr\/.*[*]/].chop + &quot;rails.conf&quot;
 
       unless options[:showcurrentconfig]
         stdout.puts &quot;* Creating configs for #{username}&quot;</diff>
      <filename>lib/cpanel_passenger/cli.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>690b14756d62c763996c92ea9016257a4d1e1fe6</id>
    </parent>
  </parents>
  <author>
    <name>Paul Hepworth</name>
    <email>paul@peppyheppy.com</email>
  </author>
  <url>http://github.com/peppyheppy/cpanel-passenger/commit/278beb26dbceff823c13f32f4b0c8bb540d3fa52</url>
  <id>278beb26dbceff823c13f32f4b0c8bb540d3fa52</id>
  <committed-date>2009-05-23T23:14:10-07:00</committed-date>
  <authored-date>2009-05-23T23:14:10-07:00</authored-date>
  <message>fixed bug affecting new hosts and added domain option for setting up a new host</message>
  <tree>6f7f2179011bee7e96cf9f7922f2bfdbc76e60b7</tree>
  <committer>
    <name>Paul Hepworth</name>
    <email>paul@peppyheppy.com</email>
  </committer>
</commit>
