   #    else
   #      log.error stderr
   #      callback stderr
-  createVhost :do->
+  createVhost : (options,callback)->
+    {username,uid,domainName} = options
+
+    domainName ?= "#{username}.#{config.defaultDomain}"
+    targetPath = "/Users/#{username}/Sites/#{domainName}"
+
+    createDirs = ['-v','-p',targetPath]
+    copyFiles  = ['-v','-r',"#{config.defaultVhostFiles}/website",targetPath]
+    changeOwner = ['-v','-R',"#{uid}:#{uid}","#{targetPath}/website"]
 
     spawnWrapper = (command, args , callback)->
       wrapper = spawn command,args

          log.info info = "createVhost: #{command} done!"
          callback null, info

    createVhost = (options,callback)->
      {username,uid,domainName} = options

      domainName ?= "#{username}.#{config.defaultDomain}"
      targetPath = "/Users/#{username}/Sites/#{domainName}"

      createDirs = ['-v','-p',targetPath]
      copyFiles  = ['-v','-r',"#{config.defaultVhostFiles}/website",targetPath]
      changeOwner = ['-v','-R',"#{uid}:#{uid}","#{targetPath}/website"]

      spawnWrapper '/bin/mkdir',createDirs, (err,res)=>
        if err?
          callback "[ERROR] couldn't create vhost #{err}"
        else
          spawnWrapper '/bin/cp',copyFiles,(err,res)=>
            if err?
              callback "[ERROR] Culdn't create vhost: #{err}"
            else
              spawnWrapper '/bin/chown',changeOwner,(err,res)->
                if err?
                  callback "[ERROR] Culdn't create vhost: #{err}"
                else
                  log.info info = "[OK] vhost #{domainName} has been created"
                  callback null, info

 # suspendUser : (options,callback)->
 #   #

 #                   log.debug "[OK] func:unSuspendUser: /usr/sbin/cagefsctl -w #{userToSuspend}"
 #                   res = "[OK] user #{userToSuspend} was successfully unsuspended"
 #                   log.info res; callback? null, res
 #
#s = new sharedHosting
#options =
#  username: 'aleksey-m'
#  uid: 5339
#s.createVhost options,(err,res)->
#  console.log err if err?
#  console.log res if res? 
