Answers.Body: <p>I have buildkit working in multiple places but a quick check suggests that</p>
  
  <p>./buildkit/bin/amp test</p>
  
  <p>gives the results above - so I don't know if you have to get past that to get buildkit working...</p>
  
  <p>Probably only if you want it to run on a port as opposed to defining something in your hosts file</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-06T06:49:20.983Z
Answers.LastActivityDate: 2017-04-06T06:49:20.983Z
Answers.UserDisplayName: user4278
Answers.Body: <p>Accessing URL <code>http://localhost:7979</code> requires at least these things:</p>
  
  <ul>
  <li>Your client is able to resolve host <code>localhost</code> to the local IP address</li>
  <li>You have a server which is listening to port 7979</li>
  <li>Your server on port 7979 is able to listen to that port (not firewalled / filtered)</li>
  </ul>
  
  <h3>Check DNS for localhost</h3>
  
  <p>If the command <code>host localhost</code> does not resolve to 127.0.0.1, you should check your <code>/etc/hosts</code> file has an entry which defines the correct IP for localhost.</p>
  
  <p>Expected output is something like:</p>
  
  <pre><code>chris@strike:~$ host localhost
  localhost has address 127.0.0.1
  localhost has IPv6 address ::1
  </code></pre>
  
  <h3>Check server is listening on expected port</h3>
  
  <p>From the debug output above, we can see your server expects to bind to port 7979. So we can use <code>lsof</code> to confirm that the expected process is listening on this port.</p>
  
  <pre><code>chris@strike:~ $ sudo lsof -i :7979
  COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  nginx     432 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  nginx   12446 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  nginx   12447 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  </code></pre>
  
  <p>This output tells us that port 7979 "belongs" to a service named "micromuse-ncps", but we'll ignore that; we're using that port for your AMP hosts. Just read "micromuse-ncps" as saying "7979".</p>
  
  <p>Your output should show that -</p>
  
  <ul>
  <li>The expected program has this port bound. (I'm using nginx, you'll see apache there.)</li>
  <li>The expected user account is running this program. (If I saw "alice" instead of "chris" as the username, that might be telling me that Alice's buildkit had already claimed port 7979, so I couldn't have it.)</li>
  <li>If no results show up, this might indicate that your webserver didn't know to bind that port, which might happen if the AMP include was not added to the webserver's config file.</li>
  </ul>
  
  <h3>Firewalls</h3>
  
  <p>If the port is bound but you can't connect to it, that might indicate the presence of a firewall or other system preventing AMP's test connecting.</p>
  
  <p>Documenting firewall configuration isn't in scope here, sorry! Should your buildkit host have a firewall, you'll have to be responsible for making sure that firewall doesn't interfere with buildkit, by ensuring the buildkit/amp ports are available to the expected client IPs.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-08T15:31:15.370Z
Answers.Text: That's great, thanks. I got down as far as   "If no results show up, this might indicate that your webserver didn't know to bind that port, which might happen if the AMP include was not added to the webserver's config file."  and found out a lot more about ufw.  Test build launches now, but new issues to diagnose of course.
Answers.UserDisplayName: Sean Kenny
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-04T07:31:46.500Z
Answers.LastActivityDate: 2016-12-04T07:31:46.500Z
Answers.UserDisplayName: Chris Burgess
Body: <p>hope there is someone who can help? It's taken me a couple of days, but I've finally got the buildkit successfully installed, however when I try to create my first instance I'm getting permissions errors, is this because I've installed it in the wrong place? I've checked the Apache version and the restart command.</p>
  
  <p>This is a fresh install on gc ubuntu16.04 with up to date dependencies</p>
  
  <p>Errors:</p>
  
  <p><code>
  seankenny@instance-2:~$ ./buildkit/bin/amp test
  Create test application
  Create data directory: /home/seankenny/.amp/canary/data/F2Dn7Skcr6zJM61SvzEB72IjOuoUMHwi
  AMP_URL='<a href="http://localhost:7979" rel="nofollow noreferrer">http://localhost:7979</a>'
  AMP_ROOT='/home/seankenny/.amp/canary'
  AMP_DB_DSN='mysql://canary_wfa83:n29ZlTuwvd9UxLuI@127.0.0.1:3306/canary_wfa83?new_link=true'
  AMP_DB_USER='canary_wfa83'
  AMP_DB_PASS='n29ZlTuwvd9UxLuI'
  AMP_DB_HOST='127.0.0.1'
  AMP_DB_PORT='3306'
  AMP_DB_NAME='canary_wfa83'
  AMP_DB_ARGS='--defaults-file='\''/home/seankenny/.amp/my.cnf.d/my.cnf-e7cb970bf21e2d4b82d944711b5fc15b'\'' canary_wfa83'
  Connect to test application
  Expect response: "response-code-wgnXWegrsL"
  PHP Warning:  file_get_contents(<a href="http://localhost:7979/index.php" rel="nofollow noreferrer">http://localhost:7979/index.php</a>): failed to open stream: Connection refused in phar:///home/seankenny/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 163
  Warning: file_get_contents(<a href="http://localhost:7979/index.php" rel="nofollow noreferrer">http://localhost:7979/index.php</a>): failed to open stream: Connection refused in phar:///home/seankenny/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 163
  Received incorrect response: ""
  Tips for common issues:
   - (Re)run "amp config"
   - Double-check the httpd_type (apache24) along with any displayed instructions.
   - Double-check the httpd_restart_command.
   - (Re)run "amp test"
  </code></p>
  
Tags: <permissions><civicrm-buildkit>
Title: Problems with first test site using Civicrm buildkit
ThreadText: # Problems with first test site using Civicrm buildkit
  
  (Asked by: username_0 on 2016-12-03)
  
  hope there is someone who can help? It's taken me a couple of days, but I've finally got the buildkit successfully installed, however when I try to create my first instance I'm getting permissions errors, is this because I've installed it in the wrong place? I've checked the Apache version and the restart command.
  
  This is a fresh install on gc ubuntu16.04 with up to date dependencies
  
  Errors:
  
  `seankenny@instance-2:~$ ./buildkit/bin/amp test
  Create test application
  Create data directory: /home/seankenny/.amp/canary/data/F2Dn7Skcr6zJM61SvzEB72IjOuoUMHwi
  AMP_URL='http://localhost:7979'
  AMP_ROOT='/home/seankenny/.amp/canary'
  AMP_DB_DSN='mysql://canary_wfa83:n29ZlTuwvd9UxLuI@127.0.0.1:3306/canary_wfa83?new_link=true'
  AMP_DB_USER='canary_wfa83'
  AMP_DB_PASS='n29ZlTuwvd9UxLuI'
  AMP_DB_HOST='127.0.0.1'
  AMP_DB_PORT='3306'
  AMP_DB_NAME='canary_wfa83'
  AMP_DB_ARGS='--defaults-file='\''/home/seankenny/.amp/my.cnf.d/my.cnf-e7cb970bf21e2d4b82d944711b5fc15b'\'' canary_wfa83'
  Connect to test application
  Expect response: "response-code-wgnXWegrsL"
  PHP Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: Connection refused in phar:///home/seankenny/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 163
  Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: Connection refused in phar:///home/seankenny/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 163
  Received incorrect response: ""
  Tips for common issues:
  - (Re)run "amp config"
  - Double-check the httpd_type (apache24) along with any displayed instructions.
  - Double-check the httpd_restart_command.
  - (Re)run "amp test"`
  
  **Tags:** permissions, civicrm-buildkit
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2016-12-04. Score: 4 | Accepted answer
  
  Accessing URL http://localhost:7979 requires at least these things:
  
  Your client is able to resolve host localhost to the local IP address
  You have a server which is listening to port 7979
  Your server on port 7979 is able to listen to that port (not firewalled / filtered)
  
  Check DNS for localhost
  If the command host localhost does not resolve to 127.0.0.1, you should check your /etc/hosts file has an entry which defines the correct IP for localhost.
  Expected output is something like:
  chris@strike:~$ host localhost
  localhost has address 127.0.0.1
  localhost has IPv6 address ::1
  
  Check server is listening on expected port
  From the debug output above, we can see your server expects to bind to port 7979. So we can use lsof to confirm that the expected process is listening on this port.
  chris@strike:~ $ sudo lsof -i :7979
  COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  nginx     432 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  nginx   12446 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  nginx   12447 chris    6u  IPv4 0x74beb77a214bedc1      0t0  TCP *:micromuse-ncps (LISTEN)
  
  This output tells us that port 7979 "belongs" to a service named "micromuse-ncps", but we'll ignore that; we're using that port for your AMP hosts. Just read "micromuse-ncps" as saying "7979".
  Your output should show that -
  
  The expected program has this port bound. (I'm using nginx, you'll see apache there.)
  The expected user account is running this program. (If I saw "alice" instead of "chris" as the username, that might be telling me that Alice's buildkit had already claimed port 7979, so I couldn't have it.)
  If no results show up, this might indicate that your webserver didn't know to bind that port, which might happen if the AMP include was not added to the webserver's config file.
  
  Firewalls
  If the port is bound but you can't connect to it, that might indicate the presence of a firewall or other system preventing AMP's test connecting.
  Documenting firewall configuration isn't in scope here, sorry! Should your buildkit host have a firewall, you'll have to be responsible for making sure that firewall doesn't interfere with buildkit, by ensuring the buildkit/amp ports are available to the expected client IPs.
  
  > **Comments:**
  > **username_0**: That's great, thanks. I got down as far as   "If no results show up, this might indicate that your webserver didn't know to bind that port, which might happen if the AMP include was not added to the webserver's config file."  and found out a lot more about ufw.  Test build launches now, but new issues to diagnose of course.  
  
  ---
  
  ### Answer by username_1 on 2017-04-06. Score: 0
  
  I have buildkit working in multiple places but a quick check suggests that
  
  ./buildkit/bin/amp test
  
  gives the results above - so I don't know if you have to get past that to get buildkit working...
  
  Probably only if you want it to run on a port as opposed to defining something in your hosts file
  
  
  ---
  
  