vccw icon indicating copy to clipboard operation
vccw copied to clipboard

phpmyadmin

Open dseegers opened this issue 6 years ago • 4 comments

Operating System: Windows Vagrant Version: Vagrant 2.0.3 Virtual Box Version: Versie 5.2.8 r121009

First of all, I love this 👍 . But I was wondering if it is possible to install phpmyadmin. When you change the site.yml

dseegers avatar Apr 05 '18 11:04 dseegers

Hi dseegers, you could download phpMyAdmin from its own website (https://www.phpmyadmin.net/) and place it in a separate folder in the wordpress folder (eg. named phpMyAdmin). After that you can access it from the url as vccw.test/phpMyAdmin/index.php

MJongbloed avatar Dec 25 '18 16:12 MJongbloed

Hey Folks, I am running vccw and vagrant box on my mac. What would be involved in having one myphpmyadmin directory for all my vagrant sites instead of copying the whole phpmyadmin folder over to each wordpress folder. Any insight/links/suggestions is greatly appreciated

PDM2020 avatar Dec 02 '19 23:12 PDM2020

There is a built-in way to add a post-provision step and you can place Ansible instructions to install PhpMyAdmin there. Simply create a playbook-post.yml next to Vagrantfile with these contents:

- hosts: all
  become: yes

  tasks:
    - name: Update apt cache
      apt: update_cache=yes            
    - name: debconf for PhpMyAdmin
      debconf: name=phpmyadmin question='phpmyadmin/dbconfig-install' value='true' vtype='boolean'
    
    - name: debconf for PhpMyAdmin
      debconf: name=phpmyadmin question='phpmyadmin/app-password-confirm' value='{{ vccw.db_pass }}' vtype='password'
    
    - name: debconf for PhpMyAdmin
      debconf: name=phpmyadmin question='phpmyadmin/mysql/admin-pass' value='{{ vccw.db_pass }}' vtype='password'
    
    - name: debconf for PhpMyAdmin
      debconf: name=phpmyadmin question='phpmyadmin/mysql/app-pass' value='{{ vccw.db_pass }}' vtype='password'
    
    - name: debconf for PhpMyAdmin
      debconf: name=phpmyadmin question='phpmyadmin/reconfigure-webserver' value='' vtype='multiselect'
    
    - name: install PhpMyAdmin
      apt: pkg=phpmyadmin state=present
    
    - name: Create apache conf link 
      file:
        src: "/etc/phpmyadmin/apache.conf"
        dest: "/etc/apache2/sites-available/phpmyadmin.conf"
        state: link
    - name: Create apache conf link 
      file:
        src: "/etc/phpmyadmin/apache.conf"
        dest: "/etc/apache2/sites-enabled/phpmyadmin.conf"
        state: link

    - name: configure site
      file: path=/var/www/phpmyadmin src=/usr/share/phpmyadmin state=link

    - name: restart apache
      become: yes
      service: name=apache2 state=restarted

After that, you need to re-provision your instance or re-create it. Either way, you need to run vagrant provision

An alternative to this would be to do vagrant ssh and install phpmyadmin via APT: sudo apt-get update && sudo apt-get install -y phpmyadmin. Disadvantage to this would be that if you ever destroy your VM or delete it or lose it in some way, phpmyadmin won't install when you re-create it via vagrant up.

PhpMyAdmin will be available at /phpmyadmin. Your access credentials are identical to those specified in your wp-config.php or in site.yml (db_name and db_pass)

This install is global to the machine, so no copies to each Wordpress folder are required (note @PDM2020).

Hope this helps someone.

lewkoo avatar May 06 '20 10:05 lewkoo

Wow this is awesome ... thanks for that ...I can't wait to try itHappy quarantining. Stay safeOn May 6, 2020 3:16 a.m., Levko Ivanchuk [email protected] wrote: There is a built-in way to add a post-provision step and you can place Ansible instructions to install PhpMyAdmin there. Simply create a playbook-post.yml next to Vagrantfile with these contents:

  • hosts: all become: yes

    tasks:

    • name: debconf for PhpMyAdmin debconf: name=phpmyadmin question='phpmyadmin/dbconfig-install' value='true' vtype='boolean'

    • name: debconf for PhpMyAdmin debconf: name=phpmyadmin question='phpmyadmin/app-password-confirm' value='{{ vccw.db_pass }}' vtype='password'

    • name: debconf for PhpMyAdmin debconf: name=phpmyadmin question='phpmyadmin/mysql/admin-pass' value='{{ vccw.db_pass }}' vtype='password'

    • name: debconf for PhpMyAdmin debconf: name=phpmyadmin question='phpmyadmin/mysql/app-pass' value='{{ vccw.db_pass }}' vtype='password'

    • name: debconf for PhpMyAdmin debconf: name=phpmyadmin question='phpmyadmin/reconfigure-webserver' value='' vtype='multiselect'

    • name: install PhpMyAdmin apt: pkg=phpmyadmin state=present

    • name: Create apache conf link file: src: "/etc/phpmyadmin/apache.conf" dest: "/etc/apache2/sites-available/phpmyadmin.conf" state: link

    • name: Create apache conf link file: src: "/etc/phpmyadmin/apache.conf" dest: "/etc/apache2/sites-enabled/phpmyadmin.conf" state: link

    • name: configure site file: path=/var/www/phpmyadmin src=/usr/share/phpmyadmin state=link

    • name: restart apache become: yes service: name=apache2 state=restarted After that, you need to re-provision your instance or re-create it. Either way, you need to run vagrant provision An alternative to this would be to do vagrant ssh and install phpmyadmin via APT: sudo apt-get update && sudo apt-get install -y phpmyadmin. Disadvantage to this would be that if you ever destroy your VM or delete it or lose it in some way, phpmyadmin won't install when you re-create it via vagrant up. PhpMyAdmin will be available at /phpmyadmin. Your access credentials are identical to those specified in your wp-config.php or in site.yml (db_name and db_pass) This install is global to the machine, so no copies to each Wordpress folder are required (note @PDM2020). Hope this helps someone.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

PDM2020 avatar May 07 '20 22:05 PDM2020