what is the CLI command that will enable me to see what packages are installed with a vagrant box

15 views
Skip to first unread message

paul kendal

unread,
Apr 20, 2017, 9:29:27 AM4/20/17
to Vagrant
hi

i still new to vagrant and a little confused by it.   i installed  a pre-configured vagrant box (this enabled me to install a zend 3 framework) . i now want to do two things.

i want to to be  able to use my command line to see what packages (php, mysql etc) are installed with it. in short i want to see how its configured. 

secondly i want to be able to access the php info page from my browser. 

below is the vagrant file. i am able to access the php from   http://localhost:8080/   but have no idea how to access the php files/php info or to determine whether mysql is install. (and if mysql is not install- how to install it and make it available to my project)



@script = <<SCRIPT
# Install dependencies
apt-get update
apt-get install -y apache2 git curl php7.0 php7.0-bcmath php7.0-bz2 php7.0-cli php7.0-curl php7.0-intl php7.0-json php7.0-mbstring php7.0-opcache php7.0-soap php7.0-sqlite3 php7.0-xml php7.0-xsl php7.0-zip libapache2-mod-php7.0

# Configure Apache
echo "<VirtualHost *:80>
DocumentRoot /var/www/public
AllowEncodedSlashes On

<Directory /var/www/public>
Options +Indexes +FollowSymLinks
DirectoryIndex index.php index.html
Order allow,deny
Allow from all
AllowOverride All
</Directory>


Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = 'bento/ubuntu-16.04'
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.synced_folder '.', '/var/www'
  config.vm.provision 'shell', inline: @script

  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024"]
    vb.customize ["modifyvm", :id, "--name", "ZF Application - Ubuntu 16.04"]
  end
end

Alvaro Miranda Aguilera

unread,
Apr 20, 2017, 9:38:30 AM4/20/17
to vagra...@googlegroups.com
Hello

I think your script is incomplete

it should include the destination file for the echo and should end with SCRIPT

So in overall the steps are:

install the packages, done

i would suggest check first the owner (numeric) for the /var/www folder and create a new mount point

ie 

 config.vm.synced_folder 'www', '/var/www', create: true, :mount_options => ["uid=510,gid=510"]

replace 510/510 with the id of the user/group that owns the current /var/www

then put a index.php there that include php info

ie:
<?php phpinfo() ?>

if you can put your project into github, will be easier to review and try and send a PR for fixes/improvements

Alvaro


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a3f2f7ec-9a0e-4219-85ad-70b7219b5544%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

paul kendal

unread,
Apr 20, 2017, 10:56:24 AM4/20/17
to Vagrant
Hi Alvaro 

thanks so much for replying; 

here is my git repo  : 



you will notice that there is no mysql. i need to add mysql and then be able to access it . 

thanks for kind help 
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Apr 20, 2017, 11:12:08 AM4/20/17
to vagra...@googlegroups.com
Try something like this:


take note that is not a Vagrant question, is more OS question, but if you have doubts, feel free to ask.

Alvaro.

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/2fd04023-0d2e-4939-9b3c-635355a83070%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages