如何将PHPadmin添加到我的bootstrap.sh命令中?

时间:2018-05-18 13:26:04

标签: vagrant-provision

我已经离PHP差不多四年了,我一直在用javascript和Node.JS工作。我记得我习惯使用哪些工具......它是一个生疏的记忆,它是如何一起走的。我跟着Traversy's tutorial to get the LAMP box running了 并connected from MySQL WorkBench.

我想使用PHPAdmin 如何将PHPadmin添加到我的bootstrap.sh命令中?

Installing phpMyAdmin On Vagrant
我最喜欢这个版本,因为每个域都拥有它自己的 / phpadmin ,但我不明白他是如何从 bootstrap.sh <内编辑配置文件的/强>

A super-simple Vagrant LAMP stack bootstrap (installable with one command)
我先尝试过这个,但是从第一个花括号中得到了一个错误,说它没有识别出这个角色..

bootstrap.sh

# Use single quotes instead of double quotes to make it work with special-character passwords
PASSWORD='12345678'
PROJECTFOLDER='myproject'

# Update Packages
apt-get update
# Upgrade Packages
apt-get upgrade

# Basic Linux Stuff
apt-get install -y git

# Apache
apt-get install -y apache2

# Enable Apache Mods
a2enmod rewrite

#Add Onrej PPA Repo
apt-add-repository ppa:ondrej/php
apt-get update

# Install PHP
apt-get install -y php7.2

# PHP Apache Mod
apt-get install -y libapache2-mod-php7.2

# Restart Apache
service apache2 restart

# PHP Mods
apt-get install -y php7.2-common
apt-get install -y php7.2-mcrypt
apt-get install -y php7.2-zip

# Set MySQL Pass
debconf-set-selections <<< 'mysql-server mysql-server/root_password password $PASSWORD'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password $PASSWORD'

# Install MySQL
apt-get install -y mysql-server

# PHP-MYSQL lib
apt-get install -y php7.2-mysql

# Install phpmyadmin
# apt-get install phpmyadmin

# Restart Apache
sudo service apache2 restart

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

# Box Settings
  config.vm.box = "ubuntu/trusty64"

# Provider Settings  
  config.vm.provider "virtualbox" do |vb|
  vb.memory = 2048
  vb.cpus = 4
  end

# Network Settings  
  # config.vm.network "forwarded_port", guest: 80, host: 8080
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  config.vm.network "private_network", ip: "192.168.33.10"
  # config.vm.network "public_network"

# Folder Settings  
  config.vm.synced_folder ".", "/var/www/html", :nfs => { :mount_options => ["dmode=777", "fmode=666"] }

# Provision Settings  
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL

  config.vm.provision "shell", path: "bootstrap.sh"
end

0 个答案:

没有答案