4

The setup for buildkit runs smoothly, until the 'amp test' command where it fails no matter what I do. I have tried over and over again for 6 hours. I'm new to this so maybe I'm making a basic mistake. Following are the exact steps and configurations I used, along with the output. Please help if you can.

  • Linux Mint 17.1 fully updated, fresh install, on
  • Virtual Box (running also in Linux Mint 17.1)
  • Apache/2.4.7 (Ubuntu)
  • PHP Version 5.5.9-1ubuntu4.9

As far as I can tell all the prerequisites are fulfilled. Following are the commands, reports and configuration I used:

apt-get install curl

comment: Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

comment: Then install with:
sudo apt-get install -y nodejs

Use software manager to install:
Ruby and 
Rake

git clone "https://github.com/civicrm/civicrm-buildkit.git" "/opt/buildkit"
export PATH="/opt/buildkit/bin:$PATH"

civi-download-tools

sudo service apache2 restart

amp config

Enter mysql_dsn> mysql://root:my_password@localhost:3306

Enter perm_type  [1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs [setfacl] (recommended)

Enter perm_user>  www-data
Enter httpd_type apache24

Note: Please add this line to the httpd.conf or apache2.conf:

  Include /root/.amp/apache.d/*.conf

service apache2 restart

amp test

Connect to test application
Expect response: "response-code-vh4D13nHwi"
PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
 in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153

Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
 in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
Received incorrect response: ""
Tip: Try running "amp config" and/or restarting the webserver.
Mint17a buildkit # 

Even if I set the following permissions I still get errors:

  • group and full permissions for /opt/buildkit = www-data
  • group and full permissions for /var/www = www-data

Thanks in advance!

5

Check that you've followed this instruction?

Note: Please add this line to the httpd.conf or apache2.conf:

Include /root/.amp/apache.d/*.conf

To do this, edit your Apache configuration (on Debian I'd create /etc/apache2/conf.d/civicrm-buildkit.conf) and add that line.


Check that you can open http://localhost:7979 (or the URL reported by your amp test) from the machine you're working on (curl http://localhost:7979/index.php etc).

  • A DNS failure suggests that your machine cannot resolve localhost - check /etc/hosts is correctly configured.
  • A connection failure suggests Apache configuration - check that Apache is seeing the configuration and able to bind to appropriate ports.
  • Errors in the output from curl, and further information in Apache / PHP error logs should give further information about what needs fixing.
  • I had put that line in. Since the error report stated "file_get_contents(localhost:7979/index.php): failed to open" I thought I'd check info on that port. Here's what I got: Mint17a tech # netstat -tulpn | grep :7979 tcp6 0 0 :::7979 :::* LISTEN 25242/apache2 Does that help you? Yes, I did restart apache2 many times – OregonJohn May 18 '15 at 22:41
  • And restarted apache? (Can't tell from formatting if the inclusion happened before service apache2 restart) – Chris Burgess May 18 '15 at 22:42
  • I cleared the logs at /var/log/apache2 and then retried amp test. I then checked the logs and all three (access.log, error.log, other_vhosts_access.log) were empty of any reports. – OregonJohn May 18 '15 at 23:08
  • What do you see at localhost:7979/index.php when you do that? Could it be that /etc/hosts is missing localhost, so localhost doesn't resolve? – Chris Burgess May 18 '15 at 23:37
  • Sorry, failed to follow directions carefully: localhost:7070/index.php resulted in the following access log entry:127.0.0.1 - - [18/May/2015:16:37:46 -0700] "GET /favicon.ico HTTP/1.1" 404 499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0". There is no enty in error.log – OregonJohn May 18 '15 at 23:40
1

Sorry to bump into an older post, I just wanted to share my experience while setting up CiviCRM development. So I already have an up and running instance of Civi drupal-demo site (which I did setup up an year ago) but recently I was again setting up development environment on other machine.

All the steps worked pretty well till amp test. Again I experienced the same PHP warnings while performing this test as OregonJohn as specified here above.

So to overcome this, I added specific permissions to the directory of buildkit in apache2.conf (in my case it is /opt/buildkit). Then I sudo chmod permissions to the directory. Here is the code I added in apache2.conf :

<Directory /opt/buildkit>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Or you can add your root directory with more configuration if it doesn't work (not recommended).

<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
    Allow from all
</Directory>

Hope it helps new upcoming Civi developers.

Thank you.

1

I had the same problem and the issue was that my web server is Apache 2.4 and I had set the httpd_type to "apache" instead of "apache24" when running amp config.

I solved the issue by giving chmod permissions to buildkit and .amp directories and setting httpd_type to "apache24"

More info here

0

For me the problem was Apache was running yet it was not properly configured. Running /usr/sbin/apache2 -V gave me the following error.

[Mon Apr 21 17:36:38.019213 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Apr 21 17:36:38.019345 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon Apr 21 17:36:38.019370 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon Apr 21 17:36:38.019385 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon Apr 21 17:36:38.019414 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.028756 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.029032 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.029056 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

This solution worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.