Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpmyadmin #325

Open
dseegers opened this issue Apr 5, 2018 · 4 comments
Open

phpmyadmin #325

dseegers opened this issue Apr 5, 2018 · 4 comments

Comments

@dseegers
Copy link

dseegers commented Apr 5, 2018

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

@MJongbloed
Copy link

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

@PDM2020
Copy link

PDM2020 commented Dec 2, 2019

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

@lewkoo
Copy link

lewkoo commented May 6, 2020

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.

@PDM2020
Copy link

PDM2020 commented May 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants