shopware5 / shopware-vagrant

A Vagrant setup ready for shopware development
MIT License
58 stars 30 forks source link

Apache won't start #25

Closed m-knorr closed 8 years ago

m-knorr commented 8 years ago

Hey guys!

Trying to get the vagrant box up running.

But I get the following error while provisioning.

TASK [apache : be sure apache is started and enabled] ************************** fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "Segmentation fault (core dumped)\n"} to retry, use: --limit @/vagrant/ansible/playbook.retry

Any hints on getting the stuff up and running?

System: OSX 10.12.1 Vagrant: 1.8.5 VirtualBox: 5.1.2

thanks! Martin

4typen commented 8 years ago

Hi Martin,

The problem is that ansible changes the default php version from 5.6 to 7.0, but after the whole ansible process apache has still loaded the php5-module instead of php7-module.

A temporary fix is to change this:

- name: Apache | Disable modules
  apache2_module: state=absent name={{ item }}
  with_items:
    - php5.6
    - php7.1
  become: yes

- name: Apache | Enable modules
  command: a2enmod {{ item }} creates=/etc/apache2/mods-enabled/{{ item }}.load
  with_items:
    - rewrite
    - php7.0
    - autoindex
    - ssl
  become: yes
  notify:
  - apache-restart

to this

- name: Apache | Disable modules
  apache2_module: state=absent name={{ item }}
  with_items:
    - php7.0
    - php7.1
  become: yes

- name: Apache | Enable modules
  command: a2enmod {{ item }} creates=/etc/apache2/mods-enabled/{{ item }}.load
  with_items:
    - rewrite
    - php5.6
    - autoindex
    - ssl
  become: yes
  notify:
  - apache-restart

The file is ansible\roles\apache\tasks\main.yml

Then the default php version will be set to 5.6 and the whole ansible process works. Now if you wanna change the version of php with the change-command, you have to execute a2dismod php5 first.

m-knorr commented 8 years ago

Hey Andre,

thanks for your response. With the ansible recipe changes it works like a charm!!!

Thank you! Greetings Martin

bcremer commented 8 years ago

Thank you @4typen, I applied your fix with commit https://github.com/shopwareLabs/shopware-vagrant/commit/d8dcaeed759b8cbfc500a3ae866d8efb0c85f195.