title: executing commands in AWS ebextensions
body: <p>I receive the following error while trying to upload my instance in aws elasticbeanstalk:</p>
  
  <pre><code>The configuration file .ebextensions/setup.config in application version t5 contains invalid YAML or JSON. 
  YAML exception: while scanning a quoted scalar in "&lt;reader&gt;", line 3, column 18: command: 
  "aws s3 cp s3:elasticbeanstalk-u ... ^ found unexpected end of stream in "&lt;reader&gt;", 
  line 5, column 1: ^ , JSON exception: Unexpected character (c) at position 0.. Update the configuration file.
  </code></pre>
  
  <p>Below is what is included in the <code>setup.config</code> file:</p>
  
  <pre><code>container_commands:
      01_setup_apache:
          command: "aws s3 cp s3:elasticbeanstalk-us-west-2-273610000489/enable_mod_rewrite.conf /etc/httpd/co
  </code></pre>
  
  <p>I am working with AWS elastic beanstalk and since I can't modify the <code>httdp conf</code> file to <code>AllowOverride All</code>  in order to clean-up my URL with rewritte rule, I was suggested to work with ebextensions:
  <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html</a></p>
  
  <p>Update:</p>
  
  <p><img src="https://i.stack.imgur.com/SNP93.png" alt="enter image description here"></p>
  
  <p>I think  what runs problem is this:</p>
  
  <pre><code>RewriteEngine On
  </code></pre>
  
  <p>located in htaccess. almost like it cant accept rewritenegine being turned on.</p>
  
  <p>Update2:</p>
  
  <p>In <code>/var/log/httpd/access_log</code></p>
  
  <p>In <code>/var/log/eb-activity.log</code>:</p>
  
  <pre><code>Command CMD-TailLogs succeeded.
  [2015-07-10T10:25:09.784Z] INFO  [25589] - [CMD-TailLogs] : Starting activity...
  [2015-07-10T10:25:10.206Z] INFO  [25589] - [CMD-TailLogs/AddonsBefore] : Starting activity...
  [2015-07-10T10:25:10.207Z] INFO  [25589] - [CMD-TailLogs/AddonsBefore] : Completed activity.
  [2015-07-10T10:25:10.207Z] INFO  [25589] - [CMD-TailLogs/TailLogs] : Starting activity...
  [2015-07-10T10:25:10.207Z] INFO  [25589] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
  </code></pre>
  
  <p>In <code>/var/log/eb-commandprocessor.log</code></p>
  
  <pre><code>    [2015-07-10T10:37:19.644Z] DEBUG [25873] : Checking if the command processor should execute...
  [2015-07-10T10:37:19.645Z] DEBUG [25873] : Checking whether the command is applicable to instance (i-80bbbd77)..
  [2015-07-10T10:37:19.645Z] INFO  [25873] : Command is applicable to this instance (i-80bbbd77)..
  [2015-07-10T10:37:19.645Z] DEBUG [25873] : Checking if the received command stage is valid..
  [2015-07-10T10:37:19.645Z] INFO  [25873] : No stage_num in command. Valid stage..
  [2015-07-10T10:37:19.645Z] INFO  [25873] : Command processor should execute command.
  [2015-07-10T10:37:19.645Z] DEBUG [25873] : Storing current stage..
  [2015-07-10T10:37:19.645Z] DEBUG [25873] : Stage_num does not exist. Not saving null stage. Returning..
  [2015-07-10T10:37:19.646Z] INFO  [25873] : Executing command: CMD-TailLogs...
  [2015-07-10T10:37:19.646Z] DEBUG [25873] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
  [2015-07-10T10:37:19.647Z] DEBUG [25873] : Refreshing metadata..
  [2015-07-10T10:37:20.061Z] DEBUG [25873] : Refreshed environment metadata.
  [2015-07-10T10:37:20.061Z] DEBUG [25873] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
  [2015-07-10T10:37:20.062Z] DEBUG [25873] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
  [2015-07-10T10:37:20.064Z] INFO  [25873] : Found enabled addons: ["logpublish"].
  [2015-07-10T10:37:20.066Z] INFO  [25873] : Updating Command definition of addon logpublish.
  [2015-07-10T10:37:20.066Z] DEBUG [25873] : Loaded definition of Command CMD-TailLogs.
  [2015-07-10T10:37:20.066Z] INFO  [25873] : Executing command CMD-TailLogs activities...
  [2015-07-10T10:37:20.066Z] DEBUG [25873] : Setting environment variables..
  [2015-07-10T10:37:20.066Z] INFO  [25873] : Running AddonsBefore for command CMD-TailLogs...
  [2015-07-10T10:37:20.067Z] DEBUG [25873] : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
  [2015-07-10T10:37:20.067Z] INFO  [25873] : Running stage 0 of command CMD-TailLogs...
  [2015-07-10T10:37:20.067Z] DEBUG [25873] : Loaded 1 actions for stage 0.
  [2015-07-10T10:37:20.067Z] INFO  [25873] : Running 1 of 1 actions: TailLogs...
  </code></pre>
  
  <p>update 3:</p>
  
  <p><img src="https://i.stack.imgur.com/SNP93.png" alt="enter image description here"></p>